0

I recognized biber always compiles fully with specified output-directory.

The setup:

1) PdfLaTex compiles all the aux files of my tex document via pdflatex -synctex=1 -interaction=nonstopmode -aux-directory=+Aux_Files %.tex.

2a) When compiling the biblography with biber.exe --input-directory=+Aux_Files --output-directory=+Aux_Files % it always does a full compilation.

2b) When compiling biber.exe --input-directory=+Aux_Files % it only compiles when changes occured (which is desired), but stores the *.bbl and *.blg in the main directory (which is undesired).

Does anyone know how to fix the "always new compilation"-issue when an output-directory is specified? I would like to have the *.bbl and *.blg stored in the +Aux_Files directory without a full compilation each time.

kilsen
  • 357
  • 3
    biber itself imho has nothing in-built to check for changes. It must be some other script that is triggering biber. Beside this: I never use output-directory, imho it is more trouble than gain. – Ulrike Fischer Apr 12 '20 at 10:31

1 Answers1

2

As Ulrike Fischer commented, Biber always performs a full compilation run when it is called. Biber does not and can not (currently) detect any changes to do only an "incremental" run or a run only when required (from the .bib and .bcf files).

If Biber is only run when there are changes in to citations or the bibliography, you are already using a script or some other utility that detects these changes and runs Biber automatically.

Chances are that tool is not able to properly pick up the Biber run if Biber's output files are diverted with --output-directory (my guess would be that your tool checks for the presence of a .bbl file, if it can't find one, Biber is rerun, with --output-directory the .bbl is directed into the subdirectory, which is apparently not checked by the script). In particular the fact that you pass the build directory information directly to Biber and pdfLaTeX probably means that your tool/script doesn't even know about the "build directory" and doesn't consider checking there for files. If your tool/script supports "build directories", you probably need to tell it directly.

Don't use build directories: They cause much more trouble than the limited benefits they may have for you.

The problem with "build directories" is that they cause auxiliary files to end up in unexpected places. Stuff simply isn't where everyone expects it to be.

This may not be a big deal when your document only needs to be run with LaTeX, but it can get increasingly frustrating if additional tools like BibTeX/Biber (for the bibliography) or makeindex/makeglossaries (for the index) are involved. Essentially the helper programs assume that the auxiliary files they use to communicate with LaTeX are in the working directory (which should usually be the directory of the main .tex file): They expect to find the auxiliary files written by LaTeX to tell them what to do there and they will write their own auxiliary files that feed certain data back to LaTeX there as well. If you use a "build directory", LaTeX outputs the auxiliary files to the build directory. Now the helper tools won't find those files in the working directory, they need to go to the "build directory" instead. But then the tools need to make sure that they still resolve all other file names (for example of .bib files) relative to the working directory and not the "build directory".

Some tools like Biber have options that help them deal with "build directories" but I wouldn't be too surprised if there were some tools that simply can't handle this discrepancy between working directory and "build directory.

moewe
  • 175,683
  • Thank you both very much. Could you be more specific about the trouble one has to expect when using build directories? So far everything works fine (despite the biber issue) – kilsen Apr 12 '20 at 13:08
  • And what is meant with my "tool/script"? I am using TeXstudio. Do you mean that? How would I tell my "tool/script" about the "build directory"? Even if I will discard the idea with a build directorey I am curious to understand the underlying mechanics. Thank you very much in advance :). – kilsen Apr 12 '20 at 13:23
  • @kilsen By "tool/script" I mean whatever software runs Biber for you (if you didn't call it explicitly and Biber runs someone must do that for you). I believe TeXstudio has a heuristic to determine if Biber needs to be run, but I never really fully understood how it works. Apparently, you can tell TeXstudio about additional paths in the advanced options, see https://tex.stackexchange.com/q/184204/35864, but I don't know if that is enough. – moewe Apr 12 '20 at 13:28