| 1 | # citation-style-language |
| 2 | |
| 3 | - Homepage: https://github.com/zepinglee/citeproc-lua |
| 4 | - Author: Zeping Lee |
| 5 | - Email: zepinglee AT gmail DOT com |
| 6 | - License: MIT, CC BY-SA 3.0, CC0 1.0 |
| 7 | |
| 8 | The [Citation Style Language](https://citationstyles.org/) (CSL) is an |
| 9 | XML-based language that defines the formats of citations and bibliography. |
| 10 | There are currently thousands of styles in CSL including the most widely used |
| 11 | APA, Chicago, Vancouver, etc. |
| 12 | The `citation-style-language` package is aimed to provide another reference |
| 13 | formatting method for LaTeX that utilizes the CSL styles. |
| 14 | It contains a citation processor implemented in pure Lua (`citeproc-lua`) |
| 15 | which reads bibliographic metadata and performs sorting and formatting on both |
| 16 | citations and bibliography according to the selected CSL style. |
| 17 | A LaTeX package (`citation-style-language.sty`) is provided to communicate |
| 18 | with the processor. |
| 19 | |
| 20 | This project is in early development stage and some features of CSL (especially |
| 21 | collapsing and disambiguation) are not implemented yet. Comments, suggestions |
| 22 | and bug reports are welcome. |
| 23 | |
| 24 | ## LaTeX example |
| 25 | |
| 26 | A full LaTeX example is in the [`examples/`](examples) directory. |
| 27 | |
| 28 | - LaTeX document example.tex |
| 29 | |
| 30 | ```latex |
| 31 | \documentclass{article} |
| 32 | |
| 33 | \usepackage{citation-style-language} |
| 34 | \cslsetup{style = apa} |
| 35 | \addbibresource{example.json} % or example.bib or example.yaml |
| 36 | |
| 37 | \begin{document} |
| 38 | |
| 39 | \cite{ITEM-1} |
| 40 | \printbibliography |
| 41 | |
| 42 | \end{document} |
| 43 | ``` |
| 44 | |
| 45 | - Compiling with LuaTeX |
| 46 | |
| 47 | ```bash |
| 48 | lualatex example.tex |
| 49 | lualatex example.tex |
| 50 | ``` |
| 51 | |
| 52 | - Compiling with other TeX engines |
| 53 | |
| 54 | ```bash |
| 55 | pdflatex example.tex |
| 56 | citeproc-lua example.aux |
| 57 | pdflatex example.tex |
| 58 | ``` |
| 59 | |
| 60 | |
| 61 | ## License |
| 62 | |
| 63 | The LaTeX package and Lua library are released under MIT license. |
| 64 | The CSL styles and locale files are redistributed under the [Creative Commons Attribution-ShareAlike 3.0 Unported](https://creativecommons.org/licenses/by-sa/3.0/) license. |
| 65 | The journal abbreviation data are generated from <https://github.com/JabRef/abbrv.jabref.org> and are redistributed under the [CC0 1.0](https://github.com/JabRef/abbrv.jabref.org/blob/main/LICENSE.md) license. |