2

I have a very simple file hello.tex

I want to use streaming instead of taking file as argument, and the following commands actually work:

cat hello.tex | pdflatex

cat hello.tex | TEXINPUTS= pdflatex

When TEXINPUTS is not defined pdflatex seems to use a default value.


My problem

I want to load some custom LaTeX environments and when I set TEXINPUTS:

cat hello.tex | TEXINPUTS="./" pdflatex

I get an error as it can not load default LaTeX files:

LaTeX Error: File 'article.cls' not found.


Is there a way to add some custom paths to TEXINPUTS without unsetting default paths, and to continue streaming in stdin?

6

If the value of TEXINPUTS starts or ends with : then the standard search path is used before or after the directories specified in the environment variable, so to add a directory local before the default path use TEXINPUTS=local:

  • I was hoping to be able to include file with relative path in parent folders like ../../common/instructions.tex but it does not seem possible just by adding the current working directory to TEXINPUTS. Is there another way to tell pdflatex how to resolve relative paths? – kube Dec 1 '16 at 21:22
  • 2
    @kube There is never any need to add the current directory as that is searched before the path, and relative paths are resolved against each directory in the path by default. So you should not need to do anything. – David Carlisle Dec 1 '16 at 21:53
1

Ok so after a little search (in fact it was a long search, but found the answer 5 minutes after posting the question):

:FIGURES// seems to be the default path I was looking for.

And now this command is working:

cat hello.tex | TEXINPUTS=":FIGURES//" pdflatex

  • 2
    that makes it recursively look in all directories under FIGURES which will not help find article.cls (what does help is the leading : which means that FIGURES// is prepended to the default path. – David Carlisle Dec 1 '16 at 20:32
0

Assuming you installed TeX Live using the MacTeX installer the default personal texmf tree has its root in ~/Library. You will have to initially create the tree texmf/tex/latex/ in ~/Library and place your personal files there. No need to reinvent the wheel.

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.