https://github.com/zepinglee/citeproc-lua
A Lua implementation of the Citation Style Language (CSL) for use with LaTeX
https://github.com/zepinglee/citeproc-lua
bibliography bibtex citation-style-language citations citeproc csl latex lua luatex
Last synced: 16 days ago
JSON representation
A Lua implementation of the Citation Style Language (CSL) for use with LaTeX
- Host: GitHub
- URL: https://github.com/zepinglee/citeproc-lua
- Owner: zepinglee
- License: mit
- Created: 2021-09-11T07:49:17.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-09-30T13:41:42.000Z (22 days ago)
- Last Synced: 2025-09-30T15:27:11.061Z (22 days ago)
- Topics: bibliography, bibtex, citation-style-language, citations, citeproc, csl, latex, lua, luatex
- Language: Lua
- Homepage:
- Size: 16.2 MB
- Stars: 80
- Watchers: 8
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# citeproc-lua
[](https://www.ctan.org/pkg/citation-style-language)
[](https://luarocks.org/modules/zepinglee/citeproc-lua)
[](https://github.com/zepinglee/citeproc-lua/releases/latest)
[](https://github.com/zepinglee/citeproc-lua/commits/main)
[](https://github.com/zepinglee/citeproc-lua/actions/workflows/test.yml)- Homepage: https://github.com/zepinglee/citeproc-lua
- Author: Zeping Lee
- Email: zepinglee AT gmail DOT com
- License: MITThe [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 `citeproc-lua` project is a Lua implementation of CSL v1.0.2 processor
that is aimed for use with LaTeX.
The engine 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 are not implemented yet.
Comments, suggestions and bug reports are welcome.## LaTeX example
A full LaTeX example is in the [`examples/`](examples) directory.
- LaTeX document example.tex
```latex
\documentclass{article}\usepackage{citation-style-language}
\cslsetup{style = apa}
\addbibresource{example.json} % or example.bib or example.yaml\begin{document}
\cite{ITEM-1}
\printbibliography\end{document}
```- For LuaTeX
```bash
lualatex example.tex
lualatex example.tex
```- For other TeX engines
```bash
pdflatex example.tex
citeproc-lua example.aux
pdflatex example.tex
```## Installation
The above example should work out-of-the-box with TeX Live 2022 or later version.
If you want to install the GitHub develop version of this package,
you may follow the steps below.The `citation-style-language` requires the following packages:
`filehook`, `l3kernel`, `l3packages`, `lua-uca`, `lualibs`,
`luatex`, `luaxml`, and `url`.
`l3build` is also required for actually performing the installation.
Make sure they are already installed in the TeX distribution.```bash
git clone https://github.com/zepinglee/citeproc-lua # Clone the repository
cd citeproc-lua
git submodule update --init --remote # Fetch submodules
l3build install
```These commands install the package files to `TEXMFHOME` which is usually
`~/texmf` on Linux or `~/Library/texmf` on macOS.
Besides, the `citeproc-lua` executable needs to be copied to some directory
in the `PATH` environmental variable so that it can be called directly in the shell.
For example provided `~/bin` is in `PATH`:```bash
cp citeproc/citeproc-lua.lua "~/bin/citeproc-lua"
```To uninstall the package from `TEXMFHOME`:
```bash
l3build uninstall
```## License
The LaTeX package and Lua library are released under MIT license.
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.
The journal abbreviation data are generated from and are redistributed under the [CC0 1.0](https://github.com/JabRef/abbrv.jabref.org/blob/main/LICENSE.md) license.## Related material
- CSL
- [CSL Homepage](https://citationstyles.org/)
- [CSL specification](https://docs.citationstyles.org/en/stable/specification.html)
- [CSL schema](https://github.com/citation-style-language/schema)
- [CSL processors in other languages](https://citationstyles.org/developers/#csl-processors)
- [Juris-M/citeproc-js](https://github.com/Juris-M/citeproc-js)
- [documentation](https://citeproc-js.readthedocs.io/en/latest/)
- [brechtm/citeproc-py](https://github.com/brechtm/citeproc-py)
- [jgm/citeproc](https://github.com/jgm/citeproc)
- [andras-simonyi/citeproc-el](https://github.com/andras-simonyi/citeproc-el)
- [inukshuk/citeproc-ruby](https://github.com/inukshuk/citeproc-ruby)
- [zotero/citeproc-rs](https://github.com/zotero/citeproc-rs)
- [CSL locales](https://github.com/citation-style-language/locales)
- [CSL styles](https://github.com/citation-style-language/styles)
- [CSL test-suite](https://github.com/citation-style-language/test-suite)
- Articles
- [A Citation Style Language (CSL) workshop](https://tug.org/TUGboat/tb35-3/tb111stender.pdf) (TUGboat article)
- Discussions
- [Citation Style Language vs. biblatex](https://tex.stackexchange.com/questions/434946/citation-style-language-vs-biblatex-vs-possibly-other-citing-systems)