In Mac OSX, using latex, I have a long class file that includes various macros containing commands of the sort



I would like to make this portable to computers with different absolute paths. (For compatibility reasons, I need absolute paths.) Probably the simplest would be to define a \imagedirectoryname and a \moviedirectoryname and do something like



How exactly do I do this in latex? Thank you in advance for any help! It is for a book that is free to download on the internet.

I am using OSX, latex, MacTeX/texlive 2014, and the dvi -> ps -> pdf typesetting method.

P.S. Yes, I know that movie15 is obsolete, but it works, and the successor package media9 is not compatible with it, as far as I understand.


You can do one of these:

  1. Update \graphicspath to point towards the folders that may include graphics. It's syntax for paths <pathA>, <pathB>, ... is


    See How to use \graphicspath?

  2. Define a macro to hold the path via something like


    and then use it in your commands as

  3. Of course, (2) could also be hard-coded by changing \includegraphics to always use a specific path via something like


    You need to know your use-case/environment to be confident that such hard-coding would work though.

  • Thanks. I'm working on Ubuntu 14.04LTS and TexLive2015 and solutions 2 works -- after 2h of search & try. (-; – alex Nov 30 '15 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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