Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find CSL in ~/.csl directory *or* follow relative paths to CSL files. #50

Closed
paultopia opened this issue Feb 6, 2021 · 3 comments

Comments

@paultopia
Copy link

paultopia commented Feb 6, 2021

hi there! So this very old issue for the previous pandoc-citeproc filter suggests that that earlier iteration looked in ~/.csl for style files.

I currently have a ~/.csl directory sitting around containing all 2000-some CSL styles from the central CSL repository. Including, importantly, chicago-author-date.csl. But I can't for the life of me figure out how to actually get citeproc to find that repository.

I started with a defaults file in ~/.pandoc/defaults/research.yaml that contains, in relevant part,

citeproc: true
csl: chicago-author-date

but running pandoc -o testres.pdf --defaults=research markdown.md yields the error File chicago-author-date.csl not found in resource path.

Then I changed it to a full relative pathname: csl: ~/.csl/chicago-author-date.csl

But, same error.

Finally, I gave it a full absolute path, i.e., csl: /Users/myhome/.csl/chicago-author-date.csl and that worked.

Similar errors happen passing relative paths directly from the commandline rather than in a defaults file.

I'm using Pandoc 2.11.4 (installed via homebrew on on Macos catalina, if it matters).

@jgm
Copy link
Owner

jgm commented Feb 7, 2021

citeproc doesn't look in .csl any more, as documented in the changelog for pandoc 2.11:

  • pandoc-citeproc searches the ~/.csl directory for .csl styles. Pandoc instead searches the csl subdirectory of the pandoc user data directory (e.g., ~/.pandoc/csl or ~/.local/share/pandoc/csl). Users who already keep CSL styles in ~/.csl may find it convenient to add a symlink.

@jgm jgm closed this as completed Feb 7, 2021
@paultopia
Copy link
Author

paultopia commented Feb 7, 2021

Aaah thank you. Is the relative pathname thing also intended behavior?

(Uh, actually, I mean tilde expansion I guess. sorry.)

@jgm
Copy link
Owner

jgm commented Feb 7, 2021

Tilde expansion is a shell feature. If you specify a tilde on the command line, the shell will interpret it as your home directory before it is passed on to pandoc. But if you specify a tilde in metadata within your file, it's not interpreted by the shell so it's just...a tilde.

But your question does come up quite a bit, e.g.
jgm/pandoc#5977
jgm/pandoc#3135
A case could be made for expanding tildes in these contexts, I suppose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants