Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 497255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:45:50+00:00 2026-05-13T05:45:50+00:00

Due to using both Windows and Ubuntu on my computer I’d like to be

  • 0

Due to using both Windows and Ubuntu on my computer I’d like to be able to create documents independently. I have one directory for logos and I want to use them in any documents everywhere.

The problem with different file addressing I solved with those commands:

\newcommand{\winlogo}{D:/logo/}

\newcommand{\linlogo}{/media/DATA/logo/}


\includegraphics{\winlogo logo_bw}

How to provide this feature:

if(parameter==windows){adress:=D:/logo/}

elseif(parameter=linux){adress:=/media/DATA/logo}

else{error}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:45:51+00:00Added an answer on May 13, 2026 at 5:45 am

    I’ve run into this problem as well, and I found that hard-coding the paths is an absolutely terrible idea. Also, keeping these directories in sync will eventually be a problem once your projects begin to grow.

    The way I solved this was to put everything in version control (I like git, your mileage may vary).

    Then I created an images folder, so my folder hierarchy looks like this:

    Working-Dir
    |– images/
    |– myfile.tex
    |– nextfile.tex

    Then in the preamble of my documents: \usepackage{graphicx} and \graphicspath{{images/}} which tells latex to look for a folder called images, then look for the graphics inside the folder.

    Then I do my work on on comp, push my finished work back the repo, and when I switch computers I just pull from my repo. This way, everything stays in sync, no matter which computer i’m working on.

    Treating tex source like source code has greatly improved my work flow and efficiency. I’d suggest similar measures for anyone dealing with a lot of latex source.

    EDIT:

    From: http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics

    Graphics storage

    There is a way to tell LaTeX where to
    look for images: for example, it can
    be useful if you store images
    centrally for use in many different
    documents. The answer is in the
    command \graphicspath which you supply
    with an argument giving the name of an
    additional directory path you want
    searched when a file uses the
    \includegraphics command, here are
    some examples:

    \graphicspath{{c:\mypict~1\camera}}

    \graphicspath{{/var/lib/images/}}

    \graphicspath{{./images/}}

    \graphicspath{{images_folder/}{other_folder/}{third_folder/}}

    please see
    http://www.ctan.org/tex-archive/macros/latex/required/graphics/grfguide.pdf

    As you may have noticed, in the first
    example I’ve used the “safe” (MS-DOS)
    form of the Windows MyPictures folder
    because it’s a bad idea to use
    directory names containing spaces.
    Using absolute paths, \graphicspath
    does make your file less portable,
    while using relative paths (like the
    last example), you shouldn’t have any
    problem with portability, but remember
    not to use spaces in file-names.
    Alternatively, if you are using
    PDFLaTeX, you can use the package
    grffile which will then allow you to
    use spaces in file names.

    The third option should do you well– just specify multiple paths for the \graphicspath I wonder if LaTeX will fail gracefully if you just include all of your paths in there (one for images, one for your logs on linux, one for your logos on windows)?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.