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 often switch between Linux and Windows. A number of my LaTeX files use images from a central folder. All of these are within a Dropbox folder, which is how I sync between them.

The dropbox folders are in different paths on Windows and Linux, so I would like to make a macro which detects the OS and uses the correct path.

share|improve this question
1  
How do you transfer the .tex between the linux and windows machine? If you put it in the dropbox folder as well, you can use relative paths. –  T. Verron Feb 20 '13 at 14:10
3  
Check the ifplatform package. –  zunbeltz Feb 20 '13 at 14:46

3 Answers 3

There should be no need to put any tests in your documents, just use

\includegraphics{file}

and arrange that your dropbox folder is in your TEXINPUTS environment variable or (better) texmf.cnf setting on your two machines and it should all just work.

share|improve this answer

write into your document

\graphicspath{{c:/Windows/images/User/}{/home/me/images/}}

and then use only the filename of the image. You have to use slashes for directories in Linux and Windows.

share|improve this answer

For windows refugees, remember that Windows also has symlinks (use mklink or from right click window->new create shortcut).

 \graphicspath{{../Dropbox/pic/}{{/home/me/images/}}}

where, Dropbox is the shortcut name to the Dropbox shortcut.

The advantage of this, is that I wouldn't have the LaTeX file in the dropbox folder (all sorts of problems). Rather place your LaTeX file somewhere separate say your Github folder.

My suggestion also is that is always better to use a version control system and only use Dropbox for back-ups.

share|improve this answer
2  
dropbox is a file syncing solution. Use a real backup solution for backups! –  Aditya Feb 24 '13 at 4:36

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.