22

I used this tutorial to export my auxiliary files into a different directory.

Basically i just add -aux-directory=build in Options -> Configure -> Commands and added the build folder into Options -> Configure -> Build -> Build Options -> Additional Search Paths -> Log.

This succesfully generates all the auxilliary files in the build folder and it's also possible to generate the pdf.

Unfortunately biber has a problem with this setup:

Prozess gestartet: biber.exe "MyFile"

INFO - This is Biber 1.7

INFO - Logfile is 'MyFile.blg'

ERROR - Cannot find control file 'MyFile.bcf'! - did you pass the "backend=biber" option to BibLaTeX?

INFO - ERRORS: 1

I guess i have to specify the correct path for biber somewhere in Texstudio. Does anyone know where i have to update the path?

In this thread someone had similar problems. Also i'm not sure if the solution of this thread applies to my situation.

  • 3
    biber --help includes the following information: --output_directory [directory] Files (.bbl and .blg) are output to directory directory instead of the current directory. Input files are also looked for in directory before current directory. [My emphasis.] – cfr Jun 10 '14 at 22:52
27

Solution to use Texstudio and output the build (temporary) files into a seperate folder using biber:

  1. Put a new Folder with YourName into the same directory as your main .tex file.
  2. Options -> Configure -> Commands -> PdfLaTeX add -aux-directory=YourName. Result looks something like this: pdflatex.exe -synctex=1 -interaction=nonstopmode -aux-directory= build %.tex
  3. Options -> Configure -> Commands -> Biber add --output_directory YourName. Result looks something like this: biber.exe --output_directory YourName % (careful: i think the space between the name and % is mandatory)
  4. In Options bottom left corner activate the additional options checkbox. Add your folder to Configure -> Build -> Additional Search Paths with .\YourName (or complete path)

Thanks @cfr for the solution!

  • 14
    The -aux-directory=DIR option is specific to MiKTeX. I think you should mention that in your answer. In TeXlive there is only the -output-directory=DIR option. But it is still possible to achieve a separate output-directory for the .pdf-file as described in the commend to the question [tex.stackexchange.com/questions/96767/mactex-aux-directory-dir] but it involves using a hard link. – Wamseln May 10 '15 at 10:42
1

For MiKTeX with TeXstudio, go to Options --> Configure --> Commands:

1- PdfLaTeX: pdflatex.exe -synctex=1 -interaction=nonstopmode --aux-directory=build %.tex

2- BibTeX: bibtex.exe build/% -include-directory=build

Copy and paste the above codes. If you use biber, do the same in biber field as you did with bibtex.

The above will create a new subfolder in your working directory named "build" where all aux/log/out files will be saved there as well as bibtex's (except for synctex.gz). The working folder will be cleaner specially if you are doing a big project with a lot of sub .tex files (e.g. chapters ... etc, used with include or input).

1

Instead of trying to use build folders and stumbling again and again into problems with each tool, the LaTeX build wrapper ltx2any may be a better solution. One of its main features is

Keeps your main directory clean by default.

This goal is achieved by not compiling in the main folder but copying all required files into a temporary folder and compiling the document there. This avoids all the problems associated with build folders.


The basic usage is

ltx2any filename.tex 

and all the auxiliary files will be in a subdirectory. For more options read the linked webpage or run ltx2any --help.

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.