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

PdfLatex custom path not used #4

Open
PeteMichaud opened this issue Apr 19, 2022 · 0 comments
Open

PdfLatex custom path not used #4

PeteMichaud opened this issue Apr 19, 2022 · 0 comments

Comments

@PeteMichaud
Copy link

I think I found a quite bad bug, but I want other eyes on it to verify.

There is a setting in the plugin that allows the user to input their own custom path for pdflatex, in case it's not accessible on the user's PATH.

The code that spawns the pandoc process tries to use this path in the following way:

  1. Make a copy of the process.env object:
    const env = Object.assign(process.env);
  2. If a custom pdflatex path is provided, update the copied env object with that new path:
    env.PATH += path.dirname(input.pdflatex);
  3. Totally ignore the modified copy, and just pass in the normal process.env anyway:
    pandoc = spawn(input.pandoc || 'pandoc', args, { env: process.env });

So the custom pdflatex path is actually never used, and the only way this plugin can ever generate pdfs is if pdflatex actually is on the user's PATH.

I think the fix is simply to change line 161 to:

pandoc = spawn(input.pandoc || 'pandoc', args, { env: env });

Thoughts?

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

1 participant