3

Jupyter's default export to PDF, like the command-line NBconvert tool, are telling me that I can't convert my notebook to PDF because the PDF conversion goes via xelatex. The error message refers me to this help page, so I installed MiKTeX. I have a xelatex folder in AppData\Local\Programs\MiKTeX 2.9\tex, but I'm not sure what exactly I should add to my PATH.

If it's helpful, here is some of the code in nbconvert's pdf.py:

def run_latex(self, filename):
    """Run xelatex self.latex_count times."""

    def log_error(command, out):
        self.log.critical(u"%s failed: %s\n%s", command[0], command, out)

    return self.run_command(self.latex_command, filename,
        self.latex_count, log_error) 
Josh Friedlander
  • 10,870
  • 5
  • 35
  • 75
  • Can you run xelatex from the command prompt at all? – butterwagon Sep 06 '18 at 18:46
  • Should there be an executable? What file type is it? – Josh Friedlander Sep 06 '18 at 18:56
  • Try running the command prompt as administrator. Then type in "xelatex" and hit enter. Do you get something like "xelatex: warning: running with administrator privileges" back? Also - do you have "xelatex.exe" in `AppData\Local\Programs\MiKTeX 2.9\tex\bin\x64` (or `x86` if you're on 32 bit)? – butterwagon Sep 06 '18 at 19:03
  • 1) Yes, I got that. 2) Yes, found it! (Path is slightly different, it's `...MiKTeX 2.9\miktex\bin\x64`.) Should I add this folder to my PATH? – Josh Friedlander Sep 06 '18 at 19:14
  • Hmm. If you got "xelatex: warning: running with administrator privileges" back, it should have already been added to PATH. Add it if it isn't already there... – butterwagon Sep 06 '18 at 19:23
  • Weird. It doesn't seem to be dependent on the notebook either. I added a comment on [this issue thread](https://github.com/jupyter/nbconvert/issues/799). – Josh Friedlander Sep 06 '18 at 19:28
  • Never mind - rebooting my machine solved it. Thanks for your help! – Josh Friedlander Sep 06 '18 at 19:38

0 Answers0