0

I am writing an application which generates .tex filed and invokes pdflatex (on windows/texlive for now, but it should be compatible with toher distros and OS).

I would like to enable the user to include custom directories for resources shared between the generated .tex files. Under Linux I had done that simply by setting the TEXINPUTS environment variable.

Now under windows, initially the variable is empty, so I cannot just "append" stuff there. However, If I set TEXINPUTS to any paths, pdflatex seems to exclusively check these paths, and forget about whatever it had checked before. doesn't reconize the default paths anymore. This results in pdflatex not even finding the input file anymore input file not found

If the input file is specified manually, then any resources within the tex file are not found anymore, starting with the document class file: cls file not found

How do I properly add input paths on windows?

  • 2
    Are you setting with the 'and default' paths ending (trailing ;), e.g. I have set TEXINPUTS=.;C:\Users\joseph\Documents\LaTeX\local\\;C:\Users\joseph\Documents\LaTeX\beamer\base\\; – Joseph Wright Jan 14 '18 at 16:42
  • Oh wow ... I think that did it. :) - didn't know the trailing ; had that semantic. – IARI Jan 14 '18 at 16:46
3

If TEXINPUTS isn't set, TeX acts in the same way

set TEXINPUTS=.;

Notice in particular the trailing ;. This means 'then follow up with the standard locations'. Thus if we want to add a location (say C:\SharedTeX), we need to _retainthe trailing;`

set TEXINPUTS=.;C:\SharedTeX;

(I've also kept ., i.e. the current directory, as this is usually sensible.)

The only time you don't want the trailing ; is if you want to 'isolate' a run from the standard tree: only really useful for low-level testing. (The LaTeX team do exactly that to test during kernel development.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.