citeproc-lua icon indicating copy to clipboard operation
citeproc-lua copied to clipboard

[feature] use another filetype to store locales's xml and styles's csl

Open Freed-Wu opened this issue 5 months ago • 2 comments

luatex's kpse.find_file(file, nil) is kpse.find_file(file, 'tex') by default. So locales's xml and styles' csl can be found in tex/latex/citation-style-languages/. However, kpathsea has 'other text files' to store other text files. Perhaps put these text files here more reasonable.

$ kpsewhich --help-formats|rg 'other text files'
82:other text files (othertext):  [variables: KPSEWHICHINPUTS]

BTW, Why use fork of https://github.com/citation-style-language/locales ? Why not original upstream?

Freed-Wu avatar Jul 30 '25 14:07 Freed-Wu

Perhaps put these text files here more reasonable.

$ kpsewhich --help-formats|rg 'other text files' 82:other text files (othertext): [variables: KPSEWHICHINPUTS]

What is the expected path? I don't find the /usr/local/texlive/2025/texmf-dist/kpsewhich dir in the installation.

BTW, Why use fork of https://github.com/citation-style-language/locales ? Why not original upstream?

The forks adds a csl- prefix to each locales-*.xml file to avoid conflict with locale files from other packages in TeX Live if any.

zepinglee avatar Jul 30 '25 14:07 zepinglee

I take a look at the document:

There are two special cases, because the paths and environment variables always depend on the name of the program: the variable name is constructed by converting the program name to upper case, and then appending ‘INPUTS’. Assuming the program is called ‘foo’, this gives us the following table. ‘other text files’ (text files used by ‘foo’) FOOINPUTS. ‘other binary files’ (binary files used by ‘foo’) FOOINPUTS

For luatex, it is variable LUATEXINPUTS, for lualatex, it is variable LUALATEXINPUTS. Maybe they expect user download files such as CSL styles/locales to a directory and then set this variable. However, this project attach these files (although it is not latest). So it is a different usage.

The forks adds a csl- prefix

If kpse search xml/csl in a different path from kpse.find_file(XXX, 'tex'), it will not conflict.

Perhaps kpse can provide a new file type for XML's styles/locales. Such as kpse.find_file(XXX, 'csl'. It will be better.

Freed-Wu avatar Jul 30 '25 15:07 Freed-Wu