TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
Check the ifplatform package. – TeXtnik Feb 20 '13 at 14:46

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


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


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).


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
dropbox is a file syncing solution. Use a real backup solution for backups! – Aditya Feb 24 '13 at 4:36

Your Answer


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.