From 26bfc07f2b7829213356de43cf5b81c3ba99e338 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 22 Jan 2022 03:01:16 +0000 Subject: CTAN sync 202201220301 --- biblio/citation-style-language/CHANGELOG.md | 17 + biblio/citation-style-language/README.md | 59 + .../american-chemical-society.csl | 280 +++ .../american-medical-association.csl | 280 +++ .../american-political-science-association.csl | 236 ++ .../american-sociological-association.csl | 309 +++ biblio/citation-style-language/apa.csl | 1914 ++++++++++++++++ .../chicago-author-date.csl | 658 ++++++ .../chicago-fullnote-bibliography.csl | 1451 ++++++++++++ .../chicago-note-bibliography.csl | 1417 ++++++++++++ .../citation-style-language-doc.pdf | Bin 0 -> 217086 bytes .../citation-style-language-doc.tex | 357 +++ .../citation-style-language.sty | 807 +++++++ biblio/citation-style-language/citeproc | 188 ++ .../citation-style-language/citeproc-bib-data.json | 2342 ++++++++++++++++++++ biblio/citation-style-language/citeproc-bib.lua | 395 ++++ .../citation-style-language/citeproc-element.lua | 410 ++++ biblio/citation-style-language/citeproc-engine.lua | 419 ++++ .../citation-style-language/citeproc-formats.lua | 209 ++ .../citeproc-node-choose.lua | 126 ++ .../citation-style-language/citeproc-node-date.lua | 379 ++++ .../citeproc-node-group.lua | 32 + .../citeproc-node-label.lua | 106 + .../citeproc-node-layout.lua | 231 ++ .../citeproc-node-locale.lua | 130 ++ .../citeproc-node-names.lua | 696 ++++++ .../citeproc-node-number.lua | 99 + .../citation-style-language/citeproc-node-sort.lua | 183 ++ .../citeproc-node-style.lua | 193 ++ .../citation-style-language/citeproc-node-text.lua | 217 ++ biblio/citation-style-language/citeproc-nodes.lua | 44 + .../citation-style-language/citeproc-richtext.lua | 777 +++++++ biblio/citation-style-language/citeproc-util.lua | 794 +++++++ biblio/citation-style-language/citeproc.1 | 26 + biblio/citation-style-language/citeproc.lua | 18 + biblio/citation-style-language/csl-core.lua | 264 +++ .../citation-style-language/csl-locales-af-ZA.xml | 312 +++ biblio/citation-style-language/csl-locales-ar.xml | 253 +++ .../citation-style-language/csl-locales-bg-BG.xml | 324 +++ .../citation-style-language/csl-locales-ca-AD.xml | 312 +++ .../citation-style-language/csl-locales-cs-CZ.xml | 319 +++ .../citation-style-language/csl-locales-cy-GB.xml | 312 +++ .../citation-style-language/csl-locales-da-DK.xml | 315 +++ .../citation-style-language/csl-locales-de-AT.xml | 334 +++ .../citation-style-language/csl-locales-de-CH.xml | 318 +++ .../citation-style-language/csl-locales-de-DE.xml | 331 +++ .../citation-style-language/csl-locales-el-GR.xml | 314 +++ .../citation-style-language/csl-locales-en-GB.xml | 357 +++ .../citation-style-language/csl-locales-en-US.xml | 357 +++ .../citation-style-language/csl-locales-es-CL.xml | 310 +++ .../citation-style-language/csl-locales-es-ES.xml | 309 +++ .../citation-style-language/csl-locales-es-MX.xml | 351 +++ .../citation-style-language/csl-locales-et-EE.xml | 309 +++ biblio/citation-style-language/csl-locales-eu.xml | 309 +++ .../citation-style-language/csl-locales-fa-IR.xml | 312 +++ .../citation-style-language/csl-locales-fi-FI.xml | 318 +++ .../citation-style-language/csl-locales-fr-CA.xml | 317 +++ .../citation-style-language/csl-locales-fr-FR.xml | 317 +++ .../citation-style-language/csl-locales-he-IL.xml | 315 +++ .../citation-style-language/csl-locales-hi-IN.xml | 361 +++ .../citation-style-language/csl-locales-hr-HR.xml | 309 +++ .../citation-style-language/csl-locales-hu-HU.xml | 313 +++ .../citation-style-language/csl-locales-id-ID.xml | 321 +++ .../citation-style-language/csl-locales-is-IS.xml | 312 +++ .../citation-style-language/csl-locales-it-IT.xml | 340 +++ .../citation-style-language/csl-locales-ja-JP.xml | 315 +++ .../citation-style-language/csl-locales-km-KH.xml | 312 +++ .../citation-style-language/csl-locales-ko-KR.xml | 312 +++ biblio/citation-style-language/csl-locales-la.xml | 309 +++ .../citation-style-language/csl-locales-lt-LT.xml | 328 +++ .../citation-style-language/csl-locales-lv-LV.xml | 361 +++ .../citation-style-language/csl-locales-mn-MN.xml | 306 +++ .../citation-style-language/csl-locales-nb-NO.xml | 309 +++ .../citation-style-language/csl-locales-nl-NL.xml | 328 +++ .../citation-style-language/csl-locales-nn-NO.xml | 309 +++ .../citation-style-language/csl-locales-pl-PL.xml | 315 +++ .../citation-style-language/csl-locales-pt-BR.xml | 324 +++ .../citation-style-language/csl-locales-pt-PT.xml | 320 +++ .../citation-style-language/csl-locales-ro-RO.xml | 311 +++ .../citation-style-language/csl-locales-ru-RU.xml | 321 +++ .../citation-style-language/csl-locales-sk-SK.xml | 318 +++ .../citation-style-language/csl-locales-sl-SI.xml | 312 +++ .../citation-style-language/csl-locales-sr-RS.xml | 312 +++ .../citation-style-language/csl-locales-sv-SE.xml | 322 +++ .../citation-style-language/csl-locales-th-TH.xml | 309 +++ .../citation-style-language/csl-locales-tr-TR.xml | 319 +++ .../citation-style-language/csl-locales-uk-UA.xml | 249 +++ .../citation-style-language/csl-locales-vi-VN.xml | 315 +++ .../citation-style-language/csl-locales-zh-CN.xml | 205 ++ .../citation-style-language/csl-locales-zh-TW.xml | 209 ++ biblio/citation-style-language/csl.lua | 141 ++ .../citation-style-language/elsevier-harvard.csl | 239 ++ .../harvard-cite-them-right.csl | 318 +++ biblio/citation-style-language/ieee.csl | 457 ++++ .../modern-humanities-research-association.csl | 496 +++++ .../modern-language-association.csl | 324 +++ biblio/citation-style-language/nature.csl | 132 ++ biblio/citation-style-language/vancouver.csl | 351 +++ 98 files changed, 35452 insertions(+) create mode 100644 biblio/citation-style-language/CHANGELOG.md create mode 100644 biblio/citation-style-language/README.md create mode 100644 biblio/citation-style-language/american-chemical-society.csl create mode 100644 biblio/citation-style-language/american-medical-association.csl create mode 100644 biblio/citation-style-language/american-political-science-association.csl create mode 100644 biblio/citation-style-language/american-sociological-association.csl create mode 100644 biblio/citation-style-language/apa.csl create mode 100644 biblio/citation-style-language/chicago-author-date.csl create mode 100644 biblio/citation-style-language/chicago-fullnote-bibliography.csl create mode 100644 biblio/citation-style-language/chicago-note-bibliography.csl create mode 100644 biblio/citation-style-language/citation-style-language-doc.pdf create mode 100644 biblio/citation-style-language/citation-style-language-doc.tex create mode 100644 biblio/citation-style-language/citation-style-language.sty create mode 100755 biblio/citation-style-language/citeproc create mode 100644 biblio/citation-style-language/citeproc-bib-data.json create mode 100644 biblio/citation-style-language/citeproc-bib.lua create mode 100644 biblio/citation-style-language/citeproc-element.lua create mode 100644 biblio/citation-style-language/citeproc-engine.lua create mode 100644 biblio/citation-style-language/citeproc-formats.lua create mode 100644 biblio/citation-style-language/citeproc-node-choose.lua create mode 100644 biblio/citation-style-language/citeproc-node-date.lua create mode 100644 biblio/citation-style-language/citeproc-node-group.lua create mode 100644 biblio/citation-style-language/citeproc-node-label.lua create mode 100644 biblio/citation-style-language/citeproc-node-layout.lua create mode 100644 biblio/citation-style-language/citeproc-node-locale.lua create mode 100644 biblio/citation-style-language/citeproc-node-names.lua create mode 100644 biblio/citation-style-language/citeproc-node-number.lua create mode 100644 biblio/citation-style-language/citeproc-node-sort.lua create mode 100644 biblio/citation-style-language/citeproc-node-style.lua create mode 100644 biblio/citation-style-language/citeproc-node-text.lua create mode 100644 biblio/citation-style-language/citeproc-nodes.lua create mode 100644 biblio/citation-style-language/citeproc-richtext.lua create mode 100644 biblio/citation-style-language/citeproc-util.lua create mode 100644 biblio/citation-style-language/citeproc.1 create mode 100644 biblio/citation-style-language/citeproc.lua create mode 100644 biblio/citation-style-language/csl-core.lua create mode 100644 biblio/citation-style-language/csl-locales-af-ZA.xml create mode 100644 biblio/citation-style-language/csl-locales-ar.xml create mode 100644 biblio/citation-style-language/csl-locales-bg-BG.xml create mode 100644 biblio/citation-style-language/csl-locales-ca-AD.xml create mode 100644 biblio/citation-style-language/csl-locales-cs-CZ.xml create mode 100644 biblio/citation-style-language/csl-locales-cy-GB.xml create mode 100644 biblio/citation-style-language/csl-locales-da-DK.xml create mode 100644 biblio/citation-style-language/csl-locales-de-AT.xml create mode 100644 biblio/citation-style-language/csl-locales-de-CH.xml create mode 100644 biblio/citation-style-language/csl-locales-de-DE.xml create mode 100644 biblio/citation-style-language/csl-locales-el-GR.xml create mode 100644 biblio/citation-style-language/csl-locales-en-GB.xml create mode 100644 biblio/citation-style-language/csl-locales-en-US.xml create mode 100644 biblio/citation-style-language/csl-locales-es-CL.xml create mode 100644 biblio/citation-style-language/csl-locales-es-ES.xml create mode 100644 biblio/citation-style-language/csl-locales-es-MX.xml create mode 100644 biblio/citation-style-language/csl-locales-et-EE.xml create mode 100644 biblio/citation-style-language/csl-locales-eu.xml create mode 100644 biblio/citation-style-language/csl-locales-fa-IR.xml create mode 100644 biblio/citation-style-language/csl-locales-fi-FI.xml create mode 100644 biblio/citation-style-language/csl-locales-fr-CA.xml create mode 100644 biblio/citation-style-language/csl-locales-fr-FR.xml create mode 100644 biblio/citation-style-language/csl-locales-he-IL.xml create mode 100644 biblio/citation-style-language/csl-locales-hi-IN.xml create mode 100644 biblio/citation-style-language/csl-locales-hr-HR.xml create mode 100644 biblio/citation-style-language/csl-locales-hu-HU.xml create mode 100644 biblio/citation-style-language/csl-locales-id-ID.xml create mode 100644 biblio/citation-style-language/csl-locales-is-IS.xml create mode 100644 biblio/citation-style-language/csl-locales-it-IT.xml create mode 100644 biblio/citation-style-language/csl-locales-ja-JP.xml create mode 100644 biblio/citation-style-language/csl-locales-km-KH.xml create mode 100644 biblio/citation-style-language/csl-locales-ko-KR.xml create mode 100644 biblio/citation-style-language/csl-locales-la.xml create mode 100644 biblio/citation-style-language/csl-locales-lt-LT.xml create mode 100644 biblio/citation-style-language/csl-locales-lv-LV.xml create mode 100644 biblio/citation-style-language/csl-locales-mn-MN.xml create mode 100644 biblio/citation-style-language/csl-locales-nb-NO.xml create mode 100644 biblio/citation-style-language/csl-locales-nl-NL.xml create mode 100644 biblio/citation-style-language/csl-locales-nn-NO.xml create mode 100644 biblio/citation-style-language/csl-locales-pl-PL.xml create mode 100644 biblio/citation-style-language/csl-locales-pt-BR.xml create mode 100644 biblio/citation-style-language/csl-locales-pt-PT.xml create mode 100644 biblio/citation-style-language/csl-locales-ro-RO.xml create mode 100644 biblio/citation-style-language/csl-locales-ru-RU.xml create mode 100644 biblio/citation-style-language/csl-locales-sk-SK.xml create mode 100644 biblio/citation-style-language/csl-locales-sl-SI.xml create mode 100644 biblio/citation-style-language/csl-locales-sr-RS.xml create mode 100644 biblio/citation-style-language/csl-locales-sv-SE.xml create mode 100644 biblio/citation-style-language/csl-locales-th-TH.xml create mode 100644 biblio/citation-style-language/csl-locales-tr-TR.xml create mode 100644 biblio/citation-style-language/csl-locales-uk-UA.xml create mode 100644 biblio/citation-style-language/csl-locales-vi-VN.xml create mode 100644 biblio/citation-style-language/csl-locales-zh-CN.xml create mode 100644 biblio/citation-style-language/csl-locales-zh-TW.xml create mode 100644 biblio/citation-style-language/csl.lua create mode 100644 biblio/citation-style-language/elsevier-harvard.csl create mode 100644 biblio/citation-style-language/harvard-cite-them-right.csl create mode 100644 biblio/citation-style-language/ieee.csl create mode 100644 biblio/citation-style-language/modern-humanities-research-association.csl create mode 100644 biblio/citation-style-language/modern-language-association.csl create mode 100644 biblio/citation-style-language/nature.csl create mode 100644 biblio/citation-style-language/vancouver.csl (limited to 'biblio') diff --git a/biblio/citation-style-language/CHANGELOG.md b/biblio/citation-style-language/CHANGELOG.md new file mode 100644 index 0000000000..db814dbb55 --- /dev/null +++ b/biblio/citation-style-language/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [v0.1.0] - 2022-01-22 + +### Added + +- Initial CTAN release. + +[Unreleased]: https://github.com/zepinglee/citeproc-lua/compare/v0.1.0...HEAD +[v0.1.0]: https://github.com/zepinglee/citeproc-lua/releases/tag/v0.1.0 diff --git a/biblio/citation-style-language/README.md b/biblio/citation-style-language/README.md new file mode 100644 index 0000000000..74c27590c6 --- /dev/null +++ b/biblio/citation-style-language/README.md @@ -0,0 +1,59 @@ +# citation-style-language + +The [Citation Style Language](https://citationstyles.org/) (CSL) is an +XML-based language that defines the formats of citations and bibliography. +There are currently thousands of styles in CSL including the most widely used +APA, Chicago, Vancouver, etc. +The `citation-style-language` package is aimed to provide another reference +formatting method for LaTeX that utilizes the CSL styles. +It contains a citation processor implemented in pure Lua (`citeproc-lua`) +which reads bibliographic metadata and performs sorting and formatting on both +citations and bibliography according to the selected CSL style. +A LaTeX package (`citation-style-language.sty`) is provided to communicate +with the processor. + +This project is in early development stage and some features of CSL (especially +collapsing and disambiguation) are not implemented yet. Comments, suggestions +and bug reports are welcome. + +## LaTeX example + +A full LaTeX example is in the [`example/`](example) directory. + +- LaTeX document example.tex + +```latex +\documentclass{article} + +\usepackage{citation-style-language} +\cslsetup{style = apa} +\addbibresource{example.bib} + +\begin{document} + +\cite{ITEM-1} +\printbibliography + +\end{document} +``` + +- Compiling with LuaTeX + +```bash +lualatex example.tex +lualatex example.tex +``` + +- Compiling with other TeX engines + +```bash +pdflatex example.tex +citeproc example.aux +pdflatex example.tex +``` + + +## License + +The LaTeX package and Lua library are released under MIT license. +The CSL locale files and styles are redistributed under the [Creative Commons Attribution-ShareAlike 3.0 Unported license](https://creativecommons.org/licenses/by-sa/3.0/). diff --git a/biblio/citation-style-language/american-chemical-society.csl b/biblio/citation-style-language/american-chemical-society.csl new file mode 100644 index 0000000000..bf75b2d8de --- /dev/null +++ b/biblio/citation-style-language/american-chemical-society.csl @@ -0,0 +1,280 @@ + + diff --git a/biblio/citation-style-language/american-medical-association.csl b/biblio/citation-style-language/american-medical-association.csl new file mode 100644 index 0000000000..44520822d0 --- /dev/null +++ b/biblio/citation-style-language/american-medical-association.csl @@ -0,0 +1,280 @@ + + diff --git a/biblio/citation-style-language/american-political-science-association.csl b/biblio/citation-style-language/american-political-science-association.csl new file mode 100644 index 0000000000..a3e7440c38 --- /dev/null +++ b/biblio/citation-style-language/american-political-science-association.csl @@ -0,0 +1,236 @@ + + diff --git a/biblio/citation-style-language/american-sociological-association.csl b/biblio/citation-style-language/american-sociological-association.csl new file mode 100644 index 0000000000..6657716cde --- /dev/null +++ b/biblio/citation-style-language/american-sociological-association.csl @@ -0,0 +1,309 @@ + + diff --git a/biblio/citation-style-language/apa.csl b/biblio/citation-style-language/apa.csl new file mode 100644 index 0000000000..f3de14b8cc --- /dev/null +++ b/biblio/citation-style-language/apa.csl @@ -0,0 +1,1914 @@ + + diff --git a/biblio/citation-style-language/chicago-author-date.csl b/biblio/citation-style-language/chicago-author-date.csl new file mode 100644 index 0000000000..8c133354b3 --- /dev/null +++ b/biblio/citation-style-language/chicago-author-date.csl @@ -0,0 +1,658 @@ + + diff --git a/biblio/citation-style-language/chicago-fullnote-bibliography.csl b/biblio/citation-style-language/chicago-fullnote-bibliography.csl new file mode 100644 index 0000000000..d0d599c289 --- /dev/null +++ b/biblio/citation-style-language/chicago-fullnote-bibliography.csl @@ -0,0 +1,1451 @@ + + diff --git a/biblio/citation-style-language/chicago-note-bibliography.csl b/biblio/citation-style-language/chicago-note-bibliography.csl new file mode 100644 index 0000000000..41c0c9ab5f --- /dev/null +++ b/biblio/citation-style-language/chicago-note-bibliography.csl @@ -0,0 +1,1417 @@ + + diff --git a/biblio/citation-style-language/citation-style-language-doc.pdf b/biblio/citation-style-language/citation-style-language-doc.pdf new file mode 100644 index 0000000000..8df2b9574f Binary files /dev/null and b/biblio/citation-style-language/citation-style-language-doc.pdf differ diff --git a/biblio/citation-style-language/citation-style-language-doc.tex b/biblio/citation-style-language/citation-style-language-doc.tex new file mode 100644 index 0000000000..87bdfacb79 --- /dev/null +++ b/biblio/citation-style-language/citation-style-language-doc.tex @@ -0,0 +1,357 @@ +\documentclass{l3doc} + +\usepackage{mathpazo} +\usepackage{helvet} +\usepackage{listings} + +\NewDocumentCommand\opt{m}{\texttt{#1}} + +\lstnewenvironment{LaTeXdemo}{ + \lstset{ + basicstyle = \ttfamily\small, + basewidth = 0.51em, + frame = single, + gobble = 2, + language = [LaTeX]TeX, + } +}{} + +\lstnewenvironment{bash}{ + \lstset{ + basicstyle = \ttfamily\small, + basewidth = 0.51em, + gobble = 2, + language = bash, + } +}{} + +% \hypersetup{hidelinks} +% \urlstyle{same} + +\begin{document} + +\title{% + Bibliography formatting with \pkg{citation-style-language} +} + +\author{% + Zeping Lee% + \thanks{% + E-mail: + \href{mailto:zepinglee@gmail.com} + {zepinglee@gmail.com}% + }% +} + +\date{2022-01-22 v0.1.0} + +\maketitle + +% \begin{abstract} +% Foo +% \end{abstract} + +\begin{documentation} + +\section{Introduction} + +The Citation Style Language\footnote{\url{https://citationstyles.org/}} (CSL) +is an XML-based language that defines the formats of citations and bibliography. +There are currently thousands of styles in CSL including the most widely used +APA, Chicago, Vancouver, etc. +The \pkg{citation-style-language} package is aimed to provide another reference formatting method +for LaTeX that utilizes the CSL styles. +It contains a citation processor implemented in pure Lua (\pkg{citeproc-lua}) +which reads bibliographic metadata and performs sorting and formatting on both +citations and bibliography according to the selected CSL style. +A LaTeX package (\file{citation-style-language.sty}) is provided to communicate with the processor. + +Note that this project is in early development stage and some features of CSL +are not implemented yet (especially collapsing and disambiguation). +Comments, suggestions, and bug reports are welcome. + + +\section{Getting started} + +An example of using \pkg{citation-style-language} package is as follows. + +\begin{LaTeXdemo} + \documentclass{...} + \usepackage{citation-style-language} + \cslsetup{ + style = ..., + ... + } + \addbibresource{bibfile.json} + \begin{document} + \cite{...} + ... + \printbibliography + \end{document} +\end{LaTeXdemo} + +The procedure to compile the document is different across engines. + +\paragraph{LuaTeX} + +The CSL processor is written in Lua and it can be run directly in LuaTeX +without the need of running external programs. +For LuaTeX, the compiling procedure is simply running \file{latex} twice, +which is the same as documents with cross references. + +\paragraph{Other engines} + +For engines other than LuaTeX, the \file{citeproc} executable is required +to run on the \file{.aux} file to generate the citations and bibliography. +The general procedure is similar to the traditional BibTeX workflow. +\begin{enumerate} + \item Run \file{latex} on \file{example.tex}. + \item Run \file{citeproc} on \file{example.aux}. + The engine reads the \file{.csl} style, CSL locale files, and + \file{.bib} database and then writes the processed citations and + bibliography to \file{example.bbl}. + \item Run \file{latex} on \file{example.tex}. + The \file{.bbl} file is loaded and all the citations and bibliography + are printed. +\end{enumerate} + + + +\section{Package commands} + +\begin{function}{\cslsetup} + \begin{syntax} + \cs{cslsetup}\marg{options} + \end{syntax} +\end{function} + +The behavior of the \pkg{citation-style-language} package is controlled by several key-value +options which can be set with the \cs{cslsetup} command. +For example, +\begin{LaTeXdemo} + \cslsetup{ + style = apa, + locale = zh-CN, + } +\end{LaTeXdemo} + +\DescribeOption{style} +The \opt{style=}\meta{style-id} option selects the style file +\meta{style-id}\file{.csl} for both citations and bibliography. +The implemented CSL style files are available in the official GitHub +repository\footnote{\url{https://github.com/citation-style-language/styles}} +as well as the Zotero style +repository\footnote{\url{https://www.zotero.org/styles}}. +The user may search and download the \file{.csl} file to the working directory. +The following styles are distributed within the package and +each of them can be directly loaded without downloading. + +\begin{description} + \item[\opt{american-chemical-society}] American Chemical Society + \item[\opt{american-medical-association}] American Medical Association 11th edition + \item[\opt{american-political-science-association}] American Political Science Association + \item[\opt{american-sociological-association}] American Sociological Association 6th edition + \item[\opt{apa}] American Psychological Association 7th edition + \item[\opt{chicago-author-date}] Chicago Manual of Style 17th edition (author-date) + \item[\opt{chicago-fullnote-bibliography}] Chicago Manual of Style 17th edition (full note) + \item[\opt{chicago-note-bibliography}] Chicago Manual of Style 17th edition (note) + \item[\opt{elsevier-harvard}] Elsevier - Harvard (with titles) + \item[\opt{harvard-cite-them-right}] Cite Them Right 11th edition - Harvard + \item[\opt{ieee}] IEEE + \item[\opt{modern-humanities-research-association}] Modern Humanities Research Association 3rd edition (note with bibliography) + \item[\opt{modern-language-association}] Modern Language Association 9th edition + \item[\opt{nature}] Nature + \item[\opt{vancouver}] Vancouver +\end{description} + +\DescribeOption{locale} +The \opt{locale} option receives an ISO 639-1 two-letter language code +(e.g., ``\opt{en}'', ``\opt{zh}''), optionally with a two-letter locale code +(e.g., ``\opt{de-DE}'', ``\opt{de-AT}''). +This option affects sorting of the entries and the output of dates, numbers, +and terms (e.g., ``et al.''). +It may also be set \opt{auto} (default) and the \opt{default-locale} attribute in +the CSL style file will be used. +The locale falls back to ``\opt{en}'' (English) if the attribute is not set. +When \pkg{babel} package is loaded, the selected main language is implicitly set +as the \opt{locale} for \pkg{citation-style-language}. + +\DescribeOption{bib-font} +Usually, the list of references is printed in the same font style and size as +the main text. +The \opt{bib-font} option is used to set different formats in the +\env{thebibliography} environment. +It may override the \opt{line-spacing} attribute configured in the CSL style. +For example, to force double-spacing in the bibliography: +\begin{LaTeXdemo} + \cslsetup{bib-font = \linespread{2}\selectfont} +\end{LaTeXdemo} + +\DescribeOption{bib-item-sep} +The vertical space between entries in the bibliography is configured in the +CSL style. +It can be overridden by this \opt{bib-item-sep} option. +It is recommended to set \opt{bib-item-sep} to a stretchable glue rather than +a fixed length to help reducing page breaks in the middle of an entry. +\begin{LaTeXdemo} + \cslsetup{bib-item-sep = 8 pt plus 4 pt minus 2 pt} +\end{LaTeXdemo} + +\DescribeOption{bib-hang} +The \opt{bib-hang} option sets the hanging indentation length which is +usually used for author-date style references. +By default, it is 1 em (with respect to the \opt{bib-font} size if set). + + +\begin{function}{\addbibresource} + \begin{syntax} + \cs{addbibresource}\oarg{options}\marg{resouce} + \end{syntax} +\end{function} + +The \cs{addbibresource} command adds the contents of \meta{resource} into the +bibliographic metadata. +Currently, only Bib(La)TeX \file{.bib} format is supported. + +and Bib(La)TeX \file{.bib} are supported. +It is internally converted to CSL-JSON\footnote{\url{https://github.com/citation-style-language/schema\#csl-json-schema}}, the data model defined with CSL +and the mapping of entry-types and fields from \file{.bib} to CSL-JSON is detailed +in GitHub wiki +page\footnote{\url{https://github.com/zepinglee/citeproc-lua/wiki/Bib-CSL-mapping}}. +Note that only UTF-8 encoding is supported for the \meta{resource} file. +\begin{LaTeXdemo} + \addbibresource{bibfile.bib} +\end{LaTeXdemo} + + +\begin{function}{\cite} + \begin{syntax} + \cs{cite}\oarg{options}\marg{keys} + \end{syntax} +\end{function} + +The citation command is similar to the one in standard LaTeX except that the +\meta{options} is in key-value style. +The \meta{options} can be \opt{prefix}, \opt{suffix} or one of the locators: +\opt{book}, +\opt{chapter}, +\opt{column}, +\opt{figure}, +\opt{folio}, +\opt{issue}, +\opt{line}, +\opt{note}, +\opt{opus}, +\opt{page}, +\opt{paragraph}, +\opt{part}, +\opt{section}, +\opt{sub-verbo}, +\opt{verse}, +and \opt{volume}. +An example is as follows. +\begin{LaTeXdemo} + \cite[prefix = {See }, page = 42]{ITEM-1} +\end{LaTeXdemo} + +The traditional form \cs{cite}\oarg{prenote}\oarg{postnote}\marg{keys} +introduced in \pkg{natbib} and \pkg{biblatex} is also supported but not +recommended. +If only one optional argument is provided, it is treated as \meta{postnote}. +The \meta{postnote} is used as a page locator if it consists of only digits. + +In other packages, several commands are provided for producing citations in +different styles such as \cs{citet}, \cs{citep}, \cs{parencite}, and +\cs{footnotecite}. +In \pkg{citation-style-language} package, however, the format of citations is fixed as formatted +in CSL style and it is impossible to select another format without modifying +the \file{.csl} style file. +Note that narrative citation (like ``Doe (2018)'') will be supported in CSL 1.1. + + + +\begin{function}{\printbibliography} + \begin{syntax} + \cs{printbibliography}\oarg{options} + \end{syntax} +\end{function} + +This command prints the reference list. +Currently no options are available. + + +% \begin{function}{\cites} +% \begin{syntax} +% \cs{cite}\oarg{options}\marg{keys} +% \end{syntax} +% \end{function} + + + + +% \markdownInput{bib-csl-mapping.md} + + +\section{Compatibility with other packages} + +\paragraph{\pkg{babel}} + +The main language set by \pkg{babel} is used as the locale for \pkg{citation-style-language}. + +\paragraph{\pkg{hyperref}} + +When \pkg{hyperref} is loaded, the DOIs, PMIDs, and PMCIDs are correctly +rendered as hyperlinks. +But the citations are not linked to the entries in bibliography. + +\paragraph{Incompatible packages} + +The following packages are not compatible with \pkg{citation-style-language}. +An error will be triggered if any of them is loaded together with \pkg{citation-style-language}. +\begin{itemize} + \item \pkg{babelbib} + \item \pkg{backref} + \item \pkg{biblatex} + \item \pkg{bibtopic} + \item \pkg{bibunits} + \item \pkg{chapterbib} + \item \pkg{cite} + \item \pkg{citeref} + \item \pkg{inlinebib} + \item \pkg{jurabib} + \item \pkg{mcite} + \item \pkg{mciteplus} + \item \pkg{multibib} + \item \pkg{natbib} + \item \pkg{splitbib} +\end{itemize} + + + +\section{Known issues} + +The \pkg{citation-style-language} package is in early development stage and there are some issues with it. + +\begin{itemize} + \item The \pkg{citeproc-lua} has not implemented all the features of CSL, + especially disambiguation and collapsing. + For detailed information of the coverage on the CSL standard test + suite\footnote{\url{https://github.com/citation-style-language/test-suite}}, + see \href{https://github.com/zepinglee/citeproc-lua/blob/main/test/citeproc-test.log}{citeproc-test.log} + in the GitHub repository. + \item The processor is much slower than expected compared to other + reference engines. + This is because little care has been taken in the development so far. + Optimization is needed in the future. + \item When used with \pkg{hyperref}, the citations are not correctly rendered + as hyperlinks. + \item The Unicode sorting method is provided by \pkg{lua-uca} package and + CJK scripts are not supported so far. +\end{itemize} + + + + +\end{documentation} + +\end{document} diff --git a/biblio/citation-style-language/citation-style-language.sty b/biblio/citation-style-language/citation-style-language.sty new file mode 100644 index 0000000000..117e9c844a --- /dev/null +++ b/biblio/citation-style-language/citation-style-language.sty @@ -0,0 +1,807 @@ +% +% Copyright (C) 2021 Zeping Lee +% + +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{expl3} +\RequirePackage{xparse} +\ProvidesExplPackage {citation-style-language} {2022-01-22} {v0.1.0} + {Citation Style Language for LaTeX} + +% \msg_new:nnn { citation-style-language } { require-luatex } +% { LuaTeX~ is~ required~ for~ `citation-style-language'~ package. } +% \sys_if_engine_luatex:F { \msg_fatal:nn { citation-style-language } { require-luatex } } + +\sys_if_engine_luatex:T + { \lua_now:n { csl = require("csl") } } + +\RequirePackage { filehook } +\RequirePackage { url } + +\cs_new:Npn \csl_incompatible_package:n #1 + { + \AtBeginOfPackageFile* { #1 } + { \msg_error:nnn { citation-style-language } { incompatible-package } { #1 } } + } +\msg_new:nnn { citation-style-language } { incompatible-package } + { The~ `#1'~ package~ is~ incompatible~ with~ `citeproc'. } + +\csl_incompatible_package:n { babelbib } +\csl_incompatible_package:n { backref } +\csl_incompatible_package:n { biblatex } +\csl_incompatible_package:n { bibtopic } +\csl_incompatible_package:n { bibunits } +\csl_incompatible_package:n { chapterbib } +\csl_incompatible_package:n { cite } +\csl_incompatible_package:n { citeref } +\csl_incompatible_package:n { inlinebib } +\csl_incompatible_package:n { jurabib } +\csl_incompatible_package:n { mcite } +\csl_incompatible_package:n { mciteplus } +\csl_incompatible_package:n { multibib } +\csl_incompatible_package:n { natbib } +\csl_incompatible_package:n { splitbib } + + +\NewDocumentCommand \cslsetup { m } + { \keys_set:nn { csl } {#1} } + +\cs_new:Npn \csloptions #1 { } + + +\DeclareDocumentCommand \cite { o o m } + { + \IfValueTF { #2 } + { \csl_cite:nnn { #1 } { #2 } { #3 } } + { + \IfValueTF { #1 } + { \csl_cite:nnn { } { #1 } { #3 } } + { \csl_cite:nnn { } { } { #3 } } + } + } + + +% % multicite command +% \DeclareDocumentCommand \cites { o o m } + + +\DeclareDocumentCommand \nocite { m } + { + \ifx \@begindocumenthook \@undefined \else + \exp_after:wN \AtBeginDocument + \fi + { + \if@filesw + \iow_now:Nn \@auxout + { \citation { { nocite } { #1 } { } } } + \fi + } + \sys_if_engine_luatex:T + { \lua_now:n { csl.nocite("#1") } } +} + + +\tl_new:N \l__csl_citation_tl +\tl_new:N \l__csl_citation_id_tl +\tl_new:N \l__csl_cite_items_tl +\tl_new:N \l__csl_note_index_tl +\tl_new:N \l__csl_citation_info_tl + +\cs_new:Npn \csl_cite:nnn #1#2#3 + { + \csl_process_citation_id:n { #3 } + \csl_process_cite_items:nnn { #1 } { #2 } { #3 } + \exp_args:NV \csl_process_note_index:n \l__csl_citation_id_tl + \tl_set:Nx \l__csl_citation_info_tl + { + { \l__csl_citation_id_tl } + { \l__csl_cite_items_tl } + { \l__csl_note_index_tl } + } + \if@filesw + { + \iow_now:Nx \@auxout + { \exp_not:N \citation { \l__csl_citation_info_tl } } + } + \fi + \tl_clear:N \l__csl_citation_tl + \tl_if_exist:cTF { g__csl_citation_ \l__csl_citation_id_tl _tl } + { + \exp_args:Nv \csl_print_defined_citation:n + { g__csl_citation_ \l__csl_citation_id_tl _tl } + } + { + \bool_if:NTF \l__csl_engine_initialized_bool + { + \tl_set:Nx \l__csl_citation_tl + { \lua_now:e { csl.cite("\l__csl_citation_info_tl") } } + } + { + \exp_args:Nx \csl_print_undefined_citation:n + { \clist_use:Nn \l__csl_keys_clist { ,~ } } + } + } + } + +\cs_new:Npn \csl_print_undefined_citation:n #1 + { + \tl_set:Nn \l__csl_citation_tl { [ \textbf { #1 } ] } + \G@refundefinedtrue + \exp_args:Nnnx \msg_warning:nnn { citation-style-language } { citation / undefined } { #1 } + \group_begin: + \reset@font [ \textbf { #1 } ] + \group_end: + } + +\cs_new:Npn \csl_print_defined_citation:n #1 + { + \csl_print_defined_citation_aux:nn #1 + } + +\cs_new:Npn \csl_print_defined_citation_aux:nn #1#2 + { + \tl_set:Nn \l__csl_citation_tl { #2 } + \tl_if_eq:nnTF { #1 } { note } + { \footnote { #2 } } + { #2 } + } + + +\msg_new:nnn { citation-style-language } { citation / undefined } + { + Citation~ `#1'~ on~ page~ \thepage \space undefined~ \msg_line_context: . + } + + +\clist_new:N \l__csl_keys_clist +\tl_new:N \l__csl_normalized_keys_tl + +% \csl_process_citation_id:n { } +% It sets the `\l__csl_citation_id_tl` `ITEM-1,ITEM-2@4`. +\cs_new:Npn \csl_process_citation_id:n #1 + { + \clist_set:Nn \l__csl_keys_clist { #1 } + \tl_set:Nx \l__csl_normalized_keys_tl + { \clist_use:Nn \l__csl_keys_clist { , } } + \int_if_exist:cF { g__csl_citation_count_ \l__csl_normalized_keys_tl _int } + { + \int_gzero_new:c + { g__csl_citation_count_ \l__csl_normalized_keys_tl _int } + } + \int_gincr:c { g__csl_citation_count_ \l__csl_normalized_keys_tl _int } + \tl_set:Nx \l__csl_citation_id_tl + { + \l__csl_normalized_keys_tl @ + \int_use:c { g__csl_citation_count_ \l__csl_normalized_keys_tl _int } + } + } + + +\tl_new:N \l__csl_cite_item_tl + +% `{citationID}{{id={id1},{}},{}}{}` +\cs_new:Npn \csl_process_cite_items:nnn #1#2#3 + { + \tl_clear:N \l__csl_cite_items_tl + \clist_map_inline:nn { #3 } + { + \tl_if_empty:NTF \l__csl_cite_items_tl + { + \csl_process_cite_item:nnn { #1 } { #2 } { ##1 } + \tl_put_right:Nx \l__csl_cite_items_tl { { \l__csl_cite_item_tl } } + } + { + \csl_process_cite_item:nnn { } { } { ##1 } + \tl_put_right:Nx \l__csl_cite_items_tl { , { \l__csl_cite_item_tl } } + } + } + } + + +\prop_new:N \l__csl_cite_item_prop + +\keys_define:nn { csl / cite-item } + { + prefix .prop_put:N = \l__csl_cite_item_prop, + suffix .prop_put:N = \l__csl_cite_item_prop, + locator .prop_put:N = \l__csl_cite_item_prop, + label .prop_put:N = \l__csl_cite_item_prop, + suppress-author .prop_put:N = \l__csl_cite_item_prop, + author-only .prop_put:N = \l__csl_cite_item_prop, + uris .prop_put:N = \l__csl_cite_item_prop, + book .code:n = { \csl_set_locator:nn { book } { #1 } } , + chapter .code:n = { \csl_set_locator:nn { chapter } { #1 } } , + column .code:n = { \csl_set_locator:nn { column } { #1 } } , + figure .code:n = { \csl_set_locator:nn { figure } { #1 } } , + folio .code:n = { \csl_set_locator:nn { folio } { #1 } } , + issue .code:n = { \csl_set_locator:nn { issue } { #1 } } , + line .code:n = { \csl_set_locator:nn { line } { #1 } } , + note .code:n = { \csl_set_locator:nn { note } { #1 } } , + opus .code:n = { \csl_set_locator:nn { opus } { #1 } } , + page .code:n = { \csl_set_locator:nn { page } { #1 } } , + paragraph .code:n = { \csl_set_locator:nn { paragraph } { #1 } } , + part .code:n = { \csl_set_locator:nn { part } { #1 } } , + section .code:n = { \csl_set_locator:nn { section } { #1 } } , + sub-verbo .code:n = { \csl_set_locator:nn { sub-verbo } { #1 } } , + verse .code:n = { \csl_set_locator:nn { verse } { #1 } } , + volume .code:n = { \csl_set_locator:nn { volume } { #1 } } , + } + +\cs_new:Npn \csl_set_locator:nn #1#2 + { + \prop_put:Nnn \l__csl_cite_item_prop { label } { #1 } + \prop_put:Nnn \l__csl_cite_item_prop { locator } { #2 } + } + +\tl_new:N \l__csl_prefix_tl +\tl_new:N \l__csl_suffix_tl + +% \csl_process_cite_item:nnn { } { } { } +% return: `id={ITEM},locator={42},label={page}` +\cs_new:Npn \csl_process_cite_item:nnn #1#2#3 + { + \prop_clear:N \l__csl_cite_item_prop + \prop_put:Nnn \l__csl_cite_item_prop { id } { #3 } + \tl_if_empty:nF { #1 } + { + \tl_set:Nn \l__csl_prefix_tl { #1 } + \tl_put_right:NV \l__csl_prefix_tl \l__csl_prefix_separator_tl + \prop_put:NnV \l__csl_cite_item_prop { prefix } { \l__csl_prefix_tl } + } + \tl_if_in:nnTF { #2 } { = } + { + \keys_set:nn { csl / cite-item } { #2 } + } + { + \tl_if_empty:nF { #2 } + { + \regex_match:nnTF { \d+ } { #2 } + { \csl_set_locator:nn { page } { #2 } } + { + \tl_set:Nn \l__csl_suffix_tl { #2 } + \tl_put_left:NV \l__csl_suffix_tl \l__csl_suffix_separator_tl + \prop_put:NnV \l__csl_cite_item_prop { suffix } { \l__csl_suffix_tl } + } + } + } + \tl_clear:N \l__csl_cite_item_tl + \prop_map_inline:Nn \l__csl_cite_item_prop + { + \tl_if_empty:NF \l__csl_cite_item_tl + { \tl_put_right:Nn \l__csl_cite_item_tl { , } } + \tl_put_right:Nn \l__csl_cite_item_tl { ##1 = { ##2 } } + } + } + +\int_new:N \l__csl_note_index_int +\int_gzero_new:N \g__csl_last_note_index_int +\int_gzero_new:N \g__csl_citation_note_count_int + +% \csl_process_note_index:nnn { } +\cs_new:Npn \csl_process_note_index:n #1 + { + \int_set_eq:Nc \l__csl_note_index_int { c@ \@mpfn } + \tl_if_exist:cTF { g__csl_citation_ #1 _tl } + { \int_incr:N \l__csl_note_index_int } + { \int_gincr:N \g__csl_citation_note_count_int } + \int_add:Nn \l__csl_note_index_int { \g__csl_citation_note_count_int } + \tl_set:Nx \l__csl_note_index_tl + { \int_use:N \l__csl_note_index_int } + \int_gset_eq:NN \g__csl_last_note_index_int \l__csl_note_index_int + \int_compare:nT { \l__csl_note_index_int < \g__csl_last_note_index_int } + { + \int_gzero:N \g__csl_last_note_index_int + \int_gzero:N \g__csl_citation_note_count_int + } + } + + +% Used in aux files to register cite items. +\cs_set:Npn \citation #1 + { + \sys_if_engine_luatex:T + { \lua_now:n { csl.register_citation_info("#1") } } + } + + +\cs_new:Npn \cslcite #1#2 + { + \bibcite { #1 } { #2 } + \if@filesw + \iow_now:Nn \@auxout { \bibcite { #1 } { #2 } } + \fi + } + + +\cs_set:Npn \bibcite #1#2 + { + \tl_gset:cn { g__csl_citation_ #1 _tl } { #2 } + } + +% The `babel` package redefines \bibcite in the \@begindocumenthook. +% This should be disabled. +\AtEndOfPackageFile* { babel } + { + \cs_set_eq:NN \bbl@cite@choice \relax + } + +\AtEndOfPackageFile* { hyperref } + { + \cs_set:Npn \bibcite #1#2 + { + \tl_gset:cn { g__csl_citation_ #1 _tl } { #2 } + } + } + +\NewDocumentCommand \printbibliography { } + { + \sys_if_engine_luatex:TF + { + \bool_if:NTF \l__csl_engine_initialized_bool + { \lua_now:n { csl.bibliography() } } + { \msg_warning:nnn { citation-style-language } { bibliography / empty } } + } + { + \tl_if_empty:NTF \l__csl_bibliography_tl + { + \file_if_exist_input:nF { \jobname .bbl } + { + \msg_warning:nnx { citation-style-language } { file / non-exist} { \jobname .bbl } + } + } + { \exp_args:NV \csl_print_bibiliography_tl \l__csl_bibliography_tl } + } + } + +\cs_new:Npn \csl_print_bibliography_tl #1 + { + \begin { thebibliography } + #1 + \end { thebibliography } + } + +\msg_new:nnn { citation-style-language } { bibliography / empty } + { The~ bibliography~ is~ empty. } + +\msg_new:nnn { citation-style-language } { file / non-exist } + { No~ file~ #1. } + + +\tl_new:N \l__csl_style_tl +\clist_new:N \l__csl_bib_resources_clist +\tl_new:N \l__csl_prefix_separator_tl +\tl_new:N \l__csl_suffix_separator_tl +\tl_new:N \l__csl_locale_tl +\tl_new:N \l__csl_bib_font_tl +\tl_new:N \l__csl_bib_item_sep_tl +\tl_new:N \l__csl_bib_hang_tl +\bool_new:N \l__csl_hanging_indent_bool +\tl_new:N \l__csl_line_spacing_tl +\tl_new:N \l__csl_entry_spacing_tl + + +\keys_define:nn { csl } + { + style .tl_set:N = \l__csl_style_tl , + prefix-separator .tl_set:N = \l__csl_prefix_separator_tl , + suffix-separator .tl_set:N = \l__csl_suffix_separator_tl , + locale .tl_set:N = \l__csl_locale_tl , + bib-font .tl_set:N = \l__csl_bib_font_tl , + bib-item-sep .tl_set:N = \l__csl_bib_item_sep_tl , + bib-hang .tl_set:N = \l__csl_bib_hang_tl , + hanging-indent .bool_set:N = \l__csl_hanging_indent_bool , + line-spacing .tl_set:N = \l__csl_line_spacing_tl , + entry-spacing .tl_set:N = \l__csl_entry_spacing_tl , + } + +\keys_set:nn { csl } + { + prefix-separator = { ~ } , + suffix-separator = { , ~ } , + bib-hang = { 1 em } , + line-spacing = { 1 } , + entry-spacing = { 1 } , + } + +\bool_new:N \l__csl_engine_initialized_bool + +\prop_set_from_keyval:Nn \l__csl_babel_locale_mapping_prop + { + acadian = fr-CA, + american = en-US, + australian = en-AU, + afrikaans = af-ZA, + albanian = sq-AL, + amharic = am-ET, + arabic = ar, + armenian = hy-AM, + asturian = ast-ES, + austrian = de-AT, + bahasa = id-ID, + bahasai = id-ID, + bahasam = id-ID, + basque = eu-ES, + bengali = bn-BD, + bgreek = el-GR, + brazil = pt-BR, + brazilian = pt-BR, + breton = br-FR, + british = en-GB, + bulgarian = bg-BG, + canadian = en-CA, + canadien = fr-CA, + catalan = ca-AD, + coptic = cop, + croatian = hr-HR, + czech = cs-CZ, + danish = da-DK, + divehi = dv-MV, + dutch = nl-NL, + english = en-US, + esperanto = eo-001, + estonian = et-EE, + ethiopia = am-ET, + farsi = fa-IR, + finnish = fi-FI, + francais = fr-FR, + french = fr-FR, + frenchle = fr-FR, + friulan = fur-IT, + galician = gl-ES, + german = de-DE, + germanb = de-DE, + greek = el-GR, + hebrew = he-IL, + hindi = hi-IN, + ibygreek = el-CY, + icelandic = is-IS, + indon = id-ID, + indonesia = id-ID, + interlingua = ia-FR, + irish = ga-IE, + italian = it-IT, + japanese = ja-JP, + kannada = kn-IN, + lao = lo-LA, + latin = la-Latn, + latvian = lv-LV, + lithuanian = lt-LT, + lowersorbian = dsb-DE, + lsorbian = dsb-DE, + magyar = hu-HU, + malay = id-ID, + malayalam = ml-IN, + marathi = mr-IN, + meyalu = id-ID, + mongolian = mn-Cyrl, + naustrian = de-AT, + newzealand = en-NZ, + ngerman = de-DE, + nko = ha-NG, + norsk = nb-NO, + norwegian = nn-NO, + nynorsk = nn-NO, + occitan = oc-FR, + piedmontese = pms-IT, + pinyin = pny, + polish = pl-PL, + polutonikogreek = el-GR, + portuges = pt-PT, + portuguese = pt-PT, + romanian = ro-RO, + romansh = rm-CH, + russian = ru-RU, + samin = se-NO, + sanskrit = sa-IN, + scottish = gd-GB, + serbian = sr-Latn, + serbianc = sr-Cyrl, + slovak = sk-SK, + slovene = sl-SI, + slovenian = sl-SI, + spanish = es-ES, + swedish = sv-SE, + swiss = de-CH, + swissgerman = de-CH, + nswissgerman = de-CH, + syriac = syc, + tamil = ta-IN, + telugu = te-IN, + thai = th-TH, + thaicjk = th-TH, + tibetan = bo-CN, + turkish = tr-TR, + turkmen = tk-TM, + ukrainian = uk-UA, + urdu = ur-IN, + UKenglish = en-UK, + uppersorbian = hsb-DE, + USenglish = en-US, + usorbian = hsb-DE, + vietnamese = vi-VN, + welsh = cy-GB, + } + +\tl_new:N \l__csl_bibliography_tl +\tl_new:N \l__csl_bibliography_setup_tl + +\AtBeginDocument + { + \tl_if_empty:NTF \l__csl_style_tl + { \tl_set_eq:NN \l__csl_style_tl \g__csl_aux_bibstyle_tl } + { \exp_args:Nx \csl_write_aux_bibstyle:n { \l__csl_style_tl } } + \clist_if_empty:NTF \l__csl_bib_resources_clist + { \clist_set_eq:NN \l__csl_bib_resources_clist \g__csl_aux_bib_files_clist } + { + \exp_args:Nx \csl_write_aux_bibdata:n + { \clist_use:Nn \l__csl_bib_resources_clist { , } } + } + \csl_write_aux_csl_options: + \sys_if_engine_luatex:T + { + \lua_now:e + { + csl.init( + "\l__csl_style_tl", + "\l__csl_bib_resources_clist", + "\l__csl_locale_tl" + ) + } + \str_if_eq:eeT { \lua_now:n { tex.print(csl.initialized) } } { true } + { \bool_set_true:N \l__csl_engine_initialized_bool } + \@ifpackageloaded { hyperref } + { \lua_now:n { csl.enable_linking() } } + { } + } + % Load .bbl at the beginning of document to save one pass of latex. + % In this procedure, the \cslcite command is processed and the contents + % of `thebibliography` is stored into \l__csl_bibliography_tl. + \group_begin: + \RenewDocumentCommand \cslsetup { m } + { \tl_set:Nn \l__csl_bibliography_setup_tl { #1 } } + \RenewDocumentEnvironment { thebibliography } { m +b } + { \tl_set:Nn \l__csl_bibliography_tl { { #1 } #2 } } + { } + \file_if_exist_input:n { \jobname .bbl } + \group_end: + } + +\cs_new:Npn \csl_write_aux_bibstyle:n #1 + { + \if@filesw + \iow_now:Nn \@auxout { \bibstyle { #1 } } + \fi + } + +\clist_new:N \l__csl_options_clist + +\cs_new:Nn \csl_write_aux_csl_options: + { + \clist_clear:N \l__csl_options_clist + % locale + \tl_if_empty:NT \l__csl_locale_tl + { + \tl_if_exist:NT \bbl@main@language + { + \prop_get:NVN \l__csl_babel_locale_mapping_prop \bbl@main@language + \l__csl_locale_tl + } + } + \tl_if_empty:NF \l__csl_locale_tl + { + \clist_put_right:Nx \l__csl_options_clist + { locale = \l__csl_locale_tl } + } + % linking + \@ifpackageloaded { hyperref } + { \clist_put_right:Nn \l__csl_options_clist { linking = true } } + { } + % write to aux file + \prop_if_empty:NF \l__csl_options_clist + { + \if@filesw + \iow_now:Nx \@auxout + { + \exp_not:N \csloptions + { \clist_use:Nn \l__csl_options_clist { , } } + } + \fi + } + } + + +\DeclareDocumentCommand \bibliographystyle { m } + { + \ifx \@begindocumenthook \@undefined + \csl_write_aux_bibstyle:n { #1 } + \fi + \tl_set:Nn \l__csl_style_tl { #1 } + } + +\tl_new:N \g__csl_aux_bibstyle_tl +\cs_set:Npn \bibstyle #1 + { \tl_gset:Nn \g__csl_aux_bibstyle_tl { #1 } } + + +\NewDocumentCommand \addbibresource { o m } + { \clist_put_right:Nn \l__csl_bib_resources_clist { #2 } } + + +\clist_new:N \g__csl_aux_bib_files_clist +\cs_set:Npn \bibdata #1 + { \clist_gput_right:Nn \g__csl_aux_bib_files_clist { #1 } } + + +\DeclareDocumentCommand \bibliography { m } + { + \csl_write_aux_bibdata:n { #1 } + \printbibliography + } + +\cs_new:Npn \csl_write_aux_bibdata:n #1 + { + \if@filesw + \iow_now:Nn \@auxout { \bibdata { #1 } } + \fi + } + + +\clist_new:N \g__csl_bib_items_clist + +% For numeric or label-style bibliography +% \def\@lbibitem[#1]#2{\item[\@biblabel{#1}\hfill]\if@filesw +% {\let\protect\noexpand +% \immediate +% \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces} +\cs_new:Npn \csl_lbibitem:nn [#1]#2 + { + \clist_gput_right:Nn \g__csl_bib_items_clist { #2 } + \item [ \@biblabel { #1 } \hfill ] \ignorespaces + } +\cs_set_eq:NN \@lbibitem \csl_lbibitem:nn + +% For author-date bibliography +% \def\@bibitem#1{\item\if@filesw \immediate\write\@auxout +% {\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces} +\cs_new:Npn \csl_bibitem:n #1 + { + \clist_gput_right:Nn \g__csl_bib_items_clist { #1 } + \item [ ] \ignorespaces + } +\cs_set_eq:NN \@bibitem \csl_bibitem:n + +\AtEndOfPackageFile* { hyperref } + { + \cs_gset_eq:NN \@lbibitem \csl_lbibitem:nn + \cs_gset_eq:NN \@bibitem \csl_bibitem:n + } + +% CSL outputs the whole label thus the brackets are removed from \@biblabel +% \def\@biblabel#1{[#1]} +\cs_set:Npn \@biblabel #1 { #1 } + + +\cs_if_exist:cTF { chapter } + { + \cs_set:Nn \csl_bib_section: + { + \chapter * + { + \bibname + \@mkboth + { \MakeUppercase { \bibname } } + { \MakeUppercase { \bibname } } + } + } + } + { + \cs_set:Nn \csl_bib_section: + { + \section * + { + \refname + \@mkboth + { \MakeUppercase { \refname } } + { \MakeUppercase { \refname } } + } + } + } + +\tl_new:N \l__csl_bib_preamble_tl + +\tl_new:N \l__csl_bib_postamble_tl + +\dim_new:N \l__csl_bib_hang_dim +\skip_new:N \l__csl_bib_item_sep_skip + +\cs_new:Npn \csl_set_bib_label_spacing:n #1 + { + \bool_if:NTF \l__csl_hanging_indent_bool + { + \dim_set:Nn \l__csl_bib_hang_dim { \l__csl_bib_hang_tl } + \dim_set_eq:NN \leftmargin \l__csl_bib_hang_dim + \dim_set:Nn \itemindent { - \leftmargin } + } + { + \settowidth \labelwidth { \@biblabel { #1 } } + \dim_set_eq:NN \leftmargin \labelwidth + \dim_add:Nn \leftmargin { \labelsep } + } + } + +\cs_new:Nn \csl_set_bib_item_sep: + { + \skip_zero:N \parsep + \tl_if_empty:NTF \l__csl_bib_item_sep_tl + { + \skip_set:Nn \l__csl_bib_item_sep_skip + { + 8 pt plus 4 pt minus 2 pt * \dim_ratio:nn { 1 em } { 8 pt } + * \l__csl_entry_spacing_tl + } + } + { \skip_set:Nn \l__csl_bib_item_sep_skip { \l__csl_bib_item_sep_tl } } + } + +\cs_new:Nn \csl_set_bib_allow_break: + { + \sloppy + \int_set:Nn \clubpenalty { 4000 } + \int_set_eq:NN \@clubpenalty \clubpenalty + \int_set:Nn \widowpenalty { 4000 } + % \sfcode`\.\@m + \frenchspacing + } +% TODO: \biburlsetup + +\cs_new_eq:NN \csl_set_bib_page_break: \csl_set_bib_allow_break: + +\cs_new:Nn \csl_set_bib_no_break: + { + \sloppy + \int_set:Nn \interlinepenalty { 5000 } + \int_set:Nn \widowpenalty { 10000 } + \int_set:Nn \clubpenalty { 10000 } + \int_set_eq:NN \@clubpenalty \clubpenalty + \raggedbottom + \frenchspacing + } + +% It will be used for multi-bibliography. +\cs_new:Nn \csl_reset_bib_format: + { + \keys_set:nn { csl } { + hanging-indent = false , + line-spacing = 1 , + entry-spacing = 1 , + } + } + +% \newenvironment{thebibliography}[1] +\RenewDocumentEnvironment { thebibliography } { m } + { + \csl_bib_section: + \dim_zero:N \parindent + \l__csl_bib_preamble_tl + \tl_if_eq:NnF \l__csl_line_spacing_tl { 1 } + { \linespread { \l__csl_line_spacing_tl } \selectfont } + \l__csl_bib_font_tl + \list { } + { + \csl_set_bib_label_spacing:n { #1 } + \csl_set_bib_item_sep: + } + \sloppy + \csl_set_bib_page_break: + \frenchspacing + \clist_gclear:N \g__csl_bib_items_clist + } + { + \l__csl_bib_postamble_tl + \tl_set:Nn \@noitemerr + { \msg_warning:nnn { citation-style-language } { bibliography / empty } } + \endlist + \csl_reset_bib_format: + } + +\endinput diff --git a/biblio/citation-style-language/citeproc b/biblio/citation-style-language/citeproc new file mode 100755 index 0000000000..3a72892ec7 --- /dev/null +++ b/biblio/citation-style-language/citeproc @@ -0,0 +1,188 @@ +#!/usr/bin/env texlua + +kpse.set_program_name("luatex") + +require("lualibs") +local citeproc = require("citeproc") +local util = require("citeproc-util") +local core = require("csl-core") + +local function getopt( arg, options ) + local tab = {} + for k, v in ipairs(arg) do + if string.sub( v, 1, 2) == "--" then + local x = string.find( v, "=", 1, true ) + if x then tab[ string.sub( v, 3, x-1 ) ] = string.sub( v, x+1 ) + else tab[ string.sub( v, 3 ) ] = true + end + elseif string.sub( v, 1, 1 ) == "-" then + local y = 2 + local l = string.len(v) + local jopt + while ( y <= l ) do + jopt = string.sub( v, y, y ) + if string.find( options, jopt, 1, true ) then + if y < l then + tab[ jopt ] = string.sub( v, y+1 ) + y = l + else + tab[ jopt ] = arg[ k + 1 ] + end + else + tab[ jopt ] = true + end + y = y + 1 + end + else + if tab.file then + error(string.format('Invalid argument "%s"', v)) + end + tab.file = v + end + + end + return tab +end + + +local function print_version() + io.write(string.format("CiteProc-Lua %s\n", citeproc.__VERSION__)) +end + + +local function print_help() + io.write("Usage: citeproc [options] auxname[.aux]\n") + io.write("Options:\n") + io.write(" -h, --help Print this message and exit.\n") + io.write(" -V, --version Print the version number and exit.\n") +end + + +local function convert_bib(path, output_path) + local contents = util.read_file(path) + local bib = citeproc.parse_bib(contents) + if not output_path then + output_path = string.gsub(path, "%.bib$", ".json") + end + local file = io.open(output_path, "w") + file:write(utilities.json.tojson(bib)) + file:write('\n') + file:close() +end + + + +local function read_aux_file(aux_file) + local bib_style = nil + local bib_files = {} + local citations = {} + local csl_options = {} + + local file = io.open(aux_file, "r") + if not file then + error(string.format('Failed to open "%s"', aux_file)) + return + end + for line in file:lines() do + local match + match = string.match(line, "^\\bibstyle%s*(%b{})") + if match then + bib_style = string.sub(match, 2, -2) + else + match = string.match(line, "^\\bibdata%s*(%b{})") + if match then + for _, bib in ipairs(util.split(string.sub(match, 2, -2), "%s*,%s*")) do + table.insert(bib_files, bib) + end + else + match = string.match(line, "^\\citation%s*(%b{})") + if match then + local citation = core.make_citation(string.sub(match, 2, -2)) + table.insert(citations, citation) + else + match = string.match(line, "^\\csloptions%s*(%b{})") + if match then + for key, value in string.gmatch(match, "([%w-]+)=(%w+)") do + csl_options[key] = value + end + end + end + end + end + end + file:close() + + return bib_style, bib_files, citations, csl_options +end + + +local function process_aux_file(aux_file) + if not util.endswith(aux_file, ".aux") then + aux_file = aux_file .. ".aux" + end + + local style_name, bib_files, citations, csl_options = read_aux_file(aux_file) + + local lang = csl_options.locale + + local engine = core.init(style_name, bib_files, lang) + if csl_options.linking == "true" then + engine:enable_linking() + end + local style_class = engine:get_style_class() + + local citation_strings = core.process_citations(engine, citations) + + local output_string = "" + + for _, citation in ipairs(citations) do + local citation_id = citation.citationID + if citation_id ~= "nocite" then + local citation_str = citation_strings[citation_id] + output_string = output_string .. string.format("\\cslcite{%s}{{%s}{%s}}\n", citation_id, style_class, citation_str) + end + end + + output_string = output_string .. "\n" + + local result = core.make_bibliography(engine) + output_string = output_string .. result + + local output_path = string.gsub(aux_file, "%.aux$", ".bbl") + local bbl_file = io.open(output_path, "w") + bbl_file:write(output_string) + bbl_file:close() +end + + +local function main() + local args = getopt(arg, "o") + + -- for k, v in pairs(args) do + -- print( k, v ) + -- end + + if args.V or args.version then + print_version() + return + elseif args.h or args.help then + print_help() + return + end + + if not args.file then + error("citeproc: Need exactly one file argument.\n") + end + + local path = args.file + + local output_path = args.o or args.output + if util.endswith(path, ".bib") then + convert_bib(path, output_path) + else + process_aux_file(path) + end + +end + +main() diff --git a/biblio/citation-style-language/citeproc-bib-data.json b/biblio/citation-style-language/citeproc-bib-data.json new file mode 100644 index 0000000000..d5775354f0 --- /dev/null +++ b/biblio/citation-style-language/citeproc-bib-data.json @@ -0,0 +1,2342 @@ +{ + "description": "Bib CSL mapping", + "types": { + "archival": { + "csl": null, + "source": "jurabib.bst" + }, + "archive": { + "csl": "book", + "notes": "Will be mapped to `collection` in CSL v1.0.2.", + "source": "gbt7714-numerical.bst" + }, + "article": { + "csl": "article-journal", + "notes": "May also be `article-magazine` or `article-newspaper` depending upon the field `entrysubtype`.", + "source": "bibtex" + }, + "artifactdataset": { + "csl": null, + "source": "ACM-Reference-Format.bst" + }, + "artifactsoftware": { + "csl": null, + "source": "ACM-Reference-Format.bst" + }, + "artwork": { + "csl": "graphic", + "source": "biblatex" + }, + "atlas": { + "csl": null, + "source": "ametsoc2014.bst" + }, + "audio": { + "csl": "song", + "notes": "CSL's `song` can be used for any audio recording (not only music).", + "source": "biblatex" + }, + "bachelor": { + "csl": null, + "source": "dlfltxbbibtex.bst" + }, + "bibnote": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex" + }, + "book": { + "csl": "book", + "source": "bibtex" + }, + "bookinbook": { + "csl": "chapter", + "source": "biblatex" + }, + "booklet": { + "csl": "pamphlet", + "source": "bibtex" + }, + "brochure": { + "csl": null, + "source": "thesnumb.bst" + }, + "cconference": { + "csl": null, + "source": "seuthesis.bst" + }, + "collection": { + "csl": "book", + "source": "biblatex" + }, + "comment": { + "csl": null, + "notes": "Special entry type for Scribe compatibility", + "source": "bibtex" + }, + "commentary": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex" + }, + "commented": { + "csl": null, + "source": "jurabib.bst" + }, + "conference": { + "alias": "inproceedings", + "csl": "paper-conference", + "source": "bibtex" + }, + "ctan": { + "csl": null, + "source": "tugboat.bst" + }, + "customa": { + "csl": null, + "source": "biblatex" + }, + "customb": { + "csl": null, + "source": "biblatex" + }, + "customc": { + "csl": null, + "source": "biblatex" + }, + "customd": { + "csl": null, + "source": "biblatex" + }, + "custome": { + "csl": null, + "source": "biblatex" + }, + "customf": { + "csl": null, + "source": "biblatex" + }, + "database": { + "csl": "dataset", + "source": "gbt7714-numerical.bst" + }, + "dataset": { + "csl": "dataset", + "source": "biblatex" + }, + "dictionary": { + "csl": null, + "source": "vancouver.bst" + }, + "docthesis": { + "csl": null, + "source": "gost2003.bst" + }, + "electronic": { + "alias": "online", + "csl": "webpage", + "source": "biblatex" + }, + "eulegislation": { + "csl": null, + "source": "bath.bst" + }, + "footnote": { + "csl": null, + "source": "apsrev4-2.bst" + }, + "game": { + "csl": null, + "source": "ACM-Reference-Format.bst" + }, + "govpub": { + "csl": null, + "source": "thesnumb.bst" + }, + "habthesis": { + "csl": null, + "source": "bestpapers-export.bst" + }, + "heading": { + "csl": null, + "source": "bookdb.bst" + }, + "hidden": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "image": { + "csl": "graphic", + "source": "biblatex" + }, + "inbook": { + "csl": "chapter", + "source": "bibtex" + }, + "incollection": { + "csl": "chapter", + "source": "bibtex" + }, + "inloosecollection": { + "csl": null, + "source": "resphilosophica.bst" + }, + "inpress": { + "csl": null, + "source": "bjnano.bst" + }, + "inproceedings": { + "csl": "paper-conference", + "source": "bibtex" + }, + "inreference": { + "csl": "entry", + "notes": "May also be `entry`, `entry-dictionary` or `entry-encyclopedia`.", + "source": "biblatex" + }, + "inserialcollection": { + "csl": null, + "source": "asmejour.bst" + }, + "internet": { + "csl": null, + "source": "IEEEtran.bst" + }, + "journalpart": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "journals": { + "csl": null, + "source": "bestpapers-export.bst" + }, + "jurisdiction": { + "csl": null, + "notes": "\"Court decisions, court recordings, and similar things.\"", + "source": "biblatex" + }, + "jurthesis": { + "csl": null, + "source": "jurabib.bst" + }, + "legal": { + "csl": "treaty", + "notes": "\"Legal documents such as treaties.\"", + "source": "biblatex" + }, + "legislation": { + "csl": "legislation", + "notes": "\"Laws, bills, legislative proposals, and similar things.\" May also be `bill`", + "source": "biblatex" + }, + "letter": { + "csl": "personal_communication", + "source": "biblatex" + }, + "lexicon": { + "csl": null, + "source": "jurabib.bst" + }, + "majorthesis": { + "csl": null, + "source": "achicago.bst" + }, + "manual": { + "csl": "report", + "nots": "CSL's `report` is also used for manuals and similar technical documentation (e.g. a software, instrument, or test manual).", + "source": "bibtex" + }, + "map": { + "csl": "map", + "source": "vancouver.bst" + }, + "mastersthesis": { + "alias": "thesis", + "csl": "thesis", + "source": "bibtex" + }, + "masterthesis": { + "csl": null, + "source": "asaetr.bst" + }, + "minorthesis": { + "csl": null, + "source": "achicago.bst" + }, + "misc": { + "csl": null, + "notes": "Will be mapped to `document` in CSL v1.0.2.", + "source": "bibtex" + }, + "monograph": { + "csl": null, + "source": "gbt7714-numerical.bst" + }, + "monography": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "movie": { + "csl": "motion_picture", + "source": "biblatex" + }, + "music": { + "csl": "song", + "source": "biblatex" + }, + "mvbook": { + "csl": "book", + "source": "biblatex" + }, + "mvcollection": { + "csl": "book", + "source": "biblatex" + }, + "mvproceedings": { + "csl": "book", + "source": "biblatex" + }, + "mvreference": { + "csl": "book", + "source": "biblatex" + }, + "news": { + "csl": "article-newspaper", + "source": "seuthesix.bst" + }, + "newspaper": { + "csl": "article-newspaper", + "source": "gbt7714-numerical.bst" + }, + "online": { + "csl": "webpage", + "source": "biblatex" + }, + "other": { + "csl": null, + "source": "bjnano.bst" + }, + "patent": { + "csl": "patent", + "source": "biblatex" + }, + "performance": { + "csl": null, + "notes": "Will be mapped to `performance` in CSL v1.0.2.", + "source": "biblatex" + }, + "periodical": { + "csl": "book", + "notes": "Will be mapped to `periodical` in CSL v1.0.2.", + "source": "biblatex" + }, + "phdthesis": { + "alias": "thesis", + "csl": "thesis", + "source": "bibtex" + }, + "preamble": { + "csl": null, + "notes": "Special entry type for inserting commands or text in the bbl", + "source": "bibtex" + }, + "preprint": { + "csl": "article", + "source": "gbt7714-numerical.bst" + }, + "presentation": { + "csl": null, + "source": "apsrev4-2.bst" + }, + "proceedings": { + "csl": "book", + "source": "bibtex" + }, + "program": { + "csl": null, + "source": "ChemCommun.bst" + }, + "reference": { + "csl": "book", + "source": "biblatex" + }, + "report": { + "csl": "report", + "source": "biblatex" + }, + "review": { + "csl": "review", + "notes": "\"A more specific variant of the `@article` type\"", + "source": "biblatex" + }, + "set": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex" + }, + "setup": { + "csl": null, + "source": "bestpapers-export.bst" + }, + "software": { + "csl": "article", + "notes": "Will be mapped to `software` in CSL v1.0.2.", + "source": "biblatex" + }, + "standard": { + "csl": "book", + "notes": "Will be mapped to `standard` in CSL v1.0.2.", + "source": "biblatex" + }, + "string": { + "csl": null, + "notes": "Special entry type for defining abbreviations", + "source": "bibtex" + }, + "suppbook": { + "csl": "chapter", + "notes": "lossy mapping; \"Supplemental material in a `@book`. This type is closely related to the @inbook entry type. While `@inbook` is primarily intended for a part of a book with its own title (e. g., a single essay in a collection of essays by the same author), this type is provided for elements such as prefaces, introductions, forewords, afterwords, etc. which often have a generic title only. Style guides may require such items to be formatted differently from other `@inbook` items.\"", + "source": "biblatex" + }, + "suppcollection": { + "csl": "chapter", + "notes": "lossy mapping; see `suppbook`", + "source": "biblatex" + }, + "suppperiodical": { + "csl": "article", + "notes": "see `article`", + "source": "biblatex" + }, + "techreport": { + "alias": "report", + "csl": "report", + "source": "bibtex" + }, + "techstandard": { + "csl": "book", + "notes": "Will be mapped to `standard` in CSL v1.0.2.", + "source": "udesoftec.bst" + }, + "thesis": { + "csl": "thesis", + "source": "biblatex" + }, + "uklegislation": { + "csl": null, + "source": "bath.bst" + }, + "unpublished": { + "csl": "manuscript", + "source": "bibtex" + }, + "video": { + "csl": "motion_picture", + "source": "biblatex" + }, + "webpage": { + "csl": "webpage", + "source": "IEEEtran.bst" + }, + "www": { + "alias": "online", + "csl": "webpage", + "source": "biblatex" + }, + "xdata": { + "csl": null, + "notes": "special item type: \"`@xdata` entries hold data which may be inherited by other entries using the xdata field. Entries of this type only serve as data containers; they may not be cited or added to the bibliography.\"", + "source": "biblatex" + } + }, + "fields": { + "abstract": { + "csl": "abstract", + "source": "biblatex", + "type": "literal" + }, + "account": { + "csl": null, + "source": "address-html.bst" + }, + "acronym": { + "csl": null, + "source": "export.bst" + }, + "add": { + "csl": null, + "source": "figbib.bst" + }, + "add1": { + "csl": null, + "source": "figbib1.bst" + }, + "addendum": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "literal" + }, + "address": { + "alias": "location", + "csl": "publisher-place", + "source": "bibtex", + "type": "literal" + }, + "adsurl": { + "csl": null, + "source": "mnras.bst" + }, + "advisor": { + "csl": null, + "source": "ACM-Reference-Format.bst" + }, + "afterword": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "name" + }, + "annotate": { + "csl": null, + "source": "apacite.bst" + }, + "annotation": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "annotator": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "annote": { + "alias": "annotation", + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "annotelanguage": { + "csl": null, + "source": "bababbr3-fl.bst" + }, + "applicant": { + "csl": null, + "source": "seuthesix.bst" + }, + "archive": { + "csl": null, + "source": "apsrev4-2.bst" + }, + "archiveprefix": { + "alias": "eprinttype", + "csl": "archive", + "source": "biblatex", + "type": "literal" + }, + "archname": { + "csl": null, + "source": "jurabib.bst" + }, + "articleno": { + "csl": null, + "source": "ACM-Reference-Format.bst" + }, + "arxiv": { + "csl": null, + "source": "aomalpha.bst" + }, + "assignee": { + "csl": null, + "source": "vancouver.bst" + }, + "author": { + "csl": "author", + "source": "bibtex", + "type": "name" + }, + "authorcountry": { + "csl": null, + "source": "gost2003.bst" + }, + "authorfa": { + "csl": null, + "source": "asa-fa.bst" + }, + "authortype": { + "csl": null, + "source": "biblatex", + "type": "key" + }, + "bibsource": { + "csl": null, + "source": "export.bst" + }, + "biburl": { + "csl": null, + "source": "export.bst" + }, + "binding": { + "csl": null, + "source": "bookdb.bst" + }, + "birthday": { + "csl": null, + "source": "adrbirthday.bst" + }, + "birthyear": { + "csl": null, + "source": "address-html.bst" + }, + "bookaddress": { + "csl": null, + "source": "apsrev4-2.bst" + }, + "bookauthor": { + "csl": "container-author", + "source": "biblatex", + "type": "name" + }, + "booklanguage": { + "csl": null, + "source": "gost2003.bst" + }, + "bookpages": { + "csl": null, + "source": "ACM-Reference-Format.bst" + }, + "bookpagination": { + "csl": null, + "source": "biblatex", + "type": "key" + }, + "booksubtitle": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "booktitle": { + "csl": "container-title", + "source": "bibtex", + "type": "literal" + }, + "booktitleaddon": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "caption": { + "csl": null, + "source": "figbib.bst" + }, + "caption1": { + "csl": null, + "source": "figbib1.bst" + }, + "cartographer": { + "csl": null, + "source": "vancouver.bst" + }, + "casenumber": { + "csl": null, + "source": "bath.bst" + }, + "category": { + "csl": null, + "source": "bookdb.bst" + }, + "cellular": { + "csl": null, + "source": "address-html.bst" + }, + "chair": { + "csl": null, + "source": "apacite.bst" + }, + "chapter": { + "csl": "chapter-number", + "source": "bibtex", + "type": "literal" + }, + "citedate": { + "csl": null, + "source": "seuthesis.bst" + }, + "city": { + "csl": null, + "source": "ACM-Reference-Format.bst" + }, + "coden": { + "csl": null, + "source": "is-abbrv.bst" + }, + "collaboration": { + "csl": null, + "source": "apsrev4-2.bst" + }, + "collator": { + "csl": null, + "source": "bookdb.bst" + }, + "commentator": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "compiler": { + "csl": null, + "source": "gost2003.bst" + }, + "condition": { + "csl": null, + "source": "bookdb.bst" + }, + "conference-location": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "conference-number": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "conference-year": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "copy": { + "csl": null, + "source": "bookdb.bst" + }, + "country": { + "csl": null, + "source": "adrbirthday.bst" + }, + "credits": { + "csl": null, + "source": "gost2003.bst" + }, + "crossref": { + "csl": null, + "notes": "Inherits data from a parent entry.", + "source": "biblatex", + "type": "entrykey" + }, + "ctrl-article-title": { + "csl": null, + "source": "achemso.bst" + }, + "ctrl-chapter-title": { + "csl": null, + "source": "achemso.bst" + }, + "ctrl-doi": { + "csl": null, + "source": "achemso.bst" + }, + "ctrl-etal-firstonly": { + "csl": null, + "source": "achemso.bst" + }, + "ctrl-etal-number": { + "csl": null, + "source": "achemso.bst" + }, + "ctrl-link-doi": { + "csl": null, + "source": "angew.bst" + }, + "ctrl-use-doi-all": { + "csl": null, + "source": "angew.bst" + }, + "ctrl-use-title": { + "csl": null, + "source": "achemso.bst" + }, + "dataset": { + "csl": null, + "source": "apalike-ejor.bst" + }, + "date": { + "csl": "issued", + "source": "biblatex", + "type": "date" + }, + "day": { + "csl": null, + "source": "apacite.bst" + }, + "dayfiled": { + "csl": null, + "source": "IEEEtran.bst" + }, + "definition": { + "csl": null, + "source": "glsplain.bst" + }, + "department": { + "csl": null, + "source": "ametsoc2014.bst" + }, + "description": { + "csl": null, + "source": "ChemCommun.bst" + }, + "designator": { + "csl": null, + "source": "thesnumb.bst" + }, + "dimensions": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "dissyear": { + "csl": null, + "source": "jurabib.bst" + }, + "doi": { + "csl": "DOI", + "source": "biblatex", + "type": "verbatim" + }, + "dticnumber": { + "csl": null, + "source": "thesnumb.bst" + }, + "dummy": { + "csl": null, + "source": "expcites.bst" + }, + "edition": { + "csl": "edition", + "source": "bibtex", + "type": "literal" + }, + "editor": { + "csl": "editor", + "source": "bibtex", + "type": "name" + }, + "editora": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "editoratype": { + "csl": null, + "source": "biblatex", + "type": "key" + }, + "editorb": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "editorbtype": { + "csl": null, + "source": "biblatex", + "type": "key" + }, + "editorc": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "editorctype": { + "csl": null, + "source": "biblatex", + "type": "key" + }, + "editortype": { + "csl": null, + "source": "biblatex", + "type": "key" + }, + "eid": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "email": { + "csl": null, + "source": "adrbirthday.bst" + }, + "endnumber": { + "csl": null, + "source": "seuthesis.bst" + }, + "endvolume": { + "csl": null, + "source": "seuthesis.bst" + }, + "endyear": { + "csl": null, + "source": "seuthesis.bst" + }, + "englishtitle": { + "csl": null, + "source": "apacite.bst" + }, + "entryset": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "entrykey" + }, + "entrysubtype": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "literal" + }, + "epilog": { + "csl": null, + "source": "iopart-num.bst" + }, + "eprint": { + "csl": null, + "notes": "Mapped to `PMID` if `eprinttype` is \"PubMed\".", + "source": "biblatex", + "type": "verbatim" + }, + "eprintclass": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "eprints": { + "csl": null, + "source": "databib.bst" + }, + "eprinttype": { + "csl": "archive", + "source": "biblatex", + "type": "literal" + }, + "erratumeid": { + "csl": null, + "source": "ChemCommun.bst" + }, + "erratumgermanpages": { + "csl": null, + "source": "ChemCommun.bst" + }, + "erratumnumpages": { + "csl": null, + "source": "ChemCommun.bst" + }, + "erratumpages": { + "csl": null, + "source": "ChemCommun.bst" + }, + "erratumvolume": { + "csl": null, + "source": "ChemCommun.bst" + }, + "erratumyear": { + "csl": null, + "source": "ChemCommun.bst" + }, + "eventdate": { + "csl": "event-date", + "source": "biblatex", + "type": "date" + }, + "eventtitle": { + "csl": "event", + "notes": "Will be mapped to `event-title` in CSL v1.0.2.", + "source": "biblatex", + "type": "literal" + }, + "eventtitleaddon": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "eventyear": { + "csl": null, + "source": "bath.bst" + }, + "execute": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "code" + }, + "faddress": { + "csl": null, + "source": "achicago.bst" + }, + "fakeset": { + "csl": null, + "source": "biblatex.bst" + }, + "fax": { + "csl": null, + "source": "adrbirthday.bst" + }, + "file": { + "csl": null, + "source": "biblatex", + "type": "verbatim" + }, + "firstkey": { + "csl": null, + "source": "apacite.bst" + }, + "fjournal": { + "csl": null, + "source": "ijmart.bst" + }, + "flanguage": { + "csl": null, + "source": "achicago.bst" + }, + "font": { + "csl": null, + "source": "nederlands.bst" + }, + "foreword": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "founder": { + "csl": null, + "source": "jurabib.bst" + }, + "fpublisher": { + "csl": null, + "source": "achicago.bst" + }, + "ftitle": { + "csl": null, + "source": "achicago.bst" + }, + "furtherresp": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "fyear": { + "csl": null, + "source": "achicago.bst" + }, + "gender": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "literal" + }, + "germanpages": { + "csl": null, + "source": "ChemCommun.bst" + }, + "group": { + "csl": null, + "source": "glsplain.bst" + }, + "heading": { + "csl": null, + "source": "glsplain.bst" + }, + "hereafter": { + "csl": null, + "source": "opcit.bst" + }, + "holder": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "howcited": { + "csl": null, + "source": "jox.bst" + }, + "howpublished": { + "csl": null, + "notes": "Check if a URL is contained.", + "source": "bibtex", + "type": "literal" + }, + "hyphenation": { + "alias": "langid", + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "ids": { + "csl": null, + "source": "biblatex", + "type": "entrykey" + }, + "illustrated": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "illustrations": { + "csl": null, + "source": "bookdb.bst" + }, + "illustrator": { + "csl": null, + "source": "achicago.bst" + }, + "indexsorttitle": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "literal" + }, + "indextitle": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "institution": { + "csl": "publisher", + "source": "bibtex", + "type": "literal" + }, + "introduction": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "intype": { + "csl": null, + "source": "IEEEtran.bst" + }, + "inventor": { + "csl": null, + "source": "vancouver.bst" + }, + "ipc": { + "csl": null, + "source": "gost2003.bst" + }, + "isan": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "isbn": { + "csl": "ISBN", + "source": "biblatex", + "type": "literal" + }, + "ismn": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "iso-abbreviation": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "iso-author-punctuation": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "iso-date-place": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "isrn": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "issn": { + "csl": "ISSN", + "source": "biblatex", + "type": "literal" + }, + "issue": { + "csl": "issue", + "source": "biblatex", + "type": "literal" + }, + "issuesubtitle": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "issuetitle": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "issuetitleaddon": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "iswc": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "jfmnumber": { + "csl": null, + "source": "aomalpha.bst" + }, + "journal": { + "alias": "journaltitle", + "csl": "container-title", + "source": "bibtex", + "type": "literal" + }, + "journalsubtitle": { + "csl": null, + "notes": "It should be concatenated to the `container-title`.", + "source": "biblatex", + "type": "literal" + }, + "journaltie": { + "csl": null, + "source": "tugboat.bst" + }, + "journaltitle": { + "csl": "container-title", + "source": "biblatex", + "type": "literal" + }, + "journaltitleaddon": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "juraauthor": { + "csl": null, + "source": "jox.bst" + }, + "juratitle": { + "csl": null, + "source": "jox.bst" + }, + "key": { + "alias": "sortkey", + "csl": null, + "notes": "Not supported.", + "source": "bibtex", + "type": "literal" + }, + "keywords": { + "csl": null, + "source": "biblatex", + "type": "keyword" + }, + "label": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "lang": { + "csl": null, + "source": "hustthesis.bst" + }, + "langid": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "langidopts": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "language": { + "csl": "language", + "source": "biblatex", + "type": "key" + }, + "lastaccessed": { + "csl": "accessed", + "source": "ACM-Reference-Format.bst" + }, + "lastchecked": { + "csl": "accessed", + "source": "apacite.bst" + }, + "lccn": { + "csl": null, + "source": "is-abbrv.bst" + }, + "library": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "lista": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "listb": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "listc": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "listd": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "liste": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "listf": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "littype": { + "csl": null, + "source": "seuthesix.bst" + }, + "location": { + "csl": "publisher-place", + "source": "biblatex", + "type": "literal" + }, + "madadurltest": { + "csl": null, + "source": "alpha-persian.bst" + }, + "main": { + "csl": null, + "source": "figbib.bst" + }, + "main1": { + "csl": null, + "source": "figbib1.bst" + }, + "mainsubtitle": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "maintitle": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "maintitleaddon": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "majorcode": { + "csl": null, + "source": "gost2003.bst" + }, + "marginnote": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "mark": { + "csl": null, + "source": "gbt7714-numerical.bst" + }, + "max.best.papers": { + "csl": null, + "source": "bestpapers-export.bst" + }, + "mcitetail": { + "csl": null, + "source": "apsrmpM.bst" + }, + "media": { + "csl": "medium", + "source": "gost2003.bst" + }, + "medium": { + "csl": "medium", + "source": "gbt7714-numerical.bst" + }, + "meeting": { + "csl": null, + "source": "amsra.bst" + }, + "misctitle": { + "csl": null, + "source": "aasjournal.bst" + }, + "miscyear": { + "csl": null, + "source": "seuthesis.bst" + }, + "mobile": { + "csl": null, + "source": "adrbirthday.bst" + }, + "modifydate": { + "csl": null, + "source": "seuthesis.bst" + }, + "month": { + "csl": null, + "notes": "Used only when `date` is empty.", + "source": "bibtex", + "type": "literal" + }, + "monthfiled": { + "csl": null, + "source": "IEEEtran.bst" + }, + "mrnumber": { + "csl": null, + "source": "amsplain.bst" + }, + "name": { + "csl": null, + "source": "adrbirthday.bst" + }, + "namea": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "nameaddon": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "nameatype": { + "csl": null, + "source": "biblatex", + "type": "key" + }, + "nameb": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "namebtype": { + "csl": null, + "source": "biblatex", + "type": "key" + }, + "namec": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "namectype": { + "csl": null, + "source": "biblatex", + "type": "key" + }, + "nationality": { + "csl": null, + "source": "IEEEtran.bst" + }, + "nbirthday": { + "csl": null, + "source": "adrbirthday.bst" + }, + "newpage": { + "csl": null, + "source": "tugboat.bst" + }, + "newspaper": { + "csl": "container-title", + "source": "seuthesix.bst" + }, + "nickname": { + "csl": null, + "source": "address-html.bst" + }, + "nihms": { + "csl": null, + "source": "apacite.bst" + }, + "noed": { + "csl": null, + "source": "jox.bst" + }, + "normal": { + "csl": null, + "source": "bookdb.bst" + }, + "normalauthor": { + "csl": null, + "source": "seuthesis.bst" + }, + "normaleditor": { + "csl": null, + "source": "seuthesis.bst" + }, + "note": { + "csl": "note", + "source": "bibtex", + "type": "literal" + }, + "nowarning": { + "csl": null, + "source": "tugboat.bst" + }, + "number": { + "csl": "number", + "notes": "It is mapped to `issue` in `@ariticle` but to `number` in `@patent` or `@report`.", + "source": "bibtex", + "type": "literal" + }, + "numpages": { + "csl": null, + "source": "ACM-Reference-Format.bst" + }, + "oaddress": { + "csl": null, + "source": "achicago.bst" + }, + "options": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "option" + }, + "opublisher": { + "csl": null, + "source": "achicago.bst" + }, + "org-short": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "organization": { + "csl": "publisher", + "notes": "It is mapped to `author` (in `institution` property) if possible.", + "source": "bibtex", + "type": "literal" + }, + "origdate": { + "csl": "original-date", + "source": "biblatex", + "type": "date" + }, + "originaladdress": { + "csl": "original-publisher-place", + "source": "apacite.bst" + }, + "originalbooktitle": { + "csl": null, + "source": "apacite.bst" + }, + "originaledition": { + "csl": null, + "source": "apacite.bst" + }, + "originaleditor": { + "csl": null, + "source": "apacite.bst" + }, + "originaljournal": { + "csl": null, + "source": "apacite.bst" + }, + "originalnumber": { + "csl": null, + "source": "apacite.bst" + }, + "originalpages": { + "csl": null, + "source": "apacite.bst" + }, + "originalpublisher": { + "csl": "original-publisher", + "source": "apacite.bst" + }, + "originalvolume": { + "csl": null, + "source": "apacite.bst" + }, + "originalyear": { + "csl": "original-date", + "source": "apacite.bst" + }, + "origlanguage": { + "csl": null, + "source": "biblatex", + "type": "key" + }, + "origlocation": { + "csl": "original-publisher-place", + "source": "biblatex", + "type": "literal" + }, + "origpublisher": { + "csl": "original-publisher", + "source": "biblatex", + "type": "literal" + }, + "origtitle": { + "csl": "original-title", + "source": "biblatex", + "type": "literal" + }, + "oyear": { + "csl": null, + "source": "achicago.bst" + }, + "pagename": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "pages": { + "csl": "page", + "source": "bibtex", + "type": "range" + }, + "pagetotal": { + "csl": "number-of-pages", + "source": "biblatex", + "type": "literal" + }, + "pagination": { + "csl": null, + "source": "biblatex", + "type": "key" + }, + "paper": { + "csl": null, + "source": "IEEEtran.bst" + }, + "part": { + "csl": "part", + "source": "biblatex", + "type": "literal" + }, + "patentid": { + "csl": null, + "source": "seuthesis.bst" + }, + "pdf": { + "alias": "file", + "csl": null, + "source": "biblatex", + "type": "verbatim" + }, + "phone": { + "csl": null, + "source": "adrbirthday.bst" + }, + "pid": { + "csl": null, + "source": "seuthesix.bst" + }, + "pii": { + "csl": null, + "source": "amsra.bst" + }, + "pmcid": { + "csl": "PMCID", + "source": "apacite.bst" + }, + "prebibitem": { + "csl": null, + "source": "tugboat.bst" + }, + "preface": { + "csl": null, + "source": "bookdb.bst" + }, + "preprint": { + "csl": null, + "source": "amsra.bst" + }, + "presort": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "literal" + }, + "price": { + "csl": null, + "source": "is-abbrv.bst" + }, + "primaryclass": { + "alias": "eprintclass", + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "printing": { + "csl": null, + "source": "dk-abbrv.bst" + }, + "prioritycountry": { + "csl": null, + "source": "gost2003.bst" + }, + "prioritydate": { + "csl": null, + "source": "gost2003.bst" + }, + "prioritynumber": { + "csl": null, + "source": "gost2003.bst" + }, + "pseudonym": { + "csl": null, + "source": "jox.bst" + }, + "publication": { + "csl": null, + "source": "gost2003.bst" + }, + "publicationdate": { + "csl": null, + "source": "gost2003.bst" + }, + "publisher": { + "csl": "publisher", + "source": "bibtex", + "type": "literal" + }, + "pubmed": { + "csl": "PMID", + "source": "urlbst" + }, + "pubstate": { + "csl": null, + "source": "biblatex", + "type": "key" + }, + "related": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "entrykey" + }, + "relatedoptions": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "option" + }, + "relatedstring": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "literal" + }, + "relatedtype": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "literal" + }, + "reprinted-from": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "reprinted-text": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "reprinttitle": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "requestdate": { + "csl": null, + "source": "gost2003.bst" + }, + "requestnumber": { + "csl": null, + "source": "gost2003.bst" + }, + "responsible": { + "csl": null, + "source": "rusnat.bst" + }, + "review": { + "csl": null, + "source": "amsra.bst" + }, + "revision": { + "csl": null, + "source": "IEEEtran.bst" + }, + "school": { + "alias": "institution", + "csl": "publisher", + "source": "bibtex", + "type": "literal" + }, + "score": { + "csl": null, + "source": "bestpapers-export.bst" + }, + "section": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "series": { + "csl": "collection-title", + "source": "bibtex", + "type": "literal" + }, + "seriesedition": { + "csl": null, + "source": "achicago.bst" + }, + "short": { + "csl": null, + "source": "glsplain.bst" + }, + "shortarchive": { + "csl": null, + "source": "jurabib.bst" + }, + "shortauthor": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "shorteditor": { + "csl": null, + "source": "biblatex", + "type": "name" + }, + "shorthand": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "literal" + }, + "shorthandintro": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "literal" + }, + "shortjournal": { + "csl": "container-title-short", + "source": "biblatex", + "type": "literal" + }, + "shortseries": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "shortsubarchive": { + "csl": null, + "source": "jurabib.bst" + }, + "shorttitle": { + "csl": "title-short", + "source": "biblatex", + "type": "literal" + }, + "sig1": { + "csl": null, + "source": "jurabib.bst" + }, + "sig2": { + "csl": null, + "source": "jurabib.bst" + }, + "sig3": { + "csl": null, + "source": "jurabib.bst" + }, + "sig4": { + "csl": null, + "source": "jurabib.bst" + }, + "size": { + "csl": null, + "source": "bookdb.bst" + }, + "slaccitation": { + "csl": null, + "source": "apsrev4-2.bst" + }, + "sort-short": { + "csl": null, + "source": "glsplain.bst" + }, + "sort-word": { + "csl": null, + "source": "glsplain.bst" + }, + "sortas": { + "csl": null, + "source": "adrbirthday.bst" + }, + "sortkey": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "literal" + }, + "sortname": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "name" + }, + "sortshorthand": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "literal" + }, + "sorttitle": { + "csl": null, + "notes": "Not supported.", + "source": "biblatex", + "type": "literal" + }, + "sortyear": { + "csl": null, + "source": "biblatex", + "type": "integer" + }, + "source": { + "csl": null, + "source": "figbib.bst" + }, + "source1": { + "csl": null, + "source": "figbib1.bst" + }, + "specialitycode": { + "csl": null, + "source": "gost2003.bst" + }, + "ssedition": { + "csl": null, + "source": "jox.bst" + }, + "standard": { + "csl": null, + "source": "udesoftec.bst" + }, + "startnumber": { + "csl": null, + "source": "seuthesis.bst" + }, + "startvolume": { + "csl": null, + "source": "seuthesis.bst" + }, + "startyear": { + "csl": null, + "source": "seuthesis.bst" + }, + "state": { + "csl": null, + "source": "address-html.bst" + }, + "status": { + "csl": null, + "source": "amsra.bst" + }, + "stdcode": { + "csl": null, + "source": "seuthesix.bst" + }, + "stitle": { + "csl": null, + "source": "jox.bst" + }, + "street": { + "csl": null, + "source": "adrbirthday.bst" + }, + "subarchive": { + "csl": null, + "source": "jurabib.bst" + }, + "subtitle": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "symposium": { + "csl": null, + "source": "apacite.bst" + }, + "text": { + "csl": null, + "source": "apacite.bst" + }, + "timestamp": { + "csl": null, + "source": "export.bst" + }, + "title": { + "csl": "title", + "source": "bibtex", + "type": "literal" + }, + "titleaddon": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "titlenote": { + "csl": null, + "source": "aomalpha.bst" + }, + "totalpages": { + "csl": null, + "source": "aomalpha.bst" + }, + "transissue": { + "csl": null, + "source": "iopart-num.bst" + }, + "transjournal": { + "csl": null, + "source": "iopart-num.bst" + }, + "translation": { + "csl": null, + "source": "apsrev4-2.bst" + }, + "translator": { + "csl": "translator", + "source": "biblatex", + "type": "name" + }, + "transnumber": { + "csl": null, + "source": "iopart-num.bst" + }, + "transpages": { + "csl": null, + "source": "iopart-num.bst" + }, + "transsection": { + "csl": null, + "source": "iopart-num.bst" + }, + "transvolume": { + "csl": null, + "source": "iopart-num.bst" + }, + "transyear": { + "csl": null, + "source": "iopart-num.bst" + }, + "type": { + "csl": "genre", + "source": "bibtex", + "type": "key" + }, + "typeoflit": { + "csl": null, + "source": "seuthesis.bst" + }, + "umfnumber": { + "csl": null, + "source": "thesnumb.bst" + }, + "updated": { + "csl": null, + "source": "vancouver.bst" + }, + "url": { + "csl": "URL", + "source": "biblatex", + "type": "uri" + }, + "urlaccessdate": { + "csl": "accessed", + "source": "abntex2-alf.bst" + }, + "urldate": { + "csl": "accessed", + "source": "biblatex", + "type": "date" + }, + "urlnewline": { + "csl": null, + "source": "tugboat.bst" + }, + "urltype": { + "csl": null, + "source": "asmeconf.bst" + }, + "urlyear": { + "csl": null, + "source": "bath.bst" + }, + "urn": { + "csl": null, + "source": "export.bst" + }, + "usera": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "userb": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "userc": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "userd": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "usere": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "userf": { + "csl": null, + "source": "biblatex", + "type": "literal" + }, + "value": { + "csl": null, + "source": "bookdb.bst" + }, + "venue": { + "csl": "event-place", + "source": "biblatex", + "type": "literal" + }, + "verba": { + "csl": null, + "source": "biblatex", + "type": "verbatim" + }, + "verbb": { + "csl": null, + "source": "biblatex", + "type": "verbatim" + }, + "verbc": { + "csl": null, + "source": "biblatex", + "type": "verbatim" + }, + "version": { + "csl": "version", + "source": "biblatex", + "type": "literal" + }, + "versiontype": { + "csl": null, + "source": "asmeconf.bst" + }, + "volformat": { + "csl": null, + "source": "jox.bst" + }, + "volume": { + "csl": "volume", + "source": "bibtex", + "type": "integer" + }, + "volumes": { + "csl": "number-of-volumes", + "source": "biblatex", + "type": "integer" + }, + "volumetitle": { + "csl": null, + "source": "iopart-num.bst" + }, + "word": { + "csl": null, + "source": "vancouver.bst" + }, + "xdata": { + "csl": null, + "notes": "inherits fields from other items.", + "source": "biblatex", + "type": "entrykey" + }, + "xid": { + "csl": null, + "source": "amsra.bst" + }, + "xref": { + "csl": null, + "notes": "Establishes a parent-child relationship in biblatex, but without inheriting data => no need to parse this.", + "source": "biblatex", + "type": "entrykey" + }, + "year": { + "csl": null, + "notes": "Used only when `date` is empty.", + "source": "bibtex", + "type": "date" + }, + "year-presented": { + "csl": null, + "source": "abntex2-alf.bst" + }, + "yearcomp": { + "csl": null, + "source": "achicago.bst" + }, + "yearfiled": { + "csl": null, + "source": "IEEEtran.bst" + }, + "zblnumber": { + "csl": null, + "source": "aomalpha.bst" + }, + "zip": { + "csl": null, + "source": "adrbirthday.bst" + } + }, + "macros": { + "jan": { + "value": "1", + "notes": "Use numeric form for easy conversion.", + "source": "bibtex" + }, + "feb": { + "value": "2", + "source": "bibtex" + }, + "mar": { + "value": "3", + "source": "bibtex" + }, + "apr": { + "value": "4", + "source": "bibtex" + }, + "may": { + "value": "5", + "source": "bibtex" + }, + "jun": { + "value": "6", + "source": "bibtex" + }, + "jul": { + "value": "7", + "source": "bibtex" + }, + "aug": { + "value": "8", + "source": "bibtex" + }, + "sep": { + "value": "9", + "source": "bibtex" + }, + "oct": { + "value": "10", + "source": "bibtex" + }, + "nov": { + "value": "11", + "source": "bibtex" + }, + "dec": { + "value": "12", + "source": "bibtex" + }, + "acmcs": { + "value": "ACM Computing Surveys", + "source": "bibtex" + }, + "acta": { + "value": "Acta Informatica", + "source": "bibtex" + }, + "cacm": { + "value": "Communications of the ACM", + "source": "bibtex" + }, + "ibmjrd": { + "value": "IBM Journal of Research and Development", + "source": "bibtex" + }, + "ibmsj": { + "value": "IBM Systems Journal", + "source": "bibtex" + }, + "ieeese": { + "value": "IEEE Transactions on Software Engineering", + "source": "bibtex" + }, + "ieeetc": { + "value": "IEEE Transactions on Computers", + "source": "bibtex" + }, + "ieeetcad": { + "value": "IEEE Transactions on Computer-Aided Design of Integrated Circuits", + "source": "bibtex" + }, + "ipl": { + "value": "Information Processing Letters", + "source": "bibtex" + }, + "jacm": { + "value": "Journal of the ACM", + "source": "bibtex" + }, + "jcss": { + "value": "Journal of Computer and System Sciences", + "source": "bibtex" + }, + "scp": { + "value": "Science of Computer Programming", + "source": "bibtex" + }, + "sicomp": { + "value": "SIAM Journal on Computing", + "source": "bibtex" + }, + "tocs": { + "value": "ACM Transactions on Computer Systems", + "source": "bibtex" + }, + "tods": { + "value": "ACM Transactions on Database Systems", + "source": "bibtex" + }, + "tog": { + "value": "ACM Transactions on Graphics", + "source": "bibtex" + }, + "toms": { + "value": "ACM Transactions on Mathematical Software", + "source": "bibtex" + }, + "toois": { + "value": "ACM Transactions on Office Information Systems", + "source": "bibtex" + }, + "toplas": { + "value": "ACM Transactions on Programming Languages and Systems", + "source": "bibtex" + }, + "tcs": { + "value": "Theoretical Computer Science", + "source": "bibtex" + } + } +} diff --git a/biblio/citation-style-language/citeproc-bib.lua b/biblio/citation-style-language/citeproc-bib.lua new file mode 100644 index 0000000000..d3532c098b --- /dev/null +++ b/biblio/citation-style-language/citeproc-bib.lua @@ -0,0 +1,395 @@ +--[[ + A naive implementation of a Bib(La)TeX dateabase (.bib) parser + References: + - http://mirrors.ctan.org/biblio/bibtex/base/btxdoc.pdf + - http://mirrors.ctan.org/info/bibtex/tamethebeast/ttb_en.pdf + - https://github.com/brechtm/citeproc-py/blob/master/citeproc/source/bibtex/bibparse.py + - http://maverick.inria.fr/~Xavier.Decoret/resources/xdkbibtex/bibtex_summary.html + - https://github.com/pcooksey/bibtex-js/blob/master/src/bibtex_js.js +--]] + +local bib = {} + +require("lualibs") +local unicode = require("unicode") + +local util = require("citeproc-util") + + +local path = "citeproc-bib-data.json" +if kpse then + path = kpse.find_file(path) +end +if path then + local contents = util.read_file(path) + if not contents then + error(string.format('Failed to find "%s"', path)) + end + bib.bib_data = utilities.json.tolua(contents) +end + +function bib.parse(contents) + local items = {} + for item_contents in string.gmatch(contents, "(@%w+%b{})") do + local item = bib.parse_item(item_contents) + table.insert(items, item) + end + return items +end + +function bib.parse_item(contents) + contents = string.gsub(contents, "%s*\r?\n%s*", " ") + local bib_type, id + bib_type, id, contents = string.match(contents, "^@(%w+){([^%s,]+),%s*(.*)}$") + if not id then + return nil + end + + local item = {id = id} + + bib_type = string.lower(bib_type) + local type_data = bib.bib_data.types[bib_type] + if type_data then + if type_data.csl then + item.type = type_data.csl + else + item.type = "document" + end + else + item.type = "document" + end + + local bib_fields = bib.parse_fields(contents) + -- util.debug(bib_fields) + + for bib_field, value in pairs(bib_fields) do + local csl_field, csl_value = bib.convert_field(bib_field, value) + + if csl_field and not item[csl_field] then + item[csl_field] = csl_value + end + end + + bib.process_special_fields(item, bib_fields) + + return item +end + +function bib.parse_fields(contents) + local fields = {} + local field_patterns = { + "^(%w+)%s*=%s*(%b{}),?%s*(.-)$", + '^(%w+)%s*=%s*"([^"]*)",?%s*(.-)$', + "^(%w+)%s*=%s*(%w+),?%s*(.-)$", + } + + while #contents > 0 do + local field, value, rest + -- This pattern may fail in the case of `title = {foo\}bar}`. + for pattern_index, pattern in ipairs(field_patterns) do + field, value, rest = string.match(contents, pattern) + if value then + if pattern_index == 1 then + -- Strip braces "{}" + value = string.sub(value, 2, -2) + elseif pattern_index == 3 then + if not string.match(value, "^%d+$") then + local string_name = value + local macro = bib.bib_data.macros[string_name] + if macro then + value = macro.value + else + util.warning(string.format('String name "%s" is undefined', string_name)) + end + end + end + fields[field] = value + contents = rest + break + end + end + end + return fields +end + +function bib.convert_field(bib_field, value) + local field_data = bib.bib_data.fields[bib_field] + if not field_data then + return nil, nil + end + local csl_field = field_data.csl + if not csl_field then + return nil, nil + end + + value = bib.unescape(bib_field, value) + + local field_type = field_data.type + if field_type == "name" then + value = bib.parse_names(value) + elseif field_type == "date" then + value = bib.parse_date(value) + end + + if bib_field == "title" or bib_field == "booktitle" then + -- TODO: check if the original title is in sentence case + value = bib.convert_sentence_case(value) + end + + if bib_field == "volume" or bib_field == "pages" then + value = string.gsub(value, util.unicode["en dash"], "-") + end + + return csl_field, value +end + +function bib.unescape(field, str) + str = string.gsub(str, "%-%-%-", util.unicode["em dash"]) + str = string.gsub(str, "%-%-", util.unicode["en dash"]) + str = string.gsub(str, "``", util.unicode["left double quotation mark"]) + str = string.gsub(str, "''", util.unicode["right double quotation mark"]) + str = string.gsub(str, "`", util.unicode["left single quotation mark"]) + str = string.gsub(str, "'", util.unicode["right single quotation mark"]) + -- TODO: unicode chars like \"{o} + str = string.gsub(str, "\\#", "#") + str = string.gsub(str, "\\%$", "$") + str = string.gsub(str, "\\%%", "%") + str = string.gsub(str, "\\&", "&") + str = string.gsub(str, "\\{", "{") + str = string.gsub(str, "\\}", "}") + str = string.gsub(str, "\\_", "_") + if field ~= "url" then + str = string.gsub(str, "~", util.unicode["no-break space"]) + end + str = string.gsub(str, "\\quad%s+", util.unicode["em space"]) + return str +end + +function bib.convert_sentence_case(str) + local res = "" + local to_lower = false + local brace_level = 0 + for _, code_point in utf8.codes(str) do + local char = utf8.char(code_point) + if to_lower and brace_level == 0 then + char = unicode.utf8.lower(char) + end + if string.match(char, "%S") then + to_lower = true + end + if char == "{" then + brace_level = brace_level + 1 + char = "" + elseif char == "}" then + brace_level = brace_level - 1 + char = "" + elseif char == ":" then + to_lower = false + end + res = res .. char + end + return res +end + +function bib.parse_names(str) + -- "{International Federation of Library Association and Institutions}" + local names = {} + local brace_level = 0 + local name = "" + local last_word = "" + for i = 1, #str do + local char = string.sub(str, i, i) + if char == " " then + if brace_level == 0 and last_word == "and" then + table.insert(names, name) + name = "" + else + if name ~= "" then + name = name .. " " + end + name = name .. last_word + end + last_word = "" + else + last_word = last_word .. char + if char == "{" then + brace_level = brace_level + 1 + elseif char == "}" then + brace_level = brace_level - 1 + end + end + end + + if name ~= "" then + name = name .. " " + end + name = name .. last_word + table.insert(names, name) + + for i, name in ipairs(names) do + names[i] = bib.parse_single_name(name) + end + return names +end + +function bib.parse_single_name(str) + local literal = string.match(str, "^{(.*)}$") + if literal then + return { + literal = literal, + } + end + + local name_parts = util.split(str, ",%s*") + if #name_parts > 1 then + return bib.parse_revesed_name(name_parts) + else + return bib.parse_non_revesed_name(str) + end +end + +function bib.parse_revesed_name(name_parts) + local name = {} + local von, last, jr, first + if #name_parts == 2 then + first = name_parts[2] + elseif #name_parts >= 3 then + jr = name_parts[2] + first = name_parts[3] + end + if first and first ~= "" then + name.given = first + end + if jr and jr ~= "" then + name.suffix = jr + end + + last = name_parts[1] + local words = util.split(last) + local index = #words - 1 + while index > 0 and string.match(words[index], "^%L") do + index = index - 1 + end + name.family = util.concat(util.slice(words, index + 1), " ") + if index >= 1 then + von = util.concat(util.slice(words, 1, index), " ") + name["non-dropping-particle"] = von + end + return name +end + +function bib.parse_non_revesed_name(str) + local name = {} + local words = util.split(str) + + local index = 1 + -- TODO: case determination for pseudo-characters (e.g., "\bb{BB}") + while index < #words and string.match(words[index], "^%L") do + index = index + 1 + end + if index > 1 then + name.given = util.concat(util.slice(words, 1, index - 1), " ") + end + + local particle_start_index = index + index = #words - 1 + while index >= particle_start_index and string.match(words[index], "^%L") do + index = index - 1 + end + if index >= particle_start_index then + local particles = util.slice(words, particle_start_index, index) + -- TODO: distiguish dropping and non-dropping particles + name["non-dropping-particle"] = util.concat(particles, " ") + end + name.family = util.concat(util.slice(words, index + 1), " ") + + return name +end + +function bib.parse_date(str) + local date_range = util.split(str, "/") + if #date_range == 1 then + date_range = util.split(str, util.unicode["en dash"]) + end + + local literal = { literal = str } + + if #date_range > 2 then + return literal + end + + local date = {} + date["date-parts"] = {} + for _, date_part in ipairs(date_range) do + local date_ = bib.parse_single_date(date_part) + if not date_ then + return literal + end + table.insert(date["date-parts"], date_) + end + return date +end + +function bib.parse_single_date(str) + local date = {} + for _, date_part in ipairs(util.split(str, "%-")) do + if not string.match(date_part, "^%d+$") then + return nil + end + table.insert(date, tonumber(date_part)) + end + return date +end + +function bib.process_special_fields(item, bib_fields) + if item.type == "document" then + if item.URL then + item.type = "webpage" + else + item.type = "article" + end + end + + if item.type == "article-journal" then + if not item["container-title"] then + item.type = "article" + end + end + + if bib_fields.year and not item.issued then + item.issued = bib.parse_date(bib_fields.year) + end + local month = bib_fields.month + if month and string.match(month, "^%d+$") then + if item.issued and item.issued["date-parts"] and + item.issued["date-parts"][1] and + item.issued["date-parts"][1][2] == nil then + item.issued["date-parts"][1][2] = tonumber(month) + end + end + + if item.number then + if not item.issue and item.type == "article-journal" or item.type == "article-magazine" or item.type == "article-newspaper" or item.type == "periodical" then + item.issue = item.number + item.number = nil + elseif item.type == "patent" or item.type == "report" or item.type == "standard" then + else + item["collection-number"] = item.number + item.number = nil + end + end + + if not item.PMID and bib_fields.eprint and string.lower(bib_fields.eprinttype) == "pubmed" then + item.PMID = bib_fields.eprint + end + + -- if not item.language then + -- if util.has_cjk_char(item.title) then + -- item.language = "zh" + -- else + -- item.language = "en" + -- end + -- end +end + +return bib diff --git a/biblio/citation-style-language/citeproc-element.lua b/biblio/citation-style-language/citeproc-element.lua new file mode 100644 index 0000000000..58d3402d2c --- /dev/null +++ b/biblio/citation-style-language/citeproc-element.lua @@ -0,0 +1,410 @@ +local element = {} + +local unicode = require("unicode") + +local richtext = require("citeproc-richtext") +local util = require("citeproc-util") + + +local Element = { + default_options = {}, +} + +function Element:new () + local o = {} + setmetatable(o, self) + self.__index = self + return o +end + +Element.option_type = { + ["et-al-min"] = "integer", + ["et-al-use-first"] = "integer", + ["et-al-subsequent-min"] = "integer", + ["et-al-subsequent-use-first"] = "integer", + ["near-note-distance"] = "integer", + ["line-spacing"] = "integer", + ["entry-spacing"] = "integer", + ["names-min"] = "integer", + ["names-use-first"] = "integer", + ["limit-day-ordinals-to-day-1"] = "boolean", + ["punctuation-in-quote"] = "boolean", + ["et-al-use-last"] = "boolean", + ["initialize"] = "boolean", + ["initialize-with-hyphen"] = "boolean", + ["disambiguate-add-names"] = "boolean", + ["disambiguate-add-givenname"] = "boolean", + ["disambiguate-add-year-suffix"] = "boolean", + ["hanging-indent"] = "boolean", + ["names-use-last"] = "boolean", + ["quotes"] = "boolean", + ["strip-periods"] = "boolean", +} + +Element.inheritable_options = { + -- Style + ["initialize-with-hyphen"] = true, + ["page-range-format"] = true, + ["demote-non-dropping-particle"] = true, + -- Citation + ["disambiguate-add-givenname"] = true, + ["givenname-disambiguation-rule"] = true, + ["disambiguate-add-names"] = true, + ["disambiguate-add-year-suffix"] = true, + ["cite-group-delimiter"] = true, + ["collapse"] = true, + ["year-suffix-delimiter"] = true, + ["after-collapse-delimiter"] = true, + ["near-note-distance"] = true, + -- Bibliography + ["second-field-align"] = true, -- for use in layout + ["subsequent-author-substitute"] = true, + ["subsequent-author-substitute-rule"] = true, + -- Date + ["date-parts"] = true, + -- Names + ["and"] = true, + ["delimiter-precedes-et-al"] = true, + ["delimiter-precedes-last"] = true, + ["et-al-min"] = true, + ["et-al-use-first"] = true, + ["et-al-use-last"] = true, + ["et-al-subsequent-min"] = true, + ["et-al-subsequent-use-first"] = true, + ["names-min"] = true, + ["names-use-first"] = true, + ["names-use-last"] = true, + ["initialize-with"] = true, + ["name-as-sort-order"] = true, + ["sort-separator"] = true, + ["name-form"] = true, + ["name-delimiter"] = true, + ["names-delimiter"] = true, +} + +function Element:render (item, context) + self:debug_info(context) + context = self:process_context(context) + return self:render_children(item, context) +end + +function Element:render_children (item, context) + local output = {} + for i, child in ipairs(self:get_children()) do + if child:is_element() then + if child.render == nil then + local element_name = child:get_element_name() + util.warning("Unkown type \"" .. element_name .. "\"") + end + local str = child:render(item, context) + table.insert(output, str) + end + end + return self:concat(output, context) +end + +function Element:set_base_class (node) + if node:is_element() then + local org_meta_table = getmetatable(node) + setmetatable(node, {__index = function (_, key) + if self[key] then + return self[key] + else + return org_meta_table[key] + end + end}) + end +end + +function Element:debug_info (context, debug) + -- debug = true + if debug then + local text = "" + local level = 0 + if context and context.level then + level = context.level + 1 + end + text = text .. string.rep(" ", 2 * level) + text = text .. self:get_element_name() + local attrs = {} + if self._attr then + for attr, value in pairs(self._attr) do + table.insert(attrs, attr .. "=\"" .. value .. "\"") + end + text = text .. "[" .. table.concat(attrs, " ") .. "]" + end + io.stderr:write(text .. "\n") + end +end + +function Element:get_child (type) + for _, child in ipairs(self:get_children()) do + if child:get_element_name() == type then + return child + end + end + return nil +end + +function Element:get_style () + local style = self:root_node().style + assert(style ~= nil) + return style +end + +function Element:get_engine () + local engine = self:root_node().engine + assert(engine ~= nil) + return engine +end + +function Element:process_context (context) + local state = { + -- The `build` table is directly passed to new context. + build = context.build or {}, + -- The `option` table is copied. + options = {}, + -- Other items in `context` is copied. + } + for key, value in pairs(self.default_options) do + state.options[key] = value + end + if context then + local element_name = self:get_element_name() + for key, value in pairs(context) do + if key == "options" then + for k, v in pairs(context.options) do + if self.inheritable_options[k] then + state.options[k] = v + if element_name == "name" then + if k == "name-form" then + state.options["form"] = v + end + if k == "name-delimiter" then + state.options["delimiter"] = v + end + elseif element_name == "names" then + if k == "names-delimiter" then + state.options["delimiter"] = v + end + end + end + end + else + state[key] = value + end + end + if state.level then + state.level = state.level + 1 + else + state.level = 0 + end + end + if self._attr then + for key, value in pairs(self._attr) do + if self.option_type[key] == "integer" then + value = tonumber(value) + elseif self.option_type[key] == "boolean" then + value = (value == "true") + end + state.options[key] = value + end + end + return state +end + +function Element:get_option (key, context) + assert(context ~= nil) + return context.options[key] +end + +function Element:get_locale_option (key) + local locales = self:get_style():get_locales() + for i, locale in ipairs(locales) do + local option = locale:get_option(key) + if option ~= nil then + return option + end + end + return nil +end + +function Element:get_variable (item, name, context) + if context.suppressed_variables and context.suppressed_variables[name] then + return nil + else + local res = item[name] + if type(res) == "table" and res._type == "RichText" then + -- TODO: should be deep copy + res = res:shallow_copy() + end + + if res and res ~= "" then + if context.suppress_subsequent_variables then + context.suppressed_variables[name] = true + end + end + return res + end +end + +function Element:get_macro (name) + local query = string.format("macro[name=\"%s\"]", name) + local macro = self:root_node():query_selector(query)[1] + if not macro then + error(string.format("Failed to find %s.", query)) + end + return macro +end + +function Element:get_term (name, form, number, gender) + return self:get_style():get_term(name, form, number, gender) +end + +-- Formatting +function Element:escape (str, context) + return str + -- return self:get_engine().formatter.text_escape(str) +end + +function Element:format(text, context) + if not text or text == "" then + return nil + end + if text._type ~= "RichText" then + text = richtext.new(text) + end + local attributes = { + "font-style", + "font-variant", + "font-weight", + "text-decoration", + "vertical-align", + } + for _, attribute in ipairs(attributes) do + local value = context.options[attribute] + if value then + if text.formats[attribute] then + local new = richtext.new() + new.contents = {text} + text = new + end + text:add_format(attribute, value) + end + end + return text +end + +-- Affixes +function Element:wrap (str, context) + if not str or str == "" then + return nil + end + local prefix = context.options["prefix"] + local suffix = context.options["suffix"] + local res = str + if prefix and prefix ~= "" then + local linkable = false + local variable_name = context.options["variable"] + if variable_name == "DOI" or variable_name == "PMID" or variable_name == "PMCID" then + linkable = true + end + if variable_name == "URL" or (linkable and not string.match(prefix, "^https?://")) then + res:add_format(variable_name, "true") + end + res = richtext.concat(prefix, res) + if linkable and string.match(prefix, "^https?://") then + res:add_format("URL", "true") + end + end + if suffix and suffix ~= "" then + res = richtext.concat(res, suffix) + end + return res +end + +-- Delimiters +function Element:concat (strings, context) + local delimiter = context.options["delimiter"] + return richtext.concat_list(strings, delimiter) +end + +-- Display +function Element:display(text, context) + if not text then + return text + end + local value = context.options["display"] + if not value then + return text + end + if type(text) == "string" then + text = richtext.new(text) + end + text:add_format("display", value) + return text +end + +-- Quotes +function Element:quote (str, context) + if not str then + return nil + end + if context.sorting then + return str + end + if not str._type == "RichText" then + str = richtext.new(str) + end + local quotes = context.options["quotes"] or false + if quotes then + str:add_format("quotes", "true") + end + return str +end + +-- Strip periods +function Element:strip_periods (str, context) + if not str then + return nil + end + if str._type ~= "RichText" then + str = richtext.new(str) + end + local strip_periods = context.options["strip-periods"] + if strip_periods then + str:strip_periods() + end + return str +end + +-- Text-case +function Element:case (text, context) + if not text or text == "" then + return nil + end + if text._type ~= "RichText" then + text = richtext.new(text) + end + local text_case = context.options["text-case"] + if not text_case then + return text + end + if text_case == "title" then + -- title case conversion only affects English-language items + local language = context.item["language"] + if not language then + language = self:get_style():get_attribute("default-locale") or "en-US" + end + if not util.startswith(language, "en") then + return text + end + end + text:add_format("text-case", text_case) + return text +end + + +element.Element = Element + +return element diff --git a/biblio/citation-style-language/citeproc-engine.lua b/biblio/citation-style-language/citeproc-engine.lua new file mode 100644 index 0000000000..ac8cc9c44e --- /dev/null +++ b/biblio/citation-style-language/citeproc-engine.lua @@ -0,0 +1,419 @@ +--[[ + Copyright (C) 2021 Zeping Lee +--]] + +local engine = {} + +local dom = require("luaxml-domobject") + +local richtext = require("citeproc-richtext") +local element = require("citeproc-element") +local nodes = require("citeproc-nodes") +local formats = require("citeproc-formats") +local util = require("citeproc-util") + + +local CiteProc = {} + +function CiteProc.new (sys, style, lang, force_lang) + if sys == nil then + error("\"citeprocSys\" required") + end + if sys.retrieveLocale == nil then + error("\"citeprocSys.retrieveLocale\" required") + end + if sys.retrieveItem == nil then + error("\"citeprocSys.retrieveItem\" required") + end + local o = {} + o.registry = { + citations = {}, -- A map + citation_strings = {}, -- A list + registry = {}, -- A map + reflist = {}, -- A list + previous_citation = nil, + requires_sorting = false, + } + + o.sys = sys + o.system_locales = {} + + if type(style) == "string" then + o.csl = dom.parse(style) + else + o.csl = style + end + o.csl:traverse_elements(CiteProc.set_base_class) + o.csl:root_node().engine = o + o.style = o.csl:get_path("style")[1] + o.style.lang = lang + o.csl:root_node().style = o.style + + o.style:set_lang(lang, force_lang) + + o.formatter = formats.latex + o.linking_enabled = false + + setmetatable(o, { __index = CiteProc }) + return o +end + +function CiteProc:updateItems (ids) + self.registry.reflist = {} + self.registry.registry = {} + for _, id in ipairs(ids) do + self:get_item(id) + end +end + +function CiteProc:updateUncitedItems(ids) + for _, id in ipairs(ids) do + if not self.registry.registry[id] then + self:get_item(id) + end + end + -- TODO: disambiguation +end + +function CiteProc:processCitationCluster(citation, citationsPre, citationsPost) + -- citation = { + -- citationID = "CITATION-3", + -- citationItems = { + -- { id = "ITEM-1" }, + -- { id = "ITEM-2" }, + -- }, + -- properties = { + -- noteIndex = 3, + -- }, + -- } + -- citationsPre = { + -- {"CITATION-1", 1}, + -- {"CITATION-2", 2}, + -- } + -- citationsPost = { + -- {"CITATION-4", 4}, + -- } + -- returns = { + -- { + -- bibchange = true, + -- citation_errors = {}, + -- }, + -- { + -- { 2, "[1,2]", "CITATION-3" } + -- } + -- } + self.registry.citations[citation.citationID] = citation + + local items = {} + + for _, cite_item in ipairs(citation.citationItems) do + cite_item.id = tostring(cite_item.id) + local position_first = (self.registry.registry[cite_item.id] == nil) + local item_data = self:get_item(cite_item.id) + + if item_data then + -- Create a wrapper of the orignal item from registry so that + -- it may hold different `locator` or `position` values for cites. + local item = setmetatable({}, {__index = function (_, key) + if cite_item[key] then + return cite_item[key] + else + return item_data[key] + end + end}) + + if not item.position and position_first then + item.position = util.position_map["first"] + end + + local first_reference_note_number = nil + for _, pre_citation in ipairs(citationsPre) do + pre_citation = self.registry.citations[pre_citation[1]] + for _, pre_cite_item in ipairs(pre_citation.citationItems) do + if pre_cite_item.id == cite_item.id then + first_reference_note_number = pre_citation.properties.noteIndex + end + break + end + if first_reference_note_number then + break + end + end + item["first-reference-note-number"] = first_reference_note_number + + table.insert(items, item) + end + end + + if #citationsPre > 0 then + local previous_citation_id = citationsPre[#citationsPre][1] + local previous_citation = self.registry.citations[previous_citation_id] + self.registry.previous_citation = previous_citation + end + + if self.registry.requires_sorting then + self:sort_bibliography() + end + + local params = { + bibchange = false, + citation_errors = {}, + } + + local citation_id_note_list = {} + for _, citation_id_note in ipairs(citationsPre) do + table.insert(citation_id_note_list, citation_id_note) + end + local note_index = 0 + if citation.properties and citation.properties.noteIndex then + note_index = citation.properties.noteIndex + end + table.insert(citation_id_note_list, {citation.citationID, note_index}) + for _, citation_id_note in ipairs(citationsPost) do + table.insert(citation_id_note_list, citation_id_note) + end + + local citation_id_cited = {} + for _, citation_id_note in ipairs(citation_id_note_list) do + citation_id_cited[citation_id_note[1]] = true + end + for citation_id, _ in pairs(self.registry.citations) do + if not citation_id_cited[citation_id] then + self.registry.citations[citation_id] = nil + self.registry.citation_strings[citation_id] = nil + end + end + + local output = {} + + for i, citation_id_note in ipairs(citation_id_note_list) do + local citation_id = citation_id_note[1] + -- local note_index = citation_id_note[2] + if citation_id == citation.citationID then + local context = { + build = {}, + engine = self, + } + local citation_str = self.style:render_citation(items, context) + + self.registry.citation_strings[citation_id] = citation_str + table.insert(output, {i - 1, citation_str, citation_id}) + else + -- TODO: correct note_index + -- TODO: update other citations after disambiguation + local citation_str = self.registry.citation_strings[citation_id] + if self.registry.citation_strings[citation_id] ~= citation_str then + params.bibchange = true + self.registry.citation_strings[citation_id] = citation_str + table.insert(output, {i - 1, citation_str, citation_id}) + end + end + end + + return {params, output} +end + +function CiteProc:makeCitationCluster (citation_items) + local items = {} + for _, cite_item in ipairs(citation_items) do + cite_item.id = tostring(cite_item.id) + local position_first = (self.registry.registry[cite_item.id] == nil) + local item_data = self:get_item(cite_item.id) + + -- Create a wrapper of the orignal item from registry so that + -- it may hold different `locator` or `position` values for cites. + local item = setmetatable({}, {__index = function (_, key) + if cite_item[key] then + return cite_item[key] + else + return item_data[key] + end + end}) + + if not item.position and position_first then + item.position = util.position_map["first"] + end + table.insert(items, item) + end + + if self.registry.requires_sorting then + self:sort_bibliography() + end + + local context = { + build = {}, + engine=self, + } + local res = self.style:render_citation(items, context) + self.registry.previous_citation = { + citationID = "pseudo-citation", + citationItems = items, + properties = { + noteIndex = 1, + } + } + return res +end + +function CiteProc:makeBibliography() + local items = {} + + if self.registry.requires_sorting then + self:sort_bibliography() + end + + for _, id in ipairs(self.registry.reflist) do + local item = self.registry.registry[id] + table.insert(items, item) + end + + local context = { + build = {}, + engine=self, + } + local res = self.style:render_biblography(items, context) + return res +end + +function CiteProc:set_formatter(format) + self.formatter = formats[format] +end + +function CiteProc:enable_linking() + self.linking_enabled = true +end + +function CiteProc:disable_linking() + self.linking_enabled = false +end + +function CiteProc.set_base_class (node) + if node:is_element() then + local name = node:get_element_name() + local element_class = nodes[name] + if element_class then + element_class:set_base_class(node) + else + element.Element:set_base_class(node) + end + end +end + +function CiteProc:get_style_class() + return self.style:get_attribute("class") or "in-text" +end + +function CiteProc:get_item (id) + local item = self.registry.registry[id] + if not item then + item = self:_retrieve_item(id) + if not item then + return nil + end + table.insert(self.registry.reflist, id) + item["citation-number"] = #self.registry.reflist + self.registry.registry[id] = item + self.registry.requires_sorting = true + end + local res = {} + setmetatable(res, {__index = item}) + return res +end + +function CiteProc:_retrieve_item (id) + -- Retrieve, copy, and normalize + local res = {} + local item = self.sys.retrieveItem(id) + if not item then + util.warning(string.format('Failed to retrieve item "%s"', id)) + return nil + end + + item.id = tostring(item.id) + + for key, value in pairs(item) do + if key == "title" then + value = self.normalize_string(value) + end + res[key] = value + end + + if res["page"] and not res["page-first"] then + local page_first = util.split(res["page"], "%s*[&,-]%s*")[1] + page_first = util.split(page_first, util.unicode["en dash"])[1] + res["page-first"] = page_first + end + + return res +end + +function CiteProc.normalize_string (str) + if not str or str == "" then + return str + end + -- French punctuation spacing + if type(str) == "string" then + str = string.gsub(str, " ;", util.unicode["narrow no-break space"] .. ";") + str = string.gsub(str, " %?", util.unicode["narrow no-break space"] .. "?") + str = string.gsub(str, " !", util.unicode["narrow no-break space"] .. "!") + str = string.gsub(str, " »", util.unicode["narrow no-break space"] .. "»") + str = string.gsub(str, "« ", "«" .. util.unicode["narrow no-break space"]) + end + -- local text = str + local text = richtext.new(str) + return text +end + +function CiteProc:sort_bibliography() + -- Sort the items in registry according to the `sort` in `bibliography.` + -- This will update the `citation-number` of each item. + local bibliography_sort = self.style:get_path("style bibliography sort")[1] + if not bibliography_sort then + return + end + local items = {} + for _, id in ipairs(self.registry.reflist) do + table.insert(items, self.registry.registry[id]) + end + + local context = { + engine = self, + style = self.style, + mode = "bibliography", + } + context = self.style:process_context(context) + context = self.style:get_path("style bibliography")[1]:process_context(context) + + bibliography_sort:sort(items, context) + self.registry.reflist = {} + for i, item in ipairs(items) do + item["citation-number"] = i + table.insert(self.registry.reflist, item.id) + end + self.registry.requires_sorting = false +end + +function CiteProc:get_system_locale (lang) + local locale = self.system_locales[lang] + if not locale then + locale = self.sys.retrieveLocale(lang) + if not locale then + util.warning(string.format("Failed to retrieve locale \"%s\"", lang)) + return nil + end + if type(locale) == "string" then + locale = dom.parse(locale) + end + locale:traverse_elements(self.set_base_class) + locale = locale:get_path("locale")[1] + locale:root_node().engine = self + locale:root_node().style = self.style + self.system_locales[lang] = locale + end + return locale +end + + +engine.CiteProc = CiteProc + +return engine diff --git a/biblio/citation-style-language/citeproc-formats.lua b/biblio/citation-style-language/citeproc-formats.lua new file mode 100644 index 0000000000..854a528b95 --- /dev/null +++ b/biblio/citation-style-language/citeproc-formats.lua @@ -0,0 +1,209 @@ +--[[ + Copyright (C) 2021 Zeping Lee +--]] + +local util = require("citeproc-util") + + +local formats = {} + +formats.html = { + ["text_escape"] = function (str) + str = string.gsub(str, "%&", "&") + str = string.gsub(str, "<", "<") + str = string.gsub(str, ">", ">") + for char, sub in pairs(util.superscripts) do + str = string.gsub(str, char, "" .. sub .. "") + end + return str + end, + ["bibstart"] = "
\n", + ["bibend"] = "
", + ["@font-style/italic"] = "%s", + ["@font-style/oblique"] = "%s", + ["@font-style/normal"] = '%s', + ["@font-variant/small-caps"] = '%s', + ["@font-variant/normal"] = '%s', + ["@font-weight/bold"] = "%s", + ["@font-weight/normal"] = '%s', + ["@font-weight/light"] = false, + ["@text-decoration/none"] = '%s', + ["@text-decoration/underline"] = '%s', + ["@vertical-align/sup"] = "%s", + ["@vertical-align/sub"] = "%s", + ["@vertical-align/baseline"] = '%s', + ["@quotes/true"] = function (str, context) + local open_quote = context.style:get_term("open-quote"):render(context) + local close_quote = context.style:get_term("close-quote"):render(context) + return open_quote .. str .. close_quote + end, + ["@quotes/inner"] = function (str, context) + local open_quote = context.style:get_term("open-inner-quote"):render(context) + local close_quote = context.style:get_term("close-inner-quote"):render(context) + return open_quote .. str .. close_quote + end, + ["@bibliography/entry"] = function (str, context) + return '
' .. str .. "
\n" + end, + ["@display/block"] = function (str, state) + return '\n\n
' .. str .. "
\n" + end, + ["@display/left-margin"] = function (str, state) + return '\n
' .. str .. "
" + end, + ["@display/right-inline"] = function (str, state) + str = util.rstrip(str) + return '
' .. str .. "
\n " + end, + ["@display/indent"] = function (str, state) + return '
' .. str .. "
\n " + end, + ["@URL/true"] = function (str, state) + if state.engine.linking_enabled then + return string.format('%s', str, str) + else + return str + end + end, + ["@DOI/true"] = function (str, state) + if state.engine.linking_enabled then + local href = str + if not string.match(href, "^https?://") then + href = "https://doi.org/" .. str; + end + return string.format('%s', href, str) + else + return str + end + end, + ["@PMID/true"] = function (str, state) + if state.engine.linking_enabled then + local href = str + if not string.match(href, "^https?://") then + href = "https://www.ncbi.nlm.nih.gov/pubmed/" .. str; + end + return string.format('%s', href, str) + else + return str + end + end, + ["@PMCID/true"] = function (str, state) + if state.engine.linking_enabled then + local href = str + if not string.match(href, "^https?://") then + href = "https://www.ncbi.nlm.nih.gov/pmc/articles/" .. str; + end + return string.format('%s', href, str) + else + return str + end + end, +} + +formats.latex = { + ["text_escape"] = function (str) + str = str:gsub("\\", "\\textbackslash") + str = str:gsub("#", "\\#") + str = str:gsub("%$", "\\$") + str = str:gsub("%%", "\\%%") + str = str:gsub("&", "\\&") + str = str:gsub("{", "\\{") + str = str:gsub("}", "\\}") + str = str:gsub("_", "\\_") + str = str:gsub(util.unicode["no-break space"], "~") + for char, sub in pairs(util.superscripts) do + str = string.gsub(str, char, "\\textsuperscript{" .. sub .. "}") + end + return str + end, + ["bibstart"] = function (context) + return string.format("\\begin{thebibliography}{%s}\n", context.build.longest_label) + end, + ["bibend"] = "\\end{thebibliography}", + ["@font-style/normal"] = "{\\normalshape %s}", + ["@font-style/italic"] = "\\emph{%s}", + ["@font-style/oblique"] = "\\textsl{%s}", + ["@font-variant/normal"] = "{\\normalshape %s}", + ["@font-variant/small-caps"] = "\\textsc{%s}", + ["@font-weight/normal"] = "\\fontseries{m}\\selectfont %s", + ["@font-weight/bold"] = "\\textbf{%s}", + ["@font-weight/light"] = "\\fontseries{l}\\selectfont %s", + ["@text-decoration/none"] = false, + ["@text-decoration/underline"] = "\\underline{%s}", + ["@vertical-align/sup"] = "\\textsuperscript{%s}", + ["@vertical-align/sub"] = "\\textsubscript{%s}", + ["@vertical-align/baseline"] = false, + ["@quotes/true"] = function (str, context) + local open_quote = context.style:get_term("open-quote"):render(context) + local close_quote = context.style:get_term("close-quote"):render(context) + return open_quote .. str .. close_quote + end, + ["@quotes/inner"] = function (str, context) + local open_quote = context.style:get_term("open-inner-quote"):render(context) + local close_quote = context.style:get_term("close-inner-quote"):render(context) + return open_quote .. str .. close_quote + end, + ["@bibliography/entry"] = function (str, context) + if not string.match(str, "\\bibitem") then + str = "\\bibitem{".. context.item.id .. "}\n" .. str + end + return str .. "\n" + end, + ["@display/block"] = function (str, state) + return str + end, + ["@display/left-margin"] = function (str, state) + if #str > #state.build.longest_label then + state.build.longest_label = str + end + if string.match(str, "%]") then + str = "{" .. str .. "}" + end + return string.format("\\bibitem[%s]{%s}\n", str, state.item.id) + end, + ["@display/right-inline"] = function (str, state) + return str + end, + ["@display/indent"] = function (str, state) + return str + end, + ["@URL/true"] = function (str, state) + return "\\url{" .. str .. "}" + end, + ["@DOI/true"] = function (str, state) + if state.engine.linking_enabled then + local href = str + if not string.match(href, "^https?://") then + href = "https://doi.org/" .. str; + end + return string.format("\\href{%s}{%s}", href, str) + else + return str + end + end, + ["@PMID/true"] = function (str, state) + if state.engine.linking_enabled then + local href = str + if not string.match(href, "^https?://") then + href = "https://www.ncbi.nlm.nih.gov/pubmed/" .. str; + end + return string.format("\\href{%s}{%s}", href, str) + else + return str + end + end, + ["@PMCID/true"] = function (str, state) + if state.engine.linking_enabled then + local href = str + if not string.match(href, "^https?://") then + href = "https://www.ncbi.nlm.nih.gov/pmc/articles/" .. str; + end + return string.format("\\href{%s}{%s}", href, str) + else + return str + end + end, +} + + +return formats diff --git a/biblio/citation-style-language/citeproc-node-choose.lua b/biblio/citation-style-language/citeproc-node-choose.lua new file mode 100644 index 0000000000..aa36e2c8c3 --- /dev/null +++ b/biblio/citation-style-language/citeproc-node-choose.lua @@ -0,0 +1,126 @@ +local choose = {} + +local element = require("citeproc-element") +local util = require("citeproc-util") + + +local Choose = element.Element:new() + +function Choose:render (item, context) + self:debug_info(context) + context = self:process_context(context) + for i, child in ipairs(self:get_children()) do + if child:is_element() then + local result, status = child:render(item, context) + if status then + return result + end + end + end + return nil +end + + +local If = element.Element:new() + +If.render = function (self, item, context) + self:debug_info(context) + context = self:process_context(context) + local results = {} + + local variable_names = context.options["is-numeric"] + if variable_names then + for _, variable_name in ipairs(util.split(variable_names)) do + local variable = self:get_variable(item, variable_name, context) + table.insert(results, util.is_numeric(variable)) + end + end + + variable_names = context.options["is-uncertain-date"] + if variable_names then + for _, variable_name in ipairs(util.split(variable_names)) do + local variable = self:get_variable(item, variable_name, context) + table.insert(results, util.is_uncertain_date(variable)) + end + end + + local locator_types = context.options["locator"] + if locator_types then + for _, locator_type in ipairs(util.split(locator_types)) do + local locator_label = item.label or "page" + local res = locator_label == locator_type + if locator_type == "sub-verbo" then + res = locator_label == "sub verbo" + end + table.insert(results, res) + end + end + + local positions = context.options["position"] + if positions then + for _, position in ipairs(util.split(positions)) do + local res = false + if context.mode == "citation" then + if position == "first" then + res = (item.position == util.position_map["first"]) + elseif position == "near-note" then + res = item["near-note"] ~= nil and item["near-note"] ~= false + else + res = (item.position >= util.position_map[position]) + end + end + table.insert(results, res) + end + end + + local type_names = context.options["type"] + if type_names then + for _, type_name in ipairs(util.split(type_names)) do + table.insert(results, item["type"] == type_name) + end + end + + variable_names = context.options["variable"] + if variable_names then + for _, variable_name in ipairs(util.split(variable_names)) do + local variable = self:get_variable(item, variable_name, context) + local res = (variable ~= nil and variable ~= "") + table.insert(results, res) + end + end + + local match = context.options["match"] or "all" + local status = false + if match == "any" then + status = util.any(results) + elseif match == "none" then + status = not util.any(results) + else + status = util.all(results) + end + if status then + return self:render_children(item, context), status + else + return nil, false + end +end + + +local ElseIf = If:new() + + +local Else = element.Element:new() + +Else.render = function (self, item, context) + self:debug_info(context) + context = self:process_context(context) + return self:render_children(item, context), true +end + + +choose.Choose = Choose +choose.If = If +choose.ElseIf = ElseIf +choose.Else = Else + +return choose diff --git a/biblio/citation-style-language/citeproc-node-date.lua b/biblio/citation-style-language/citeproc-node-date.lua new file mode 100644 index 0000000000..9c712a8135 --- /dev/null +++ b/biblio/citation-style-language/citeproc-node-date.lua @@ -0,0 +1,379 @@ +local date_module = {} + +local element = require("citeproc-element") +local util = require("citeproc-util") + + +local Date = element.Element:new() + +function Date:render (item, context) + self:debug_info(context) + context = self:process_context(context) + + if context.sorting then + return self:render_sort_key(item, context) + end + + local variable_name = context.options["variable"] + + local is_locale_date + if variable_name then + context.variable = variable_name + is_locale_date = false + else + variable_name = context.variable + is_locale_date = true + end + + local date = self:get_variable(item, variable_name, context) + if not date then + return nil + end + + local res = nil + local form = context.options["form"] + if form and not is_locale_date then + for _, date_part in ipairs(self:query_selector("date-part")) do + local name = date_part:get_attribute("name") + if not context.date_part_attributes then + context.date_part_attributes = {} + end + if not context.date_part_attributes[name] then + context.date_part_attributes[name] = {} + end + + for attr, value in pairs(date_part._attr) do + if attr ~= name then + context.date_part_attributes[name][attr] = value + end + end + end + res = self:get_locale_date(context, form):render(item, context) + else + if not date["date-parts"] or #date["date-parts"] == 0 then + local literal = date["literal"] + if literal then + res = literal + else + local raw = date["raw"] + if raw then + res = raw + end + end + + else + if #date["date-parts"] == 1 then + res = self:_render_single_date(date, context) + elseif #date["date-parts"] == 2 then + res = self:_render_date_range(date, context) + end + end + end + + table.insert(context.variable_attempt, res ~= nil) + + res = self:format(res, context) + res = self:wrap(res, context) + return res +end + +function Date:get_locale_date(context, form) + local date = nil + local style = context.style + local query = string.format("date[form=\"%s\"]", form) + for _, locale in ipairs(style:get_locales()) do + date = locale:query_selector(query)[1] + if date then + break + end + end + if not date then + error(string.format("Failed to find '%s'", query)) + end + return date +end + +function Date:render_sort_key (item, context) + local variable_name = context.options["variable"] + local date = self:get_variable(item, variable_name, context) + if not date or not date["date-parts"] then + return nil + end + local show_parts = { + year = false, + month = false, + day = false, + } + if self:get_attribute("form") then + local date_parts = self:get_attribute("date-parts") or "year-month-day" + for _, dp_name in ipairs(util.split(date_parts, "%-")) do + show_parts[dp_name] = true + end + else + for _, child in ipairs(self:query_selector("date-part")) do + show_parts[child:get_attribute("name")] = true + end + end + local res = "" + for _, date_parts in ipairs(date["date-parts"]) do + for i, dp_name in ipairs({"year", "month", "day"}) do + local value = date_parts[i] + if not value or not show_parts[dp_name] then + value = 0 + end + if i == 1 then + res = res .. string.format("%05d", value + 10000) + else + res = res .. string.format("%02d", value) + end + end + end + return res +end + +function Date:_render_single_date (date, context) + local show_parts = self:_get_show_parts(context) + + local output = {} + for _, child in ipairs(self:query_selector("date-part")) do + if show_parts[child:get_attribute("name")] then + table.insert(output, child:render(date, context)) + end + end + return self:concat(output, context) +end + +function Date:_render_date_range (date, context) + local show_parts = self:_get_show_parts(context) + local part_index = {} + + local largest_diff_part = nil + for i, name in ipairs({"year", "month", "day"}) do + part_index[name] = i + local part_value1 = date["date-parts"][1][i] + if show_parts[name] and part_value1 then + if not largest_diff_part then + largest_diff_part = name + end + end + end + + local date_parts = {} + for _, date_part in ipairs(self:query_selector("date-part")) do + if show_parts[date_part:get_attribute("name")] then + table.insert(date_parts, date_part) + end + end + + local diff_begin = 0 + local diff_end = #date_parts + local range_delimiter = nil + + for i, date_part in ipairs(date_parts) do + local name = date_part:get_attribute("name") + if name == largest_diff_part then + range_delimiter = date_part:get_attribute("range-delimiter") + if not range_delimiter then + range_delimiter = util.unicode["en dash"] + end + end + + local index = part_index[name] + local part_value1 = date["date-parts"][1][index] + local part_value2 = date["date-parts"][2][index] + if part_value1 and part_value1 ~= part_value2 then + if diff_begin == 0 then + diff_begin = i + end + diff_end = i + end + end + + local same_prefix = {} + local range_begin = {} + local range_end = {} + local same_suffix = {} + + local no_suffix_context = self:process_context(context) + no_suffix_context.options["suffix"] = nil + + for i, date_part in ipairs(date_parts) do + local res = nil + if i == diff_end then + res = date_part:render(date, no_suffix_context, true) + else + res = date_part:render(date, context) + end + if i < diff_begin then + table.insert(same_prefix, res) + elseif i <= diff_end then + table.insert(range_begin, res) + table.insert(range_end, date_part:render(date, context, false, true)) + else + table.insert(same_suffix, res) + end + end + + local prefix_output = self:concat(same_prefix, context) or "" + local range_begin_output = self:concat(range_begin, context) or "" + local range_end_output = self:concat(range_end, context) or "" + local suffix_output = self:concat(same_suffix, context) + local range_output = range_begin_output .. range_delimiter .. range_end_output + + local res = self:concat({prefix_output, range_output, suffix_output}, context) + + return res +end + +function Date:_get_show_parts (context) + local show_parts = {} + local date_parts = context.options["date-parts"] or "year-month-day" + for _, date_part in ipairs(util.split(date_parts, "%-")) do + show_parts[date_part] = true + end + return show_parts +end + + +local DatePart = element.Element:new() + +DatePart.render = function (self, date, context, last_range_begin, range_end) + self:debug_info(context) + context = self:process_context(context) + local name = context.options["name"] + local range_delimiter = context.options["range-delimiter"] or false + + -- The attributes set on cs:date-part elements of a cs:date with form + -- attribute override those specified for the localized date formats + if context.date_part_attributes then + local context_attributes = context.date_part_attributes[name] + if context_attributes then + for attr, value in pairs(context_attributes) do + context.options[attr] = value + end + end + end + + if last_range_begin then + context.options["suffix"] = "" + end + + local date_parts_index = 1 + if range_end then + date_parts_index = 2 + end + + local res = nil + if name == "day" then + local day = date["date-parts"][date_parts_index][3] + if not day then + return nil + end + day = tonumber(day) + -- range open + if day == 0 then + return nil + end + local form = context.options["form"] or "numeric" + + if form == "ordinal" then + local option = self:get_locale_option("limit-day-ordinals-to-day-1") + if option and option ~= "false" and day > 1 then + form = "numeric" + end + end + if form == "numeric" then + res = tostring(day) + elseif form == "numeric-leading-zeros" then + -- TODO: day == nil? + if not day then + return nil + end + res = string.format("%02d", day) + elseif form == "ordinal" then + res = util.to_ordinal(day) + end + + elseif name == "month" then + local form = context.options["form"] or "long" + + local month = date["date-parts"][date_parts_index][2] + if month then + month = tonumber(month) + -- range open + if month == 0 then + return nil + end + end + + if form == "long" or form == "short" then + local term_name = nil + if month then + if month >= 1 and month <= 12 then + term_name = string.format("month-%02d", month) + elseif month >= 13 and month <= 24 then + local season = month % 4 + if season == 0 then + season = 4 + end + term_name = string.format("season-%02d", season) + else + util.warning("Invalid month value") + return nil + end + else + local season = date["season"] + if season then + season = tonumber(season) + term_name = string.format("season-%02d", season) + else + return nil + end + end + res = self:get_term(term_name, form):render(context) + elseif form == "numeric" then + res = tostring(month) + elseif form == "numeric-leading-zeros" then + -- TODO: month == nil? + if not month then + return nil + end + res = string.format("%02d", month) + end + res = self:strip_periods(res, context) + + elseif name == "year" then + local year = date["date-parts"][date_parts_index][1] + if year then + year = tonumber(year) + -- range open + if year == 0 then + return nil + end + local form = context.options["form"] or "long" + if form == "long" then + year = tonumber(year) + if year < 0 then + res = tostring(-year) .. self:get_term("bc"):render(context) + elseif year < 1000 then + res = tostring(year) .. self:get_term("ad"):render(context) + else + res = tostring(year) + end + elseif form == "short" then + res = string.sub(tostring(year), -2) + end + end + end + res = self:case(res, context) + res = self:format(res, context) + res = self:wrap(res, context) + res = self:display(res, context) + return res +end + + +date_module.Date = Date +date_module.DatePart = DatePart + +return date_module diff --git a/biblio/citation-style-language/citeproc-node-group.lua b/biblio/citation-style-language/citeproc-node-group.lua new file mode 100644 index 0000000000..3148e96148 --- /dev/null +++ b/biblio/citation-style-language/citeproc-node-group.lua @@ -0,0 +1,32 @@ +local group = {} + +local element = require("citeproc-element") +local util = require("citeproc-util") + + +local Group = element.Element:new() + +function Group:render (item, context) + self:debug_info(context) + context = self:process_context(context) + + local num_variable_attempt = #context.variable_attempt + + local res = self:render_children(item, context) + + if #context.variable_attempt > num_variable_attempt then + if not util.any(util.slice(context.variable_attempt, num_variable_attempt + 1)) then + res = nil + end + end + + res = self:format(res, context) + res = self:wrap(res, context) + res = self:display(res, context) + return res +end + + +group.Group = Group + +return group diff --git a/biblio/citation-style-language/citeproc-node-label.lua b/biblio/citation-style-language/citeproc-node-label.lua new file mode 100644 index 0000000000..d8bfe2ba3d --- /dev/null +++ b/biblio/citation-style-language/citeproc-node-label.lua @@ -0,0 +1,106 @@ +local label = {} + +local element = require("citeproc-element") +local util = require("citeproc-util") + + +local Label = element.Element:new() + +function Label:render (item, context) + self:debug_info(context) + context = self:process_context(context) + + local variable_name + if context.names_element then + -- The `variable` attribute of names may hold multiple roles. + -- Each of them may call `Label:render()` to render the term. + -- When used in `names` element, the role name is the first argument + -- and the item is accessed via `context.item`. + -- Bad design + -- TODO: Redesign the arguments of render() + variable_name = item + else + variable_name = context.options["variable"] + end + + local form = context.options["form"] + local plural = context.options["plural"] or "contextual" + + if not context.names_element then + local variable_type = util.variable_types[variable_name] + -- variable must be or one of the number variables. + if variable_type ~= "number" then + return nil + end + -- The term is only rendered if the selected variable is non-empty + local variable = item[variable_name] + if not variable then + return nil + end + if type(variable) == "string" then + if not (string.match(variable, "^%d") or util.is_numeric(variable)) then + return nil + end + end + end + + local term + if variable_name == "locator" then + local locator_type = item.label or "page" + term = self:get_term(locator_type, form) + else + term = self:get_term(variable_name, form) + end + + local res = nil + if term then + if plural == "contextual" and self:_is_plural(variable_name, context) or plural == "always" then + res = term:render(context, true) + else + res = term:render(context, false) + end + + res = self:strip_periods(res, context) + res = self:case(res, context) + res = self:format(res, context) + res = self:wrap(res, context) + end + return res +end + +function Label:_is_plural (variable_name, context) + local variable_type = util.variable_types[variable_name] + -- Don't use self:get_variable here + local variable = context.item[variable_name] + local res = false + if variable_type == "name" then + -- Label inside `names` + res = #variable > 1 + + elseif variable_type == "number" then + if util.startswith(variable_name, "number-of-") then + res = tonumber(variable) > 1 + else + variable = tostring(variable) + variable = string.gsub(variable, "\\%-", "") + if #util.split(variable, "%s*[,&-]%s*") > 1 then + -- check if contains multiple numbers + -- "i–ix": true + -- res = string.match(tostring(variable), "%d+%D+%d+") ~= nil + res = true + elseif string.match(variable, "%Aand%A") or string.match(variable, "%Aet%A") then + res = true + else + res = false + end + end + else + util.warning("Invalid attribute \"variable\".") + end + return res +end + + +label.Label = Label + +return label diff --git a/biblio/citation-style-language/citeproc-node-layout.lua b/biblio/citation-style-language/citeproc-node-layout.lua new file mode 100644 index 0000000000..40ce358629 --- /dev/null +++ b/biblio/citation-style-language/citeproc-node-layout.lua @@ -0,0 +1,231 @@ +local layout = {} + +local richtext = require("citeproc-richtext") +local element = require("citeproc-element") +local util = require("citeproc-util") + + +local Layout = element.Element:new() + +function Layout:render (items, context) + self:debug_info(context) + + context.items = items + + -- When used within cs:citation, the delimiter attribute may be used to specify a delimiter for cites within a citation. + -- Thus the processing of context is put after render_children(). + if context.mode == "citation" then + if context.options["collapse"] == "citation-number" then + context.build.item_citation_numbers = {} + context.build.item_citation_number_text = {} + end + elseif context.mode == "bibliography" then + context.build.longest_label = "" + context.build.preceding_first_rendered_names = nil + context = self:process_context(context) + end + + local output = {} + local previous_cite = nil + for _, item in ipairs(items) do + + context.item = item + context.variable_attempt = {} + context.suppressed_variables = {} + context.suppress_subsequent_variables = false + if context.mode == "bibliography" then + context.build.first_rendered_names = {} + end + + if not item.position then + item.position = self:_get_position(item, previous_cite, context) + end + + local first = nil + local second = {} + local element_index = 0 + for _, child in ipairs(self:get_children()) do + if child:is_element() then + element_index = element_index + 1 + local text = child:render(item, context) + if element_index == 1 then + first = text + else + table.insert(second, text) + end + end + end + second = self:concat(second, context) + + if context.mode == "bibliography" then + if first and context.options["prefix"] then + first = richtext.new(context.options["prefix"]) .. first + end + if second and context.options["suffix"] then + second = second .. richtext.new(context.options["suffix"]) + end + end + + local res = nil + if context.options["second-field-align"] == "flush" then + if first then + first:add_format("display", "left-margin") + res = first + end + if second then + second:add_format("display", "right-inline") + if res then + res = richtext.concat(res, second) + else + res = second + end + end + else + res = self:concat({first, second}, context) + end + + if context.mode == "citation" then + if res and item["prefix"] then + res = richtext.new(item["prefix"]) .. res + end + if res and item["suffix"] then + res = res .. richtext.new(item["suffix"]) + end + elseif context.mode == "bibliography" then + if not res then + res = richtext.new("[CSL STYLE ERROR: reference with no printed form.]") + end + res = self:wrap(res, context) + -- util.debug(text) + res = res:render(context.engine.formatter, context) + res = context.engine.formatter["@bibliography/entry"](res, context) + end + table.insert(output, res) + previous_cite = item + end + + if context.mode == "citation" then + if next(output) == nil then + return "[CSL STYLE ERROR: reference with no printed form.]" + end + + context = self:process_context(context) + local res + if context.options["collapse"] then + res = self:_collapse_citations(output, context) + else + res = self:concat(output, context) + end + res = self:wrap(res, context) + res = self:format(res, context) + if res then + -- util.debug(res) + res = res:render(context.engine.formatter, context) + end + return res + + else + local params = { + maxoffset = #context.build.longest_label, + } + + return {params, output} + end +end + +function Layout:_get_position (item, previous_cite, context) + local engine = context.engine + if not engine.registry.registry[item.id] then + return util.position_map["first"] + end + + local position = util.position_map["subsequent"] + -- Find the preceding cite referencing the same item + local preceding_cite = nil + if previous_cite then + -- a. the current cite immediately follows on another cite + if item.id == previous_cite.id then + preceding_cite = previous_cite + end + elseif engine.registry.previous_citation then + -- b. first cite in the citation and previous citation exists + for _, cite in ipairs(engine.registry.previous_citation.citationItems) do + if item.id == cite.id then + preceding_cite = cite + break + end + end + end + + if preceding_cite then + if preceding_cite.locator then + -- Preceding cite does have a locator + if item.locator then + if item.locator == preceding_cite.locator then + position = util.position_map["ibid"] + else + position = util.position_map["ibid-with-locator"] + end + else + -- the current cite lacks a locator + position = util.position_map["subsequent"] + end + else + -- Preceding cite does not have a locator + if item.locator then + position = util.position_map["ibid-with-locator"] + else + position = util.position_map["ibid"] + end + end + end + return position +end + + +function Layout:_collapse_citations(output, context) + if context.options["collapse"] == "citation-number" then + assert(#output == #context.items) + local citation_numbers = {} + for i, item in ipairs(context.items) do + citation_numbers[i] = context.build.item_citation_numbers[item.id] or 0 + end + + local collapsed_output = {} + local citation_number_range_delimiter = util.unicode["en dash"] + local index = 1 + while index <= #citation_numbers do + local stop_index = index + 1 + if output[index] == context.build.item_citation_number_text[index] then + while stop_index <= #citation_numbers do + if output[stop_index] ~= context.build.item_citation_number_text[stop_index] then + break + end + if citation_numbers[stop_index - 1] + 1 ~= citation_numbers[stop_index] then + break + end + stop_index = stop_index + 1 + end + end + + if stop_index >= index + 3 then + local range_text = output[index] .. citation_number_range_delimiter .. output[stop_index - 1] + table.insert(collapsed_output, range_text) + else + for i = index, stop_index - 1 do + table.insert(collapsed_output, output[i]) + end + end + + index = stop_index + end + + return self:concat(collapsed_output, context) + end + return self:concat(output, context) +end + + +layout.Layout = Layout + +return layout diff --git a/biblio/citation-style-language/citeproc-node-locale.lua b/biblio/citation-style-language/citeproc-node-locale.lua new file mode 100644 index 0000000000..e324c3502e --- /dev/null +++ b/biblio/citation-style-language/citeproc-node-locale.lua @@ -0,0 +1,130 @@ +local locale = {} + +local element = require("citeproc-element") + + +local Locale = element.Element:new() + +function Locale:get_option (key) + local query = string.format("style-options[%s]", key) + local option = self:query_selector(query)[1] + if option then + local value = option:get_attribute(key) + if self.option_type[key] == "integer" then + value = tonumber(value) + elseif self.option_type[key] == "boolean" then + value = (value == "true") + end + return value + else + return nil + end +end + +function Locale:get_term (name, form, number, gender) + + if form == "long" then + form = nil + end + + local match_last + local match_last_two + local match_whole + if number then + assert(type(number) == "number") + match_last = string.format("%s-%02d", name, number % 10) + match_last_two = string.format("%s-%02d", name, number % 100) + match_whole = string.format("%s-%02s", name, number) + end + + local res = nil + for _, term in ipairs(self:query_selector("term")) do + -- Use get_path? + local match_name = name + + if number then + local term_match = term:get_attribute("last-two-digits") + if term_match == "whole-number" then + match_name = match_whole + elseif term_match == "last-two-digits" then + match_name = match_last_two + elseif number < 10 then + -- "13" can match only "ordinal-13" not "ordinal-03" + -- It is sliced to "3" in a later checking pass. + match_name = match_last_two + else + match_name = match_last + end + end + + local term_name = term:get_attribute("name") + local term_form = term:get_attribute("form") + if term_form == "long" then + term_form = nil + end + local term_gender = term:get_attribute("gender-form") + + if term_name == match_name and term_form == form and term_gender == gender then + return term + end + + end + + -- Fallback + if form == "verb-sort" then + return self:get_term(name, "verb") + elseif form == "symbol" then + return self:get_term(name, "short") + elseif form == "verb" then + return self:get_term(name, "long") + elseif form == "short" then + return self:get_term(name, "long") + end + + if number and number > 10 then + return self:get_term(name, nil, number % 10, gender) + end + + if gender then + return self:get_term(name, nil, number, nil) + end + + if number then + return self:get_term(name, nil, nil, nil) + end + + return nil +end + + +local Term = element.Element:new() + +function Term:render (context, is_plural) + self:debug_info(context) + context = self:process_context(context) + + local output = { + single = self:get_text(), + } + for _, child in ipairs(self:get_children()) do + if child:is_element() then + output[child:get_element_name()] = self:escape(child:get_text()) + end + end + local res = output.single + if is_plural then + if output.multiple then + res = output.multiple + end + end + if res == "" then + return nil + end + return res +end + + +locale.Locale = Locale +locale.Term = Term + +return locale diff --git a/biblio/citation-style-language/citeproc-node-names.lua b/biblio/citation-style-language/citeproc-node-names.lua new file mode 100644 index 0000000000..9958e28999 --- /dev/null +++ b/biblio/citation-style-language/citeproc-node-names.lua @@ -0,0 +1,696 @@ +local names_module = {} + +local unicode = require("unicode") + +local richtext = require("citeproc-richtext") +local element = require("citeproc-element") +local util = require("citeproc-util") + + +local Name = element.Element:new() + +Name.default_options = { + ["delimiter"] = ", ", + ["delimiter-precedes-et-al"] = "contextual", + ["delimiter-precedes-last"] = "contextual", + ["et-al-min"] = nil, + ["et-al-use-first"] = nil, + ["et-al-subsequent-min"] = nil, + ["et-al-subsequent-use-first "] = nil, + ["et-al-use-last"] = false, + ["form"] = "long", + ["initialize"] = true, + ["initialize-with"] = false, + ["name-as-sort-order"] = false, + ["sort-separator"] = ", ", + ["prefix"] = "", + ["suffix"] = "", +} + +function Name:render (names, context) + self:debug_info(context) + context = self:process_context(context) + + local and_ = context.options["and"] + local delimiter = context.options["delimiter"] + local delimiter_precedes_et_al = context.options["delimiter-precedes-et-al"] + local delimiter_precedes_last = context.options["delimiter-precedes-last"] + local et_al_min = context.options["et-al-min"] + local et_al_use_first = context.options["et-al-use-first"] + local et_al_subsequent_min = context.options["et-al-subsequent-min"] + local et_al_subsequent_use_first = context.options["et-al-subsequent-use-first "] + local et_al_use_last = context.options["et-al-use-last"] + + -- sorting + if context.options["names-min"] then + et_al_min = context.options["names-min"] + end + if context.options["names-use-first"] then + et_al_use_first = context.options["names-use-first"] + end + if context.options["names-use-last"] ~= nil then + et_al_use_last = context.options["names-use-last"] + end + + local form = context.options["form"] + + local et_al_truncate = et_al_min and et_al_use_first and #names >= et_al_min + local et_al_last = et_al_use_last and et_al_use_first <= et_al_min - 2 + + if form == "count" then + if et_al_truncate then + return et_al_use_first + else + return #names + end + end + + local output = nil + + local res = nil + local inverted = false + + for i, name in ipairs(names) do + if et_al_truncate and i > et_al_use_first then + if et_al_last then + if i == #names then + output = richtext.concat(output, delimiter) + output = output .. util.unicode["horizontal ellipsis"] + output = output .. " " + res = self:render_single_name(name, i, context) + output = output .. res + end + else + if not self:_check_delimiter(delimiter_precedes_et_al, i, inverted) then + delimiter = " " + end + if output then + output = richtext.concat_list({output, context.et_al:render(context)}, delimiter) + end + break + end + else + if i > 1 then + if i == #names and context.options["and"] then + if self:_check_delimiter(delimiter_precedes_last, i, inverted) then + output = richtext.concat(output, delimiter) + else + output = output .. " " + end + local and_term = "" + if context.options["and"] == "text" then + and_term = self:get_term("and"):render(context) + elseif context.options["and"] == "symbol" then + and_term = self:escape("&") + end + output = output .. and_term .. " " + else + output = richtext.concat(output, delimiter) + end + end + res, inverted = self:render_single_name(name, i, context) + + if res and res ~= "" then + res = richtext.new(res) + if context.build.first_rendered_names then + table.insert(context.build.first_rendered_names, res) + end + + if output then + output = richtext.concat(output, res) + else + output = res + end + end + end + end + + local ret = self:format(output, context) + ret = self:wrap(ret, context) + return ret +end + +function Name:_check_delimiter (delimiter_attribute, index, inverted) + -- `delimiter-precedes-et-al` and `delimiter-precedes-last` + if delimiter_attribute == "always" then + return true + elseif delimiter_attribute == "never" then + return false + elseif delimiter_attribute == "contextual" then + if index > 2 then + return true + else + return false + end + elseif delimiter_attribute == "after-inverted-name" then + if inverted then + return true + else + return false + end + end + return false +end + +function Name:render_single_name (name, index, context) + local form = context.options["form"] + local initialize = context.options["initialize"] + local initialize_with = context.options["initialize-with"] + local name_as_sort_order = context.options["name-as-sort-order"] + if context.sorting then + name_as_sort_order = "all" + end + local sort_separator = context.options["sort-separator"] + + local demote_non_dropping_particle = context.options["demote-non-dropping-particle"] + + -- TODO: make it a module + local function _strip_quotes(str) + if str then + str = string.gsub(str, '"', "") + str = string.gsub(str, "'", util.unicode["apostrophe"]) + end + return str + end + + local family = _strip_quotes(name["family"]) or "" + local given = _strip_quotes(name["given"]) or "" + local dp = _strip_quotes(name["dropping-particle"]) or "" + local ndp = _strip_quotes(name["non-dropping-particle"]) or "" + local suffix = _strip_quotes(name["suffix"]) or "" + local literal = _strip_quotes(name["literal"]) or "" + + if family == "" then + family = literal + if family == "" then + family = given + given = "" + end + if family ~= "" then + return family + else + error("Name not avaliable") + end + end + + if initialize_with then + given = self:initialize(given, initialize_with, context) + end + + local demote_ndp = false -- only active when form == "long" + if demote_non_dropping_particle == "display-and-sort" or + demote_non_dropping_particle == "sort-only" and context.sorting then + demote_ndp = true + else -- demote_non_dropping_particle == "never" + demote_ndp = false + end + + local family_name_part = nil + local given_name_part = nil + for _, child in ipairs(self:get_children()) do + if child:is_element() and child:get_element_name() == "name-part" then + local name_part = child:get_attribute("name") + if name_part == "family" then + family_name_part = child + elseif name_part == "given" then + given_name_part = child + end + end + end + + local res = nil + local inverted = false + if form == "long" then + local order + local suffix_separator = sort_separator + if not util.has_romanesque_char(name["family"]) then + order = {family, given} + inverted = true + sort_separator = "" + elseif name_as_sort_order == "all" or (name_as_sort_order == "first" and index == 1) then + + -- "Alan al-One" + local hyphen_parts = util.split(family, "%-", 1) + if #hyphen_parts > 1 then + local particle + particle, family = table.unpack(hyphen_parts) + particle = particle .. "-" + ndp = richtext.concat(ndp, particle) + end + + if family_name_part then + family = family_name_part:format_name_part(family, context) + ndp = family_name_part:format_name_part(ndp, context) + end + if given_name_part then + given = given_name_part:format_name_part(given, context) + dp = family_name_part:format_name_part(dp, context) + end + + if demote_ndp then + given = richtext.concat_list({given, dp, ndp}, " ") + else + family = richtext.concat_list({ndp, family}, " ") + given = richtext.concat_list({given, dp}, " ") + end + + if family_name_part then + family = family_name_part:wrap_name_part(family, context) + end + if given_name_part then + given = given_name_part:wrap_name_part(given, context) + end + + order = {family, given, suffix} + inverted = true + else + if family_name_part then + family = family_name_part:format_name_part(family, context) + ndp = family_name_part:format_name_part(ndp, context) + end + if given_name_part then + given = given_name_part:format_name_part(given, context) + dp = family_name_part:format_name_part(dp, context) + end + + family = richtext.concat_list({dp, ndp, family}, " ") + if name["comma-suffix"] then + suffix_separator = ", " + else + suffix_separator = " " + end + family = richtext.concat_list({family, suffix}, suffix_separator) + + if family_name_part then + family = family_name_part:wrap_name_part(family, context) + end + if given_name_part then + given = given_name_part:wrap_name_part(given, context) + end + + order = {given, family} + sort_separator = " " + end + res = richtext.concat_list(order, sort_separator) + + elseif form == "short" then + if family_name_part then + family = family_name_part:format_name_part(family, context) + ndp = family_name_part:format_name_part(ndp, context) + end + family = util.concat({ndp, family}, " ") + if family_name_part then + family = family_name_part:wrap_name_part(family, context) + end + res = family + else + error(string.format('Invalid attribute form="%s" of "name".', form)) + end + return res, inverted +end + +function Name:initialize (given, terminator, context) + if not given or given == "" then + return "" + end + + local initialize = context.options["initialize"] + if context.options["initialize-with-hyphen"] == false then + given = string.gsub(given, "-", " ") + end + + -- Split the given name to name_list (e.g., {"John", "M." "E"}) + -- Compound names are splitted too but are marked in punc_list. + local name_list = {} + local punct_list = {} + local last_position = 1 + for name, pos in string.gmatch(given, "([^-.%s]+[-.%s]+)()") do + table.insert(name_list, string.match(name, "^[^-%s]+")) + if string.match(name, "%-") then + table.insert(punct_list, "-") + else + table.insert(punct_list, "") + end + last_position = pos + end + if last_position <= #given then + table.insert(name_list, util.strip(string.sub(given, last_position))) + table.insert(punct_list, "") + end + + for i, name in ipairs(name_list) do + local is_particle = false + local is_abbreviation = false + + local first_letter = utf8.char(utf8.codepoint(name)) + if util.is_lower(first_letter) then + is_particle = true + elseif #name == 1 then + is_abbreviation = true + else + local abbreviation = string.match(name, "^([^.]+)%.$") + if abbreviation then + is_abbreviation = true + name = abbreviation + end + end + + if is_particle then + name_list[i] = name .. " " + if i > 1 and not string.match(name_list[i-1], "%s$") then + name_list[i-1] = name_list[i-1] .. " " + end + elseif is_abbreviation then + name_list[i] = name .. terminator + else + if initialize then + if util.is_upper(name) then + name = first_letter + else + -- Long abbreviation: "TSerendorjiin" -> "Ts." + local abbreviation = "" + for _, c in utf8.codes(name) do + local char = utf8.char(c) + local lower = unicode.utf8.lower(char) + if lower == char then + break + end + if abbreviation == "" then + abbreviation = char + else + abbreviation = abbreviation .. lower + end + end + name = abbreviation + end + name_list[i] = name .. terminator + else + name_list[i] = name .. " " + end + end + + -- Handle the compound names + if i > 1 and punct_list[i-1] == "-" then + if is_particle then -- special case "Guo-ping" + name_list[i] = "" + else + name_list[i-1] = util.rstrip(name_list[i-1]) + name_list[i] = "-" .. name_list[i] + end + end + end + + local res = util.concat(name_list, "") + res = util.strip(res) + return res + +end + +local NamePart = element.Element:new() + +function NamePart:format_name_part(name_part, context) + context = self:process_context(context) + local res = self:case(name_part, context) + res = self:format(res, context) + return res +end + +function NamePart:wrap_name_part(name_part, context) + context = self:process_context(context) + local res = self:wrap(name_part, context) + return res +end + + +local EtAl = element.Element:new() + +EtAl.default_options = { + term = "et-al", +} + +EtAl.render = function (self, context) + self:debug_info(context) + context = self:process_context(context) + local res = self:get_term(context.options["term"]):render(context) + res = self:format(res, context) + return res +end + + +local Substitute = element.Element:new() + +function Substitute:render (item, context) + self:debug_info(context) + + if context.suppressed_variables then + -- true in layout, not in sort + context.suppress_subsequent_variables = true + end + + for i, child in ipairs(self:get_children()) do + if child:is_element() then + local result = child:render(item, context) + if result and result ~= "" then + return result + end + end + end + return nil +end + + +local Names = element.Element:new() + +function Names:render (item, context) + self:debug_info(context) + context = self:process_context(context) + + local names_delimiter = context.options["names-delimiter"] + if names_delimiter then + context.options["delimiter"] = names_delimiter + end + + -- Inherit attributes of parent `names` element + local names_element = context.names_element + if names_element then + for key, value in pairs(names_element._attr) do + context.options[key] = value + end + for key, value in pairs(self._attr) do + context.options[key] = value + end + else + context.names_element = self + context.variable = context.options["variable"] + end + + local name, et_al, label + -- The position of cs:label relative to cs:name determines the order of + -- the name and label in the rendered text. + local label_position = nil + for _, child in ipairs(self:get_children()) do + if child:is_element() then + local element_name = child:get_element_name() + if element_name == "name" then + name = child + if label then + label_position = "before" + end + elseif element_name == "et-al" then + et_al = child + elseif element_name == "label" then + label = child + if name then + label_position = "after" + end + end + end + end + if label_position then + context.label_position = label_position + else + label_position = context.label_position or "after" + end + + -- local name = self:get_child("name") + if not name then + name = context.name_element + end + if not name then + name = self:create_element("name", {}, self) + Name:set_base_class(name) + end + context.name_element = name + + -- local et_al = self:get_child("et-al") + if not et_al then + et_al = context.et_al + end + if not et_al then + et_al = self:create_element("et-al", {}, self) + EtAl:set_base_class(et_al) + end + context.et_al = et_al + + -- local label = self:get_child("label") + if label then + context.label = label + else + label = context.label + end + + local sub_str = nil + if context.mode == "bibliography" and not context.sorting then + sub_str = context.options["subsequent-author-substitute"] + -- if sub_str and #context.build.preceding_first_rendered_names == 0 then + -- context.rendered_names = {} + -- else + -- sub_str = nil + -- context.rendered_names = nil + -- end + end + + local variable_names = context.options["variable"] or context.variable + local ret = nil + + if variable_names then + local output = {} + local num_names = 0 + for _, role in ipairs(util.split(variable_names)) do + local names = self:get_variable(item, role, context) + + table.insert(context.variable_attempt, names ~= nil) + + if names then + local res = name:render(names, context) + if res then + if type(res) == "number" then -- name[form="count"] + num_names = num_names + res + elseif label and not context.sorting then + -- drop name label in sorting + local label_result = label:render(role, context) + if label_result then + if label_position == "before" then + res = richtext.concat(label_result, res) + else + res = richtext.concat(res, label_result) + end + end + end + end + table.insert(output, res) + end + end + + if num_names > 0 then + ret = tostring(num_names) + else + ret = self:concat(output, context) + if ret and sub_str and context.build.first_rendered_names then + ret = self:substitute_names(ret, context) + end + end + end + + if ret then + ret = self:format(ret, context) + ret = self:wrap(ret, context) + ret = self:display(ret, context) + return ret + else + local substitute = self:get_child("substitute") + if substitute then + ret = substitute:render(item, context) + end + if ret and sub_str then + ret = self:substitute_single_field(ret, context) + end + return ret + end +end + +function Names:substitute_single_field(result, context) + if not result then + return nil + end + if context.build.first_rendered_names and #context.build.first_rendered_names == 0 then + context.build.first_rendered_names[1] = result + end + result = self:substitute_names(result, context) + return result +end + +function Names:substitute_names(result, context) + if not context.build.first_rendered_names then + return result + end + local name_strings = {} + local match_all + + if #context.build.first_rendered_names > 0 then + match_all = true + else + match_all = false + end + for i, text in ipairs(context.build.first_rendered_names) do + local str = text:render(context.engine.formatter, context) + name_strings[i] = str + if context.build.preceding_first_rendered_names and str ~= context.build.preceding_first_rendered_names[i] then + match_all = false + end + end + + if context.build.preceding_first_rendered_names then + local sub_str = context.options["subsequent-author-substitute"] + local sub_rule = context.options["subsequent-author-substitute-rule"] + + if sub_rule == "complete-all" then + if match_all then + if sub_str == "" then + result = nil + else + result.contents = {sub_str} + end + end + + elseif sub_rule == "complete-each" then + -- In-place substitution + if match_all then + for _, text in ipairs(context.build.first_rendered_names) do + text.contents = {sub_str} + end + result = self:concat(context.build.first_rendered_names, context) + end + + elseif sub_rule == "partial-each" then + for i, text in ipairs(context.build.first_rendered_names) do + if name_strings[i] == context.build.preceding_first_rendered_names[i] then + text.contents = {sub_str} + else + break + end + end + result = self:concat(context.build.first_rendered_names, context) + + elseif sub_rule == "partial-first" then + if name_strings[1] == context.build.preceding_first_rendered_names[1] then + context.build.first_rendered_names[1].contents = {sub_str} + end + result = self:concat(context.build.first_rendered_names, context) + end + end + + if #context.build.first_rendered_names > 0 then + context.build.first_rendered_names = nil + end + context.build.preceding_first_rendered_names = name_strings + return result +end + +names_module.Names = Names +names_module.Name = Name +names_module.NamePart = NamePart +names_module.EtAl = EtAl +names_module.Substitute = Substitute + +return names_module diff --git a/biblio/citation-style-language/citeproc-node-number.lua b/biblio/citation-style-language/citeproc-node-number.lua new file mode 100644 index 0000000000..e4fe710fd0 --- /dev/null +++ b/biblio/citation-style-language/citeproc-node-number.lua @@ -0,0 +1,99 @@ +local number_module = {} + +local element = require("citeproc-element") +local util = require("citeproc-util") + + +local Number = element.Element:new() + +function Number:render (item, context) + self:debug_info(context) + context = self:process_context(context) + local variable = context.options["variable"] + local content = self:get_variable(item, variable, context) + + table.insert(context.variable_attempt, content ~= nil) + + if not content then + return nil + end + + local numbers = {} + local punct_list = {} + local last_position = 1 + for number, punct, pos in string.gmatch(content, "(.-)%s*([-,&])%s*()") do + table.insert(numbers, number) + table.insert(punct_list, punct) + last_position = pos + end + table.insert(numbers, string.sub(content, last_position)) + + local res = "" + for i, number in ipairs(numbers) do + local punct = punct_list[i] + number = self:_format_single_number(number, context) + res = res .. number + + if punct == "-" then + res = res .. punct + elseif punct == "," then + res = res .. punct .. " " + elseif punct == "&" then + res = res .. " " .. punct .. " " + end + end + + res = self:case(res, context) + res = self:wrap(res, context) + res = self:display(res, context) + + return res +end + +function Number:_format_single_number(number, context) + local form = context.options["form"] or "numeric" + if form == "numeric" or not string.match(number, "^%d+$") then + return number + end + number = tonumber(number) + if form == "ordinal" or form == "long-ordinal" then + return self:_format_oridinal(number, form, context) + elseif form == "roman" then + return util.convert_roman(number) + end +end + +function Number:_format_oridinal(number, form, context) + assert(type(number) == "number") + local variable = context.options["variable"] + + if form == "long-ordinal" then + if number < 1 or number > 10 then + form = "ordinal" + end + end + + local gender = nil + local term = self:get_term(variable) + if term then + gender = term:get_attribute("gender") + end + + term = self:get_term(form, nil, number, gender) + local res = term:render(context) + if form == "ordinal" then + if res then + return tostring(number) .. res + else + res = tostring(number) + end + else + return res + end + return res +end + + +number_module.Number = Number + +return number_module diff --git a/biblio/citation-style-language/citeproc-node-sort.lua b/biblio/citation-style-language/citeproc-node-sort.lua new file mode 100644 index 0000000000..f36baccf00 --- /dev/null +++ b/biblio/citation-style-language/citeproc-node-sort.lua @@ -0,0 +1,183 @@ +local sort = {} + +local unicode = require("unicode") + +local element = require("citeproc-element") +local names = require("citeproc-node-names") +local date = require("citeproc-node-date") +local util = require("citeproc-util") + + +local Sort = element.Element:new() + +function Sort:sort (items, context) + -- key_map = { + -- id1 = {key1, key2, ...}, + -- id2 = {key1, key2, ...}, + -- ... + -- } + context.variable_attempt = {} + + local key_map = {} + local sort_directions = {} + -- true: ascending + -- false: descending + + if not Sort.collator_obj then + local lang = context.style.lang + local language = string.sub(lang, 1, 2) + -- It's 6 seconds slower to run the whole test-suite if these package + -- loading statements are put in the header. + local ducet = require("lua-uca.lua-uca-ducet") + local collator = require("lua-uca.lua-uca-collator") + local languages = require("lua-uca.lua-uca-languages") + local collator_obj = collator.new(ducet) + if languages[language] then + Sort.collator_obj = languages[language](collator_obj) + else + util.warning(string.format('Lcoale "%s" is not supported.', lang)) + end + end + + for _, item in ipairs(items) do + if not key_map[item.id] then + key_map[item.id] = {} + + context.item = item + for i, key in ipairs(self:query_selector("key")) do + if sort_directions[i] == nil then + local direction = (key:get_attribute("sort") ~= "descending") + sort_directions[i] = direction + end + local value = key:render(item, context) + table.insert(key_map[item.id], value) + end + end + end + + -- util.debug(key_map) + + local function compare_entry(item1, item2) + return self.compare_entry(key_map, sort_directions, item1, item2) + end + table.sort(items, compare_entry) + + return items +end + +function Sort.compare(value1, value2) + if type(value1) == "string" then + return Sort.compare_strings(value1, value2) + else + return value1 < value2 + end +end + +function Sort.compare_strings(str1, str2) + if Sort.collator_obj then + return Sort.collator_obj:compare_strings(str1, str2) + else + return str1 < str2 + end +end + +function Sort.compare_entry(key_map, sort_directions, item1, item2) + for i, value1 in ipairs(key_map[item1.id]) do + local ascending = sort_directions[i] + local value2 = key_map[item2.id][i] + if value1 and value2 then + local res + if ascending then + res = Sort.compare(value1, value2) + else + res = Sort.compare(value2, value1) + end + if res or value1 ~= value2 then + return res + end + elseif value1 then + return true + elseif value2 then + return false + end + end +end + +local Key = element.Element:new() + +function Key:render (item, context) + context = self:process_context(context) + context.options["name-as-sort-order"] = "all" + context.sorting = true + local variable = self:get_attribute("variable") + local res = nil + if variable then + context.variable = variable + local variable_type = util.variable_types[variable] + if variable_type == "name" then + res = self:_render_name(item, context) + elseif variable_type == "date" then + res = self:_render_date(item, context) + elseif variable_type == "number" then + res = item[variable] + else + res = item[variable] + end + else + local macro = self:get_attribute("macro") + if macro then + res = self:get_macro(macro):render(item, context) + end + end + if res == nil then + res = false + elseif type(res) == "table" and res._type == "RichText" then + res = res:render(nil, context) + end + if type(res) == "string" then + res = self._normalize_string(res) + end + return res +end + +function Key:_render_name (item, context) + if not self.names then + self.names = self:create_element("names", {}, self) + names.Names:set_base_class(self.names) + self.names:set_attribute("variable", context.options["variable"]) + self.names:set_attribute("form", "long") + end + local res = self.names:render(item, context) + return res +end + +function Key:_render_date (item, context) + if not self.date then + self.date = self:create_element("date", {}, self) + date.Date:set_base_class(self.date) + self.date:set_attribute("variable", context.options["variable"]) + self.date:set_attribute("form", "numeric") + end + local res = self.date:render(item, context) + return res +end +function Key._normalize_string(str) + str = unicode.utf8.lower(str) + str = string.gsub(str, "[%[%]]", "") + local words = {} + for _, word in ipairs(util.split(str, " ")) do + -- TODO: strip leading prepositions + -- remove leading apostrophe on name particle + word = string.gsub(word, "^" .. util.unicode["apostrophe"], "") + table.insert(words, word) + end + str = table.concat(words, " ") + str = string.gsub(str, util.unicode["apostrophe"], "'") + return str +end + + +sort.Sort = Sort +sort.Key = Key + +return sort diff --git a/biblio/citation-style-language/citeproc-node-style.lua b/biblio/citation-style-language/citeproc-node-style.lua new file mode 100644 index 0000000000..b8386c47e7 --- /dev/null +++ b/biblio/citation-style-language/citeproc-node-style.lua @@ -0,0 +1,193 @@ +local style = {} + +local element = require("citeproc-element") +local util = require("citeproc-util") + + +local Style = element.Element:new() + +Style.default_options = { + ["initialize-with-hyphen"] = true, + ["page-range-format"] = nil, + ["demote-non-dropping-particle"] = "display-and-sort", +} + +function Style:set_lang(lang, force_lang) + local default_locale = self:get_attribute("default-locale") + if lang then + if default_locale and not force_lang then + self.lang = default_locale + end + else + self.lang = default_locale or "en-US" + end +end + +function Style:render_citation (items, context) + self:debug_info(context) + context = self:process_context(context) + context.style = self + local citation = self:get_child("citation") + return citation:render(items, context) +end + +function Style:render_biblography (items, context) + self:debug_info(context) + context = self:process_context(context) + context.style = self + local bibliography = self:get_child("bibliography") + return bibliography:render(items, context) +end + +function Style:get_version () + return self:get_attribute("version") +end + +function Style:get_locales() + if not self.locale_dict then + self.locale_dict = {} + end + local locales = self.locale_dict[self.lang] + if not locales then + locales = self:get_locale_list(self.lang) + self.locale_dict[self.lang] = locales + end + return locales +end + +function Style:get_locale_list (lang) + assert(lang ~= nil) + local language = string.sub(lang, 1, 2) + local primary_dialect = util.primary_dialects[language] + if not primary_dialect then + -- util.warning(string.format("Failed to find primary dialect of \"%s\"", language)) + end + local locale_list = {} + + -- 1. In-style cs:locale elements + -- i. `xml:lang` set to chosen dialect, “de-AT” + if lang == language then + lang = primary_dialect + end + table.insert(locale_list, self:get_in_style_locale(lang)) + + -- ii. `xml:lang` set to matching language, “de” (German) + if language and language ~= lang then + table.insert(locale_list, self:get_in_style_locale(language)) + end + + -- iii. `xml:lang` not set + table.insert(locale_list, self:get_in_style_locale(nil)) + + -- 2. Locale files + -- iv. `xml:lang` set to chosen dialect, “de-AT” + if lang then + table.insert(locale_list, self:get_engine():get_system_locale(lang)) + end + + -- v. `xml:lang` set to matching primary dialect, “de-DE” (Standard German) + -- (only applicable when the chosen locale is a secondary dialect) + if primary_dialect and primary_dialect ~= lang then + table.insert(locale_list, self:get_engine():get_system_locale(primary_dialect)) + end + + -- vi. `xml:lang` set to “en-US” (American English) + if lang ~= "en-US" and primary_dialect ~= "en-US" then + table.insert(locale_list, self:get_engine():get_system_locale("en-US")) + end + + return locale_list +end + +function Style:get_in_style_locale (lang) + for _, locale in ipairs(self:query_selector("locale")) do + if locale:get_attribute("xml:lang") == lang then + return locale + end + end + return nil +end + +function Style:get_term (...) + for _, locale in ipairs(self:get_locales()) do + local res = locale:get_term(...) + if res then + return res + end + end + return nil +end + + +local Citation = element.Element:new() + +function Citation:render (items, context) + self:debug_info(context) + context = self:process_context(context) + + context.mode = "citation" + context.citation = self + + local sort = self:get_child("sort") + if sort then + sort:sort(items, context) + end + + local layout = self:get_child("layout") + return layout:render(items, context) +end + + +local Bibliography = element.Element:new() + +Bibliography.default_options = { + ["hanging-indent"] = false, + ["second-field-align"] = nil, + ["line-spacing"] = 1, + ["entry-spacing"] = 1, + ["subsequent-author-substitute"] = nil, + ["subsequent-author-substitute-rule"] = "complete-all", +} + +function Bibliography:render (items, context) + self:debug_info(context) + context = self:process_context(context) + -- util.debug(context) + + context.mode = "bibliography" + context.bibliography = self + + -- Already sorted in CiteProc:sort_bibliography() + + local layout = self:get_child("layout") + local res = layout:render(items, context) + + local params = res[1] + + params.entryspacing = context.options["entry-spacing"] + params.linespacing = context.options["line-spacing"] + params.hangingindent = context.options["hanging-indent"] + params["second-field-align"] = context.options["second-field-align"] + for _, key in ipairs({"bibstart", "bibend"}) do + local value = context.engine.formatter[key] + if type(value) == "function" then + value = value(context) + end + params[key] = value + end + + params.bibliography_errors = {} + params.entry_ids = {} + for _, item in ipairs(items) do + table.insert(params.entry_ids, item.id) + end + + return res +end + +style.Style = Style +style.Citation = Citation +style.Bibliography = Bibliography + + +return style diff --git a/biblio/citation-style-language/citeproc-node-text.lua b/biblio/citation-style-language/citeproc-node-text.lua new file mode 100644 index 0000000000..55dd13e295 --- /dev/null +++ b/biblio/citation-style-language/citeproc-node-text.lua @@ -0,0 +1,217 @@ +local text = {} + +local element = require("citeproc-element") +local richtext = require("citeproc-richtext") +local util = require("citeproc-util") + + +local Text = element.Element:new() + +function Text:render (item, context) + self:debug_info(context) + context = self:process_context(context) + + local res = nil + + local variable = nil + local variable_name = self:get_attribute("variable") + if variable_name then + local form = self:get_attribute("form") + if form == "short" then + variable = self:get_variable(item, variable_name .. "-" .. form, context) + end + if not variable then + variable = self:get_variable(item, variable_name, context) + end + if variable then + res = variable + if type(res) == "number" then + res = tostring(res) + end + if variable_name == "page" or variable_name == "locator" then + res = util.lstrip(res) + res = self:_format_page(res, context) + end + end + + table.insert(context.variable_attempt, res ~= nil) + end + + local macro_name = self:get_attribute("macro") + if macro_name then + local macro = self:get_macro(macro_name) + res = macro:render(item, context) + end + + local term_name = self:get_attribute("term") + if term_name then + local form = self:get_attribute("form") + + local term = self:get_term(term_name, form) + if term then + res = term:render(context) + end + end + + local value = self:get_attribute("value") + if value then + res = value + res = self:escape(res) + end + + if type(res) == "string" and res ~= "" then + res = richtext.new(res) + end + + res = self:strip_periods(res, context) + res = self:case(res, context) + res = self:format(res, context) + res = self:quote(res, context) + res = self:wrap(res, context) + res = self:display(res, context) + + if variable_name == "citation-number" then + res = self:_process_citation_number(variable, res, context) + end + + return res +end + + +function Text:_process_citation_number(citation_number, res, context) + if context.mode == "citation" and not context.sorting and context.options["collapse"] == "citation-number" then + context.build.item_citation_numbers[context.item.id] = citation_number + if type(res) == "string" then + res = richtext.new(res) + end + table.insert(context.build.item_citation_number_text, res) + end + return res +end + + +function Text:_format_page (page, context) + local res = nil + + local page_range_delimiter = self:get_term("page-range-delimiter"):render(context) or util.unicode["en dash"] + local page_range_format = context.options["page-range-format"] + if page_range_format == "chicago" then + if self:get_style():get_version() >= "1.1" then + page_range_format = "chicago-16" + else + page_range_format = "chicago-15" + end + end + + local last_position = 1 + local page_parts = {} + local punct_list = {} + for part, punct, pos in string.gmatch(page, "(.-)%s*([,&])%s*()") do + table.insert(page_parts, part) + table.insert(punct_list, punct) + last_position = pos + end + table.insert(page_parts, string.sub(page, last_position)) + + res = "" + for i, part in ipairs(page_parts) do + res = res .. self:_format_range(part, page_range_format, page_range_delimiter) + local punct = punct_list[i] + if punct then + if punct == "&" then + res = res .. " " .. punct .. " " + else + res = res .. punct .. " " + end + end + end + res = self:escape(res) + return res +end + +function Text:_format_range (str, format, range_delimiter) + local start, delimiter, stop = string.match(str, "(%w+)%s*(%-+)%s*(%S*)") + if not stop or stop == "" then + return string.gsub(str, "\\%-", "-") + end + + + local start_prefix, start_num = string.match(start, "(.-)(%d*)$") + local stop_prefix, stop_num = string.match(stop, "(.-)(%d*)$") + + if start_prefix ~= stop_prefix then + -- Not valid range: "n11564-1568" -> "n11564-1568" + -- 110-N6 + -- N110-P5 + return start .. delimiter .. stop + end + + if format == "chicago-16" then + stop = self:_format_range_chicago_16(start_num, stop_num) + elseif format == "chicago-15" then + stop = self:_format_range_chicago_15(start_num, stop_num) + elseif format == "expanded" then + stop = stop_prefix .. self:_format_range_expanded(start_num, stop_num) + elseif format == "minimal" then + stop = self:_format_range_minimal(start_num, stop_num) + elseif format == "minimal-two" then + stop = self:_format_range_minimal(start_num, stop_num, 2) + end + + return start .. range_delimiter .. stop +end + +function Text:_format_range_chicago_16(start, stop) + if #start < 3 or string.sub(start, -2) == "00" then + return self:_format_range_expanded(start, stop) + elseif string.sub(start, -2, -2) == "0" then + return self:_format_range_minimal(start, stop) + else + return self:_format_range_minimal(start, stop, 2) + end + return stop +end + +function Text:_format_range_chicago_15(start, stop) + if #start < 3 or string.sub(start, -2) == "00" then + return self:_format_range_expanded(start, stop) + else + local changed_digits = self:_format_range_minimal(start, stop) + if string.sub(start, -2, -2) == "0" then + return changed_digits + elseif #start == 4 and #changed_digits == 3 then + return self:_format_range_expanded(start, stop) + else + return self:_format_range_minimal(start, stop, 2) + end + end + return stop +end + +function Text:_format_range_expanded(start, stop) + -- Expand "1234–56" -> "1234–1256" + if #start <= #stop then + return stop + end + return string.sub(start, 1, #start - #stop) .. stop +end + +function Text:_format_range_minimal(start, stop, threshold) + threshold = threshold or 1 + if #start < #stop then + return stop + end + local offset = #start - #stop + for i = 1, #stop - threshold do + local j = i + offset + if string.sub(stop, i, i) ~= string.sub(start, j, j) then + return string.sub(stop, i) + end + end + return string.sub(stop, -threshold) +end + + +text.Text = Text + +return text diff --git a/biblio/citation-style-language/citeproc-nodes.lua b/biblio/citation-style-language/citeproc-nodes.lua new file mode 100644 index 0000000000..255d170bc9 --- /dev/null +++ b/biblio/citation-style-language/citeproc-nodes.lua @@ -0,0 +1,44 @@ +--[[ + Copyright (C) 2021 Zeping Lee +--]] + + +local style = require("citeproc-node-style") +local locale = require("citeproc-node-locale") +local layout = require("citeproc-node-layout") +local text = require("citeproc-node-text") +local date = require("citeproc-node-date") +local number = require("citeproc-node-number") +local names = require("citeproc-node-names") +local label = require("citeproc-node-label") +local group = require("citeproc-node-group") +local choose = require("citeproc-node-choose") +local sort = require("citeproc-node-sort") + +local nodes = { + ["style"] = style.Style, + ["citation"] = style.Citation, + ["bibliography"] = style.Bibliography, + ["locale"] = locale.Locale, + ["term"] = locale.Term, + ["layout"] = layout.Layout, + ["text"] = text.Text, + ["date"] = date.Date, + ["date-part"] = date.DatePart, + ["number"] = number.Number, + ["names"] = names.Names, + ["name"] = names.Name, + ["name-part"] = names.NamePart, + ["et-al"] = names.EtAl, + ["substitute"] = names.Substitute, + ["label"] = label.Label, + ["group"] = group.Group, + ["choose"] = choose.Choose, + ["if"] = choose.If, + ["else"] = choose.Else, + ["else-if"] = choose.ElseIf, + ["sort"] = sort.Sort, + ["key"] = sort.Key, +} + +return nodes diff --git a/biblio/citation-style-language/citeproc-richtext.lua b/biblio/citation-style-language/citeproc-richtext.lua new file mode 100644 index 0000000000..50f78a4466 --- /dev/null +++ b/biblio/citation-style-language/citeproc-richtext.lua @@ -0,0 +1,777 @@ +--[[ + Copyright (C) 2021 Zeping Lee +--]] + +local richtext = {} + +local unicode = require("unicode") + +local util = require("citeproc-util") + + +local RichText = { + contents = nil, + formats = nil, + _type = "RichText", +} + +function RichText:shallow_copy() + local res = richtext.new() + for _, text in ipairs(self.contents) do + table.insert(res.contents, text) + end + for key, value in pairs(self.formats) do + res.formats[key] = value + end + return res +end + +function RichText:render(formatter, context, punctuation_in_quote) + self:merge_punctuations() + + if punctuation_in_quote == nil and context then + punctuation_in_quote = context.style:get_locale_option("punctuation-in-quote") + end + if punctuation_in_quote then + self:move_punctuation_in_quote() + end + + self:change_case() + + self:flip_flop() + + self:clean_formats() + + return self:_render(formatter, context) +end + +function RichText:_render(formatter, context) + local res = "" + for _, text in ipairs(self.contents) do + local str + if type(text) == "string" then + if formatter and formatter.text_escape then + str = formatter.text_escape(text) + else + str = text + end + else -- RichText + str = text:_render(formatter, context) + end + -- Remove leading spaces + if string.sub(res, -1) == " " and string.sub(str, 1, 1) == " " then + str = string.gsub(str, "^%s+", "") + end + res = res .. str + end + for _, attr in ipairs(richtext.format_sequence) do + local value = self.formats[attr] + if value then + local key = string.format("@%s/%s", attr, value) + if formatter then + local format = formatter[key] + if type(format) == "string" then + res = string.format(format, res) + elseif type(format) == "function" then + res = format(res, context) + end + end + end + end + return res +end + +function RichText:merge_punctuations(contents, index) + for i, text in ipairs(self.contents) do + if text._type == "RichText" then + contents, index = text:merge_punctuations(contents, index) + elseif type(text) == "string" then + if contents and index then + local previous_string = contents[index] + local last_char = string.sub(previous_string, -1) + local right_punct_map = richtext.punctuation_map[last_char] + if right_punct_map then + local first_char = string.sub(text, 1, 1) + local new_punctuations = nil + if first_char == last_char then + new_punctuations = last_char + elseif contents == self.contents then + new_punctuations = right_punct_map[first_char] + end + if new_punctuations then + if #text == 1 then + table.remove(self.contents, i) + else + self.contents[i] = string.sub(text, 2) + end + contents[index] = string.sub(previous_string, 1, -2) .. new_punctuations + end + end + end + contents = self.contents + index = i + end + end + return contents, index +end + +function RichText:move_punctuation_in_quote() + local i = 1 + while i <= #self.contents do + local text = self.contents[i] + if type(text) == "table" and text._type == "RichText" then + text:move_punctuation_in_quote() + + if text.formats["quotes"] then + local contents = self.contents + local last_string = text + while type(last_string) == "table" and last_string._type == "RichText" do + contents = last_string.contents + last_string = contents[#contents] + end + + local done = false + while not done do + done = true + last_string = contents[#contents] + local last_char = string.sub(last_string, -1) + if i < #self.contents then + local next_text = self.contents[i + 1] + if type(next_text) == "string" then + local first_char = string.sub(next_text, 1, 1) + if richtext.in_quote_punctuations[first_char] then + done = false + local right_punct_map = richtext.punctuation_map[last_char] + if right_punct_map then + first_char = right_punct_map[first_char] + last_string = string.sub(last_string, 1, -2) + end + contents[#contents] = last_string .. first_char + if #next_text == 1 then + table.remove(self.contents, i + 1) + else + self.contents[i + 1] = string.sub(next_text, 2) + end + end + end + end + end + end + end + i = i + 1 + end +end + +function RichText:change_case() + for _, text in ipairs(self.contents) do + if type(text) == "table" and text._type == "RichText" then + text:change_case() + end + end + local text_case = self.formats["text-case"] + if text_case then + if text_case == "lowercase" then + self:lowercase() + elseif text_case == "uppercase" then + self:uppercase() + elseif text_case == "capitalize-first" then + self:capitalize_first() + elseif text_case == "capitalize-all" then + self:capitalize_all() + elseif text_case == "sentence" then + self:sentence() + elseif text_case == "title" then + self:title() + end + end +end + +function RichText:_change_word_case(state, word_transform, first_tranform, is_phrase) + if self.formats["text-case"] == "nocase" then + return + end + if is_phrase and (self.formats["vertical-align"] == "sup" or + self.formats["vertical-align"] == "sub" or + self.formats["font-variant"] == "small-caps") then + return + end + state = state or "after-sentence" + word_transform = word_transform or function (x) return x end + first_tranform = first_tranform or word_transform + for i, text in ipairs(self.contents) do + if type(text) == "string" then + + local res = "" + local word_seps = { + " ", + "%-", + "/", + util.unicode["no-break space"], + util.unicode["en dash"], + util.unicode["em dash"], + } + for _, tuple in ipairs(util.split(text, word_seps, nil, true)) do + local word, punctuation = table.unpack(tuple) + if state == "after-sentence" then + res = res .. first_tranform(word) + if string.match(word, "%w") then + state = "after-word" + end + else + res = res .. word_transform(word, punctuation) + end + res = res .. punctuation + if string.match(word, "[.!?:]%s*$") then + state = "after-sentence" + end + end + + -- local word_index = 0 + -- local res = string.gsub(text, "%w+", function (word) + -- word_index = word_index + 1 + -- if word_index == 1 then + -- return first_tranform(word) + -- else + -- return word_transform(word) + -- end + -- end) + -- if string.match(res, "[.!?:]%s*$") then + -- state = "after-sentence" + -- end + + self.contents[i] = res + else + state = text:_change_word_case(state, word_transform, first_tranform, true) + end + end + return state +end + +function RichText:lowercase() + local word_transform = unicode.utf8.lower + self:_change_word_case("after-sentence", word_transform) +end + +function RichText:uppercase() + local word_transform = unicode.utf8.upper + self:_change_word_case("after-sentence", word_transform) +end + +local function capitalize(str) + local res = string.gsub(str, utf8.charpattern, unicode.utf8.upper, 1) + return res +end + +local function capitalize_if_lower(word) + if util.is_lower(word) then + return capitalize(word) + else + return word + end +end + +function RichText:capitalize_first(state) + local first_tranform = capitalize_if_lower + self:_change_word_case("after-sentence", nil, first_tranform) +end + +function RichText:capitalize_all() + local word_transform = capitalize_if_lower + self:_change_word_case("after-sentence", word_transform) +end + +function RichText:is_upper() + for _, text in ipairs(self.contents) do + if type(text) == "string" then + if not util.is_upper(text) then + return false + end + else + local res = text:is_upper() + if not res then + return false + end + end + end + return true +end + +function RichText:sentence() + if self:is_upper() then + local first_tranform = function(word) + return capitalize(unicode.utf8.lower(word)) + end + local word_transform = unicode.utf8.lower + self:_change_word_case("after-sentence", word_transform, first_tranform) + else + local first_tranform = capitalize_if_lower + self:_change_word_case("after-sentence", nil, first_tranform) + end +end + +function RichText:title() + if self:is_upper() then + local first_tranform = function(word) + return capitalize(unicode.utf8.lower(word)) + end + local word_transform = function(word, sep) + local res = unicode.utf8.lower(word) + if not util.stop_words[res] then + res = capitalize(res) + end + return res + end + self:_change_word_case("after-sentence", word_transform, first_tranform) + else + local first_tranform = capitalize_if_lower + local word_transform = function(word, sep) + local lower = unicode.utf8.lower(word) + -- Stop word before hyphen is treated as a normal word. + if util.stop_words[lower] and sep ~= "-" then + return lower + elseif word == lower then + return capitalize(word) + else + return word + end + end + self:_change_word_case("after-sentence", word_transform, first_tranform) + end +end + +function richtext.concat(str1, str2) + assert(str1 and str2) + + if type(str1) == "string" then + str1 = richtext.new(str1) + end + + local res + if next(str1.formats) == nil or str2 == "" then + -- shallow copy + res = str1 + else + res = richtext.new() + res.contents = {str1} + end + + if str2._type == "RichText" then + if next(str2.formats) == nil then + for _, text in ipairs(str2.contents) do + table.insert(res.contents, text) + end + else + table.insert(res.contents, str2) + end + elseif str2 ~= "" then + table.insert(res.contents, str2) + end + return res +end + +function richtext.concat_list(list, delimiter) + -- Strings in the list may be nil thus ipairs() should be avoided. + -- The delimiter may be nil. + local res = nil + for i = 1, #list do + local text = list[i] + if text and text ~= "" then + if res then + if delimiter and delimiter ~= "" then + res = richtext.concat(res, delimiter) + end + res = richtext.concat(res, text) + else + if type(text) == "string" then + text = richtext.new(text) + end + res = text + end + end + end + return res +end + +function RichText:strip_periods() + local last_string = self + local contents = self.contents + while last_string._type == "RichText" do + contents = last_string.contents + last_string = contents[#contents] + end + if string.sub(last_string, -1) == "." then + contents[#contents] = string.sub(last_string, 1, -2) + end +end + +function RichText:add_format(attr, value) + self.formats[attr] = value +end + +function RichText:flip_flop(attr, value) + if not attr then + for attr, _ in pairs(richtext.flip_flop_formats) do + self:flip_flop(attr) + end + return + end + + local default_value = richtext.default_formats[attr] + + if value and value ~= default_value and self.formats[attr] == value then + self.formats[attr] = richtext.flip_flop_values[attr][value] + end + if self.formats[attr] then + value = self.formats[attr] + end + + for _, text in ipairs(self.contents) do + if type(text) == "table" and text._type == "RichText" then + text:flip_flop(attr, value) + end + end +end + +function RichText:clean_formats(format) + -- Remove the formats that are default values + if not format then + for format, _ in pairs(richtext.default_formats) do + self:clean_formats(format) + end + return + end + if self.formats[format] then + if self.formats[format] == richtext.default_formats[format] then + self.formats[format] = nil + else + return + end + end + for _, text in ipairs(self.contents) do + if type(text) == "table" and text._type == "RichText" then + text:clean_formats(format) + end + end +end + +local RichText_mt = { + __index = RichText, + __concat = richtext.concat, +} + +local function table_update(t, new_t) + for key, value in pairs(new_t) do + t[key] = value + end + return t +end + +function RichText._split_tags(str) + -- Normalize markup + str = string.gsub(str, '', '') + str = string.gsub(str, '', '') + str = string.gsub(str, '', '') + + local strings = {} + + local start_index = 1 + local i = 1 + + while i <= #str do + local substr = string.sub(str, i) + local starts_with_tag = false + for tag, _ in pairs(richtext.tags) do + if util.startswith(substr, tag) then + if start_index <= i - 1 then + table.insert(strings, string.sub(str, start_index, i-1)) + end + table.insert(strings, tag) + i = i + #tag + start_index = i + starts_with_tag = true + break + end + end + if not starts_with_tag then + i = i + 1 + end + end + if start_index <= #str then + table.insert(strings, string.sub(str, start_index)) + end + + for i = 1, #strings do + str = strings[i] + if str == "'" or str == util.unicode["apostrophe"] then + local previous_str = strings[i - 1] + local next_str = strings[i + 1] + if previous_str and next_str then + local previous_code_point = nil + for _, code_point in utf8.codes(previous_str) do + previous_code_point = code_point + end + local next_code_point = utf8.codepoint(next_str) + if util.is_romanesque(previous_code_point) and util.is_romanesque(next_code_point) then + -- An apostrophe + strings[i-1] = strings[i-1] .. util.unicode["apostrophe"] .. strings[i+1] + table.remove(strings, i+1) + table.remove(strings, i) + end + end + end + end + + return strings +end + +function richtext.new(text, formats) + local res = { + contents = {}, + formats = formats or {}, + } + + setmetatable(res, RichText_mt) + + if not text then + return res + end + + if type(text) == "string" then + + local strings = RichText._split_tags(text) + local contents = {} + for _, str in ipairs(strings) do + table.insert(contents, str) + + local end_tag = nil + if str == '"' then + local last_text = contents[#contents - 1] + if last_text and type(last_text) == "string" and string.match(last_text, "%s$") then + end_tag = nil + else + end_tag = str + end + elseif richtext.end_tags[str] then + end_tag = str + end + + if end_tag then + for i = #contents - 1, 1, -1 do + local start_tag = contents[i] + if type(start_tag) == "string" and richtext.tag_pairs[start_tag] == end_tag then + local subtext = richtext.new() + -- subtext.contents = util.slice(contents, i + 1, #contents - 1) + if start_tag == "'" and end_tag == "'" and i == #contents - 1 then + contents[i] = util.unicode["apostrophe"] + contents[#contents] = util.unicode["apostrophe"] + break + end + + for j = i + 1, #contents - 1 do + local substr = contents[j] + if substr == "'" then + substr = util.unicode["apostrophe"] + end + local last_text = subtext.contents[#subtext.contents] + if type(substr) == "string" and type(last_text) == "string" then + subtext.contents[#subtext.contents] = last_text .. substr + else + table.insert(subtext.contents, substr) + end + end + + if start_tag == '' then + for attr, value in pairs(richtext.default_formats) do + subtext.formats[attr] = value + end + subtext.formats["text-case"] = "nocase" + else + for attr, value in pairs(richtext.tag_formats[start_tag]) do + subtext.formats[attr] = value + end + end + + for j = #contents, i, -1 do + table.remove(contents, j) + end + table.insert(contents, subtext) + break + end + end + end + end + + for i = #contents, 1, -1 do + if contents[i] == "'" then + contents[i] = util.unicode["apostrophe"] + end + if type(contents[i]) == "string" and type(contents[i+1]) == "string" then + contents[i] = contents[i] .. contents[i+1] + table.remove(contents, i+1) + end + end + + if #contents == 1 and type(contents[1]) == "table" then + res = contents[1] + else + res.contents = contents + end + + return res + + elseif type(text) == "table" and text._type == "RichText" then + return text + + elseif type(text) == "table" then + return text + end + return nil +end + +richtext.tag_formats = { + [""] = {["font-style"] = "italic"}, + [""] = {["font-weight"] = "bold"}, + [""] = {["vertical-align"] = "sup"}, + [""] = {["vertical-align"] = "sub"}, + [""] = {["font-variant"] = "small-caps"}, + [''] = {["font-variant"] = "small-caps"}, + [''] = {["text-case"] = "nocase"}, + ['"'] = {["quotes"] = "true"}, + [util.unicode['left double quotation mark']] = {["quotes"] = "true"}, + ["'"] = {["quotes"] = "true"}, + [util.unicode['left single quotation mark']] = {["quotes"] = "true"}, +} + +richtext.default_formats = { + ["URL"] = "false", + ["DOI"] = "false", + ["PMID"] = "false", + ["PMCID"] = "false", + ["font-style"] = "normal", + ["font-variant"] = "normal", + ["font-weight"] = "normal", + ["text-decoration"] = "none", + ["vertical-align"] = "baseline", + ["quotes"] = "false", +} + +richtext.format_sequence = { + "URL", + "DOI", + "PMID", + "PMCID", + "font-style", + "font-variant", + "font-weight", + "text-decoration", + "vertical-align", + "quotes", + "display", +} + +richtext.flip_flop_formats = { + ["font-style"] = true, + ["font-weight"] = true, + ["font-variant"] = true, + ["quotes"] = true, +} + +richtext.flip_flop_values = { + ["font-style"] = { + italic = "normal", + normal = "italic", + }, + ["font-weight"] = { + bold = "normal", + normal = "bold", + }, + ["font-variant"] = { + ["small-caps"] = "normal", + normal = "small-caps", + }, + ["quotes"] = { + ["true"] = "inner", + inner = "true", + }, +} + +-- https://github.com/Juris-M/citeproc-js/blob/aa2683f48fe23be459f4ed3be3960e2bb56203f0/src/queue.js#L724 +-- Also merge duplicate punctuations. +richtext.punctuation_map = { + ["!"] = { + ["."] = "!", + ["?"] = "!?", + [":"] = "!", + [","] = "!,", + [";"] = "!;", + }, + ["?"] = { + ["!"] = "?!", + ["."] = "?", + [":"] = "?", + [","] = "?,", + [";"] = "?;", + }, + ["."] = { + ["!"] = ".!", + ["?"] = ".?", + [":"] = ".:", + [","] = ".,", + [";"] = ".;", + }, + [":"] = { + ["!"] = "!", + ["?"] = "?", + ["."] = ":", + [","] = ":,", + [";"] = ":;", + }, + [","] = { + ["!"] = ",!", + ["?"] = ",?", + [":"] = ",:", + ["."] = ",.", + [";"] = ",;", + }, + [";"] = { + ["!"] = "!", + ["?"] = "?", + [":"] = ";", + [","] = ";,", + ["."] = ";", + } +} + +richtext.in_quote_punctuations = { + [","] = true, + ["."] = true, + ["?"] = true, + ["!"] = true, +} + +richtext.tag_pairs = { + [""] = "", + [""] = "", + [""] = "", + [""] = "", + [""] = "", + [''] = "", + [''] = "", + [''] = "", + ['"'] = '"', + [util.unicode['left double quotation mark']] = util.unicode['right double quotation mark'], + ["'"] = "'", + [util.unicode['left single quotation mark']] = util.unicode['right single quotation mark'], +} + +richtext.tags = {} + +richtext.end_tags = {} + +for start_tag, end_tag in pairs(richtext.tag_pairs) do + richtext.tags[start_tag] = true + richtext.tags[end_tag] = true + richtext.end_tags[end_tag] = true +end + +return richtext diff --git a/biblio/citation-style-language/citeproc-util.lua b/biblio/citation-style-language/citeproc-util.lua new file mode 100644 index 0000000000..9aaa077874 --- /dev/null +++ b/biblio/citation-style-language/citeproc-util.lua @@ -0,0 +1,794 @@ +--[[ + Copyright (C) 2021 Zeping Lee +--]] + +-- load `slnunicode` from LuaTeX +local unicode = require("unicode") +local inspect = require("inspect") + + +local util = {} + +function util.to_ordinal (n) + assert(type(n) == "number") + local last_digit = n % 10 + if last_digit == 1 and n ~= 11 + then return tostring(n) .. "st" + elseif last_digit == 2 and n ~= 12 + then return tostring(n) .. "nd" + elseif last_digit == 3 and n ~= 13 + then return tostring(n) .. "rd" + else + return tostring(n) .. "th" + end +end + + +function util.error(message) + if luatexbase then + luatexbase.module_error("citeproc", message) + else + error(message, 2) + end +end + +util.warning_enabled = true + +function util.warning(message) + if luatexbase then + luatexbase.module_warning("citeproc", message) + elseif util.warning_enabled then + io.stderr:write(message, "\n") + end +end + +local function remove_all_metatables(item, path) + if path[#path] ~= inspect.METATABLE then return item end +end + +function util.debug(...) + -- io.stderr:write(inspect(..., {process = remove_all_metatables})) + io.stderr:write(inspect(...)) + io.stderr:write("\n") +end + +-- Similar to re.split() in Python +function util.split(str, seps, maxsplit, include_sep) + if not str then + error("Invalid string.") + end + seps = seps or "%s+" + if seps == "" then + error("Empty separator") + end + if type(seps) == "string" then + seps = {seps} + end + + local splits = {} + for _, sep_pattern in ipairs(seps) do + for start, sep, stop in string.gmatch(str, "()(" .. sep_pattern .. ")()") do + table.insert(splits, {start, sep, stop}) + end + end + + if #seps > 1 then + table.sort(splits, function(a, b) return a[1] < b[1] end) + end + + local res = {} + local previous = 1 + for _, sep_tuple in ipairs(splits) do + local start, sep, stop = table.unpack(sep_tuple) + local item = string.sub(str, previous, start - 1) + if include_sep then + item = {item, sep} + end + table.insert(res, item) + previous = stop + end + local item = string.sub(str, previous, #str) + if include_sep then + item = {item, ""} + end + table.insert(res, item) + return res +end + +function util.slice (t, start, stop) + start = start or 1 + stop = stop or #t + if start < 0 then + start = start + #t + 1 + end + if stop < 0 then + stop = stop + #t + 1 + end + local new = {} + for i, item in ipairs(t) do + if i >= start and i <= stop then + table.insert(new, item) + end + end + return new +end + +function util.concat (list, sep) + -- This helper function omits empty strings in list, which is different from table.concat + -- This function always returns a string, even empty. + local res = "" + for i = 1, #list do + local s = list[i] + if s and s~= "" then + if res == "" then + res = s + else + res = res .. sep .. s + end + end + end + return res +end + +function util.lstrip (str) + if not str then + return nil + end + local res = string.gsub(str, "^%s+", "") + return res +end + +function util.rstrip (str) + if not str then + return nil + end + local res = string.gsub(str, "%s+$", "") + return res +end + +function util.strip (str) + return util.lstrip(util.rstrip(str)) +end + +function util.startswith (str, prefix) + return string.sub(str, 1, #prefix) == prefix +end + +function util.endswith (str, suffix) + return string.sub(str, -#suffix) == suffix +end + +function util.is_numeric (str) + if str == nil or str == "" then + return false + end + local res = true + for w in string.gmatch(str, "%w+") do + if string.match(w, "^[a-zA-Z]*%d+[a-zA-Z]*$") == nil then + res = false + break + end + end + for w in string.gmatch(str, "%W+") do + if string.match(w, "^%s*[,&-]+%s*$") == nil then + res = false + break + end + end + return res +end + +function util.is_uncertain_date (variable) + if variable == nil then + return false + end + local value = variable["circa"] + return value ~= nil and value ~= "" +end + +util.variable_types = {} + +-- schema/schemas/styles/csl-variables.rnc +util.variables = {} + +-- Date variables +util.variables.date = { + "accessed", + "available-date", + "event-date", + "issued", + "original-date", + "submitted", +} + +-- Name variables +util.variables.name = { + "author", + "chair", + "collection-editor", + "compiler", + "composer", + "container-author", + "contributor", + "curator", + "director", + "editor", + "editor-translator", + "editorial-director", + "executive-producer", + "guest", + "host", + "illustrator", + "interviewer", + "narrator", + "organizer", + "original-author", + "performer", + "producer", + "recipient", + "reviewed-author", + "script-writer", + "series-creator", + "translator", +} + +-- Number variables +util.variables.number = { + "chapter-number", + "citation-number", + "collection-number", + "edition", + "first-reference-note-number", + "issue", + "locator", + "number", + "number-of-pages", + "number-of-volumes", + "page", + "page-first", + "part-number", + "printing-number", + "section", + "supplement-number", + "version", + "volume", +} + +util.variable_types = {} + +for type, variables in pairs(util.variables) do + for _, variable in ipairs(variables) do + util.variable_types[variable] = type + end +end + +util.primary_dialects = { + af= "af-ZA", + ar= "ar", + bg= "bg-BG", + ca= "ca-AD", + cs= "cs-CZ", + cy= "cy-GB", + da= "da-DK", + de= "de-DE", + el= "el-GR", + en= "en-US", + es= "es-ES", + et= "et-EE", + eu= "eu", + fa= "fa-IR", + fi= "fi-FI", + fr= "fr-FR", + he= "he-IL", + hi= "hi-IN", + hr= "hr-HR", + hu= "hu-HU", + id= "id-ID", + is= "is-IS", + it= "it-IT", + ja= "ja-JP", + km= "km-KH", + ko= "ko-KR", + la= "la", + lt= "lt-LT", + lv= "lv-LV", + mn= "mn-MN", + nb= "nb-NO", + nl= "nl-NL", + nn= "nn-NO", + pl= "pl-PL", + pt= "pt-PT", + ro= "ro-RO", + ru= "ru-RU", + sk= "sk-SK", + sl= "sl-SI", + sr= "sr-RS", + sv= "sv-SE", + th= "th-TH", + tr= "tr-TR", + uk= "uk-UA", + vi= "vi-VN", + zh= "zh-CN" +} + + + +-- Range delimiter + +util.unicode = { + ["no-break space"] = "\u{00A0}", + ["em space"] = "\u{2003}", + ["en dash"] = "\u{2013}", + ["em dash"] = "\u{2014}", + ["left single quotation mark"] = "\u{2018}", + ["right single quotation mark"] = "\u{2019}", + ["apostrophe"] = "\u{2019}", + ["left double quotation mark"] = "\u{201C}", + ["right double quotation mark"] = "\u{201D}", + ["horizontal ellipsis"] = "\u{2026}", + ["narrow no-break space"] = "\u{202F}", +} + + +-- Text-case + +function util.is_lower (str) + return unicode.utf8.lower(str) == str +end + +function util.is_upper (str) + return unicode.utf8.upper(str) == str +end + +function util.capitalize (str) + str = unicode.utf8.lower(str) + local res = string.gsub(str, "%w", unicode.utf8.upper, 1) + return res +end + +function util.sentence (str) + if util.is_upper(str) then + return util.capitalize(str) + else + local output = {} + for i, word in ipairs(util.split(str)) do + if i == 1 and util.is_lower(word) then + table.insert(output, util.capitalize(word)) + else + table.insert(output, word) + end + end + return table.concat(output, " ") + end +end + +-- TODO: process multiple words +util.stop_words = { + ["a"] = true, + ["according to"] = true, + ["across"] = true, + ["afore"] = true, + ["after"] = true, + ["against"] = true, + ["ahead of"] = true, + ["along"] = true, + ["alongside"] = true, + ["amid"] = true, + ["amidst"] = true, + ["among"] = true, + ["amongst"] = true, + ["an"] = true, + ["and"] = true, + ["anenst"] = true, + ["apart from"] = true, + ["apropos"] = true, + ["apud"] = true, + ["around"] = true, + ["as"] = true, + ["as regards"] = true, + ["aside"] = true, + ["astride"] = true, + ["at"] = true, + ["athwart"] = true, + ["atop"] = true, + ["back to"] = true, + ["barring"] = true, + ["because of"] = true, + ["before"] = true, + ["behind"] = true, + ["below"] = true, + ["beneath"] = true, + ["beside"] = true, + ["besides"] = true, + ["between"] = true, + ["beyond"] = true, + ["but"] = true, + ["by"] = true, + ["c"] = true, + ["ca"] = true, + ["circa"] = true, + ["close to"] = true, + ["d'"] = true, + ["de"] = true, + ["despite"] = true, + ["down"] = true, + ["due to"] = true, + ["during"] = true, + ["et"] = true, + ["except"] = true, + ["far from"] = true, + ["for"] = true, + ["forenenst"] = true, + ["from"] = true, + ["given"] = true, + ["in"] = true, + ["inside"] = true, + ["instead of"] = true, + ["into"] = true, + ["lest"] = true, + ["like"] = true, + ["modulo"] = true, + ["near"] = true, + ["next"] = true, + ["nor"] = true, + ["notwithstanding"] = true, + ["of"] = true, + ["off"] = true, + ["on"] = true, + ["onto"] = true, + ["or"] = true, + ["out"] = true, + ["outside of"] = true, + ["over"] = true, + ["per"] = true, + ["plus"] = true, + ["prior to"] = true, + ["pro"] = true, + ["pursuant to"] = true, + ["qua"] = true, + ["rather than"] = true, + ["regardless of"] = true, + ["sans"] = true, + ["since"] = true, + ["so"] = true, + ["such as"] = true, + ["than"] = true, + ["that of"] = true, + ["the"] = true, + ["through"] = true, + ["throughout"] = true, + ["thru"] = true, + ["thruout"] = true, + ["till"] = true, + ["to"] = true, + ["toward"] = true, + ["towards"] = true, + ["under"] = true, + ["underneath"] = true, + ["until"] = true, + ["unto"] = true, + ["up"] = true, + ["upon"] = true, + ["v."] = true, + ["van"] = true, + ["versus"] = true, + ["via"] = true, + ["vis-à-vis"] = true, + ["von"] = true, + ["vs."] = true, + ["where as"] = true, + ["with"] = true, + ["within"] = true, + ["without"] = true, + ["yet"] = true, +} + +function util.title (str) + local output = {} + local previous = ":" + for i, word in ipairs(util.split(str)) do + local lower = unicode.utf8.lower(word) + if previous ~= ":" and util.stop_words[string.match(lower, "%w+")] then + table.insert(output, lower) + elseif util.is_lower(word) or util.is_upper(word) then + table.insert(output, util.capitalize(word)) + else + table.insert(output, word) + end + end + local res = table.concat(output, " ") + return res +end + +function util.all (t) + for _, item in ipairs(t) do + if not item then + return false + end + end + return true +end + +function util.any (t) + for _, item in ipairs(t) do + if item then + return true + end + end + return false +end + +-- ROMANESQUE_REGEXP = "-0-9a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e" + +util.romanesque_ranges = { + {0x0030, 0x0039}, -- 0-9 + {0x0041, 0x005A}, -- A-Z + {0x0061, 0x007A}, -- a-z + {0x0E01, 0x0E5B}, -- Thai + {0x0E01, 0x0E5B}, -- Thai + {0x00C0, 0x017F}, -- Latin-1 Supplement + {0x0370, 0x03FF}, -- Greek and Coptic + {0x0400, 0x052F}, -- Cyrillic + {0x0590, 0x05D4}, -- Hebrew + {0x05D6, 0x05FF}, -- Hebrew + {0x1F00, 0x1FFF}, -- Greek Extended + {0x0600, 0x06FF}, -- Arabic + {0x202A, 0x202E}, -- Writing directions in General Punctuation +} + +util.romanesque_chars = { + 0x200c, + 0x200d, + 0x200e, + 0x0218, + 0x0219, + 0x021a, + 0x021b, +} + +util.CJK_ranges = { + {0x4E00, 0x9FFF}, -- CJK Unified Ideographs + {0x3400, 0x4DBF}, -- CJK Unified Ideographs Extension A + {0x3040, 0x309F}, -- Hiragana + {0x30A0, 0x30FF}, -- Katakana + {0xF900, 0xFAFF}, -- CJK Compatibility Ideographs + {0x20000, 0x2A6DF}, -- CJK Unified Ideographs Extension B + {0x2A700, 0x2B73F}, -- CJK Unified Ideographs Extension C + {0x2B740, 0x2B81F}, -- CJK Unified Ideographs Extension D + {0x2B820, 0x2CEAF}, -- CJK Unified Ideographs Extension E + {0x2CEB0, 0x2EBEF}, -- CJK Unified Ideographs Extension F + {0x30000, 0x3134F}, -- CJK Unified Ideographs Extension G + {0x2F800, 0x2FA1F}, -- CJK Compatibility Ideographs Supplement +} + +function util.in_list (value, list) + for _, v in ipairs(list) do + if value == v then + return true + end + end + return false +end + +function util.in_ranges (value, ranges) + for _, range in ipairs(ranges) do + if value >= range[1] and value <= range[2] then + return true + end + end + return false +end + +function util.is_romanesque(code_point) + if not code_point then + return false + end + if util.in_ranges(code_point, util.romanesque_ranges) then + return true + end + if util.in_list(code_point, util.romanesque_chars) then + return true + end + return false +end + +function util.has_romanesque_char(s) + -- has romanesque char but not necessarily pure romanesque + if not s then + return false + end + for _, code_point in utf8.codes(s) do + if util.is_romanesque(code_point) then + return true + end + end + return false +end + +function util.is_cjk_char(code_point) + if not code_point then + return false + end + if util.in_ranges(code_point, util.CJK_ranges) then + return true + end + return false +end + +function util.has_cjk_char(s) + -- has romanesque char but not necessarily pure romanesque + if not s then + return false + end + for _, code_point in utf8.codes(s) do + if util.is_cjk_char(code_point) then + return true + end + end + return false +end + +function util.convert_roman (number) + assert(type(number) == "number") + local output = {} + for _, tuple in ipairs(util.roman_numerals) do + local letter, value = table.unpack(tuple) + table.insert(output, string.rep(letter, number // value)) + number = number % value + end + return table.concat(output, "") +end + +util.roman_numerals = { + {"m", 1000}, + {"cm", 900}, + {"d", 500}, + {"cd", 400}, + {"c", 100}, + {"xc", 90}, + {"l", 50}, + {"xl", 40}, + {"x", 10}, + {"ix", 9}, + {"v", 5}, + {"iv", 4}, + {"i", 1}, +}; + + +-- Choose + +util.position_map = { + ["first"] = 0, + ["subsequent"] = 1, + ["ibid"] = 2, + ["ibid-with-locator"] = 3, + ["container-subsequent"] = 4, +} + + +-- Output + +util.superscripts = { + ["\u{00AA}"] = "\u{0061}", + ["\u{00B2}"] = "\u{0032}", + ["\u{00B3}"] = "\u{0033}", + ["\u{00B9}"] = "\u{0031}", + ["\u{00BA}"] = "\u{006F}", + ["\u{02B0}"] = "\u{0068}", + ["\u{02B1}"] = "\u{0266}", + ["\u{02B2}"] = "\u{006A}", + ["\u{02B3}"] = "\u{0072}", + ["\u{02B4}"] = "\u{0279}", + ["\u{02B5}"] = "\u{027B}", + ["\u{02B6}"] = "\u{0281}", + ["\u{02B7}"] = "\u{0077}", + ["\u{02B8}"] = "\u{0079}", + ["\u{02E0}"] = "\u{0263}", + ["\u{02E1}"] = "\u{006C}", + ["\u{02E2}"] = "\u{0073}", + ["\u{02E3}"] = "\u{0078}", + ["\u{02E4}"] = "\u{0295}", + ["\u{1D2C}"] = "\u{0041}", + ["\u{1D2D}"] = "\u{00C6}", + ["\u{1D2E}"] = "\u{0042}", + ["\u{1D30}"] = "\u{0044}", + ["\u{1D31}"] = "\u{0045}", + ["\u{1D32}"] = "\u{018E}", + ["\u{1D33}"] = "\u{0047}", + ["\u{1D34}"] = "\u{0048}", + ["\u{1D35}"] = "\u{0049}", + ["\u{1D36}"] = "\u{004A}", + ["\u{1D37}"] = "\u{004B}", + ["\u{1D38}"] = "\u{004C}", + ["\u{1D39}"] = "\u{004D}", + ["\u{1D3A}"] = "\u{004E}", + ["\u{1D3C}"] = "\u{004F}", + ["\u{1D3D}"] = "\u{0222}", + ["\u{1D3E}"] = "\u{0050}", + ["\u{1D3F}"] = "\u{0052}", + ["\u{1D40}"] = "\u{0054}", + ["\u{1D41}"] = "\u{0055}", + ["\u{1D42}"] = "\u{0057}", + ["\u{1D43}"] = "\u{0061}", + ["\u{1D44}"] = "\u{0250}", + ["\u{1D45}"] = "\u{0251}", + ["\u{1D46}"] = "\u{1D02}", + ["\u{1D47}"] = "\u{0062}", + ["\u{1D48}"] = "\u{0064}", + ["\u{1D49}"] = "\u{0065}", + ["\u{1D4A}"] = "\u{0259}", + ["\u{1D4B}"] = "\u{025B}", + ["\u{1D4C}"] = "\u{025C}", + ["\u{1D4D}"] = "\u{0067}", + ["\u{1D4F}"] = "\u{006B}", + ["\u{1D50}"] = "\u{006D}", + ["\u{1D51}"] = "\u{014B}", + ["\u{1D52}"] = "\u{006F}", + ["\u{1D53}"] = "\u{0254}", + ["\u{1D54}"] = "\u{1D16}", + ["\u{1D55}"] = "\u{1D17}", + ["\u{1D56}"] = "\u{0070}", + ["\u{1D57}"] = "\u{0074}", + ["\u{1D58}"] = "\u{0075}", + ["\u{1D59}"] = "\u{1D1D}", + ["\u{1D5A}"] = "\u{026F}", + ["\u{1D5B}"] = "\u{0076}", + ["\u{1D5C}"] = "\u{1D25}", + ["\u{1D5D}"] = "\u{03B2}", + ["\u{1D5E}"] = "\u{03B3}", + ["\u{1D5F}"] = "\u{03B4}", + ["\u{1D60}"] = "\u{03C6}", + ["\u{1D61}"] = "\u{03C7}", + ["\u{2070}"] = "\u{0030}", + ["\u{2071}"] = "\u{0069}", + ["\u{2074}"] = "\u{0034}", + ["\u{2075}"] = "\u{0035}", + ["\u{2076}"] = "\u{0036}", + ["\u{2077}"] = "\u{0037}", + ["\u{2078}"] = "\u{0038}", + ["\u{2079}"] = "\u{0039}", + ["\u{207A}"] = "\u{002B}", + ["\u{207B}"] = "\u{2212}", + ["\u{207C}"] = "\u{003D}", + ["\u{207D}"] = "\u{0028}", + ["\u{207E}"] = "\u{0029}", + ["\u{207F}"] = "\u{006E}", + ["\u{2120}"] = "\u{0053}\u{004D}", + ["\u{2122}"] = "\u{0054}\u{004D}", + ["\u{3192}"] = "\u{4E00}", + ["\u{3193}"] = "\u{4E8C}", + ["\u{3194}"] = "\u{4E09}", + ["\u{3195}"] = "\u{56DB}", + ["\u{3196}"] = "\u{4E0A}", + ["\u{3197}"] = "\u{4E2D}", + ["\u{3198}"] = "\u{4E0B}", + ["\u{3199}"] = "\u{7532}", + ["\u{319A}"] = "\u{4E59}", + ["\u{319B}"] = "\u{4E19}", + ["\u{319C}"] = "\u{4E01}", + ["\u{319D}"] = "\u{5929}", + ["\u{319E}"] = "\u{5730}", + ["\u{319F}"] = "\u{4EBA}", + ["\u{02C0}"] = "\u{0294}", + ["\u{02C1}"] = "\u{0295}", + ["\u{06E5}"] = "\u{0648}", + ["\u{06E6}"] = "\u{064A}", +} + + +-- File IO + +function util.read_file(path) + if not path then + print(debug.traceback()) + end + local file = io.open(path, "r") + if not file then return nil end + local content = file:read("*a") + file:close() + return content +end + + +return util diff --git a/biblio/citation-style-language/citeproc.1 b/biblio/citation-style-language/citeproc.1 new file mode 100644 index 0000000000..5b97090561 --- /dev/null +++ b/biblio/citation-style-language/citeproc.1 @@ -0,0 +1,26 @@ +.TH citeproc 1 "0.1.0" +.SH NAME +citeproc \- make CSL citations and bibliography for LaTeX +.SH SYNOPSIS +.B citeproc +.RB [] +.IR auxname [ \fB.aux\fP ] +.SH DESCRIPTION +The citeproc engine is a Citation Style Lanugage processor for LaTeX. +It reads the auxiliary +.RB ( .aux ) +file +.I auxname +and creates a bibliography +.RB ( .bbl ) +file +.SH OPTIONS +.IP \-h ", " \-\-help +Prints the usage and exits. +.IP \-V ", " \-\-version +Prints the version number and exits. +.SH AUTHOR +Zeping Lee +.PP +Please log issues on the GitHub homepage: +https://github.com/zepinglee/citeproc-lua/issues. diff --git a/biblio/citation-style-language/citeproc.lua b/biblio/citation-style-language/citeproc.lua new file mode 100644 index 0000000000..19f217535e --- /dev/null +++ b/biblio/citation-style-language/citeproc.lua @@ -0,0 +1,18 @@ +--[[ + Copyright (C) 2021 Zeping Lee +--]] + + +local citeproc = {} + +local engine = require("citeproc-engine") +local bib = require("citeproc-bib") +local util = require("citeproc-util") + +citeproc.__VERSION__ = "0.1.0" + +citeproc.new = engine.CiteProc.new +citeproc.parse_bib = bib.parse +citeproc.util = util + +return citeproc diff --git a/biblio/citation-style-language/csl-core.lua b/biblio/citation-style-language/csl-core.lua new file mode 100644 index 0000000000..8e0448b993 --- /dev/null +++ b/biblio/citation-style-language/csl-core.lua @@ -0,0 +1,264 @@ +local core = {} + +local citeproc = require("citeproc") +local util = citeproc.util +require("lualibs") + + +core.locale_file_format = "csl-locales-%s.xml" +core.ids = {} +core.loaded_ids = {} +core.uncite_all_items = false + +function core.error(message) + if luatexbase then + luatexbase.module_error("csl", message) + else + util.error(message) + end +end + +function core.warning(message) + if luatexbase then + luatexbase.module_warning("csl", message) + else + util.warning(message) + end +end + +function core.info(message) + if luatexbase then + luatexbase.module_info("csl", message) + else + util.info(message) + end +end + + +function core.read_file(file_name, ftype, file_info) + file_info = file_info or "file" + local path = kpse.find_file(file_name, ftype) + if not path then + if ftype and not util.endswith(file_name, ftype) then + file_name = file_name .. ftype + end + core.error(string.format('Failed to find %s "%s"', file_info, file_name)) + return nil + end + local file = io.open(path, "r") + if not file then + core.error(string.format('Failed to open %s "%s"', file_info, path)) + return nil + end + local contents = file:read("*a") + file:close() + return contents +end + +local function load_bib(bib_files) + local bib = {} + for _, bib_file in ipairs(bib_files) do + -- TODO: try to load `.json` first? + local bib_contents = core.read_file(bib_file, "bib", "database file") + local file_name = bib_file + if not util.endswith(file_name, ".bib") then + file_name = file_name .. ".bib" + end + -- TODO: parse bib entries on demand + local csl_items = citeproc.parse_bib(bib_contents) + for _, item in ipairs(csl_items) do + local id = item.id + if bib[id] then + core.error(string.format('Duplicate entry key "%s" in "%s".', id, file_name)) + end + bib[id] = item + end + end + return bib +end + +function core.make_citeproc_sys(bib_files) + core.bib = load_bib(bib_files) + local citeproc_sys = { + retrieveLocale = function (lang) + local locale_file_format = core.locale_file_format or "locales-%s.xml" + local filename = string.format(locale_file_format, lang) + return core.read_file(filename) + end, + retrieveItem = function (id) + local res = core.bib[id] + -- if not res then + -- core.warning(string.format('Failed to find entry "%s".', id)) + -- end + return res + end + } + + return citeproc_sys +end + +function core.init(style_name, bib_files, lang) + if style_name == "" or #bib_files == 0 then + return nil + end + local style = core.read_file(style_name .. ".csl", nil, "style file") + if not style then + core.error(string.format('Failed to load style "%s.csl"', style_name)) + return nil + end + + local force_lang = nil + if lang and lang ~= "" then + force_lang = true + else + lang = nil + end + + local citeproc_sys = core.make_citeproc_sys(bib_files) + local engine = citeproc.new(citeproc_sys, style, lang, force_lang) + return engine +end + + +function core.make_citation(citation_info) + -- `citation_info`: "{ITEM-1@2}{{id={ITEM-1},label={page},locator={6}}}{3}" + local arguments = {} + for argument in string.gmatch(citation_info, "(%b{})") do + table.insert(arguments, string.sub(argument, 2, -2)) + end + if #arguments ~= 3 then + error(string.format('Invalid citation "%s"', citation_info)) + return nil + end + local citation_id, cite_items_str, note_index = table.unpack(arguments) + + local cite_items = {} + if citation_id == "nocite" then + for _, cite_id in ipairs(util.split(cite_items_str, "%s*,%s*")) do + table.insert(cite_items, {id = cite_id}) + end + + else + for item_str in string.gmatch(cite_items_str, "(%b{})") do + item_str = string.sub(item_str, 2, -2) + local cite_item = {} + for key, value in string.gmatch(item_str, "([%w%-]+)=(%b{})") do + if key == "sub-verbo" then + key = "sub verbo" + end + value = string.sub(value, 2, -2) + cite_item[key] = value + end + table.insert(cite_items, cite_item) + end + end + + local citation = { + citationID = citation_id, + citationItems = cite_items, + properties = { + noteIndex = tonumber(note_index), + }, + } + + return citation +end + + +function core.process_citations(engine, citations) + local citations_pre = {} + + -- Save the time of bibliography sorting by update all ids at one time. + core.update_item_ids(engine, citations) + local citation_strings = {} + + for _, citation in ipairs(citations) do + if citation.citationID ~= "nocite" then + local res = engine:processCitationCluster(citation, citations_pre, {}) + + for _, citation_res in ipairs(res[2]) do + local citation_str = citation_res[2] + local citation_id = citation_res[3] + citation_strings[citation_id] = citation_str + end + + table.insert(citations_pre, {citation.citationID, citation.properties.noteIndex}) + end + end + + return citation_strings +end + + +function core.update_item_ids(engine, citations) + if core.uncite_all_items then + for item_id, _ in pairs(core.bib) do + if not core.loaded_ids[item_id] then + table.insert(core.ids, item_id) + core.loaded_ids[item_id] = true + end + end + end + for _, citation in ipairs(citations) do + for _, cite_item in ipairs(citation.citationItems) do + local id = cite_item.id + if id == "*" then + for item_id, _ in pairs(core.bib) do + if not core.loaded_ids[item_id] then + table.insert(core.ids, item_id) + core.loaded_ids[item_id] = true + end + end + else + if not core.loaded_ids[id] then + table.insert(core.ids, id) + core.loaded_ids[id] = true + end + end + end + end + engine:updateItems(core.ids) + -- TODO: engine:updateUncitedItems(ids) +end + + +function core.make_bibliography(engine) + local result = engine:makeBibliography() + + local params = result[1] + local bib_items = result[2] + + local res = "" + + local bib_options = "" + if params["hangingindent"] then + bib_options = bib_options .. "\n hanging-indent = true," + end + if params["linespacing"] then + bib_options = bib_options .. string.format("\n line-spacing = %d,", params["linespacing"]) + end + if params["entryspacing"] then + bib_options = bib_options .. string.format("\n entry-spacing = %d,", params["entryspacing"]) + end + + if bib_options ~= "" then + bib_options = "\\cslsetup{" .. bib_options .. "\n}\n\n" + res = res .. bib_options + end + + if params.bibstart then + res = res .. params.bibstart + end + + for _, bib_item in ipairs(bib_items) do + res = res .. "\n" .. bib_item + end + + if params.bibend then + res = res .. "\n" .. params.bibend + end + return res +end + + +return core diff --git a/biblio/citation-style-language/csl-locales-af-ZA.xml b/biblio/citation-style-language/csl-locales-af-ZA.xml new file mode 100644 index 0000000000..1035a9b14e --- /dev/null +++ b/biblio/citation-style-language/csl-locales-af-ZA.xml @@ -0,0 +1,312 @@ + + + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2015-10-15T14:41:06-04:00 + + + + + + + + + + + + + + toegang verkry + en + and others + anonymous + anon + at + available at + by + circa + c. + cited + + edition + editions + + ed + et al. + voorhande + van + ibid. + in + in press + internet + interview + letter + no date + n.d. + online + presented at the + + reference + references + + + ref. + refs. + + opgehaal + scale + version + + + AD + BC + + + + + + + + + + th + st + nd + rd + th + th + th + + + first + second + third + fourth + fifth + sixth + seventh + eighth + ninth + tenth + + + + book + books + + + chapter + chapters + + + column + columns + + + figure + figures + + + folio + folios + + + number + numbers + + + reël + reëls + + + note + notes + + + opus + opera + + + bladsy + bladsye + + + bladsy + bladsye + + + paragraaf + paragrawe + + + part + parts + + + section + sections + + + sub verbo + sub verbis + + + verse + verses + + + volume + volumes + + + + bk + chap + col + fig + f + no + l. + n. + op + + bl + bll + + + bl + bll + + para + pt + sec + + s.v. + s.vv. + + + v + vv + + + vol + vols + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + redakteur + redakteurs + + + editor + editors + + + illustrator + illustrators + + + vertaler + vertalers + + + editor & translator + editors & translators + + + + + dir. + dirs. + + + red + reds + + + ed. + eds. + + + ill. + ills. + + + vert + verts + + + ed. & tran. + eds. & trans. + + + + by + directed by + onder redaksie van + edited by + illustrated by + interview by + to + by + vertaal deur + edited & translated by + + + dir. + red + ed. + illus. + verts + ed. & trans. by + + + Januarie + Februarie + Maart + April + Mei + Junie + Julie + Augustus + September + Oktober + November + Desember + + + Jan + Feb + Mrt + Apr + Mei + Jun + Jul + Aug + Sep + Okt + Nov + Des + + + Spring + Summer + Autumn + Winter + + diff --git a/biblio/citation-style-language/csl-locales-ar.xml b/biblio/citation-style-language/csl-locales-ar.xml new file mode 100644 index 0000000000..57dd5dda06 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-ar.xml @@ -0,0 +1,253 @@ + + + + + abdealikhurrum + + + Dr. Ayman Saleh + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + تاريخ الوصول + و + وآخرون + مجهول + مجهول + عند + موجود في + عن طريق + حوالي + حوالي + وثق + + الطبعة + الطبعات + + ط + وآخرون + التالي + من + المرجع السابق + في + قيد النشر + انترنت + مقابلة + خطاب + دون تاريخ + د.ت + مباشر على الإنترنت + قُدَّم في + + مرجع + مراجع + + + مرجع + مراجع + + استرجع في + السلم الموسيقي + إصدار + + + ب.م. + ق.م. + + + " + " + ' + ' + + + + + + + الأول + الثاني + الثالث + الرابع + الخامس + السادس + السابع + الثامن + التاسع + العاشر + + + + كتاب + كتب + + + فصل + فصول + + + عمود + أعمدة + + + رسم توضيحي + رسوم توضيحية + + + ورقة + أوراق + + + عدد + أعداد + + + سطر + أسطر + + + ملاحظة + ملاحظات + + + نوته موسيقية + نوتات موسيقية + + + صفحة + صفحات + + + صفحة + صفحات + + + فقرة + فقرات + + + جزء + أجزاء + + + قسم + أقسام + + + تفسير فرعي + تفسيرات فرعية + + + بيت شعر + أبيات شعر + + + مجلد + مجلدات + + + + كتاب + فصل + عمود + رسم توضيحي + مطوية + عدد + سـ + ملاحظة + نوتة موسيقية + + ص + ص + + + ص + ص + + فقرة + ج + قسم + + تفسير فرعي + تفسيرات فرعية + + + بيت شعر + أبيات شعر + + + م + م + + + + + + ¶¶ + + + § + §§ + + + + إدارة + تحقيق + إدارة التحرير + رسوم + ترجمة + ترجمة وتحقيق + + + + + إنشاء + إشراف + تحقيق + إعداد + رسوم + مقابلة مع + المستلم + مراجعة + ترجمة + تحقيق وترجمة + + + + + يناير + فبراير + مارس + أبريل + مايو + يونيو + يوليو + أغسطس + سبتمبر + أكتوبر + نوفمبر + ديسمبر + + + + + + ربيع + صيف + خريف + شتاء + + diff --git a/biblio/citation-style-language/csl-locales-bg-BG.xml b/biblio/citation-style-language/csl-locales-bg-BG.xml new file mode 100644 index 0000000000..ebb65cd3b1 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-bg-BG.xml @@ -0,0 +1,324 @@ + + + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2019-01-23T08:34:57-05:00 + + Valeriya Simeonova + simeonova@fmi.uni-sofia.bg + http://www.mendeley.com/profiles/valeriya-simeonova/ + + + + + + + + + + + + + + + отворен на + и + и други + анонимен + анон. + в + достъпен на + от + около + ок. + цитиран + + издание + издания + + изд. + и съавт. + предстоящ + от + пак там + в + под печат + интернет + интервю + писмо + без дата + б.д. + онлайн + представен на + + източник + източници + + + изт. + изт. + + изтеглен на + скала + версия + + + сл.хр. + пр.хр. + + + + + + + + + + то + во + ро + то + во + ро + то + ти + ви + ри + ти + ви + ри + ти + та + ва + ра + та + ва + ра + та + + + първo + вторo + третo + четвъртo + петo + шестo + седмo + осмo + деветo + десетo + първи + втори + трети + четверти + пети + шести + седми + осми + девети + десети + първа + втора + трета + четверта + пета + шеста + седма + осма + девета + десета + + + + книга + книги + + + глава + глави + + + колона + колони + + + фигура + фигури + + + фолио + фолия + + + брой + броеве + + + ред + редове + + + бележка + бележки + + + опус + опуси + + + страница + страници + + брой страници + + абзац + абзаци + + + част + части + + + раздел + раздели + + + под раздел + под раздели + + + стихотворение + стихове + + + том + томове + + + + кн. + гл. + кол. + фиг. + фол. + бр. + р. + бел. + оп. + стр. + бр.стр. + абз. + ч. + разд. + подразд. + ст. + + том + томове + + + + + + ¶¶ + + + § + §§ + + + + режисьор + + редактор + редактори + + + главен редактор + редакторски колектив + + илюстрации + + преводач + преводачи + + + editor & translator + editors & translators + + + + реж. + + ред. + ред.кол. + + + гл.ред. + гл.ред.кол. + + ил. + + прев + прев.кол. + + + ред. & прев. + ред.кол. & прев. + + + + от + под общата редакция на + редактиран от + главен редактор + илюстрации от + интервюиран от + до + рецензент + преведен от + редактирано & преведено от + + + п.о.р. + ред. + гл.ред. + ил. + прев. + ред. & прев. от + + + Януари + Февруари + Март + Април + Май + Юни + Юли + Август + Септември + Октомври + Ноември + Декември + + + Яну + Фев + Мар + Апр + Май + Юни + Юли + Авг + Сеп + Окт + Ное + Дек + + + Пролет + Лято + Есен + Зима + + diff --git a/biblio/citation-style-language/csl-locales-ca-AD.xml b/biblio/citation-style-language/csl-locales-ca-AD.xml new file mode 100644 index 0000000000..ec590b1c2f --- /dev/null +++ b/biblio/citation-style-language/csl-locales-ca-AD.xml @@ -0,0 +1,312 @@ + + + + + anidal + + + javimat + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + consulta + i + i altres + anònim + anòn. + a + disponible a + per + circa + c. + citat + + edició + edicions + + ed. + et al. + previst + de + ibíd. + en + en impremta + internet + entrevista + carta + sense data + s.d. + en línia + presentat a + + referència + referències + + + ref. + ref. + + recuperat + escala + versió + + + dC + aC + + + « + » + + + - + + + a + + + primera + segona + tercera + quarta + cinquena + sisena + setena + vuitena + novena + desena + + + + llibre + llibres + + + capítol + capítols + + + columna + columnes + + + figura + figures + + + foli + folis + + + número + números + + + línia + línies + + + nota + notes + + + opus + opera + + + pàgina + pàgines + + + pàgina + pàgines + + + paràgraf + paràgrafs + + + part + parts + + + secció + seccions + + + sub voce + sub vocibus + + + vers + versos + + + volum + volums + + + + llib. + cap. + col. + fig. + f. + núm. + l. + n. + op. + + p. + p. + + + p. + p. + + par. + pt. + sec. + + s.v. + s.v. + + + v. + v. + + + vol. + vol. + + + + + § + § + + + § + § + + + + + director + directors + + + editor + editors + + + editor + editors + + + il·lustrador + il·lustradors + + + traductor + traductors + + + editor i traductor + editors i traductors + + + + + dir. + dir. + + + ed. + ed. + + + ed. + ed. + + + il·lust. + il·lust. + + + trad. + trad. + + + ed. i trad. + ed. i trad. + + + + per + dirigit per + editat per + editat per + il·lustrat per + entrevistat per + a + per + traduït per + editat i traduït per + + + dir. + ed. + ed. + il·lust. + trad. + ed. i trad. per + + + gener + febrer + març + abril + maig + juny + juliol + agost + setembre + octubre + novembre + desembre + + + gen. + feb. + març + abr. + maig + juny + jul. + ago. + set. + oct. + nov. + des. + + + primavera + estiu + tardor + hivern + + diff --git a/biblio/citation-style-language/csl-locales-cs-CZ.xml b/biblio/citation-style-language/csl-locales-cs-CZ.xml new file mode 100644 index 0000000000..1d797504a0 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-cs-CZ.xml @@ -0,0 +1,319 @@ + + + + + nosaal + + + Andrew Dunning + + + libora + + + Michal Hoftich + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + viděno + vid. + a + a další + anonym + anon. + v + dostupné z + od + asi + cca. + citován + + vydání + vydání + + vyd. + et al. + nadcházející + z + ibid. + in + v tisku + internet + interview + dopis + nedatováno + b.r. + online + prezentováno v + + reference + reference + + + ref. + ref. + + získáno + měřítko + verze + + + n. l. + př. n. l. + + + + " + + ´ + + + + . + + + první + druhé + třetí + čtvrté + páté + šesté + sedmé + osmé + deváté + desáté + + + + kniha + knihy + + + kapitola + kapitoly + + + sloupec + sloupce + + + obrázek + obrázky + + + list + listy + + + číslo + čísla + + + řádek + řádky + + + poznámka + poznámky + + + opus + opusy + + + strana + strany + + + strana + strany + + + odstavec + odstavce + + + část + části + + + sekce + sekce + + + pod heslem + pod hesly + + + verš + verše + + + ročník + ročníky + + + + k. + kap. + sl. + obr. + l. + č. + ř. + pozn. + op. + + s. + s. + + + s. + s. + + odst. + č. + sek. + + s.v. + s.v. + + + v. + v. + + + roč. + roč. + + + + + + ¶¶ + + + § + §§ + + + + + ředitel + ředitelé + + + editor + editoři + + + vedoucí editor + vedoucí editoři + + + ilustrátor + ilustrátoři + + + překladatel + překladatelé + + + editor a překladatel + editoři a překladatelé + + + + + řed. + řed. + + + ed. + ed. + + + ed. + ed. + + + il. + il. + + + přel. + přel. + + + ed. a přel. + ed. a přel. + + + + + řídil + editoval + editoval + ilustroval + rozhovor vedl + pro + recenzoval + přeložil + editoval a přeložil + + + řed. + ed. + ed. + ilust. + přel. + ed. a přel. + + + leden + únor + březen + duben + květen + červen + červenec + srpen + září + říjen + listopad + prosinec + + + led. + úno. + bře. + dub. + kvě. + čer. + čvc. + srp. + zář. + říj. + lis. + pro. + + + jaro + léto + podzim + zima + + diff --git a/biblio/citation-style-language/csl-locales-cy-GB.xml b/biblio/citation-style-language/csl-locales-cy-GB.xml new file mode 100644 index 0000000000..e2615fa911 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-cy-GB.xml @@ -0,0 +1,312 @@ + + + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2015-10-15T14:41:06-04:00 + + + + + + + + + + + + + + gwelwyd + a/ac + ac eraill + di-enw + dienw + at + ar gael + gan + circa + c. + dyfynnwyd + + argraffiad + argraffiadau + + arg. + et al. + ar fin ymddangos + gan + ibid. + yn + yn y wasg + rhyngrwyd + cyfweliad + llythyr + dim dyddiad + d.d. + arlein + cyflwynwyd yn + + cyfeirnod + cyfeirnodau + + + cyf. + cyf’au. + + gwelwyd + graddfa + fersiwn + + + OC + CC + + + + + + + + + + th + af + il + ydd + ed + ed + ed + + + cyntaf + ail + trydydd + pedwerydd + pumed + chweched + seithfed + wythfed + nawfed + degfed + + + + llyfr + llyfrau + + + pennod + penodau + + + colofn + colofnau + + + ffigwr + ffigyrau + + + ffolio + ffolios + + + rhifyn + rhifynnau + + + llinell + llinellau + + + nodyn + nodiadau + + + opus + opera + + + tudalen + tudalennau + + + tudalen + tudalennau + + + paragraff + paragraffau + + + rhan + rhannau + + + adran + adrannau + + + sub verbo + sub verbis + + + pennill + penillion + + + cyfrol + cyfrolau + + + + llyfr. + pen. + col. + ffig. + ff. + rhif. + ll. + n. + op. + + t. + tt. + + + t. + tt. + + para. + rhan. + adr. + + s.v. + s.vv. + + + p. + pp. + + + rhif. + rhifu. + + + + + + ¶¶ + + + § + §§ + + + + + cyfarwyddwr + cyfarwyddwyr + + + golygydd + golygyddion + + + cyfarwyddwr-golygyddol + cyfarwyddwyr-golygyddol + + + darlunydd + darlunwyr + + + cyfieithydd + cyfieithwyr + + + golygydd a chyfieithydd + golygyddion a chyfieithwyr + + + + + cyf. + cyfy. + + + gol. + goln. + + + gol. + goln. + + + darlun. + darlun. + + + cyf. + cyf. + + + gol. a chyf. + goln. a chyf. + + + + gan + cyfarwyddwyd gan + golygwyd gan + cyfarwyddwyd a golygwyd gan + darlunwyd gan + cyfweliad gan + i + gan + cyfieithwyd gan + golygwyd a chyfieithwyd gan + + + cyf. gan + gol. gan + cyf.-gol. gan + darlun. gan + cyf. gan + gol. a chyf. gan + + + Ionawr + Chwefror + Mawrth + Ebrill + Mai + Mehefin + Gorffennaf + Awst + Medi + Hydref + Tachwedd + Rhagfyr + + + Ion. + Chwe. + Maw. + Ebr. + Mai + Meh. + Gorff. + Aws. + Med. + Hyd. + Tach. + Rhag. + + + Gwanwyn + Haf + Hydref + Gaeaf + + diff --git a/biblio/citation-style-language/csl-locales-da-DK.xml b/biblio/citation-style-language/csl-locales-da-DK.xml new file mode 100644 index 0000000000..f2f934d102 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-da-DK.xml @@ -0,0 +1,315 @@ + + + + + Niels Erik Wille + + + Jonas Nyrup + + + hafnius + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + set + og + med flere + anonym + anon. + + tilgængelig hos + af + cirka + ca. + henvist + + udgave + udgaver + + udg. + m.fl. + kommende + fra + ibid. + i + i trykken + internet + interview + brev + uden år + u.å. + online + præsenteret ved + + reference + referencer + + + ref. + refr. + + hentet + skala + version + + + e.v.t. + f.v.t. + + + + + + + + + + . + + + første + anden + tredje + fjerde + femte + sjette + syvende + ottende + niende + tiende + + + + bog + bøger + + + kapitel + kapitler + + + kolonne + kolonner + + + figur + figurer + + + folio + folio + + + nummer + numre + + + linje + linjer + + + note + noter + + + opus + opus + + + side + sider + + + side + sider + + + afsnit + afsnit + + + del + dele + + + paragraf + paragraffer + + + sub voce + sub voce + + + vers + vers + + + bind + bind + + + + b. + kap. + kol. + fig. + fol. + nr. + l. + n. + op. + + s. + s. + + + s. + s. + + afs. + d. + par. + + s.v. + s.v. + + + v. + v. + + + bd. + bd. + + + + + + ¶¶ + + + § + §§ + + + + + instruktør + instruktører + + + redaktør + redaktører + + + redaktør + redaktører + + + illustrator + illustratorer + + + oversætter + oversættere + + + redaktør & oversætter + redaktører & oversættere + + + + + instr. + instr. + + + red. + red. + + + red. + red. + + + ill. + ill. + + + overs. + overs. + + + red. & overs. + red. & overs. + + + + af + instrueret af + redigeret af + redigeret af + illustreret af + interviewet af + modtaget af + af + oversat af + redigeret & oversat af + + + instr. + red. + red. + illus. + overs. + red. & overs. af + + + januar + februar + marts + april + maj + juni + juli + august + september + oktober + november + december + + + jan. + feb. + mar. + apr. + maj + jun. + jul. + aug. + sep. + okt. + nov. + dec. + + + Forår + Sommer + Efterår + Vinter + + diff --git a/biblio/citation-style-language/csl-locales-de-AT.xml b/biblio/citation-style-language/csl-locales-de-AT.xml new file mode 100644 index 0000000000..1a4586f52c --- /dev/null +++ b/biblio/citation-style-language/csl-locales-de-AT.xml @@ -0,0 +1,334 @@ + + + + + Till A. Heilmann + + + Georg Duffner + + + Sebastian Karcher + + + Sylvester Keil + + + jakov + + + Frank Bennett + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2021-10-19T12:12:03-04:00 + + + + + + + + + + + + + + zugegriffen + und + und andere + ohne Autor + o. A. + auf + verfügbar unter + von + circa + ca. + zitiert + + Auflage + Auflagen + + Aufl. + u. a. + i. E. + von + ebd. + in + im Druck + Internet + Interview + Brief + ohne Datum + o. J. + online + gehalten auf der + + Referenz + Referenzen + + + Ref. + Ref. + + abgerufen + Maßstab + Version + + +  n. Chr. +  v. Chr. + + + + + + + + + + . + + + erster + zweiter + dritter + vierter + fünfter + sechster + siebter + achter + neunter + zehnter + + + + Buch + Bücher + + + Kapitel + Kapitel + + + Spalte + Spalten + + + Abbildung + Abbildungen + + + Blatt + Blätter + + + Nummer + Nummern + + + Zeile + Zeilen + + + Note + Noten + + + Opus + Opera + + + Seite + Seiten + + + Seite + Seiten + + + Absatz + Absätze + + + Teil + Teile + + + Abschnitt + Abschnitte + + + sub verbo + sub verbis + + + Vers + Verse + + + Band + Bände + + + + B. + Kap. + Sp. + Abb. + Fol. + Nr. + l. + n. + op. + + S. + S. + + + S. + S. + + Abs. + Teil + Abschn. + + s. v. + s. vv. + + + V. + V. + + + Bd. + Bd. + + + + + + ¶¶ + + + § + §§ + + + + + Regisseur + Regisseure + + + Herausgeber + Herausgeber + + + Reihenherausgeber + Reihenherausgeber + + + Herausgeber + Herausgeber + + + Illustrator + Illustratoren + + + Übersetzer + Übersetzer + + + Herausgeber & Übersetzer + Herausgeber & Übersetzer + + + + + Reg. + Reg. + + + Hrsg. + Hrsg. + + + Hrsg. + Hrsg. + + + Hrsg. + Hrsg. + + + Ill. + Ill. + + + Übers. + Übers. + + + Hrsg. & Übers. + Hrsg. & Übers. + + + + von + Regie von + herausgegeben von + herausgegeben von + herausgegeben von + illustriert von + interviewt von + an + von + übersetzt von + herausgegeben und übersetzt von + + + Reg. + hg. von + hg. von + hg. von + illus. von + übers. von + hg. & übers. von + + + Jänner + Februar + März + April + Mai + Juni + Juli + August + September + Oktober + November + Dezember + + + Jän. + Feb. + März + Apr. + Mai + Juni + Juli + Aug. + Sep. + Okt. + Nov. + Dez. + + + Frühjahr + Sommer + Herbst + Winter + + diff --git a/biblio/citation-style-language/csl-locales-de-CH.xml b/biblio/citation-style-language/csl-locales-de-CH.xml new file mode 100644 index 0000000000..68184635ee --- /dev/null +++ b/biblio/citation-style-language/csl-locales-de-CH.xml @@ -0,0 +1,318 @@ + + + + + Till A. Heilmann + + + Sylvester Keil + + + jakov + + + Sebastian Karcher + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2021-10-19T12:12:03-04:00 + + + + + + + + + + + + + + zugegriffen + und + und andere + ohne Autor + o. A. + auf + verfügbar unter + von + circa + ca. + zitiert + + Auflage + Auflagen + + Aufl. + u. a. + i. E. + von + ebd. + in + im Druck + Internet + Interview + Brief + ohne Datum + o. J. + online + gehalten auf der + + Referenz + Referenzen + + + Ref. + Ref. + + abgerufen + Massstab + Version + + +  n. Chr. +  v. Chr. + + + « + » + + + + + + . + + + erster + zweiter + dritter + vierter + fünfter + sechster + siebter + achter + neunter + zehnter + + + + Buch + Bücher + + + Kapitel + Kapitel + + + Spalte + Spalten + + + Abbildung + Abbildungen + + + Blatt + Blätter + + + Nummer + Nummern + + + Zeile + Zeilen + + + Note + Noten + + + Opus + Opera + + + Seite + Seiten + + + Seite + Seiten + + + Absatz + Absätze + + + Teil + Teile + + + Abschnitt + Abschnitte + + + sub verbo + sub verbis + + + Vers + Verse + + + Band + Bände + + + + B. + Kap. + Sp. + Abb. + Fol. + Nr. + l. + n. + op. + + S. + S. + + + S. + S. + + Abs. + Teil + Abschn. + + s. v. + s. vv. + + + V. + V. + + + Bd. + Bd. + + + + + + ¶¶ + + + § + §§ + + + + + Regisseur + Regisseure + + + Herausgeber + Herausgeber + + + Herausgeber + Herausgeber + + + Illustrator + Illustratoren + + + Übersetzer + Übersetzer + + + Herausgeber & Übersetzer + Herausgeber & Übersetzer + + + + + Reg. + Reg. + + + Hrsg. + Hrsg. + + + Hrsg. + Hrsg. + + + Ill. + Ill. + + + Übers. + Übers. + + + Hrsg. & Übers. + Hrsg. & Übers. + + + + von + Regie von + herausgegeben von + herausgegeben von + illustriert von + interviewt von + an + von + übersetzt von + herausgegeben und übersetzt von + + + Reg. + hg. von + hg. von + illus. von + übers. von + hg. & übers. von + + + Januar + Februar + März + April + Mai + Juni + Juli + August + September + Oktober + November + Dezember + + + Jan. + Feb. + März + Apr. + Mai + Juni + Juli + Aug. + Sep. + Okt. + Nov. + Dez. + + + Frühjahr + Sommer + Herbst + Winter + + diff --git a/biblio/citation-style-language/csl-locales-de-DE.xml b/biblio/citation-style-language/csl-locales-de-DE.xml new file mode 100644 index 0000000000..d99d2f5a22 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-de-DE.xml @@ -0,0 +1,331 @@ + + + + + Till A. Heilmann + + + Ulrich + + + Rintze M. Zelle + + + Sebastian Karcher + + + jakov + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2021-10-19T12:12:03-04:00 + + + + + + + + + + + + + + zugegriffen + und + und andere + ohne Autor + o. A. + auf + verfügbar unter + von + circa + ca. + zitiert + + Auflage + Auflagen + + Aufl. + u. a. + i. E. + von + ebd. + in + im Druck + Internet + Interview + Brief + ohne Datum + o. J. + online + gehalten auf der + + Referenz + Referenzen + + + Ref. + Ref. + + abgerufen + Maßstab + Version + + +  n. Chr. +  v. Chr. + + + + + + + + + + . + + + erster + zweiter + dritter + vierter + fünfter + sechster + siebter + achter + neunter + zehnter + + + + Buch + Bücher + + + Kapitel + Kapitel + + + Spalte + Spalten + + + Abbildung + Abbildungen + + + Blatt + Blätter + + + Nummer + Nummern + + + Zeile + Zeilen + + + Note + Noten + + + Opus + Opera + + + Seite + Seiten + + + Seite + Seiten + + + Absatz + Absätze + + + Teil + Teile + + + Abschnitt + Abschnitte + + + sub verbo + sub verbis + + + Vers + Verse + + + Band + Bände + + + + B. + Kap. + Sp. + Abb. + Fol. + Nr. + Z. + N. + op. + + S. + S. + + + S. + S. + + Abs. + Teil + Abschn. + + s. v. + s. vv. + + + V. + V. + + + Bd. + Bde. + + + + + + ¶¶ + + + § + §§ + + + + + Regisseur + Regisseure + + + Herausgeber + Herausgeber + + + Reihenherausgeber + Reihenherausgeber + + + Herausgeber + Herausgeber + + + Illustrator + Illustratoren + + + Übersetzer + Übersetzer + + + Herausgeber & Übersetzer + Herausgeber & Übersetzer + + + + + Reg. + Reg. + + + Hrsg. + Hrsg. + + + Hrsg. + Hrsg. + + + Hrsg. + Hrsg. + + + Ill. + Ill. + + + Übers. + Übers. + + + Hrsg. & Übers. + Hrsg. & Übers. + + + + von + Regie von + herausgegeben von + herausgegeben von + herausgegeben von + illustriert von + interviewt von + an + von + übersetzt von + herausgegeben und übersetzt von + + + Reg. + hg. von + hg. von + hg. von + illus. von + übers. von + hg. & übers. von + + + Januar + Februar + März + April + Mai + Juni + Juli + August + September + Oktober + November + Dezember + + + Jan. + Feb. + März + Apr. + Mai + Juni + Juli + Aug. + Sep. + Okt. + Nov. + Dez. + + + Frühjahr + Sommer + Herbst + Winter + + diff --git a/biblio/citation-style-language/csl-locales-el-GR.xml b/biblio/citation-style-language/csl-locales-el-GR.xml new file mode 100644 index 0000000000..321af96cde --- /dev/null +++ b/biblio/citation-style-language/csl-locales-el-GR.xml @@ -0,0 +1,314 @@ + + + + + thanasis57 + + + dimtamb + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2018-10-20T21:17:08-04:00 + + + + + + + + + + + + + + ημερομηνία πρόσβασης + και + και άλλοι + ανώνυμο + ανών. + εφ. + διαθέσιμο στο + από + περίπου + περ. + παρατίθεται + + έκδοση + εκδόσεις + + έκδ. + κ.ά. + προσεχές + από + στο ίδιο + στο + υπό έκδοση + διαδίκτυο + συνέντευξη + επιστολή + χωρίς χρονολογία + χ.χ. + έκδοση σε ψηφιακή μορφή + παρουσιάστηκε στο + + παραπομπή + παραπομπές + + + παρ. + παρ. + + ανακτήθηκε + κλίμακα + εκδοχή + + + μ.Χ. + π.Χ. + + + + + ' + ' + + + + ο + η + ος + + + πρώτος + δεύτερος + τρίτος + τέταρτος + πέμπτος + έκτος + έβδομος + όγδοος + ένατος + δέκατος + + + + βιβλίο + βιβλία + + + κεφάλαιο + κεφάλαια + + + στήλη + στήλες + + + εικόνα + εικόνες + + + φάκελος + φάκελοι + + + τεύχος + τεύχη + + + σειρά + σειρές + + + σημείωση + σημειώσεις + + + έργο + έργα + + + σελίδα + σελίδες + + + σελίδα + σελίδες + + + παράγραφος + παράγραφοι + + + μέρος + μέρη + + + τμήμα + τμήματα + + + λήμμα + λήμματα + + + στίχος + στίχοι + + + τόμος + τόμοι + + + + βιβ. + κεφ. + στ. + εικ. + φάκ + τχ. + γρ. + σημ. + έργ. + + σ. + σσ. + + + σ. + σσ. + + παρ. + μέρ. + τμ. + + λήμ. + λήμ. + + + στ. + στ. + + + τ. + τ. + + + + + + ¶¶ + + + § + §§ + + + + + Διευθυντής + Διευθυντές + + + επιμελητής + επιμελητές + + + διευθυντής σειράς + διευθυντές σειράς + + + εικονογράφος + εικονογράφοι + + + μεταφραστής + μεταφραστές + + + μεταφραστής και επιμελητής + μεταφραστές και επιμελητές + + + + + δ/ντης. + δ/ντές. + + + επιμ. + επιμ. + + + δ/ντής σειράς + δ/ντές σειρας + + + εικ. + εικ.. + + + μτφ. + μτφ. + + + μτφ. και επιμ. + μτφ. και επιμ. + + + + στον συλλ. τόμο + διεύθυνση + επιμέλεια + διεύθυνση σειράς + εικονογράφηση: + συνέντευξη + παραλήπτης + συγγραφέας: + μετάφραση + μετάφραση και επιμέλεια + + + διευθ. + επιμέλ. + δ/νση σειράς + εικον. + μετάφρ. + μετάφρ. και επιμέλ. + + + Ιανουάριος + Φεβρουάριος + Μάρτιος + Απρίλιος + Μάιος + Ιούνιος + Ιούλιος + Αύγουστος + Σεπτέμβριος + Οκτώβριος + Νοέμβριος + Δεκέμβριος + + + Ιανουαρίου + Φεβρουαρίου + Μαρτίου + Απριλίου + Μαΐου + Ιουνίου + Ιουλίου + Αυγούστου + Σεπτεμβρίου + Οκτωβρίου + Νοεμβρίου + Δεκεμβρίου + + + Άνοιξη + Καλοκαίρι + Φθινόπωρο + Χειμώνας + + diff --git a/biblio/citation-style-language/csl-locales-en-GB.xml b/biblio/citation-style-language/csl-locales-en-GB.xml new file mode 100644 index 0000000000..e6a5d330e2 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-en-GB.xml @@ -0,0 +1,357 @@ + + + + + Andrew Dunning + + + Sebastian Karcher + + + Rintze M. Zelle + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T13:02:03-05:00 + + + + + + + + + + + + + + accessed + and + and others + anonymous + anon. + at + available at + by + circa + c. + cited + + edition + editions + + ed. + et al. + forthcoming + from + ibid. + in + in press + internet + interview + letter + no date + n.d. + online + presented at the + + reference + references + + + ref. + refs. + + retrieved + scale + version + + + AD + BC + + + + + + + + + + th + st + nd + rd + th + th + th + + + first + second + third + fourth + fifth + sixth + seventh + eighth + ninth + tenth + + + + book + books + + + chapter + chapters + + + column + columns + + + figure + figures + + + folio + folios + + + number + numbers + + + line + lines + + + note + notes + + + opus + opera + + + page + pages + + + page + pages + + + paragraph + paragraphs + + + part + parts + + + section + sections + + + sub verbo + sub verbis + + + verse + verses + + + volume + volumes + + + + + bk. + bks + + + chap. + chaps + + + col. + cols + + + fig. + figs + + + fol. + fols + + + no. + nos. + + + l. + ll. + + + n. + nn. + + + op. + opp. + + + p. + pp. + + + p. + pp. + + + para. + paras + + + pt. + pts + + + sec. + secs + + + s.v. + s.vv. + + + v. + vv. + + + vol. + vols + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + editor + editors + + + editor + editors + + + illustrator + illustrators + + + translator + translators + + + editor & translator + editors & translators + + + + + dir. + dirs. + + + ed. + eds. + + + ed. + eds. + + + ill. + ills. + + + tran. + trans. + + + ed. & tran. + eds. & trans. + + + + by + directed by + edited by + edited by + illustrated by + interview by + to + by + translated by + edited & translated by + + + dir. by + ed. by + ed. by + illus. by + trans. by + ed. & trans. by + + + January + February + March + April + May + June + July + August + September + October + November + December + + + Jan. + Feb. + Mar. + Apr. + May + Jun. + Jul. + Aug. + Sep. + Oct. + Nov. + Dec. + + + Spring + Summer + Autumn + Winter + + diff --git a/biblio/citation-style-language/csl-locales-en-US.xml b/biblio/citation-style-language/csl-locales-en-US.xml new file mode 100644 index 0000000000..a6bbb6bab4 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-en-US.xml @@ -0,0 +1,357 @@ + + + + + Andrew Dunning + + + Sebastian Karcher + + + Rintze M. Zelle + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T13:02:03-05:00 + + + + + + + + + + + + + + accessed + and + and others + anonymous + anon. + at + available at + by + circa + c. + cited + + edition + editions + + ed. + et al. + forthcoming + from + ibid. + in + in press + internet + interview + letter + no date + n.d. + online + presented at the + + reference + references + + + ref. + refs. + + retrieved + scale + version + + + AD + BC + + + + + + + + + + th + st + nd + rd + th + th + th + + + first + second + third + fourth + fifth + sixth + seventh + eighth + ninth + tenth + + + + book + books + + + chapter + chapters + + + column + columns + + + figure + figures + + + folio + folios + + + number + numbers + + + line + lines + + + note + notes + + + opus + opera + + + page + pages + + + page + pages + + + paragraph + paragraphs + + + part + parts + + + section + sections + + + sub verbo + sub verbis + + + verse + verses + + + volume + volumes + + + + + bk. + bks. + + + chap. + chaps. + + + col. + cols. + + + fig. + figs. + + + fol. + fols. + + + no. + nos. + + + l. + ll. + + + n. + nn. + + + op. + opp. + + + p. + pp. + + + p. + pp. + + + para. + paras. + + + pt. + pts. + + + sec. + secs. + + + s.v. + s.vv. + + + v. + vv. + + + vol. + vols. + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + editor + editors + + + editor + editors + + + illustrator + illustrators + + + translator + translators + + + editor & translator + editors & translators + + + + + dir. + dirs. + + + ed. + eds. + + + ed. + eds. + + + ill. + ills. + + + tran. + trans. + + + ed. & tran. + eds. & trans. + + + + by + directed by + edited by + edited by + illustrated by + interview by + to + by + translated by + edited & translated by + + + dir. by + ed. by + ed. by + illus. by + trans. by + ed. & trans. by + + + January + February + March + April + May + June + July + August + September + October + November + December + + + Jan. + Feb. + Mar. + Apr. + May + Jun. + Jul. + Aug. + Sep. + Oct. + Nov. + Dec. + + + Spring + Summer + Autumn + Winter + + diff --git a/biblio/citation-style-language/csl-locales-es-CL.xml b/biblio/citation-style-language/csl-locales-es-CL.xml new file mode 100644 index 0000000000..3b6f3f1e56 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-es-CL.xml @@ -0,0 +1,310 @@ + + + + + Scott Sadowsky + http://sadowsky.cl/ + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2015-10-15T14:41:06-04:00 + + + + + + + + + + + + + + accedido + y + et al. + anónimo + anón. + en + disponible en + de + circa + c. + citado + + edición + ediciones + + ed. + et al. + en preparación + a partir de + ibid. + en + en imprenta + internet + entrevista + carta + sin fecha + s. f. + en línea + presentado en + + referencia + referencias + + + ref. + refs. + + recuperado + escala + versión + + + d. C. + a. C. + + + + + + + + + + ª + + + primera + segunda + tercera + cuarta + quinta + sexta + séptima + octava + novena + décima + + + + libro + libros + + + capítulo + capítulos + + + columna + columnas + + + figura + figuras + + + folio + folios + + + número + números + + + línea + líneas + + + nota + notas + + + opus + opera + + + página + páginas + + + página + páginas + + + párrafo + párrafos + + + parte + partes + + + sección + secciones + + + sub voce + sub vocibus + + + verso + versos + + + volumen + volúmenes + + + + lib. + cap. + col. + fig. + f. + + l. + n. + op. + + p. + pp. + + + p. + pp. + + párr. + pt. + sec. + + s. v. + s. vv. + + + v. + vv. + + + vol. + vols. + + + + + § + § + + + § + § + + + + + director + directores + + + editor + editores + + + coordinador + coordinadores + + + ilustrador + ilustradores + + + traductor + traductores + + + editor y traductor + editores y traductores + + + + + dir. + dirs. + + + ed. + eds. + + + coord. + coords. + + + ilust. + ilusts. + + + trad. + trads. + + + ed. y trad. + eds. y trads. + + + + de + dirigido por + editado por + coordinado por + ilustrado por + entrevistado por + a + por + traducido por + editado y traducido por + + + dir. + ed. + coord. + ilust. + trad. + ed. y trad. + + + enero + febrero + marzo + abril + mayo + junio + julio + agosto + septiembre + octubre + noviembre + diciembre + + + ene. + feb. + mar. + abr. + may + jun. + jul. + ago. + sep. + oct. + nov. + dic. + + + primavera + verano + otoño + invierno + + diff --git a/biblio/citation-style-language/csl-locales-es-ES.xml b/biblio/citation-style-language/csl-locales-es-ES.xml new file mode 100644 index 0000000000..1ce004aab9 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-es-ES.xml @@ -0,0 +1,309 @@ + + + + + javimat + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + accedido + y + y otros + anónimo + anón. + en + disponible en + de + circa + c. + citado + + edición + ediciones + + ed. + et al. + previsto + a partir de + ibid. + en + en imprenta + internet + entrevista + carta + sin fecha + s. f. + en línea + presentado en + + referencia + referencias + + + ref. + refs. + + recuperado + escala + versión + + + d. C. + a. C. + + + « + » + + + - + + + + + + primera + segunda + tercera + cuarta + quinta + sexta + séptima + octava + novena + décima + + + + libro + libros + + + capítulo + capítulos + + + columna + columnas + + + figura + figuras + + + folio + folios + + + número + números + + + línea + líneas + + + nota + notas + + + opus + opera + + + página + páginas + + + página + páginas + + + párrafo + párrafos + + + parte + partes + + + sección + secciones + + + sub voce + sub vocibus + + + verso + versos + + + volumen + volúmenes + + + + lib. + cap. + col. + fig. + f. + n.º + l. + n. + op. + + p. + pp. + + + p. + pp. + + párr. + pt. + sec. + + s. v. + s. vv. + + + v. + vv. + + + vol. + vols. + + + + + § + § + + + § + § + + + + + director + directores + + + editor + editores + + + editor + editores + + + ilustrador + ilustradores + + + traductor + traductores + + + editor y traductor + editores y traductores + + + + + dir. + dirs. + + + ed. + eds. + + + ed. + eds. + + + ilust. + ilusts. + + + trad. + trads. + + + ed. y trad. + eds. y trads. + + + + de + dirigido por + editado por + editado por + ilustrado por + entrevistado por + a + por + traducido por + editado y traducido por + + + dir. + ed. + ed. + ilust. + trad. + ed. y trad. + + + enero + febrero + marzo + abril + mayo + junio + julio + agosto + septiembre + octubre + noviembre + diciembre + + + ene. + feb. + mar. + abr. + may + jun. + jul. + ago. + sep. + oct. + nov. + dic. + + + primavera + verano + otoño + invierno + + diff --git a/biblio/citation-style-language/csl-locales-es-MX.xml b/biblio/citation-style-language/csl-locales-es-MX.xml new file mode 100644 index 0000000000..385a4ba106 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-es-MX.xml @@ -0,0 +1,351 @@ + + + + + Juan Ignacio Flores Salgado + https://www.mendeley.com/profiles/juan-ignacio-flores-salgado/ + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2015-10-15T14:41:06-04:00 + + + + + + + + + + + + + + consultado + y + et al. + anónimo + anón. + en + disponible en + de + circa + c. + citado + + edición + ediciones + + + ed. + eds. + + et al. + en preparación + a partir de + ibid. + en + en imprenta + internet + entrevista + carta + sin fecha + s/f + en línea + presentado en + + referencia + referencias + + + ref. + refs. + + recuperado + escala + versión + + + d. C. + a. C. + + + + + + + + + + a + a + o + + + primera + segunda + tercera + cuarta + quinta + sexta + séptima + octava + novena + décima + + + + libro + libros + + + capítulo + capítulos + + + columna + columnas + + + figura + figuras + + + folio + folios + + + número + números + + + línea + líneas + + + nota + notas + + + opus + opera + + + página + páginas + + + página + páginas + + + párrafo + párrafos + + + parte + partes + + + sección + secciones + + + sub voce + sub vocibus + + + verso + versos + + + volumen + volúmenes + + + + + lib. + libs. + + + cap. + caps. + + + col. + cols. + + + fig. + figs. + + + f. + ff. + + + núm. + núms. + + + l. + ls. + + + n. + nn. + + + op. + opp. + + + p. + pp. + + + p. + pp. + + + párr. + párrs. + + + pt. + pts. + + + sec. + secs. + + + s. v. + s. vv. + + + v. + vv. + + + vol. + vols. + + + + + + + + + § + § + + + + + director + directores + + + editor + editores + + + coordinador + coordinadores + + + ilustrador + ilustradores + + + traductor + traductores + + + editor y traductor + editores y traductores + + + + + dir. + dirs. + + + ed. + eds. + + + coord. + coords. + + + ilust. + ilusts. + + + trad. + trads. + + + ed. y trad. + eds. y trads. + + + + de + dirigido por + editado por + coordinado por + ilustrado por + entrevistado por + a + por + traducido por + editado y traducido por + + + dir. + ed. + coord. + ilust. + trad. + ed. y trad. + + + enero + febrero + marzo + abril + mayo + junio + julio + agosto + septiembre + octubre + noviembre + diciembre + + + ene. + feb. + mar. + abr. + may + jun. + jul. + ago. + sep. + oct. + nov. + dic. + + + primavera + verano + otoño + invierno + + diff --git a/biblio/citation-style-language/csl-locales-et-EE.xml b/biblio/citation-style-language/csl-locales-et-EE.xml new file mode 100644 index 0000000000..a9afd09b99 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-et-EE.xml @@ -0,0 +1,309 @@ + + + + + Andrew Dunning + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + vaadatud + ja + ja teised + anonüümne + anon + + available at + + umbes + u + tsiteeritud + + väljaanne + väljaanded + + tr + et al. + ilmumisel + + ibid. + + trükis + internet + intervjuu + kiri + s.a. + s.a. + online + esitatud + + viide + viited + + + viide + viited + + salvestatud + scale + version + + + pKr + eKr + + + + + + + + + + . + + + esimene + teine + kolmas + neljas + viies + kuues + seitsmes + kaheksas + üheksas + kümnes + + + + raamat + raamatud + + + peatükk + peatükid + + + veerg + veerud + + + joonis + joonised + + + foolio + fooliod + + + number + numbrid + + + rida + read + + + viide + viited + + + opus + opera + + + lehekülg + leheküljed + + + lehekülg + leheküljed + + + lõik + lõigud + + + osa + osad + + + alajaotis + alajaotised + + + sub verbo + sub verbis + + + värss + värsid + + + köide + köited + + + + rmt + ptk + v + joon + f + nr + l. + n. + op + + lk + lk + + + lk + lk + + lõik + osa + alajaot. + + s.v. + s.vv. + + + v + vv + + + kd + kd + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + toimetaja + toimetajad + + + toimetaja + toimetajad + + + illustrator + illustrators + + + tõlkija + tõlkijad + + + toimetaja & tõlkija + toimetajad & tõlkijad + + + + + dir. + dirs. + + + toim + toim + + + toim + toim + + + ill. + ills. + + + tõlk + tõlk + + + toim & tõlk + toim & tõlk + + + + + directed by + toimetanud + toimetanud + illustrated by + intervjueerinud + + by + tõlkinud + toimetanud & tõlkinud + + + dir. + toim + toim + illus. + tõlk + toim & tõlk + + + jaanuar + veebruar + märts + aprill + mai + juuni + juuli + august + september + oktoober + november + detsember + + + jaan + veebr + märts + apr + mai + juuni + juuli + aug + sept + okt + nov + dets + + + kevad + suvi + sügis + talv + + diff --git a/biblio/citation-style-language/csl-locales-eu.xml b/biblio/citation-style-language/csl-locales-eu.xml new file mode 100644 index 0000000000..12b0511740 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-eu.xml @@ -0,0 +1,309 @@ + + + + + Amaraun + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T12:56:15-05:00 + + + + + + + + + + + + + + eskuratua + eta + eta beste + ezezaguna + ezez. + -(e)n + available at + -(e)k egina + inguru + ing. + aipatua + + argitalpena + argitalpenak + + arg. + et al. + bidean + -(e)tik + ibíd. + in + moldiztegian + internet + elkarrizketa + gutuna + datarik gabe + d. g. + sarean + -(e)n aurkeztua + + aipamena + aipamenak + + + aip. + aip. + + berreskuratua + scale + version + + + K.a. + K.o. + + + « + » + + + + + + . + + + lehengo + bigarren + hirugarren + laugarren + bosgarren + seigarren + zazpigarren + zortzigarren + bederatzigarren + hamargarren + + + + liburua + liburuak + + + kapitulua + kapituluak + + + zutabea + zutabeak + + + irudia + irudiak + + + orria + orriak + + + zenbakia + zenbakiak + + + lerroa + lerroak + + + oharra + oharrak + + + obra + obrak + + + orrialdea + orrialdeak + + + orrialdea + orrialdeak + + + paragrafoa + paragrafoak + + + zatia + zatiak + + + atala + atalak + + + sub voce + sub vocem + + + bertsoa + bertsoak + + + luburikia + luburukiak + + + + lib. + kap. + zut. + iru. + or. + zenb. + l. + n. + op. + + or. + or. + + + or. + or. + + par. + zt. + atal. + + s.v. + s.v. + + + b. + bb. + + + libk. + libk. + + + + + + ¶¶ + + + § + § + + + + + director + directors + + + argitaratzailea + argitaratzaileak + + + argitaratzailea + argitaratzaileak + + + illustrator + illustrators + + + itzultzailea + itzultzaileak + + + argitaratzaile eta itzultzailea + argitaratzaile eta itzultzaileak + + + + + dir. + dirs. + + + arg. + arg. + + + arg. + arg. + + + ill. + ills. + + + itzul. + itzul. + + + arg. eta itzul. + arg. eta itzul. + + + + + directed by + -(e)k argitaratua + -(e)k argitaratua + illustrated by + -(e)k elkarrizketatua + -(r)entzat + by + -(e)k itzulia + -(e)k argitaratu eta itzulia + + + dir. + arg. + arg. + illus. + itzul. + -(e)k arg. eta itzul. + + + urtarrilak + otsailak + martxoak + apirilak + maiatzak + ekainak + uztailak + abuztuak + irailak + urriak + azaroak + abenduak + + + urt. + ots. + martx. + apr. + mai. + eka. + uzt. + abz. + ira. + urr. + aza. + abe. + + + udaberria + uda + udazkena + negua + + diff --git a/biblio/citation-style-language/csl-locales-fa-IR.xml b/biblio/citation-style-language/csl-locales-fa-IR.xml new file mode 100644 index 0000000000..2d24057199 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-fa-IR.xml @@ -0,0 +1,312 @@ + + + + + Hamed Heydari + + + abdealikhurrum + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + دسترسی + و + و دیگران + ناشناس + ناشناس + در + قابل دسترس در + توسط + تقریباً + c. + ارجاع شده + + ویرایش + ویرایش‌های + + ویرایش + و همکاران + در دست انتشار + از + همان + در + زیر چاپ + اینترنت + مصاحبه + نامه + بدون تاریخ + بدون تاریخ + آنلاین + ارائه شده در + + مرجع + مراجع + + + مرجع + مراجع + + retrieved + scale + نسخه + + + بعد از میلاد + قبل از میلاد + + + + + + + + + + + + + اول + دوم + سوم + چهارم + پنجم + ششم + هفتم + هشتم + نهم + دهم + + + + کتاب + کتاب‌های + + + فصل + فصل‌های + + + ستون + ستون‌های + + + تصویر + تصاویر + + + برگ + برگ‌های + + + شماره + شماره‌های + + + خط + خطوط + + + یادداشت + یادداشت‌های + + + قطعه + قطعات + + + صفحه + صفحات + + + صفحه + صفحات + + + پاراگراف + پاراگراف‌های + + + بخش + بخش‌های + + + قسمت + قسمت‌های + + + در ذیلِ واژه + در ذیلِ واژه‌های + + + بیت + بیت‌های + + + جلد + جلدهای + + + + کتاب + فصل + ستون + تصویر + برگ + ش + خط + یادداشت + قطعه + + ص + صص + + + ص + صص + + پاراگراف + بخش + قسمت + + s.v + s.vv + + + بیت + ابیات + + + ج + جج + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + ویراستار + ویراستاران + + + ویراستار + ویراستاران + + + طراح گرافیک + طراحان گرافیک + + + مترجم + مترجمین + + + ویراستار و مترجم + ویراستاران و مترجمین + + + + + dir. + dirs. + + + ویراستار + ویراستاران + + + ویراستار + ویراستاران + + + تصویرگر + تصویرگران + + + مترجم + مترجمین + + + ویراستار و مترجم + ویراستاران و مترجمین + + + + توسط + زیر نظر + ویراسته‌ی + ویراسته‌ی + طراحی گرافیکی از + مصاحبه توسط + به + بازبینی توسط + ترجمه‌ی + ترجمه و ویراسته‌ی + + + dir. + ویراسته‌ی + ویراسته‌ی + طراحی از + ترجمه‌ی + ترجمه و ویراسته‌ی + + + ژانویه + فوریه + مارس + آوریل + می + ژوئن + جولای + آگوست + سپتامبر + اکتبر + نوامبر + دسامبر + + + ژانویه + فوریه + مارس + آوریل + می + ژوئن + جولای + آگوست + سپتامبر + اکتبر + نوامبر + دسامبر + + + بهار + تابستان + پاییز + زمستان + + diff --git a/biblio/citation-style-language/csl-locales-fi-FI.xml b/biblio/citation-style-language/csl-locales-fi-FI.xml new file mode 100644 index 0000000000..1155a41868 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-fi-FI.xml @@ -0,0 +1,318 @@ + + + + + Janne Huovari + + + snissine + + + villelahtinen + + + Juhana Venäläinen + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2018-10-18T06:05:10+03:00 + + + + + + + + + + + + + + viitattu + ja + ym. + tuntematon + tuntematon + osoitteessa + saatavissa + tekijä + noin + n. + viitattu + + painos + painokset + + p. + ym. + tulossa + osoitteesta + mt. + teoksessa + painossa + internet + haastattelu + kirje + ei päivämäärää + ei pvm. + verkossa + esitetty tilaisuudessa + + viittaus + viittaukset + + + viit. + viit. + + noudettu + mittakaava + versio + + + jaa. + eaa. + + + + + + + + + + . + + + ensimmäinen + toinen + kolmas + neljäs + viides + kuudes + seitsemäs + kahdeksas + yhdeksäs + kymmenes + + + + kirja + kirjat + + + luku + luvut + + + palsta + palstat + + + kuvio + kuviot + + + folio + foliot + + + numero + numerot + + + rivi + rivit + + + huomautus + huomautukset + + + opus + opukset + + + sivu + sivut + + + sivu + sivut + + + kappale + kappaleet + + + osa + osat + + + osa + osat + + + sub verbo + sub verbis + + + säkeistö + säkeistöt + + + vuosikerta + vuosikerrat + + + + kirja + luku + palsta + kuv. + fol. + nro + r. + huom. + op. + + s. + ss. + + + s. + ss. + + kappale + osa + osa + + s.v. + s.vv. + + + säk. + säk. + + + vsk. + vsk. + + + + + + ¶¶ + + + § + §§ + + + + + ohjaaja + ohjaajat + + + toimittaja + toimittajat + + + toimittaja + toimittajat + + + kuvittaja + kuvittajat + + + kääntäjä + kääntäjät + + + toimittaja ja kääntäjä + toimittajat ja kääntäjät + + + + + ohj. + ohj. + + + toim. + toim. + + + toim. + toim. + + + kuv. + kuv. + + + käänt. + käänt. + + + toim. ja käänt. + toim. ja käänt. + + + + + ohjannut + toimittanut + toimittanut + kuvittanut + haastatellut + vastaanottaja + + kääntänyt + toimittanut ja kääntänyt + + + ohj. + toim. + toim. + kuv. + käänt. + toim. ja käänt. + + + tammikuuta + helmikuuta + maaliskuuta + huhtikuuta + toukokuuta + kesäkuuta + heinäkuuta + elokuuta + syyskuuta + lokakuuta + marraskuuta + joulukuuta + + + tammi + helmi + maalis + huhti + touko + kesä + heinä + elo + syys + loka + marras + joulu + + + kevät + kesä + syksy + talvi + + diff --git a/biblio/citation-style-language/csl-locales-fr-CA.xml b/biblio/citation-style-language/csl-locales-fr-CA.xml new file mode 100644 index 0000000000..cd08f0982c --- /dev/null +++ b/biblio/citation-style-language/csl-locales-fr-CA.xml @@ -0,0 +1,317 @@ + + + + + Grégoire Colly + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2015-10-15T14:41:06-04:00 + + + + + + + + + + + + + + consulté le + et + et autres + anonyme + anon. + sur + disponible à + par + vers + v. + cité + + édition + éditions + + éd. + et al. + à paraître + à l'adresse + ibid. + dans + sous presse + Internet + entretien + lettre + sans date + s. d. + en ligne + présenté à + + référence + références + + + réf. + réf. + + consulté + échelle + version + + + apr. J.-C. + av. J.-C. + + + «  +  » + + + + + + + ʳᵉ + ᵉʳ + + + premier + deuxième + troisième + quatrième + cinquième + sixième + septième + huitième + neuvième + dixième + + + + livre + livres + + + chapitre + chapitres + + + colonne + colonnes + + + figure + figures + + + folio + folios + + + numéro + numéros + + + ligne + lignes + + + note + notes + + + opus + opus + + + page + pages + + + page + pages + + + paragraphe + paragraphes + + + partie + parties + + + section + sections + + + sub verbo + sub verbis + + + verset + versets + + + volume + volumes + + + + liv. + chap. + col. + fig. + + fᵒ + fᵒˢ + + + nᵒ + nᵒˢ + + l. + n. + op. + + p. + p. + + + p. + p. + + paragr. + part. + sect. + + s. v. + s. vv. + + + v. + v. + + + vol. + vol. + + + + + § + § + + + § + § + + + + + réalisateur + réalisateurs + + + éditeur + éditeurs + + + directeur + directeurs + + + illustrateur + illustrateurs + + + traducteur + traducteurs + + + éditeur et traducteur + éditeurs et traducteurs + + + + + réal. + réal. + + + éd. + éd. + + + dir. + dir. + + + ill. + ill. + + + trad. + trad. + + + éd. et trad. + éd. et trad. + + + + par + réalisé par + édité par + sous la direction de + illustré par + entretien réalisé par + à + par + traduit par + édité et traduit par + + + réal. par + éd. par + ss la dir. de + ill. par + trad. par + éd. et trad. par + + + janvier + février + mars + avril + mai + juin + juillet + août + septembre + octobre + novembre + décembre + + + janv. + févr. + mars + avr. + mai + juin + juill. + août + sept. + oct. + nov. + déc. + + + printemps + été + automne + hiver + + diff --git a/biblio/citation-style-language/csl-locales-fr-FR.xml b/biblio/citation-style-language/csl-locales-fr-FR.xml new file mode 100644 index 0000000000..9066bd58cb --- /dev/null +++ b/biblio/citation-style-language/csl-locales-fr-FR.xml @@ -0,0 +1,317 @@ + + + + + Grégoire Colly + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2015-10-15T14:41:06-04:00 + + + + + + + + + + + + + + consulté le + et + et autres + anonyme + anon. + sur + disponible sur + par + vers + v. + cité + + édition + éditions + + éd. + et al. + à paraître + à l'adresse + ibid. + in + sous presse + Internet + entretien + lettre + sans date + s. d. + en ligne + présenté à + + référence + références + + + réf. + réf. + + consulté + échelle + version + + + apr. J.-C. + av. J.-C. + + + «  +  » + + + + + + + ʳᵉ + ᵉʳ + + + premier + deuxième + troisième + quatrième + cinquième + sixième + septième + huitième + neuvième + dixième + + + + livre + livres + + + chapitre + chapitres + + + colonne + colonnes + + + figure + figures + + + folio + folios + + + numéro + numéros + + + ligne + lignes + + + note + notes + + + opus + opus + + + page + pages + + + page + pages + + + paragraphe + paragraphes + + + partie + parties + + + section + sections + + + sub verbo + sub verbis + + + verset + versets + + + volume + volumes + + + + liv. + chap. + col. + fig. + + fᵒ + fᵒˢ + + + nᵒ + nᵒˢ + + l. + n. + op. + + p. + p. + + + p. + p. + + paragr. + part. + sect. + + s. v. + s. vv. + + + v. + v. + + + vol. + vol. + + + + + § + § + + + § + § + + + + + réalisateur + réalisateurs + + + éditeur + éditeurs + + + directeur + directeurs + + + illustrateur + illustrateurs + + + traducteur + traducteurs + + + éditeur et traducteur + éditeurs et traducteurs + + + + + réal. + réal. + + + éd. + éd. + + + dir. + dir. + + + ill. + ill. + + + trad. + trad. + + + éd. et trad. + éd. et trad. + + + + par + réalisé par + édité par + sous la direction de + illustré par + entretien réalisé par + à + par + traduit par + édité et traduit par + + + réal. par + éd. par + ss la dir. de + ill. par + trad. par + éd. et trad. par + + + janvier + février + mars + avril + mai + juin + juillet + août + septembre + octobre + novembre + décembre + + + janv. + févr. + mars + avr. + mai + juin + juill. + août + sept. + oct. + nov. + déc. + + + printemps + été + automne + hiver + + diff --git a/biblio/citation-style-language/csl-locales-he-IL.xml b/biblio/citation-style-language/csl-locales-he-IL.xml new file mode 100644 index 0000000000..260b455ac6 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-he-IL.xml @@ -0,0 +1,315 @@ + + + + + roypeled1 + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + נבדק לאחרונה + ו + ואחרים + אלמוני + anon + + זמין ב + על-ידי + לערך + c. + מצוטט ב + + מהדורה + מהדורות + + ed + ואחרים + צפוי + מתוך + שם + בתוך + בהדפסה + אינטרנט + ראיון + מכתב + אין נתונים + nd + מקוון + הוצג ב + + הפניה + הפניות + + + ref. + refs. + + אוחזר + scale + גירסה + + + לספירה + לפני הספירה + + + + + + + + + + th + st + nd + rd + th + th + th + + + ראשון + שני + שלישי + רביעי + חמישי + שישי + שביעי + שמיני + תשיעי + עשירי + + + + ספר + ספרים + + + פרק + פרקים + + + טור + טורים + + + figure + figures + + + פוליו + פוליו + + + מספר + מספרים + + + שורה + שורות + + + הערה + הערות + + + אופוס + אופרה + + + עמוד + עמודים + + + עמוד + עמודים + + + פיסקה + פיסקאות + + + חלק + חלקים + + + סעיף + סעיפים + + + sub verbo + sub verbis + + + בית + בתים + + + כרך + כרכים + + + + bk + chap + col + fig + f + no + l. + n. + op + + 'עמ + 'עמ + + + 'עמ + 'עמ + + para + pt + ס' + + s.v. + s.vv. + + + v + vv + + + vol + vols + + + + + + ¶¶ + + + § + §§ + + + + + במאי + במאים + + + עורך + עורכים + + + עורך ראשי + עורכים ראשיים + + + מאייר + מאיירים + + + מתרגם + מתרגמים + + + editor & translator + editors & translators + + + + + dir. + dirs. + + + ed + eds + + + ed. + eds. + + + ill. + ills. + + + tran + trans + + + ed. & tran. + eds. & trans. + + + + by + בוים ע"י + נערך ע"י + בוים ע"י + אויר ע"י + רואיין ע"י + אל + ע"י + תורגם ע"י + edited & translated by + + + dir. + ed + ed. + illus. + trans + ed. & trans. by + + + ינואר + פברואר + מרץ + אפריל + מאי + יוני + יולי + אוגוסט + ספטמבר + אוקטובר + נובמבר + דצמבר + + + Jan + Feb + Mar + Apr + May + Jun + Jul + Aug + Sep + Oct + Nov + Dec + + + Spring + Summer + Autumn + Winter + + diff --git a/biblio/citation-style-language/csl-locales-hi-IN.xml b/biblio/citation-style-language/csl-locales-hi-IN.xml new file mode 100644 index 0000000000..b2f127d68a --- /dev/null +++ b/biblio/citation-style-language/csl-locales-hi-IN.xml @@ -0,0 +1,361 @@ + + + + + Neha Srivastava + neha-srivastava@outlook.com + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2021-03-02T00:21:50-05:00 + + + + + + + + + + + + + + अंतिम उपयोग + + व अन्य + अज्ञात + अज्ञात + पर + पर उपलब्ध + द्वारा + सन + सन. + उल्लेखित + + संस्करण + संस्करण + + ed. + इत्यादि + आगामी + से + उक्त + में + मुद्रण में + इंटर्नेट + साक्षात्कार + पत्र + दिनांक अज्ञात + n.d. + ऑनलाइन + पर प्रस्तुत + + संदर्भ + references + + + ref. + refs. + + पुनर्प्राप्त + scale + संस्करण + + + CE + BCE + + + + + + + + + + वाँ + + + + + + + + पहला + पहली + दूसरा + दूसरी + तीसरा + तीसरी + चौथा + चौथी + पाँचवा + पाँचवी + छठा + छठी + सातवाँ + सातवीं + आठवाँ + आठवीं + नवाँ + नौवीं + दसवाँ + दसवीं + + + + पुस्तक + पुस्तकें + + + अध्याय + अध्याय + + + कॉलम + columns + + + चित्र + चित्रों + + + पर्ण + folios + + + संख्या + संख्याएँ + + + पंक्ति + पंक्तियाँ + + + नोट + notes + + + opus + opera + + + पृष्ठ + पृष्ठ + + + पृष्ठ संख्या + पृष्ठों की संख्या + + + अनुच्छेद + paragraphs + + + भाग + parts + + + अनुभाग + sections + + + sub verbo + sub verbis + + + पद + verses + + + वॉल्यूम + वॉल्यूम्ज़ + + + + + bk. + bks. + + + chap. + chaps. + + + col. + cols. + + + fig. + figs. + + + fol. + fols. + + + no. + nos. + + + l. + ll. + + + n. + nn. + + + op. + opp. + + + पृ. + पृ. + + + पृ. स. + पृ. स. + + + para. + paras. + + + pt. + pts. + + + sec. + secs. + + + s.v. + s.vv. + + + v. + vv. + + + vol. + vols. + + + + + + ¶¶ + + + § + §§ + + + + + निर्देशक + directors + + + सम्पादक + editors + + + सम्पादक + editors + + + चित्रकार + illustrators + + + अनुवादक + translators + + + सम्पादक & अनुवादक + editors & translators + + + + + dir. + dirs. + + + ed. + eds. + + + ed. + eds. + + + ill. + ills. + + + tran. + trans. + + + ed. & tran. + eds. & trans. + + + + द्वारा + निर्देशन + सम्पादन + निर्देशन + चित्रकारी + साक्षात्कारकर्ता + सेवा में + द्वारा + अनुवाद + सम्पादन & अनुवाद + + + dir. by + ed. by + ed. by + illus. by + trans. by + ed. & trans. by + + + जनवरी + फ़रवरी + मार्च + अप्रैल + मई + जून + जुलाई + अगस्त + सितम्बर + अक्टूबर + नवम्बर + दिसम्बर + + + जन. + फ़र. + मार्च + अप्रैल + मई + जून + जुलाई + अग. + सित. + अक्ट. + नव. + दिस. + + + वसंत ऋतु + ग्रीष्म ऋतु + पतझड़ ऋतु + शिशिर ऋतु + + diff --git a/biblio/citation-style-language/csl-locales-hr-HR.xml b/biblio/citation-style-language/csl-locales-hr-HR.xml new file mode 100644 index 0000000000..79db78a455 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-hr-HR.xml @@ -0,0 +1,309 @@ + + + + + tvrbanec + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + pristupljeno + i + i ostali + anonimno + anon. + na + dostupno na + od + oko + oko + citirano + + izdanje + izdanja + + izd. + i ostali + u pripremi + od + ibid. + u + u tisku + internet + intervju + pismo + bez datuma + bez dat. + na internetu + predstavljeno na + + reference + reference + + + ref. + ref. + + preuzeto + skala + verzija + + + + pr. Kr. + + + + + + + + + + . + + + prvi + drugi + treći + četvrti + peti + šesti + sedmi + osmi + deveti + deseti + + + + knjiga + knjige + + + poglavlje + poglavlja + + + stupac + stupci + + + crtež + crteži + + + folija + folije + + + izdanje + izdanja + + + red + redovi + + + bilješka + bilješke + + + djelo + djela + + + stranica + stranice + + + stranica + stranice + + + pasus + pasusi + + + dio + dijelova + + + odjeljak + odjeljci + + + sub verbo + sub verbis + + + stih + stihovi + + + svezak + svesci + + + + knj. + pogl. + stup. + crt. + fol. + izd. + red + bilj. + sv. + + str. + str. + + + str. + str. + + par. + dio + od. + + s.v. + s.vv. + + + st. + st. + + + sv. + sv. + + + + + + ¶¶ + + + § + §§ + + + + + voditelj + voditelji + + + urednik + urednici + + + urednik + urednici + + + ilustrator + ilustratori + + + prevoditelj + prevoditelji + + + urednik & prevoditelj + urednici & prevoditelji + + + + + vod. + vod. + + + ur. + ur. + + + ur.-vod. + ur.-vod. + + + il. + il. + + + prev. + prev. + + + ur. & prev. + ur. & prev. + + + + od + vodio + uredio + uredio + ilustrirao + intervjuirao + primatelj + pregledao + preveo + uredio & preveo + + + vod. + ur. + ur. vod. + ilus. + prev. + ur. & prev. + + + siječanj + veljača + ožujak + travanj + svibanj + lipanj + srpanj + kolovoz + rujan + listopad + studeni + prosinac + + + sij. + velj. + ožu. + tra. + svi. + lip. + srp. + kol. + ruj. + lis. + stu. + pros. + + + proljeće + ljeto + jesen + zima + + diff --git a/biblio/citation-style-language/csl-locales-hu-HU.xml b/biblio/citation-style-language/csl-locales-hu-HU.xml new file mode 100644 index 0000000000..f3e109aba9 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-hu-HU.xml @@ -0,0 +1,313 @@ + + + + + Miklos Vajna + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + elérés + és + és mások + szerző nélkül + sz. n. + + elérhető + by + körülbelül + kb. + idézi + + kiadás + kiadás + + kiad. + és mtsai. + megjelenés alatt + forrás + uo. + in + nyomtatás alatt + internet + interjú + levél + évszám nélkül + é. n. + online + előadás + + hivatkozás + hivatkozás + + + hiv. + hiv. + + elérés + skála + verzió + + + Kr. u. + Kr. e. + + + i. sz. + i. e. + + + + + » + « + + + + . + + + első + második + harmadik + negyedik + ötödik + hatodik + hetedik + nyolcadik + kilencedik + tizedik + + + + könyv + könyv + + + fejezet + fejezet + + + oszlop + oszlop + + + ábra + ábra + + + fóliáns + fóliáns + + + szám + szám + + + sor + sor + + + jegyzet + jegyzet + + + + + + + oldal + oldal + + + oldal + oldal + + + bekezdés + bekezdés + + + rész + rész + + + szakasz + szakasz + + + sub verbo + sub verbis + + + versszak + versszak + + + kötet + kötet + + + + könyv + fej. + oszl. + ábr. + fol. + sz. + s. + j. + op. + + o. + o. + + + o. + o. + + bek. + rész + szak. + + s. v. + s. vv. + + + vsz. + vsz. + + + köt. + köt. + + + + + + ¶¶ + + + § + §§ + + + + + igazgató + igazgató + + + szerkesztő + szerkesztő + + + szerkesztőségi igazgató + szerkesztőségi igazgató + + + illusztrátor + illusztrátor + + + fordító + fordító + + + szerkesztő & fordító + szerkesztő & fordító + + + + + ig. + ig. + + + szerk. + szerk. + + + szerk. ig. + szerk. ig. + + + ill. + ill. + + + ford. + ford. + + + szerk. & ford. + szerk. & ford. + + + + by + directed by + szerkesztette + edited by + illusztrálta + interjúkészítő + címzett + by + fordította + szerkesztette & fordította + + + ig. + szerk. + ed. + ill. + ford. + szerk. & ford. + + + január + február + március + április + május + június + július + augusztus + szeptember + október + november + december + + + jan. + febr. + márc. + ápr. + máj. + jún. + júl. + aug. + szept. + okt. + nov. + dec. + + + tavasz + nyár + ősz + tél + + diff --git a/biblio/citation-style-language/csl-locales-id-ID.xml b/biblio/citation-style-language/csl-locales-id-ID.xml new file mode 100644 index 0000000000..15dbabc3e3 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-id-ID.xml @@ -0,0 +1,321 @@ + + + + + faizhabibullah + + + Deden Habibi + + + xbypass + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T12:56:15-05:00 + + + + + + + + + + + + + + diakses + dan + dan lainnya + anonim + anon. + pada + tersedia pada + oleh + circa + ca. + dikutip + + edisi + edisi + + ed. + dkk. + mendatang + dari + ibid. + dalam + dalam proses cetakan + internet + wawancara + surat + tanpa tanggal + t.t. + daring + dipresentasikan pada + + referensi + referensi + + + ref. + ref. + + diambil + skala + versi + + + M + SM + + + + + + + + + + + + + + + + + + + pertama + kedua + ketiga + keempat + kelima + keenam + ketujuh + kedelapan + kesembilan + kesepuluh + + + + buku + buku + + + bab + bab + + + kolom + kolom + + + gambar + gambar + + + folio + folio + + + nomor + nomor + + + baris + baris + + + catatan + catatan + + + opus + opera + + + halaman + halaman + + + halaman + halaman + + + paragraf + paragraf + + + bagian + bagian + + + bagian + bagian + + + sub verbo + sub verbis + + + ayat + ayat + + + volume + volume + + + + bk. + bb. + kol. + gbr. + fol. + no. + brs. + ctt. + op. + + hlm. + hlm. + + + hlm. + hlm. + + para. + bag. + bag. + + s.v. + s.vv. + + + a. + a. + + + vol. + vol. + + + + + + ¶¶ + + + § + §§ + + + + + direktur + direktur + + + editor + editor + + + editor + editor + + + ilustrator + ilustrator + + + penerjemah + penerjemah + + + editor & penerjemah + editor & penerjemah + + + + + dir. + dir. + + + ed. + ed. + + + ed. + ed. + + + il. + il. + + + penerj. + penerj. + + + ed. & penerj. + ed. & penerj. + + + + oleh + diarahkan oleh + disunting oleh + disunting oleh + diilustrasi oleh + diwawancara oleh + kepada + oleh + diterjemahkan oleh + disunting & diterjemahkan oleh + + + dir. oleh + ed. oleh + ed. oleh + illus. oleh + trans. oleh + ed. & penerj. oleh + + + Januari + Februari + Maret + April + Mei + Juni + Juli + Agustus + September + Oktober + November + Desember + + + Jan + Feb + Mar + Apr + Mei + Jun + Jul + Agu + Sep + Okt + Nov + Des + + + Semi + Panas + Gugur + Dingin + + diff --git a/biblio/citation-style-language/csl-locales-is-IS.xml b/biblio/citation-style-language/csl-locales-is-IS.xml new file mode 100644 index 0000000000..854cca193c --- /dev/null +++ b/biblio/citation-style-language/csl-locales-is-IS.xml @@ -0,0 +1,312 @@ + + + + + dadamaster + + + styrmirm + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + sótt + og + og fleiri + nafnlaus + nafnl. + af + aðgengilegt á + eftir + sirka + u.þ.b. + tilvitnun + + útgáfa + útgáfur + + útg. + o.fl. + óbirt + af + sama heimild + í + í prentun + rafrænt + viðtal + bréf + engin dagsetning + e.d. + rafrænt + flutt á + + tilvitnun + tilvitnanir + + + tilv. + tilv. + + sótt + scale + útgáfa + + + e.Kr. + f.Kr. + + + + + + + + + + . + + + fyrsti + annar + þriðji + fjórði + fimmti + sjötti + sjöundi + áttundi + níundi + tíundi + + + + bók + bækur + + + kafli + kaflar + + + dálkur + dálkar + + + mynd + myndir + + + handrit + handrit + + + tölublað + tölublöð + + + lína + línur + + + athugasemd + athugasemdir + + + tónverk + tónverk + + + blaðsíða + blaðsíður + + + blaðsíða + blaðsíður + + + málsgrein + málsgreinar + + + hluti + hlutar + + + hluti + hlutar + + + sub verbo + sub verbis + + + vers + vers + + + bindi + bindi + + + + bók + k. + d. + mynd. + handr. + tbl. + l. + ath. + tónv. + + bls. + bls. + + + bls. + bls. + + málsgr. + hl. + hl. + + s.v. + s.vv. + + + v. + v. + + + b. + b. + + + + + + ¶¶ + + + § + §§ + + + + + leikstjóri + leikstjórar + + + ritstjóri + ritstjórar + + + ritstjóri + ritstjórar + + + höfundur myndskreytinga + höfundar myndskreytinga + + + þýðandi + þýðendur + + + ritstjóri og þýðandi + ritstjórar og þýðendur + + + + + leikstj. + leikstj. + + + ritstj. + ritstj. + + + ritstj. + ritstj. + + + höf. mynd. + höf. mynd. + + + þýð. + þýð. + + + ritstj. og þýð. + ritstj. og þýð. + + + + eftir + leikstýrt af + ritstýrt af + ritstýrt af + myndskreytt af + viðtal tók + til + by + þýddi + ritstýrt og þýtt af + + + leikstj. + ritstj. + ritstj. + myndskr. + þýð. + ritstj. og þýð. + + + janúar + febrúar + mars + apríl + maí + júní + júlí + ágúst + september + október + nóvember + desember + + + jan. + feb. + mar. + apr. + maí + jún. + júl. + ágú. + sep. + okt. + nóv. + des. + + + vor + sumar + haust + vetur + + diff --git a/biblio/citation-style-language/csl-locales-it-IT.xml b/biblio/citation-style-language/csl-locales-it-IT.xml new file mode 100644 index 0000000000..970574ec80 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-it-IT.xml @@ -0,0 +1,340 @@ + + + + + FI App Development + + + Monica Thuegaz + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2020-12-07T06:01:04+01:00 + + + + + + + + + + + + + + consultato + e + e altri + anonimo + anon. + a + disponibile su + su + di + circa + c. + citato + + edizione + edizioni + + ed. + et al. + futuro + da + ibid. + ibidem + ibid. + in + in stampa + internet + intervista + lettera + senza data + s.d. + online + presentato al + + reference + references + + + ref. + refs. + + recuperato + scala + versione + + + d.C. + a.C. + + + « + » + + + + + + º + º + ª + + + prima + primo + prima + seconda + secondo + seconda + terza + terzo + terza + quarta + quarto + quarta + quinta + quinto + quinta + sesta + sesto + sesta + settima + settimo + settima + ottava + ottavo + ottava + nona + nono + nona + decima + decimo + decima + + + + libro + libri + + + capitolo + capitoli + + + colonna + colonne + + + figura + figure + + + foglio + fogli + + + numero + numeri + + + riga + righe + + + nota + note + + + opera + opere + + + pagina + pagine + + + pagina + pagine + + + capoverso + capoversi + + + parte + parti + + + paragrafo + paragrafi + + + sub verbo + sub verbis + + + verso + versi + + + volume + volumi + + + + lib. + + cap. + capp. + + col. + fig. + fgl. + n. + l. + n. + op. + + pag. + pagg. + + + pag. + pagg. + + cpv. + pt. + par. + + s.v. + s.vv. + + + v. + vv. + + + vol. + voll. + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + curatore + curatori + + + editor + editors + + + illustratore + illustratori + + + traduttore + traduttori + + + curatore e traduttore + curatori e tradutori + + + + + dir. + dir. + + + a c. di + a c. di + + + ed. + ed. + + + ill. + ill. + + + trad. + trad. + + + a c. di e trad. da + a c. di e trad. da + + + + di + diretto da + a cura di + edited by + illustrato da + intervista di + a + di + tradotto da + a cura di e tradotto da + + + dir. da + a c. di + ed. + ill. da + trad. da + a c. di e trad. da + + + gennaio + febbraio + marzo + aprile + maggio + giugno + luglio + agosto + settembre + ottobre + novembre + dicembre + + + gen. + feb. + mar. + apr. + mag. + giu. + lug. + ago. + set. + ott. + nov. + dic. + + + primavera + estate + autunno + inverno + + diff --git a/biblio/citation-style-language/csl-locales-ja-JP.xml b/biblio/citation-style-language/csl-locales-ja-JP.xml new file mode 100644 index 0000000000..b370d46883 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-ja-JP.xml @@ -0,0 +1,315 @@ + + + + + Shoji Takahashi + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + 参照 + + and others + anonymous + anon + at + available at + by + circa + c. + cited + + + + + + ほか + 近刊 + から + 前掲 + + in press + internet + interview + letter + no date + 日付なし + online + presented at the + + reference + references + + + ref. + refs. + + 読み込み + scale + version + + + AD + BC + + + + + + + + + + th + st + nd + rd + th + th + th + + + first + second + third + fourth + fifth + sixth + seventh + eighth + ninth + tenth + + + + book + books + + + chapter + chapters + + + column + columns + + + figure + figures + + + folio + folios + + + number + numbers + + + + + + + note + notes + + + opus + opera + + + ページ + ページ + + + ページ + ページ + + + 段落 + 段落 + + + part + parts + + + section + sections + + + sub verbo + sub verbis + + + verse + verses + + + volume + volumes + + + + bk. + chap. + col. + fig. + f. + no. + l. + n. + op. + + p. + pp. + + + p. + pp. + + para. + pt. + sec. + + s.v. + s.vv. + + + v. + vv. + + + vol. + vols. + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + + + + + editor + editors + + + illustrator + illustrators + + + 翻訳者 + 翻訳者 + + + editor & translator + editors & translators + + + + + dir. + dirs. + + + + + + + ed. + eds. + + + ill. + ills. + + + 翻訳者 + 翻訳者 + + + ed. & tran. + eds. & trans. + + + + by + directed by + 編集者: + edited by + illustrated by + interview by + to + by + 翻訳者: + edited & translated by + + + dir. + 編集者: + ed. + illus. + 翻訳者: + ed. & trans. by + + + 1月 + 2月 + 3月 + 4月 + 5月 + 6月 + 7月 + 8月 + 9月 + 10月 + 11月 + 12月 + + + 1月 + 2月 + 3月 + 4月 + 5月 + 6月 + 7月 + 8月 + 9月 + 10月 + 11月 + 12月 + + + Spring + Summer + Autumn + Winter + + diff --git a/biblio/citation-style-language/csl-locales-km-KH.xml b/biblio/citation-style-language/csl-locales-km-KH.xml new file mode 100644 index 0000000000..da58df8692 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-km-KH.xml @@ -0,0 +1,312 @@ + + + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2015-10-15T16:51:15-04:00 + + + + + + + + + + + + + + accessed + and + and others + anonymous + anon. + at + available at + by + circa + c. + cited + + edition + editions + + ed. + et al. + forthcoming + from + ibid + in + in press + internet + interview + letter + no date + n.d. + online + presented at the + + reference + references + + + ref. + refs. + + retrieved + scale + version + + + AD + BC + + + + + + + + + + th + st + nd + rd + th + th + th + + + ទីមួយ + ទីពីរ + ទីបី + ទីបួន + ទីប្រាំ + ទីប្រាំមួយ + ទីប្រាំពីរ + ទីប្រាំបី + ទីប្រាំបួន + ទីដប់មួយ + + + + សៀវភៅ + សៀវភៅ + + + ជំពូក + ជំពូក + + + កាឡោន + កាឡោន + + + តួលេខ + តួលេខ + + + folio + folios + + + ចំនួន + ចំនួន + + + បន្ទាត់ + បន្ទាត់ + + + កំណត់ចំណាំ + កំណត់ចំណាំ + + + opus + opera + + + ទំព័រ + ទំព័រ + + + ទំព័រ + ទំព័រ + + + កថាខណ្ឌ + កថាខណ្ឌ + + + ជំពូក + ជំពូក + + + ផ្នែក + ផ្នែក + + + sub verbo + sub verbis + + + verse + verses + + + វ៉ុល + វ៉ុល + + + + bk. + chap. + col. + fig. + f. + no. + l. + n. + op. + + p. + pp. + + + p. + pp. + + para. + pt. + sec. + + s.v. + s.vv. + + + v. + vv. + + + vol. + vols. + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + editor + editors + + + + editors + + + illustrator + illustrators + + + translator + translator + + + editor & translator + editors & translators + + + + + dir. + dirs. + + + ed. + eds. + + + ed. + eds. + + + ill. + ills. + + + tran. + trans. + + + ed. & tran. + eds. & trans. + + + + by + directed by + edited by + edited by + illustrated by + interview by + to + by + translated by + edited & translated by + + + dir. + ed. + ed. + illus. + trans. + ed. & trans. by + + + មករា + កុម្ភៈ + មីនា + មេសា + ឧសភា + មិថុនា + កក្កដា + សីហា + កញ្ញា + តុលា + វិច្ឆិកា + ធ្នូ + + + Jan. + Feb. + Mar. + Apr. + May + Jun. + Jul. + Aug. + Sep. + Oct. + Nov. + Dec. + + + Spring + Summer + Autumn + Winter + + diff --git a/biblio/citation-style-language/csl-locales-ko-KR.xml b/biblio/citation-style-language/csl-locales-ko-KR.xml new file mode 100644 index 0000000000..80fdfc7cd2 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-ko-KR.xml @@ -0,0 +1,312 @@ + + + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2015-10-15T14:41:06-04:00 + + + + + + + + + + + + + + 접근된 + 와/과 + and others + anonymous + anon + at + available at + by + circa + c. + cited + + edition + editions + + ed + 기타 + 근간 + (으)로부터 + ibid. + in + in press + internet + interview + letter + no date + 일자 없음 + online + presented at the + + reference + references + + + ref. + refs. + + retrieved + scale + version + + + AD + BC + + + + + + + + + + th + st + nd + rd + th + th + th + + + first + second + third + fourth + fifth + sixth + seventh + eighth + ninth + tenth + + + + book + books + + + chapter + chapters + + + column + columns + + + figure + figures + + + folio + folios + + + number + numbers + + + + + + + note + notes + + + opus + opera + + + 페이지 + 페이지 + + + 페이지 + 페이지 + + + 단락 + 단락 + + + part + parts + + + section + sections + + + sub verbo + sub verbis + + + verse + verses + + + volume + volumes + + + + bk + chap + col + fig + f + + l. + n. + op + + p + pp + + + p + pp + + para + pt + sec + + s.v. + s.vv. + + + v + vv + + + vol + vols + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + 편집자 + 편집자 + + + editor + editors + + + illustrator + illustrators + + + 번역자 + 번역자 + + + editor & translator + editors & translators + + + + + dir. + dirs. + + + 편집자 + 편집자 + + + ed. + eds. + + + ill. + ills. + + + 번역자 + 번역자 + + + ed. & tran. + eds. & trans. + + + + by + directed by + 편집자: + edited by + illustrated by + interview by + to + by + 번역자: + edited & translated by + + + dir. + ed + ed. + illus. + trans + ed. & trans. by + + + 1월 + 2월 + 3월 + 4월 + 5월 + 6월 + 7월 + 8월 + 9월 + 10월 + 11월 + 12월 + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + + + Spring + Summer + Autumn + Winter + + diff --git a/biblio/citation-style-language/csl-locales-la.xml b/biblio/citation-style-language/csl-locales-la.xml new file mode 100644 index 0000000000..3e3f1b21fd --- /dev/null +++ b/biblio/citation-style-language/csl-locales-la.xml @@ -0,0 +1,309 @@ + + + + + Andrew Dunning + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2019-01-22T23:20:59-05:00 + + + + + + + + + + + + + + consultatus + et + et alii + anonymus + anon. + ad + praestatus ad + a + circa + c. + citatus + + editio + editiones + + ed. + et al. + futurus + ab + ibid. + in + impressorio + interrete + congressus + epistula + sine die + s.d. + in linea + praebitus ad + + relatio + relationes + + + rel. + rell. + + recuperatus + scala + uersio + + + A.D. + A.C. + + + + + + + + + + º + + + primus + secundus + tertius + quartus + quintus + sextus + septimus + octauus + nonus + decimus + + + + liber + libri + + + capitulum + capitula + + + columna + columnae + + + figura + figurae + + + folium + folii + + + numerus + numeri + + + linea + lineae + + + nota + notae + + + opus + opera + + + pagina + paginae + + + pagina + paginae + + + paragraphus + paragraphi + + + pars + partes + + + paragraphus + paragraphi + + + sub uerbo + sub uerbis + + + versus + versus + + + tomus + tomi + + + + lib. + cap. + col. + fig. + fol. + n. + l. + n. + op. + + p. + pp. + + + p. + pp. + + par. + pr. + par. + + s.u. + s.uu. + + + u. + uu. + + + t. + tt. + + + + + + ¶¶ + + + § + §§ + + + + + director + directores + + + curator + curatores + + + editor + editores + + + illustrator + illustratores + + + interpres + interpretes + + + curator et interpres + curatores et interpretes + + + + + dir. + dirs. + + + cur. + curs. + + + ed. + eds. + + + ill. + ills. + + + interp. + interps. + + + cur. et interp. + curs. et interps. + + + + a + a directione + a cura + ab editione + ab illustratione + a congressione + a + a + a interpretatione + a cura et interpretatione + + + dir. + cur. + ed. + illus. + interp. + a cur. et interp. + + + ianuarius + februarius + martius + aprilis + maius + iunius + iulius + augustus + september + october + nouember + december + + + ian. + feb. + mar. + apr. + mai. + iun. + iul. + aug. + sep. + oct. + nou. + dec. + + + uer + aestas + autumnus + hiems + + diff --git a/biblio/citation-style-language/csl-locales-lt-LT.xml b/biblio/citation-style-language/csl-locales-lt-LT.xml new file mode 100644 index 0000000000..9b0e509fec --- /dev/null +++ b/biblio/citation-style-language/csl-locales-lt-LT.xml @@ -0,0 +1,328 @@ + + + + + Valdemaras Klumbys + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-01-22T17:56:13-05:00 + + + + + + + + + + + + + + + + žiūrėta + ir + ir kt. + anonimas + anon. + + adresas + + apie + apie + žiūrėta + + leidimas + leidimai + + leid. + ir kt. + ruošiamas + + ten pat + + priimta spaudai + prieiga per internetą + interviu + laiškas + sine anno + s.a. + interaktyvus + pristatytas + + nuoroda + nuorodos + + + nuor. + nuor. + + gauta + mastelis + versija + + + po Kr. + pr. Kr. + + + + + , + + + + + -asis + -asis + -oji + -iasis + -asis + -ioji + -oji + + + pirmasis + antrasis + trečiasis + ketvirtasis + penktasis + šeštasis + septintasis + aštuntasis + devintasis + dešimtasis + + pirmoji + antroji + trečioji + ketvirtoji + penktoji + šeštoji + septintoji + aštuntoji + devintoji + dešimtoji + + + + knyga + knygos + + + skyrius + skyriai + + + skiltis + skiltys + + + iliustracija + iliustracijos + + + lapas + lapai + + + numeris + numeriai + + + eilutė + eilutės + + + pastaba + pastabos + + + kūrinys + kūriniai + + + puslapis + puslapiai + + + puslapis + puslapiai + + + pastraipa + pastraipos + + + dalis + dalys + + + poskyris + poskyriai + + + žiūrėk + žiūrėk + + + eilėraštis + eilėraščiai + + + tomas + tomai + + + + kn. + sk. + skilt. + il. + l. + nr. + eil. + pstb. + kūr. + + p. + p. + + + p. + p. + + pastr. + d. + posk. + + žr. + žr. + + + eilėr. + eilėr. + + + t. + t. + + + + + + ¶¶ + + + § + §§ + + + + + vadovas + vadovai + + + sudarytojas + sudarytojai + + + atsakingasis redaktorius + atsakingieji redaktoriai + + + iliustratorius + iliustratoriai + + + vertėjas + vertėjai + + + sudarytojas ir vertėjas + sudarytojai ir vertėjai + + + + + vad. + vad. + + + sud. + sud. + + + ats. red. + ats. red. + + + iliustr. + iliustr. + + + vert. + vert. + + + sud. ir vert. + sud. ir vert. + + + + + vadovavo + sudarė + parengė + iliustravo + interviu ėmė + gavo + recenzavo + vertė + sudarė ir vertė + + + vad. + sud. + pareng. + iliustr. + vert. + sud. ir vert. + + + sausio + vasario + kovo + balandžio + gegužės + birželio + liepos + rugpjūčio + rugsėjo + spalio + lapkričio + gruodžio + + + saus. + vas. + kovo + bal. + geg. + birž. + liep. + rugpj. + rugs. + spal. + lapkr. + gruodž. + + + pavasaris + vasara + ruduo + žiema + + diff --git a/biblio/citation-style-language/csl-locales-lv-LV.xml b/biblio/citation-style-language/csl-locales-lv-LV.xml new file mode 100644 index 0000000000..c659a1cc1e --- /dev/null +++ b/biblio/citation-style-language/csl-locales-lv-LV.xml @@ -0,0 +1,361 @@ + + + + + Andris Lupgins + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2015-10-15T16:51:15-04:00 + + + + + + + + + + + + + + + + skatīts + m.ē. + un + un citi + anonīms + anon. + + pieejams + p.m.ē. + + apmēram + apm. + citēts + + redakcija + redakcijas + + red. + u.c. + gaidāms + no + turpat + no + presē + internets + intervija + vēstule + bez datuma + b.g. + tiešsaiste + iesniegts + + atsauce + atsauces + + + ats. + ats. + + iegūts + mērogs + versija + + + " + " + " + " + + + + -ais + + + + pirmais + otrais + trešais + ceturtais + piektais + sestais + septītais + astotais + devītais + desmitais + + pirmā + otrā + trešā + ceturtā + piektā + sestā + septītā + astotā + devītā + desmitā + + + + grāmata + grāmatas + + + nodaļa + nodaļas + + + sleja + slejas + + + ilustrācija + ilustrācijas + + + folio + folio + + + numurs + numuri + + + rinda + rindas + + + piezīme + piezīmes + + + opuss + opusi + + + lappuse + lappuses + + + lappuse + lappuses + + + rindkopa + rindkopas + + + daļa + daļas + + + apakšnodaļa + apakšnodaļas + + + skatīt + skatīt + + + pants + panti + + + sējums + sējumi + + + + grām. + nod. + sl. + il. + fo. + nr. + r. + piez. + op. + + lpp. + lpp. + + + lpp. + lpp. + + rindk. + d. + apakšnod. + + sk. + sk. + + + p. + p. + + + sēj. + sēj. + + + + + + ¶¶ + + + § + §§ + + + + + krājuma redaktors + krājuma redaktori + + + sastādītājs + sastādītāji + + + pamatmateriāla autors + pamatmateriāla autori + + + vadītājs + vadītāji + + + redaktors + redaktors + + + galvenais redaktors + galvenie redaktori + + + redaktors un tulkotājs + redaktors un tulkotājs + + + ilustrators + ilustratori + + + intervētājs + intervētāji + + + saņēmējs + saņēmēji + + + tulkotājs + tulkotāji + + + + + kr. red. + kr. red. + + + sast. + sast. + + + pamatmat. aut. + pamatmat. aut. + + + vad. + vad. + + + red. + red. + + + galv. red. + galv. red. + + + red. un tulk. + red. un tulk. + + + ilustr. + ilustr. + + + interv. + interv. + + + saņ. + saņ. + + + tulk. + tulk. + + + + + sastādīja + vadīja + sagatavoja + sagatavoja + sagatavoja un tulkoja + ilustrēja + intervēja + saņēma + tulkoja + + + sast. + sag. + sag. + ilustr. + tulk. + sag. un tulk. + + + janvārī + februārī + martā + aprīlī + maijā + jūnijā + jūlijā + augustā + septembrī + oktobrī + novembrī + decembrī + + + janv. + febr. + mar. + apr. + mai. + jūn. + jūl. + aug. + sept. + okt. + nov. + dec. + + + pavasaris + vasara + rudens + ziema + + diff --git a/biblio/citation-style-language/csl-locales-mn-MN.xml b/biblio/citation-style-language/csl-locales-mn-MN.xml new file mode 100644 index 0000000000..883ffcda74 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-mn-MN.xml @@ -0,0 +1,306 @@ + + + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2019-02-17T22:59:29-05:00 + + + + + + + + + + + + + + accessed + and + and others + anonymous + anon + at + available at + by + circa + c. + cited + + edition + editions + + ed + et al. + forthcoming + from + ibid. + in + in press + internet + interview + letter + no date + n.d. + online + presented at the + + reference + references + + + ref. + refs. + + retrieved + scale + version + + + AD + BC + + + « + » + + + + + + -p + + + нэгдүгээр + хоёрдугаар + гуравдугаар + дөрөвдүгээр + тавдугаар + зургаадугаар + долоодугаар + наймдугаар + есдүгээр + аравдугаар + + + + ном + номнууд + + + chapter + chapters + + + багана + баганууд + + + figure + figures + + + folio + folios + + + тоо + тоонууд + + + шугам + шугамнууд + + + note + notes + + + opus + opera + + + хуудас + хуудаснууд + + + хуудас + хуудаснууд + + + paragraph + paragraph + + + part + parts + + + section + sections + + + sub verbo + sub verbis + + + verse + verses + + + volume + volumes + + + + bk + chap + col + fig + f + no + l. + n. + op + + p + pp + + + p + pp + + para + pt + sec + + s.v. + s.vv. + + + v + vv + + + vol + vols + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + редактор + редакторууд + + + редактор + редакторууд + + + illustrator + illustrators + + + орчуулагч + орчуулагчид + + + редактор ба орчуулагч + редакторууд ба орчуулагчид + + + + + dir. + dirs. + + + ред. + ред. + + + ред. + ред. + + + ill. + ills. + + + орч + орч + + + ред. ба орч. + ред. ба орч. + + + + by + directed by + edited by + edited by + illustrated by + interview by + to + by + translated by + edited & translated by + + + dir. + ed + ed. + illus. + trans + ed. & trans. by + + + Нэгдүгээр сар + Хоёрдугаар сар + Гуравдугаар сар + Дөрөвдүгээр сар + Тавдугаар сар + Зургаадугаар сар + Долдугаар сар + Наймдугаар сар + Есдүгээр сар + Аравдугаар сар + Арван нэгдүгээр сар + Арван хоёрдугаар сар + + + 1-р сар + 2-р сар + 3-р сар + 4-р сар + 5-р сар + 6-р сар + 7-р сар + 8-р сар + 9-р сар + 10-р сар + 11-р сар + 12-р сар + + + Хавар + Зун + Намар + Өвөл + + diff --git a/biblio/citation-style-language/csl-locales-nb-NO.xml b/biblio/citation-style-language/csl-locales-nb-NO.xml new file mode 100644 index 0000000000..bc44a1a5ee --- /dev/null +++ b/biblio/citation-style-language/csl-locales-nb-NO.xml @@ -0,0 +1,309 @@ + + + + + Guttorm Flatabø + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2020-01-18T15:35:53+01:00 + + + + + + + + + + + + + + åpnet + og + med flere + anonym + anon. + + tilgjengelig på + av + circa + ca. + sitert + + utgave + utgaver + + utg. + mfl. + kommende + fra + ibid. + i + i trykk + Internett + intervju + brev + ingen dato + u.å. + online + presentert på + + referanse + referanser + + + ref. + refr. + + hentet + målestokk + versjon + + + fvt. + evt. + + + « + » + + + + + + . + + + første + andre + tredje + fjerde + femte + sjette + sjuende + åttende + niende + tiende + + + + bok + bøker + + + kapittel + kapitler + + + kolonne + kolonner + + + figur + figurer + + + folio + folioer + + + nummer + numre + + + linje + linjer + + + note + noter + + + opus + opus + + + side + side + + + side + sider + + + avsnitt + avsnitt + + + del + deler + + + paragraf + paragrafer + + + sub verbo + sub verbis + + + vers + vers + + + bind + bind + + + + b. + kap. + kol. + fig. + fol. + nr. + l. + n. + op. + + s. + s. + + + s. + s. + + avsn. + d. + pargr. + + s.v. + s.vv. + + + v. + v. + + + bd. + bd. + + + + + + ¶¶ + + + § + §§ + + + + + regissør + regissører + + + redaktør + redaktører + + + redaktør + redaktører + + + illustratør + illustratører + + + oversetter + oversettere + + + redaktør & oversetter + redaktører & oversettere + + + + + regi + regi + + + red. + red. + + + red. + red. + + + ill. + ills. + + + overs. + overs. + + + red. & overs. + red. & overs. + + + + av + regissert av + redigert av + redigert av + illustrert av + intervjuet av + til + av + oversatt av + redigert & oversatt av + + + regi + red. + red. + illus. + overs. + red. & overs. av + + + januar + februar + mars + april + mai + juni + juli + august + september + oktober + november + desember + + + jan. + feb. + mar. + apr. + mai + jun. + jul. + aug. + sep. + okt. + nov. + des. + + + vår + sommer + høst + vinter + + diff --git a/biblio/citation-style-language/csl-locales-nl-NL.xml b/biblio/citation-style-language/csl-locales-nl-NL.xml new file mode 100644 index 0000000000..88ccb0405f --- /dev/null +++ b/biblio/citation-style-language/csl-locales-nl-NL.xml @@ -0,0 +1,328 @@ + + + + + Rintze M. Zelle + http://twitter.com/rintzezelle + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2020-04-16T13:27:31-04:00 + + + + + + + + + + + + + + geraadpleegd + en + en anderen + anoniem + anon. + bij + beschikbaar op + door + circa + c. + geciteerd + + druk + drukken + + dr. + e.a. + in voorbereiding + van + ibid. + in + in druk + internet + interview + brief + zonder datum + z.d. + online + gepresenteerd bij + + referentie + referenties + + + ref. + refs. + + geraadpleegd + schaal + versie + + + AD + BC + + + + + + + + + + ste + de + de + de + de + de + de + de + de + de + de + de + de + de + de + de + de + de + de + + + eerste + tweede + derde + vierde + vijfde + zesde + zevende + achtste + negende + tiende + + + + boek + boeken + + + hoofdstuk + hoofdstukken + + + column + columns + + + figuur + figuren + + + folio + folio's + + + nummer + nummers + + + regel + regels + + + aantekening + aantekeningen + + + opus + opera + + + pagina + pagina's + + + pagina + pagina's + + + paragraaf + paragrafen + + + deel + delen + + + sectie + secties + + + sub verbo + sub verbis + + + vers + versen + + + volume + volumes + + + + bk. + hfdst. + col. + fig. + f. + nr. + l. + n. + op. + + p. + pp. + + + p. + pp. + + par. + deel + sec. + + s.v. + s.vv. + + + v. + vv. + + + vol. + vols. + + + + + + ¶¶ + + + § + §§ + + + + + regisseur + regisseurs + + + redacteur + redacteuren + + + redacteur + redacteuren + + + illustrator + illustrators + + + vertaler + vertalers + + + redacteur & vertaler + redacteuren & vertalers + + + + + reg. + reg. + + + red. + red. + + + red. + red. + + + ill. + ill. + + + vert. + vert. + + + red. & vert. + red. & vert. + + + + door + geregisseerd door + onder redactie van + onder redactie van + geïllustreerd door + geïnterviewd door + ontvangen door + door + vertaald door + bewerkt & vertaald door + + + geregisseerd door + onder redactie van + bewerkt door + geïllustreerd door + vertaald door + bewerkt & vertaald door + + + januari + februari + maart + april + mei + juni + juli + augustus + september + oktober + november + december + + + jan. + feb. + mrt. + apr. + mei + jun. + jul. + aug. + sep. + okt. + nov. + dec. + + + lente + zomer + herst + winter + + diff --git a/biblio/citation-style-language/csl-locales-nn-NO.xml b/biblio/citation-style-language/csl-locales-nn-NO.xml new file mode 100644 index 0000000000..ea3e0b8c50 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-nn-NO.xml @@ -0,0 +1,309 @@ + + + + + Guttorm Flatabø + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2020-01-18T15:35:53+01:00 + + + + + + + + + + + + + + vitja + og + med fleire + anonym + anon. + + tilgjengeleg på + av + circa + ca. + sitert + + utgåve + utgåver + + utg. + mfl. + kommande + frå + ibid. + i + i trykk + Internett + intervju + brev + ingen dato + u.å. + online + presentert på + + referanse + referansar + + + ref. + refr. + + henta + målestokk + versjon + + + fvt. + evt. + + + « + » + + + + + + . + + + første + andre + tredje + fjerde + femte + sjette + sjuande + åttande + niande + tiande + + + + bok + bøker + + + kapittel + kapittel + + + kolonne + kolonner + + + figur + figurar + + + folio + folioar + + + nummer + nummer + + + linje + linjer + + + note + notar + + + opus + opus + + + side + side + + + side + sider + + + avsnitt + avsnitt + + + del + deler + + + paragraf + paragrafar + + + sub verbo + sub verbis + + + vers + vers + + + bind + bind + + + + b. + kap. + kol. + fig. + fol. + nr. + l. + n. + op. + + s. + s. + + + s. + s. + + avsn. + d. + par. + + s.v. + s.vv. + + + v. + v. + + + bd. + bd. + + + + + + ¶¶ + + + § + §§ + + + + + regissør + regissørar + + + redaktør + redaktørar + + + redaktør + redaktørar + + + illustratør + illustratørar + + + omsetjar + omsetjarar + + + redaktør & omsetjar + redaktørar & omsetjarar + + + + + regi + regi + + + red. + red. + + + red. + red. + + + ill. + ills. + + + oms. + oms. + + + red. & oms. + red. & oms. + + + + av + regissert av + redigert av + redigert av + illustrert av + intervjua av + til + av + omsett av + redigert & omsett av + + + regi + red. + red. + illus. + oms. + red. & oms. av + + + januar + februar + mars + april + mai + juni + juli + august + september + oktober + november + desember + + + jan. + feb. + mar. + apr. + mai + jun. + jul. + aug. + sep. + okt. + nov. + des. + + + vår + sommar + haust + vinter + + diff --git a/biblio/citation-style-language/csl-locales-pl-PL.xml b/biblio/citation-style-language/csl-locales-pl-PL.xml new file mode 100644 index 0000000000..f73e4e0fbe --- /dev/null +++ b/biblio/citation-style-language/csl-locales-pl-PL.xml @@ -0,0 +1,315 @@ + + + + + pAo + + + Michal + + + Pendzoncymisio + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2021-06-23T23:06:42-04:00 + + + + + + + + + + + + + + dostęp + i + i inni + anonim + anon. + na + dostępne na + przez + około + ok + cytowane + + wydanie + wydania + + wyd. + i in. + w przygotowaniu + z + ibid. + w + w druku + internet + wywiad + list + brak daty + b.d. + online + zaprezentowano na + + referencja + referencje + + + ref. + ref. + + pobrano + skala + wersja + + + n.e. + p.n.e. + + + + + « + » + + + + . + + + pierwszy + drugi + trzeci + czwarty + piąty + szósty + siódmy + ósmy + dziewiąty + dziesiąty + + + + książka + książki + + + rozdział + rozdziały + + + kolumna + kolumny + + + rycina + ryciny + + + folio + folio + + + numer + numery + + + wiersz + wiersze + + + notatka + notatki + + + opus + opera + + + strona + strony + + + strona + strony + + + akapit + akapity + + + część + części + + + sekcja + sekcje + + + sub verbo + sub verbis + + + wers + wersy + + + tom + tomy + + + + książka + rozdz. + kol. + ryc. + fol. + nr + l. + n. + op. + + s. + s. + + + s. + ss. + + akap. + cz. + sekc. + + s.v. + s.vv. + + + w. + w. + + + t. + t. + + + + + + ¶¶ + + + § + §§ + + + + + reżyser + reżyserzy + + + redaktor + redaktorzy + + + edytor + edytorzy + + + ilustrator + ilustratorzy + + + tłumacz + tłumacze + + + redaktor & tłumacz + redaktorzy & tłumacze + + + + + reż. + reż. + + + red. + red. + + + red. + red. + + + il. + il. + + + tłum. + tłum. + + + red.tłum. + red.tłum. + + + + przez + reżyserowane przez + zredagowane przez + zredagowane przez + ilustrowane przez + przeprowadzony przez + dla + przez + przetłumaczone przez + zredagowane i przetłumaczone przez + + + reż. + red. + red. + il. + tłum. + red.tłum. + + + styczeń + luty + marzec + kwiecień + maj + czerwiec + lipiec + sierpień + wrzesień + październik + listopad + grudzień + + + sty. + luty + mar. + kwi. + maj + cze. + lip. + sie. + wrz. + paź. + lis. + grudz. + + + wiosna + lato + jesień + zima + + diff --git a/biblio/citation-style-language/csl-locales-pt-BR.xml b/biblio/citation-style-language/csl-locales-pt-BR.xml new file mode 100644 index 0000000000..4c630d7140 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-pt-BR.xml @@ -0,0 +1,324 @@ + + + + + José Antonio Meira da Rocha + + + Meira da Rocha + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2021-12-16T08:33:10-03:00 + + + + + + + + + + + + + + acessado + e + e outros + anônimo + anon + em + disponível em + por + circa + c. + citado + + edição + edições + + ed + et al. + a ser publicado + de + ibidem + em + no prelo + internet + entrevista + carta + sem data + [s.d.] + online + apresentado em + + referência + referências + + + ref. + refs. + + recuperado + escala + versão + + + DC + AC + + + + + + + + + + º + ª + º + + + primeiro + segundo + terceiro + quarto + quinto + sexto + sétimo + oitavo + nono + décimo + primeira + segunda + terceira + quarta + quinta + sexta + sétima + oitava + nona + décima + + + + livro + livros + + + capítulo + capítulos + + + coluna + colunas + + + figura + figuras + + + folio + folios + + + número + números + + + linha + linhas + + + nota + notas + + + opus + opera + + + página + páginas + + + página + páginas + + + parágrafo + parágrafos + + + parte + partes + + + seção + seções + + + sub verbo + sub verbis + + + verso + versos + + + volume + volumes + + + + liv. + cap. + col. + fig. + f. + + l. + n. + op. + + p. + p. + + + p. + p. + + parag. + pt. + seç. + + s.v. + s.vv. + + + v. + vv. + + + vol. + vols. + + + + + + ¶¶ + + + § + §§ + + + + + diretor + diretores + + + organizador + organizadores + + + editor + editores + + + ilustrador + ilustradores + + + tradutor + tradutores + + + editor e tradutor + editores e tradutores + + + + + dir. + dirs. + + + org. + orgs. + + + ed. + eds. + + + il. + ils. + + + trad. + trads. + + + ed. e trad. + eds. e trads. + + + + por + dirigido por + organizado por + editado por + ilustrado por + entrevista de + para + por + traduzido por + editado e traduzido por + + + dir. + org. + ed. + ilus. + trad. + ed. e trad. por + + + janeiro + fevereiro + março + abril + maio + junho + julho + agosto + setembro + outubro + novembro + dezembro + + + jan. + fev. + mar. + abr. + maio + jun. + jul. + ago. + set. + out. + nov. + dez. + + + Primavera + Verão + Outono + Inverno + + diff --git a/biblio/citation-style-language/csl-locales-pt-PT.xml b/biblio/citation-style-language/csl-locales-pt-PT.xml new file mode 100644 index 0000000000..442eaf9401 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-pt-PT.xml @@ -0,0 +1,320 @@ + + + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2015-10-15T14:41:06-04:00 + + Jonadabe PT + + + + + + + + + + + + + + + acedido + e + e outros + anónimo + anón. + em + disponível em + por + circa + c. + citado + + edição + edições + + ed. + et al. + a publicar + de + ibid. + em + no prelo + internet + entrevista + carta + sem data + sem data + em linha + apresentado na + + referência + referências + + + ref. + refs. + + obtido + scale + versão + + + AD + BC + + + « + » + + + + + + + + + + primeiro + primeira + segundo + segunda + terceiro + terceira + quarto + quarta + quinto + quinta + sexto + sexta + sétimo + sétima + oitavo + oitava + nono + nona + décimo + décima + + + + livro + livros + + + capítulo + capítulos + + + coluna + colunas + + + figura + figuras + + + fólio + fólios + + + número + números + + + linha + linhas + + + nota + notas + + + opus + opera + + + página + páginas + + + página + páginas + + + parágrafo + parágrafos + + + parte + partes + + + secção + secções + + + sub verbo + sub verbis + + + versículo + versículos + + + volume + volumes + + + + liv. + cap. + col. + fig. + f. + n. + l. + n. + op. + + p. + pp. + + + p. + pp. + + par. + pt. + sec. + + s.v. + s.vv. + + + v + vv + + + vol. + vols. + + + + + + ¶¶ + + + § + §§ + + + + + director + directores + + + editor + editores + + + editor + editores + + + ilustrador + ilustradores + + + tradutor + tradutores + + + editor & tradutor + editores & tradutores + + + + + dir. + dirs. + + + ed. + eds. + + + ed. + eds. + + + il. + ils. + + + trad. + trads. + + + ed. & trad. + eds. & trads. + + + + por + dirigido por + editado por + editorial de + ilustrado por + entrevistado por + para + revisto por + traduzido por + editado & traduzido por + + + dir. + ed. + ed. + ilus. + trad. + ed. & trad. por + + + Janeiro + Fevereiro + Março + Abril + Maio + Junho + Julho + Agosto + Setembro + Outubro + Novembro + Dezembro + + + Jan. + Fev. + Mar. + Abr. + Mai. + Jun. + Jul. + Ago. + Set. + Out. + Nov. + Dez. + + + Primavera + Verão + Outono + Inverno + + diff --git a/biblio/citation-style-language/csl-locales-ro-RO.xml b/biblio/citation-style-language/csl-locales-ro-RO.xml new file mode 100644 index 0000000000..650b873515 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-ro-RO.xml @@ -0,0 +1,311 @@ + + + + + Nicolae Turcan + nturcan@gmail.com + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2019-02-23T11:26:39+02:00 + + + + + + + + + + + + + + data accesării + și + și alții + anonim + anon. + la + disponibil la + de + circa + cca. + citat + + ediția + edițiile + + ed + et al. + în curs de apariție + din + ibidem + în + sub tipar + internet + interviu + scrisoare + fără dată + f.a. + online + prezentat la + + referință + referințe + + + ref. + ref. + + preluat în + scală + versiunea + + + d.Hr. + î.Hr. + + + + + « + » + + + + -lea + + + + primul + al doilea + al treilea + al patrulea + al cincilea + al șaselea + al șaptelea + al optulea + al nouălea + al zecelea + + + + cartea + cărțile + + + capitolul + capitolele + + + coloana + coloanele + + + figura + figurile + + + folio + folio + + + numărul + numerele + + + linia + liniile + + + nota + notele + + + opusul + opusurile + + + pagina + paginile + + + pagina + paginile + + + paragraful + paragrafele + + + partea + părțile + + + secțiunea + secțiunile + + + sub verbo + sub verbis + + + versetul + versetele + + + volumul + volumele + + + + cart. + cap. + col. + fig. + fol. + nr. + l. + n. + op. + + p. + pp. + + + p. + pp. + + par. + part. + sec. + + s.v. + s.vv. + + + v. + vv. + + + vol. + vol. + + + + + + ¶¶ + + + § + §§ + + + + + director + directori + + + editor + editori + + + coordonator + coordonatori + + + ilustrator + ilustratori + + + traducător + traducători + + + editor și traducător + editori și traducători + + + + + dir. + dir. + + + ed. + ed. + + + coord. + coord. + + + ilustr. + ilustr. + + + trad. + trad. + + + ed. și trad. + ed. și trad. + + + + de + coordonat de + ediție de + coordonator + ilustrații de + interviu de + în + de + traducere de + ediție și traducere de + + + dir. + ed. + coord. + ilustr. + trad. + ed. și trad. de + + + ianuarie + februarie + martie + aprilie + mai + iunie + iulie + august + septembrie + octombrie + noiembrie + decembrie + + + ian. + feb. + mar. + apr. + mai + iun. + iul. + aug. + sep. + oct. + nov. + dec. + + + primăvara + vara + toamna + iarna + + diff --git a/biblio/citation-style-language/csl-locales-ru-RU.xml b/biblio/citation-style-language/csl-locales-ru-RU.xml new file mode 100644 index 0000000000..56eb8875f6 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-ru-RU.xml @@ -0,0 +1,321 @@ + + + + + Alexei Kouprianov + alexei.kouprianov@gmail.com + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2015-10-15T16:51:15-04:00 + + + + + + + + + + + + + + просмотрено + и + и др. + аноним + анон. + на + доступно на + + около + ок. + цитируется по + цит. по + + издание + издания + + изд. + и др. + ожидается + от + там же + в + в печати + Интернет + интервью + письмо + без даты + б. д. + онлайн + представлено на + + + ссылка + ссылки + + + + ссылка + ссылки + + извлечено + масштаб + версия + + + н. э. + до н. э. + + + « + » + + + + + + + + + + + первое + второе + третье + четвертое + пятое + шестое + седьмое + восьмое + девятое + десятое + первый + второй + третий + четвертый + пятый + шестой + седьмой + восьмой + девятый + десятый + первая + вторая + третья + четвертая + пятая + шестая + седьмая + восьмая + девятая + десятая + + + + книга + книги + + + глава + главы + + + столбец + столбцы + + + рисунок + рисунки + + + лист + листы + + + выпуск + выпуски + + + строка + строки + + + примечание + примечания + + + сочинение + сочинения + + + страница + страницы + + + + страница + страницы + + + параграф + параграфы + + + часть + части + + + раздел + разделы + + смотри + + стих + стихи + + + том + тома + + + + + кн. + гл. + стб. + рис. + + л. + лл. + + вып. + стр. + прим. + соч. + + с. + сс. + + + с. + сс. + + + п. + пп. + + + ч. + чч. + + разд. + см. + ст. + + т. + тт. + + + + + + ¶¶ + + + § + §§ + + + + + режиссер + режиссеры + + + редактор + редакторы + + + ответственный редактор + ответственные редакторы + + + иллюстратор + иллюстраторы + + + переводчик + переводчики + + + редактор и переводчик + редакторы и переводчики + + + + реж. + ред. + отв. ред. + ил. + пер. + ред. и пер. + + + + + режиссировано + под редакцией + под ответственной редакцией + иллюстрировано + интервью проведено + к + + переведено + под редакцией и переведено + + + реж. + под ред. + под отв. ред. + ил. + пер. + под ред. и пер. + + + + январь + февраль + март + апрель + май + июнь + июль + август + сентябрь + октябрь + ноябрь + декабрь + + + янв. + фев. + мар. + апр. + май + июн. + июл. + авг. + сен. + окт. + ноя. + дек. + + + весна + лето + осень + зима + + diff --git a/biblio/citation-style-language/csl-locales-sk-SK.xml b/biblio/citation-style-language/csl-locales-sk-SK.xml new file mode 100644 index 0000000000..40afbbef26 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-sk-SK.xml @@ -0,0 +1,318 @@ + + + + + Tomáš Ferianc + + + kohafan + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + cit + a + a ďalší + anonym + anon. + v + available at + by + circa + cca. + cit + + vydanie + vydania + + vyd. + et al. + nadchádzajúci + z + ibid. + v + v tlači + internet + osobná komunikácia + list + no date + n.d. + online + prezentované na + + reference + references + + + ref. + refs. + + cit + scale + version + + + po Kr. + pred Kr. + + + + + + + + + + th + st + nd + rd + th + th + th + + + first + second + third + fourth + fifth + sixth + seventh + eighth + ninth + tenth + + + + kniha + knihy + + + kapitola + kapitoly + + + stĺpec + stĺpce + + + obrázok + obrázky + + + list + listy + + + číslo + čísla + + + riadok + riadky + + + poznámka + poznámky + + + opus + opera + + + strana + strany + + + strana + strany + + + odstavec + odstavce + + + časť + časti + + + sekcia + sekcie + + + sub verbo + sub verbis + + + verš + verše + + + ročník + ročníky + + + + k. + kap. + stĺp. + obr. + l. + č. + l. + n. + op. + + s. + s. + + + s. + s. + + par. + č. + sek. + + s.v. + s.vv. + + + v. + v. + + + roč. + roč. + + + + + + + + + § + § + + + + + director + directors + + + editor + editori + + + zostavovateľ + zostavovatelia + + + illustrator + illustrators + + + prekladateľ + prekladatelia + + + zostavovateľ & prekladateľ + zostavovatelia & prekladatelia + + + + + dir. + dirs. + + + ed. + ed. + + + zost. + zost. + + + ill. + ills. + + + prel. + prel. + + + ed. & tran. + eds. & trans. + + + + by + directed by + zostavil + zostavil + illustrated by + rozhovor urobil + adresát + by + preložil + zostavil & preložil + + + dir. + ed. + ed. + illus. + prel. + zost. & prel. + + + január + február + marec + apríl + máj + jún + júl + august + september + október + november + december + + + jan. + feb. + mar. + apr. + máj. + jún. + júl. + aug. + sep. + okt. + nov. + dec. + + + Jar + Leto + Jeseň + Zima + + diff --git a/biblio/citation-style-language/csl-locales-sl-SI.xml b/biblio/citation-style-language/csl-locales-sl-SI.xml new file mode 100644 index 0000000000..0054ed306e --- /dev/null +++ b/biblio/citation-style-language/csl-locales-sl-SI.xml @@ -0,0 +1,312 @@ + + + + + Kristof Ostir + + + ratek1 + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2020-05-06T22:40:25+02:00 + + + + + + + + + + + + + + pridobljeno + in + in drugi + anonimni + anon. + pri + dostopno na + + približno + prib. + citirano + + izdaja + izdaje + + izd. + idr. + pred izidom + s + isto + v + v tisku + internet + intervju + pismo + brez datuma + b. d. + na spletu + predstavljeno na + + referenca + reference + + + ref. + ref. + + pridobljeno + merilo + različica + + + n. št. + pr. n. št. + + + + + + + + + + . + + + prva + druga + tretja + četrta + peta + šesta + sedma + osma + deveta + deseta + + + + knjiga + knjige + + + poglavje + poglavja + + + stolpec + stolpci + + + slika + slike + + + folio + folii + + + številka + številke + + + vrstica + vrstice + + + opomba + opombe + + + opus + opusi + + + stran + strani + + + stran + strani + + + odstavek + odstavki + + + del + deli + + + odsek + odseki + + + sub verbo + sub verbis + + + verz + verzi + + + letnik + letniki + + + + knj. + pogl. + stolp. + sl. + fol. + št. + vrst. + op. + opus + + str. + str. + + + str. + str. + + odst. + del + ods. + + s. v. + s. v. + + + v. + v. + + + let. + let. + + + + + + ¶¶ + + + § + §§ + + + + + režiser + režiserji + + + urednik + uredniki + + + glavni urednik + glavni uredniki + + + ilustrator + ilustratorji + + + prevajalec + prevajalci + + + urednik & prevajalec + uredniki & prevajalci + + + + + rež. + rež. + + + ur. + ur. + + + gl. ur. + gl. ur. + + + ilus. + ilus. + + + prev. + prev. + + + ur. & prev. + ur. & prev. + + + + + režiral + uredil + uredil + ilustriral + intervjuval + za + od + prevedel + uredil & prevedel + + + rež. + ured. + ured. + ilus. + prev. + ured. & prev. by + + + januar + februar + marec + april + maj + junij + julij + avgust + september + oktober + november + december + + + jan. + feb. + mar. + apr. + maj + jun. + jul. + avg. + sep. + okt. + nov. + dec. + + + pomlad + poletje + jesen + zima + + diff --git a/biblio/citation-style-language/csl-locales-sr-RS.xml b/biblio/citation-style-language/csl-locales-sr-RS.xml new file mode 100644 index 0000000000..504a2f703f --- /dev/null +++ b/biblio/citation-style-language/csl-locales-sr-RS.xml @@ -0,0 +1,312 @@ + + + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2015-10-15T14:41:06-04:00 + + + + + + + + + + + + + + приступљено + и + и остали + анонимна + анон. + на + available at + by + circa + c. + цитирано + + издање + издања + + изд. + и остали + долазећи + од + ibid. + у + у штампи + Интернет + интервју + писмо + no date + без датума + на Интернету + представљено на + + reference + references + + + ref. + refs. + + преузето + scale + version + + + AD + BC + + + + + + + + + + th + st + nd + rd + th + th + th + + + first + second + third + fourth + fifth + sixth + seventh + eighth + ninth + tenth + + + + књига + књиге + + + поглавље + поглавља + + + колона + колоне + + + цртеж + цртежи + + + фолио + фолији + + + број + бројеви + + + линија + линије + + + белешка + белешке + + + опус + опера + + + страница + странице + + + страница + странице + + + параграф + параграфи + + + део + делова + + + одељак + одељака + + + sub verbo + sub verbis + + + строфа + строфе + + + том + томова + + + + књига + Пог. + кол. + црт. + фолио + изд. + l. + n. + оп. + + стр. + стр. + + + стр. + стр. + + пар. + део + од. + + s.v. + s.vv. + + + стр. + стр. + + + том + томови + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + уредник + урединици + + + editor + editors + + + illustrator + illustrators + + + преводилац + преводиоци + + + editor & translator + editors & translators + + + + + dir. + dirs. + + + ур. + ур. + + + ed. + eds. + + + ill. + ills. + + + прев. + прев. + + + ed. & tran. + eds. & trans. + + + + by + directed by + уредио + edited by + illustrated by + интервјуисао + прима + by + превео + edited & translated by + + + dir. + ур. + ed. + illus. + прев. + ed. & trans. by + + + Јануар + Фебруар + Март + Април + Мај + Јуни + Јули + Август + Септембар + Октобар + Новембар + Децембар + + + Јан. + Феб. + Март + Апр. + Мај + Јуни + Јули + Авг. + Сеп. + Окт. + Нов. + Дец. + + + Spring + Summer + Autumn + Winter + + diff --git a/biblio/citation-style-language/csl-locales-sv-SE.xml b/biblio/citation-style-language/csl-locales-sv-SE.xml new file mode 100644 index 0000000000..072a075521 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-sv-SE.xml @@ -0,0 +1,322 @@ + + + + + torfeur + + + Sylvester Keil + + + Sebastian Karcher + + + Ulf Harnhammar + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T13:02:03-05:00 + + + + + + + + + + + + + + åtkomstdatum + och + och andra + anonym + anon. + vid + tillgänglig vid + av + cirka + ca + citerad + + upplaga + upplagor + + uppl. + m.fl. + kommande + från + ibid. + i + i tryck + internet + intervju + brev + utan årtal + u.å. + online + presenterad vid + + referens + referenser + + + ref. + ref. + + hämtad + scale + version + + + e.Kr. + f.Kr. + + + + + + + + + + :e + :a + :a + :e + :e + + + första + andra + tredje + fjärde + femte + sjätte + sjunde + åttonde + nionde + tionde + + + + bok + böcker + + + kapitel + kapitel + + + kolumn + kolumner + + + figur + figurer + + + folio + folios + + + nummer + nummer + + + rad + rader + + + not + noter + + + opus + opera + + + sida + sidor + + + sida + sidor + + + stycke + stycken + + + del + delar + + + avsnitt + avsnitt + + + sub verbo + sub verbis + + + vers + verser + + + volym + volymer + + + + bok + kap. + kol. + fig. + f. + nr + l. + n. + op. + + s. + s. + + + s. + s. + + st. + del + avs. + + s.v. + s.vv. + + + vers + verser + + + vol. + vol. + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + redaktör + redaktörer + + + editor + editors + + + illustratör + illustratörer + + + översättare + översättare + + + redaktör & översättare + redaktörer & översättare + + + + + dir. + dirs. + + + red. + red. + + + ed. + eds. + + + ill. + ill. + + + övers. + övers. + + + red. & övers. + red. & övers. + + + + av + directed by + redigerad av + edited by + illustrerad av + intervjuad av + till + by + översatt av + redigerad & översatt av + + + dir. + red. + ed. + illus. + övers. + red. & övers. av + + + januari + februari + mars + april + maj + juni + juli + augusti + september + oktober + november + december + + + jan. + feb. + mar. + apr. + maj + juni + juli + aug. + sep. + okt. + nov. + dec. + + + vår + sommar + höst + vinter + + diff --git a/biblio/citation-style-language/csl-locales-th-TH.xml b/biblio/citation-style-language/csl-locales-th-TH.xml new file mode 100644 index 0000000000..704a9f7011 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-th-TH.xml @@ -0,0 +1,309 @@ + + + + + Dusit Laohasinnarong + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2021-08-06T16:54:19-04:00 + + + + + + + + + + + + + + สืบค้น + และ + และคณะ + นิรนาม + นิรนาม + ที่ + available at + โดย + โดยประมาณ + ประมาณ + อ้างถึง + + พิมพ์ครั้งที่ + พิมพ์ครั้งที่ + + พิมพ์ครั้งที่ + และคณะ + เต็มใจให้ข้อมูล + จาก + ในที่เดียวกัน + ใน + กำลังรอตีพิมพ์ + อินเทอร์เน็ต + การสัมภาษณ์ + จดหมาย + ไม่ปรากฏปีที่พิมพ์ + ม.ป.ป. + ออนไลน์ + นำเสนอที่ + + เอกสารอ้างอิง + เอกสารอ้างอิง + + + อ้างอิง + อ้างอิง + + สืบค้น + scale + version + + + ค.ศ. + พ.ศ. + + + + + + + + + + + + + หนึ่ง + สอง + สาม + สี่ + ห้า + หก + เจ็ด + แปด + เก้า + สิบ + + + + หนังสือ + หนังสือ + + + บทที่ + บทที่ + + + สดมภ์ + สดมภ์ + + + รูปภาพ + รูปภาพ + + + หน้า + หน้า + + + ฉบับที่ + ฉบับที่ + + + บรรทัดที่ + บรรทัดที่ + + + บันทึก + บันทึก + + + บทประพันธ์ + บทประพันธ์ + + + หน้า + หน้า + + + หน้า + หน้า + + + ย่อหน้า + ย่อหน้า + + + ส่วนย่อย + ส่วนย่อย + + + หมวด + หมวด + + + ใต้คำ + ใต้คำ + + + ร้อยกรอง + ร้อยกรอง + + + ปีที่ + ปีที่ + + + + หนังสือ + บทที่ + สดมภ์ + รูปภาพ + หน้า + ฉบับที่ + l. + n. + บทประพันธ์ + + น. + น. + + + น. + น. + + ย่อหน้า + ส่วนย่อย + หมวด + + ใต้คำ + ใต้คำ + + + ร้อยกรอง + ร้อยกรอง + + + ปี + ปี + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + บรรณาธิการ + บรรณาธิการ + + + ผู้อำนวยการบทบรรณาธิการ + ผู้อำนวยการบทบรรณาธิการ + + + illustrator + illustrators + + + ผู้แปล + ผู้แปล + + + บรรณาธิการและผู้แปล + บรรณาธิการและผู้แปล + + + + + dir. + dirs. + + + บ.ก. + บ.ก. + + + ผอ.บทบรรณาธิการ + ผอ.บทบรรณาธิการ + + + ill. + ills. + + + ผู้แปล + ผู้แปล + + + บ.ก. + บ.ก. + + + + โดย + directed by + เรียบเรียงโดย + เรียบเรียงโดย + illustrated by + สัมภาษณ์โดย + ถึง + by + แปลโดย + แปลและเรียบเรียงโดย + + + dir. + โดย + โดย + illus. + แปล + แปลและเรียบเรียงโดย + + + มกราคม + กุมภาพันธ์ + มีนาคม + เมษายน + พฤษภาคม + มิถุนายน + กรกฎาคม + สิงหาคม + กันยายน + ตุลาคม + พฤศจิกายน + ธันวาคม + + + ม.ค. + ก.พ. + มี.ค. + เม.ย. + พ.ค. + มิ.ย. + ก.ค. + ส.ค. + ก.ย. + ต.ค. + พ.ย. + ธ.ค. + + + ฤดูใบไม้ผลิ + ฤดูร้อน + ฤดูใบไม้ร่วง + ฤดูหนาว + + diff --git a/biblio/citation-style-language/csl-locales-tr-TR.xml b/biblio/citation-style-language/csl-locales-tr-TR.xml new file mode 100644 index 0000000000..c75eaf836c --- /dev/null +++ b/biblio/citation-style-language/csl-locales-tr-TR.xml @@ -0,0 +1,319 @@ + + + + + ekizyener + + + Binici + + + cengiza + + + Muhammet Tarakçı + muhammettarakci@gmail.com + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2018-04-11T05:54:35+03:00 + + + + + + + + + + + + + + erişim + ve + ve diğerleri + anonim + anonim + de + erişim adresi + by + yaklaşık + yakl. + a.yer + + baskı + baskı + + bs + vd. + gelecek + gönderen + a.g.e. + içinde + basımda + internet + mülakat + mektup + tarih yok + t.y. + çevrimiçi + program adı: + + kaynak + kaynaklar + + + kay. + kay. + + geliş tarihi + ölçek + versiyon + + + M.S. + M.Ö. + + + + + + + - + + + . + + + birinci + ikinci + üçüncü + dördüncü + beşinci + altıncı + yedinci + sekizinci + dokuzuncu + onuncu + + + + kitap + kitaplar + + + bölüm + bölümler + + + sütun + sütunlar + + + şekil + şekiller + + + folyo + folyo + + + sayı + sayı + + + satır + satırlar + + + not + notlar + + + eser + eserler + + + sayfa + sayfalar + + + sayfa sayısı + sayfa sayıları + + + paragraf + paragraflar + + + kısım + kısımlar + + + bölüm + bölümler + + + madde + maddeler + + + ayet + ayetler + + + cilt + ciltler + + + + kit. + böl. + süt. + şek. + fl. + sy + satır + n. + a.yer + + s. + ss. + + + s. + ss. + + par. + ksm. + blm. + + md. + md. + + + v. + vv. + + + c. + c. + + + + + + ¶¶ + + + § + §§ + + + + + direktör + direktörler + + + editör + editörler + + + sorumlu editör + sorumlu editörler + + + çizen + çizenler + + + çeviren + çevirenler + + + editör & çeviren + editörler & çevirenler + + + + + dir. + dir. + + + ed. + ed. + + + sor.ed. + sor.ed. + + + çzm. + çzm. + + + çev. + çev. + + + ed. & çev. + ed. & çev. + + + + kitap editörü + direktör + editör + sorumlu editör + çizen + röportaj yapan + alıcı + tanıtım yazarı + çeviren + düzenleyen & çeviren by + + + dir. + ed. + sor.ed. + çizen + çev. + ed. & çev. + + + Ocak + Şubat + Mart + Nisan + Mayıs + Haziran + Temmuz + Ağustos + Eylül + Ekim + Kasım + Aralık + + + Oca. + Şub. + Mar. + Nis. + May. + Haz. + Tem. + Ağu. + Eyl. + Eki. + Kas. + Ara. + + + Bahar + Yaz + Sonbahar + Kış + + diff --git a/biblio/citation-style-language/csl-locales-uk-UA.xml b/biblio/citation-style-language/csl-locales-uk-UA.xml new file mode 100644 index 0000000000..82124fa682 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-uk-UA.xml @@ -0,0 +1,249 @@ + + + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2018-09-25T04:00:45+00:00 + + + + + + + + + + + + + + дата звернення + і + та інші + анонімний + анон. + на + доступний у + відповідно до + близько + c. + цит. за + видання + вид. + et al. + майбутній + із + там само + в + у пресі + інтернет + інтервю + лист + без дати + б. д. + online + представлена на + список використаних джерел + джерела + вилучено + масштаб + версія + + + н. е. + до н. е. + + + « + » + + + + + + ий + + + перший + другий + третій + четвертий + п'ятий + шостий + сьомий + восьмий + дев'ятий + десятий + + + + книга + книги + + + розділ + розділи + + + графа + графи + + + рисунок + рисунки + + + фоліант + фоліанти + + випуск + + Рядок + Рядки + + + примітка + примітки + + + opus + opera + + С. + с. + + параграф + параграфи + + + частина + частини + + + розділ + розділи + + + sub verbo + sub verbis + + + verse + verses + + + Том + Томи + + + + кн. + розд. + ряд. + рис. + ф. + вип. + л. + прим. + оп. + с. + с. + пар. + ч. + сек. + + s.v. + s.vv. + + с. + вип. + + + + + ¶¶ + + + § + §§ + + + + + режисер + режисери + + за ред. + за ред. + + ілюстратор + ілюстратори + + + перекладач + перекладачі + + За ред. & переклад + + + реж. + ред. + ред. + іл. + пер. + ред. & пер. + + + by + directed by + edited by + edited by + illustrated by + interview by + to + by + translated by + edited & translated by + + + dir. + ed + ed. + illus. + trans + ed. & trans. by + + + Січень + Лютий + Березень + Квітень + Травень + Червень + Липень + Серпень + Вересень + Жовтень + Листопад + Грудень + + + Січ + Лют + Бер + Квіт + Трав + Чер + Лип + Сер + Вер + Жов + Лис + Груд + + + Spring + Summer + Autumn + Winter + + diff --git a/biblio/citation-style-language/csl-locales-vi-VN.xml b/biblio/citation-style-language/csl-locales-vi-VN.xml new file mode 100644 index 0000000000..8f76c1c9e3 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-vi-VN.xml @@ -0,0 +1,315 @@ + + + + + dowens76 + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + truy cập + + and others + vô danh + v.d + tại + available at + bởi + circa + c. + cited + + ấn bản + ấn bản + + a.b + và c.s. + sắp tới + từ + n.t. + trong + in press + internet + interview + letter + không ngày + không ngày + online + được trình bày tại + + reference + references + + + ref. + refs. + + truy vấn + scale + version + + + AD + BC + + + + + + + + + + th + st + nd + rd + th + th + th + + + thứ nhất + thứ hai + thứ ba + thứ tư + thứ năm + thứ sáu + thứ bảy + thứ tám + thứ chính + thứ mười + + + + sách + sách + + + chương + chương + + + column + columns + + + figure + figures + + + folio + folios + + + số + số + + + dòng + dòng + + + ghi chú + ghi chú + + + opus + opera + + + trang + trang + + + trang + trang + + + đoạn văn + đoạn văn + + + phần + phần + + + section + sections + + + sub verbo + sub verbis + + + câu + câu + + + tập + tập + + + + sách + ch + col + fig + f + số p.h + d. + gc. + op + + tr + tr + + + tr + tr + + para + ph + sec + + s.v. + s.vv. + + + v + vv + + + vol + vols + + + + + + ¶¶ + + + § + §§ + + + + + director + directors + + + biên tập viên + biên tập viên + + + biên tập viên + biên tập viên + + + họa sĩ + họa sĩ + + + biên dịch viên + biên dịch viên + + + biên tập viên & biên dịch viên + biên tập viên & biên dịch viên + + + + + dir. + dirs. + + + b.t.v + b.t.v + + + b.t.v + b.t.v + + + h.s + h.s + + + b.d.v + b.d.v + + + b.t.v & b.d.v + b.t.v & b.d.v + + + + bởi + directed by + biên tập bởi + biên tập bởi + illustrated by + interview by + to + bởi + biên dịch bởi + biên tập & biên dịch bởi + + + dir. + b.t + b.t + h.s + b.d + b.t & b.d bởi + + + Tháng Giêng + Tháng Hai + Tháng Ba + Tháng Tư + Tháng Năm + Tháng Sáu + Tháng Bảy + Tháng Tám + Tháng Chín + Tháng Mười + Tháng Mười-Một + Tháng Chạp + + + tháng 1 + tháng 2 + tháng 3 + tháng 4 + tháng 5 + tháng 6 + tháng 7 + tháng 8 + tháng 9 + tháng 10 + tháng 11 + tháng 12 + + + Mùa Xuân + Mùa Hè + Mùa Thu + Mùa Đông + + diff --git a/biblio/citation-style-language/csl-locales-zh-CN.xml b/biblio/citation-style-language/csl-locales-zh-CN.xml new file mode 100644 index 0000000000..45e36bdd02 --- /dev/null +++ b/biblio/citation-style-language/csl-locales-zh-CN.xml @@ -0,0 +1,205 @@ + + + + + rongls + + + sati-bodhi + + + Heromyth + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2019-04-16T11:15:46+08:00 + + + + + + + + + + + + + + 见于 + + 及其他 + 作者不详 + 无名氏 + + 载于 + + 介于 + + 见引于 + 版本 + + + 即将出版 + + 同上 + 收入 + 送印中 + 网际网络 + 访谈 + 信函 + 日期不详 + 不详 + 在线 + 发表于 + 参考 + + 取读于 + 比例 + + + + 公元 + 公元前 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 图表 + + + + 注脚 + 作品 + + 总页数 + 段落 + 部分 + + 另见 + + + + + + + + + + + + + op. + + + + + + 另见 + + + + + + + ¶¶ + + + § + §§ + + + + 导演 + 编辑 + 主编 + 绘图 + 翻译 + 编译 + + + 导演 + + 主编 + + + 编译 + + + + 指导 + 编辑 + 主编 + 绘图 + 采访 + 受函 + 校订 + 翻译 + 编译 + + + + + 主编 + + + 编译 + + + + 一月 + 二月 + 三月 + 四月 + 五月 + 六月 + 七月 + 八月 + 九月 + 十月 + 十一月 + 十二月 + + + 1月 + 2月 + 3月 + 4月 + 5月 + 6月 + 7月 + 8月 + 9月 + 10月 + 11月 + 12月 + + + + + + + + diff --git a/biblio/citation-style-language/csl-locales-zh-TW.xml b/biblio/citation-style-language/csl-locales-zh-TW.xml new file mode 100644 index 0000000000..d6144950cb --- /dev/null +++ b/biblio/citation-style-language/csl-locales-zh-TW.xml @@ -0,0 +1,209 @@ + + + + + sati-bodhi + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2017-12-29T16:29:13+01:00 + + + + + + + + + + + + + + 引見於 + + 及其他 + 作者不詳 + 無名氏 + + 載於 + + 介於 + + 見引於 + 版本 + + + 即將出版 + + 同上 + 收入 + 印行中 + 互聯網 + 訪談 + 信函 + 日期不詳 + 不詳 + 線上 + 發表於 + 參考 + + 讀取於 + 比例 + + + + 西元 + 西元前 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 圖表 + + + + 註腳 + 作品 + + 總頁數 + 段落 + 部分 + + 另見 + + + + + + + + + + + + op. + + + + + + 另見 + + + + + + + ¶¶ + + + § + §§ + + + + 作者 + 導演 + 編輯 + 主編 + 繪圖師 + 採訪員 + 收信人 + 翻譯員 + 編譯員 + 評論人 + + + 作者 + 導演 + 編輯 + 主編 + 繪圖師 + 採訪員 + 收信人 + 翻譯員 + 編譯員 + 評論人 + + + + + + 指導 + 編輯 + 點校 + 主編 + 繪圖 + 採訪 + 受函 + 點評 + 翻譯 + 編譯 + + + + + + + + + + + + 一月 + 二月 + 三月 + 四月 + 五月 + 六月 + 七月 + 八月 + 九月 + 十月 + 十一月 + 十二月 + + + 1月 + 2月 + 3月 + 4月 + 5月 + 6月 + 7月 + 8月 + 9月 + 10月 + 11月 + 12月 + + + + + + + + diff --git a/biblio/citation-style-language/csl.lua b/biblio/citation-style-language/csl.lua new file mode 100644 index 0000000000..701102319b --- /dev/null +++ b/biblio/citation-style-language/csl.lua @@ -0,0 +1,141 @@ +--[[ + Copyright (C) 2021 Zeping Lee +--]] + +local csl = {} + +local citeproc = require("citeproc") +local util = citeproc.util +require("lualibs") +local core = require("csl-core") + + +csl.initialized = "false" +csl.citations = {} +csl.citations_pre = {} + + +function csl.error(str) + luatexbase.module_error("csl", str) +end +function csl.warning(str) + luatexbase.module_warning("csl", str) +end +function csl.info(str) + luatexbase.module_info("csl", str) +end + + +function csl.init(style_name, bib_files, lang) + bib_files = util.split(util.strip(bib_files), "%s*,%s*") + + csl.engine = core.init(style_name, bib_files, lang) + + if csl.engine then + csl.initialized = "true" + else + return + end + + -- csl.init is called via \AtBeginDocument and it's executed after + -- loading .aux file. The csl.ids are already registered. + csl.citation_strings = core.process_citations(csl.engine, csl.citations) + csl.style_class = csl.engine:get_style_class() + + for _, citation in ipairs(csl.citations) do + local citation_id = citation.citationID + local citation_str = csl.citation_strings[citation_id] + local bibcite_command = string.format("\\bibcite{%s}{{%s}{%s}}", citation.citationID, csl.style_class, citation_str) + tex.sprint(bibcite_command) + end + +end + + +function csl.register_citation_info(citation_info) + local citation = core.make_citation(citation_info) + table.insert(csl.citations, citation) +end + + +function csl.enable_linking() + csl.engine:enable_linking() +end + + +function csl.cite(citation_info) + if not csl.engine then + csl.error("CSL engine is not initialized.") + end + + local citation = core.make_citation(citation_info) + + local res = csl.engine:processCitationCluster(citation, csl.citations_pre, {}) + + local citation_str + for _, citation_res in ipairs(res[2]) do + local citation_id = citation_res[3] + -- csl.citation_strings[citation_id] = citation_res[2] + if citation_id == citation.citationID then + citation_str = citation_res[2] + end + end + tex.sprint(citation_str) + + table.insert(csl.citations_pre, {citation.citationID, citation.properties.noteIndex}) +end + + +function csl.nocite(ids_string) + local cite_ids = util.split(ids_string, "%s*,%s*") + if csl.engine then + local ids = {} + for _, cite_id in ipairs(cite_ids) do + if cite_id == "*" then + for item_id, _ in pairs(core.bib) do + table.insert(ids, item_id) + end + else + table.insert(ids, cite_id) + end + end + csl.engine:updateUncitedItems(ids) + else + -- `\nocite` in preamble, where csl.engine is not initialized yet + for _, cite_id in ipairs(cite_ids) do + if cite_id == "*" then + core.uncite_all_items = true + else + if not core.loaded_ids[cite_id] then + table.insert(core.ids, cite_id) + core.loaded_ids[cite_id] = true + end + end + end + end +end + + +function csl.bibliography() + if not csl.engine then + csl.error("CSL engine is not initialized.") + return + end + + -- if csl.include_all_items then + -- for id, _ in pairs(csl.bib) do + -- if not csl.loaded_ids[id] then + -- table.insert(csl.ids, id) + -- csl.loaded_ids[id] = true + -- end + -- end + -- end + -- csl.engine:updateItems(csl.ids) + + local result = core.make_bibliography(csl.engine) + + tex.print(util.split(result, "\n")) +end + + +return csl diff --git a/biblio/citation-style-language/elsevier-harvard.csl b/biblio/citation-style-language/elsevier-harvard.csl new file mode 100644 index 0000000000..5d88c51d80 --- /dev/null +++ b/biblio/citation-style-language/elsevier-harvard.csl @@ -0,0 +1,239 @@ + + diff --git a/biblio/citation-style-language/harvard-cite-them-right.csl b/biblio/citation-style-language/harvard-cite-them-right.csl new file mode 100644 index 0000000000..2800678205 --- /dev/null +++ b/biblio/citation-style-language/harvard-cite-them-right.csl @@ -0,0 +1,318 @@ + + diff --git a/biblio/citation-style-language/ieee.csl b/biblio/citation-style-language/ieee.csl new file mode 100644 index 0000000000..b56ba3a9bd --- /dev/null +++ b/biblio/citation-style-language/ieee.csl @@ -0,0 +1,457 @@ + + diff --git a/biblio/citation-style-language/modern-humanities-research-association.csl b/biblio/citation-style-language/modern-humanities-research-association.csl new file mode 100644 index 0000000000..715a28d62a --- /dev/null +++ b/biblio/citation-style-language/modern-humanities-research-association.csl @@ -0,0 +1,496 @@ + + diff --git a/biblio/citation-style-language/modern-language-association.csl b/biblio/citation-style-language/modern-language-association.csl new file mode 100644 index 0000000000..41eedd6ff2 --- /dev/null +++ b/biblio/citation-style-language/modern-language-association.csl @@ -0,0 +1,324 @@ + + diff --git a/biblio/citation-style-language/nature.csl b/biblio/citation-style-language/nature.csl new file mode 100644 index 0000000000..2646cfe922 --- /dev/null +++ b/biblio/citation-style-language/nature.csl @@ -0,0 +1,132 @@ + + diff --git a/biblio/citation-style-language/vancouver.csl b/biblio/citation-style-language/vancouver.csl new file mode 100644 index 0000000000..edbb69b411 --- /dev/null +++ b/biblio/citation-style-language/vancouver.csl @@ -0,0 +1,351 @@ + + -- cgit v1.2.3