I am a newbie using TeXStudio - and trying to set TEXINPUTS so that LaTeX can recursively search for my figures. I've run


at the command line, and then run LaTeX, which worked fine. However, when I try this in TexStudio, it bombs. It looks like setting TEXINPUTS at the command line is not good for TeXStudio. I looked through the TeXStudio documentation, but I can't seem to find how to do this. Any help is greatly appreciated.

  • (1) welcome, (2) you presumably start texstudio via a menu or some other interface on your Mac. Thus the setting you set on the command line does not apply to any thing but that command line. You will need to figure out how one sets general system variables on a Mac – daleif Jan 15 '15 at 13:40
  • Welcome to TeX.SX! You don't have to sign with your name since it automatically appears in the lower right corner of your post. – jub0bs Jan 15 '15 at 13:40
  • Besides is setenv even a correct command on the command line on a Mac, I thought it was running bash on the cli. – daleif Jan 15 '15 at 13:41
  • @HarishKumar, are you sure that is what that is for? Besides, then TeX Studio can find the figures, but if one choose to compile via the CLI, then pdflatex cannot find the files. I'd guess ~/.profile might be a suitable place, though I do not remember the syntax – daleif Jan 15 '15 at 13:53
  • Sorry, doesnt work for me. – spy123 Jan 15 '15 at 16:43

OK, here is what worked. I am using OS X 10.7.5 (Lion). Apparently, launchctl adds the environment variables without having to log out

launchctl setenv TEXINPUTS :FIGURES//:

To load this on startup create a .launchd.conf file with


| improve this answer | |

Given that Apple are discouraging system wide environment variables, it would probably be best to place symbolic links to your folders in your TEXMFHOME which would usually be ~/Library/texmf

You can create symbolic links with packages such as Path Finder or in Terminal with the ln command — see Create symbolic link — Ask Different

    ln -s originalFile symlink

You have the follow the TeX Directory Structure (say texdoc tds in Terminal for documentation)

  • Place LaTeX files in TEXMFHOME/tex/latex/
  • Place BibTeX source files in TEXMFHOME/bibtex/bib/
  • Place BibTeX style files in TEXMFHOME/bibtex/bst/

There is (at least) one obscure point to watch out for. If a directory, d, being searched for subdirectories contains plain files and symbolic links to other directories, but no true subdirectories, d will be considered a leaf directory, that is, the symbolic links will not be followed (from page 39, section 8.5.1 of the Kpathsea manual version 6.2.0, May 2014; page 22 of the Kpathsea manual version 6.0.1, April 2011). Workaround: create an empty dummy subdirectory in d

| improve this answer | |

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.