Support for tectonic for LaTeX
Have you tried setting the LaTeX command in the nbconvert config file?
c.PDFExporter.latex_command = ['xelatex', '{filename}']
Try replacing XeLaTeX with tectonic. I've never heard of tectonic before. I don't know if that would work, but if tectonic wraps XeLaTeX it might.
Part of the issue is tectonic is not xelatex. It is certainly based off of xelatex. However it's made some different design decisions (am not aware of all of the details here so hopefully others can fill these in). So depending on how much nbconvert is relying on tectonic being xelatex either in terms of options provided or behavior this may or may not work. If I have said anything inaccurate here, would be happy to have someone more knowledgeable correct me.
xref: https://github.com/tectonic-typesetting/tectonic/issues/158
Tectonic has made various changes, yes, but for standard usages it should look like a drop-in replacement for other TeX engines. In particular I'd expect the suggested command to work, though I haven't tried it myself.
Have you tried setting the LaTeX command in the nbconvert config file?
c.PDFExporter.latex_command = ['xelatex', '{filename}']Try replacing
XeLaTeXwithtectonic. I've never heard of tectonic before. I don't know if that would work, but if tectonic wraps XeLaTeX it might.
@t-makaro I tried your suggestion, and it works for me. However, I also had to install bibtex.
That's a bit odd, since Tectonic bundles its own bibtex tool. (It doesn't and can't bundle biber, used by biblatex, which is a perennial source of issues, though.)
FWIW, in the time since this issue was first opened, Tectonic has started evolving to a git-like CLI, so a more future-compatible command should be:
c.PDFExporter.latex_command = ['tectonic', '-X', 'compile', '{filename}']
For the time being this is exactly compatible with a simple tectonic {filename} but the hope is to gradually deprecate the no-subcommand form of invocation.
@pkgw Thanks for the info! The missing bibtex is then very likely a symptom of my dev environment.
EDIT: It looks like the bibtex program is called separately by nbconvert, explaining why I had to install it: https://github.com/jupyter/nbconvert/blob/acf41acf6d83cb725f3a2c48686c828eff7b24d8/nbconvert/exporters/pdf.py#L66
@pkgw Thanks for the info! The missing
bibtexis then very likely a symptom of my dev environment.EDIT: It looks like the
bibtexprogram is called separately bynbconvert, explaining why I had to install it:https://github.com/jupyter/nbconvert/blob/acf41acf6d83cb725f3a2c48686c828eff7b24d8/nbconvert/exporters/pdf.py#L66
@pkgw can you tell how to call bundled bibtex from tectonic here?
@Ingvar-Y Hmmm. Tectonic doesn't currently have a way to "call" its bundled bibtex in this way. Since Tectonic automatically runs bibtex as needed, would it potentially work to just set the program to /bin/true or something along those lines? Part of the Tectonic idea is that you just run it and get the PDF you want, without every higher-level tool needing to implement its own logic for the tex/bibtex/tex/tex dance.
That being said it's conceivable to add a feature to expose the bundled bibtex — it might even be effectively possible now, if one were to develop a clever wrapper script involving a throwaway .tex file or something.