4

In most of my work, I use a specific .tex ("main".tex) file with a preamble and \begin- and \end{document}. In the document I use \input{...} to another .tex file, with no preamble. Let's say "main".tex is located in H:.

My problem is, that when I use a music notation system called "Lilypond", it generates a .tex file with relative paths to pictures. Let's say it's called "lilypond".tex and is located in H:/lilypond/.

When "lilypond".tex is included in my "main".tex file, I get an error because the pictures cannot be located: The compiler searches in H:, because the paths in "lilypond".tex are relative.

How can I avoid this problem, without having to manually edit my "main".tex according to every specific file I might include?

I use Emacs, and have thought of making a macro to run through the "lilypond".tex-file and edit paths, but it might be a little inconvenient.

simon
  • 41
  • 2

1 Answers1

1

in your main file write

\graphicspath{{H:/lilypond/}}
  • 1
    Hi! Thanks for your answer. I have edited my question because I were not precise enough. I am looking for a solution that avoids editing "main".tex from time to time. My lilypond-files are in various places, and I would have to do a manuel edit of "main".tex according to every lilypond-compilation. – simon Jun 18 '15 at 18:42
  • @simon why don't you use this command in the input'd files, then? untested, but i think it'd work. – Sean Allred Jul 18 '15 at 21:36