# Paths and Linux/Windows slash conventions

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?

-
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

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.

-