At least, in teTeX/Linux, one can use environment variables like TEXINPUTS, BIBINPUTS, BSTINPUTS to change default directories. In TeXStudio/Mac, how to access these like variables to specify others directories than the defaults? Specifically, I have my own bibstyle.bst file with the other tex files in just one working directory but bibtex can't see it.
2 Answers
Here is a more or less direct answer. I am on Ubuntu 12.04 and TexStudio 2.4. I have given up on the environment variables and other bibtex command line solutions. An elegant workaround consists of following Mojca Miklavec's answer. Here is a summary:
- Run
kpsexpand '$TEXMFHOME'in your console/terminal. - The path generally corresponds to
~/texmfon a standard TeXLive distribution. If the displayed path doesn't exist (like in my case) then put your.bstfiles under~/texmf/bibtex/bstand your.bibfiles under~/texmf/bibtex/bib.
The bibtex calls from TexStudio should be able to run smoothly now.
-
1The default behavior of TeX Live is that
$TEXMFHOMEresolves to~/texmfon Unix systems, but to~/Library/texmfif installed via MacTeX on Mac OS X. – egreg Oct 04 '12 at 15:56 -
... and your custom style files can be put e.g. in
$(kpsexpand '$TEXMFHOME')/tex/style/. In my case (style and bib files in a specific directory that's under version control), I could use symlinks, e.g.ln -s $proj/doc/tex/style .in.../tex/. Now it all works well! – Pierre D Nov 18 '17 at 16:09
Converting my comment above into an answer, just because I had to Google it all over again after getting a new Mac, and rediscovering this Q&A (and my comment).
For people with Mac OS X and who want to add a folder of styles from, say, a project you have under source control, do this (in a shell):
tmp=$(kpsexpand '$TEXMFHOME')/tex
mkdir -p $tmp
cd $tmp
ln -s your_project_path/docs/tex/style .
(Amend the path to the folder you want to add, of course).
No need to restart texstudio. Just hit F5 (build and view) and now everything should work fine.
- 111
bibtexshould find your.bstfile if it is in the same directory as your source file, or in~/Library/texmf/bibtex/bst. – Alan Munn Jun 25 '12 at 17:26