Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
I regularly build LaTeX on windows and linux systems, but I use cygwin + miktex. Since miktex is running inside the cygwin shell, I don't have the problems you mention. Using cygwin seems like an excessively NON-easy option though. –  Suresh May 24 '11 at 5:01
    
I'm using a Linux driven notebook and the usual windows PC at work. What gives me a headache are filenames. People in the windows world tend to use &, !, (), and whatever in filenames and that won't work between the two worlds, even not with the grffile package. –  Keks Dose Feb 9 at 20:22
    
While Windows is famous for using \ as its path separator, it can use / equally well. –  ChrisS Feb 9 at 23:16

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.