4

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.

Caramdir
  • 89,023
  • 26
  • 255
  • 291
  • Not a direct answer, but bibtex should find your .bst file 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

2 Answers2

2

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:

  1. Run kpsexpand '$TEXMFHOME' in your console/terminal.
  2. The path generally corresponds to ~/texmf on a standard TeXLive distribution. If the displayed path doesn't exist (like in my case) then put your .bst files under ~/texmf/bibtex/bst and your .bib files under ~/texmf/bibtex/bib.

The bibtex calls from TexStudio should be able to run smoothly now.

champost
  • 275
  • 1
    The default behavior of TeX Live is that $TEXMFHOME resolves to ~/texmf on Unix systems, but to ~/Library/texmf if 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
1

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.

Pierre D
  • 111