9

I'm working on a collaborative project and I like to organize all the supporting files for my tex documents (rather than just having everything in one flat folder). This involves referencing figures/files/etc. by a (relative) path. The difference in slash convention between linux/windows means that collaboration between users on different systems becomes annoying.

Is there any easy way of dealing with path references between systems?

crasic
  • 1,606

1 Answers1

12

The Latex "path" command always uses the forward slash / convention, at least for Windows and Linux. You can therefor use relative paths if you have the same "relative" directory structure (from your main document and deeper)

\include{chapters/chap-intro}
\includegraphics{figs/Tikz/myfig}

Remember that all the paths are relative to you main document (even for figures inside included files in a different directory)

Another option is the import package. It gives you the option to input files relative to an \include or \input. e.g.

\includefrom{chapters/chap-intro/}{report}

Included graphics (or \input) inside report.tex is now relative to the include file position

\includegraphics{fig.png}%-> now from chapters/chap-intro/fig.png
\input{expl}%--------------> input chapters/chap-intro/expl.tex

One thing to keep in mind is that path names are case sensitive in Linux but not in windows and the line endings (CR/LF, etc) is also different for the two. It is therefor advisable to use one of the many software management/version control packges such as CVS, SVN or Git to syncronize the files between the systems.

Danie Els
  • 19,694