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

Integrate with citeproc-rs #189

Open
cormacrelf opened this issue Nov 15, 2019 · 5 comments
Open

Integrate with citeproc-rs #189

cormacrelf opened this issue Nov 15, 2019 · 5 comments

Comments

@cormacrelf
Copy link
Collaborator

I'm the author of citeproc-rs. This is probably an issue for upstream tectonic later on, but this is the cool repo at the moment.

Currently, if you want citeproc, you use Pandoc and pandoc-citeproc. I recall someone was working on a lua-based citeproc for LuaTeX, I don't know where that's at. In any case, citeproc-rs is coming along well, and it might be useful to make it work with \cite commands, the way bibtex works. It would need slightly different syntax and maybe a slightly different command set to support different things.

My main questions are:

  • Would you really want it compiled in, as you clearly could do with the rust library? Arguably no -- then you need to release a new tectonic for citeproc-rs updates. Not exactly ideal.
  • If not, how? My best answer at the moment is JSON over stdio. See Stdio mode zotero/citeproc-rs#13.
@crlf0710
Copy link
Owner

I've not really thinking deeply on this yet, but maybe one thing we could do is build a plugin infrastructure: use the libloading crate to load all dlls from a directory, and collect some entry function pointers into a central position.

Maybe some other currently missing features like EPS image processing could live under this infrastructure, too.

@crlf0710
Copy link
Owner

https://docs.rs/abi_stable this crate may help creating such a plugin system. I've not tried it before though.

@cormacrelf
Copy link
Collaborator Author

cormacrelf commented Nov 15, 2019

I'm having a hard time imagining what the common function signature would look like. Obviously you do not want to give out references to the xetex_ini static mut variables, so these plugins can't really process their own tokens. But if they can't do that, what can they do that could be described with one function? This might speak to the structure of the xetex code more than anything else. I'm getting the sense that there's a long story involving removing the static muts before you can do this.

EPS would be a dpx plugin, that might work better, just have it implement the dpx specials API with a bunch of isolation thrown at it, ending up as a small set of exposed functions to access things immutably. This is again why mutable globals are annoying! But the situation is much better in dpx land than xetex, I think.

@crlf0710
Copy link
Owner

well, on the tex/xetex part, there's a function called primitive which adds a tex primitive into the hashtable. i think calling that would be the start point. Haven't give it a test it myself, though.

yes i agree mutable globals are annoying. but since in the pascal code time, many variables are already mutable global when they don't have to. maybe we'll have a much better time fixing these when doing the web2rust conversion.

@cormacrelf
Copy link
Collaborator Author

Some more discussion over in the zulip

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