4

I sometimes see \include{../foo} and \input{../bar.tex} in code examples online.

What does the ../ means? What does it changes? What are its advantages? How is it possible to use it?

  • LaTeX and TeX using Unix pathname protocols, even on MSDOS machines. – John Kormylo Mar 21 at 4:20
3

Let us say you have the following structure:

LaTeXFiles (directory)
  foo.tex
  bar.tex
  test (directory)
    mwe.tex

Let us say you have the following line in file mwe.tex:

\include{../foo}

Then the file foo.tex in directory LaTeXFiles is included. So ../ means: go one directory back.

It simply used the path command available in windows with cd .. or cd test or cd LaTeXFiles/test or simular in unix/linux. Same with line

\input{../bar.tex}

It means the file bar.tex in directory LaTeXFiles is used in file mwe.tex.

2

../foo means that the file foo is located in the parent of the current working directory (one directory above it).

https://stackoverflow.com/a/23242061

  • You could also mention that in TeX this ../ relative syntax has some other beneficial uses such as with the file changed to an additional / e.g. with TeXINPUTS= the use of ..// means the parent all adjoining sibling subfolders and their child folders as well as this folders subfolders – user170109 Mar 20 at 17:42

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.