2

I have the following directory structure in my project:

main.tex
LaTeX
    mypackage.sty
content
  chapter2.tex
    figures
      LaTeX
         figure.tex

In main.tex I input content/chapter2.tex. I also use the package defined in mypackage.sty which contains all of my setup code (such as using packages etc.).

figure.tex contains some tikz code. I'd like to input it into content/chapter2.tex. However when I use \input{./figures/LaTeX/figure} it tells me it can't find the file even though it exists.

Any help would be appreciated!

  • 4
    It should be \input{content/figures/LaTeX/figure), the path is relative to the main file. Use the import package to change this. – Ulrike Fischer Mar 14 '15 at 15:22
  • See the import package to establish input relative to a directory. – Fran Mar 14 '15 at 15:57
  • @UlrikeFischer (+1) can you edit your comment? – touhami Mar 14 '15 at 17:02
  • Assuming you are compiling main.tex, which is in a directory above content, then these should work: \input{./content/chapter2.tex} and \input{./content/figures/LaTeX/figure} – John Laviolette Mar 14 '15 at 19:21
2

It should be \input{content/figures/LaTeX/figure), the path is relative to the main file. Use the import package to change this. (I'm certain that there is a duplicate to this question somewhere).

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.