2

I recently split my thesis in several files each containing one chapter which is included with \include in the main Latex-file. I call pdflatex with -output-directory=output to keep the source directory clean.

The problem is that bibtex does not find the axuliary files for the included subfiles. I call it with bibtex ./output/%.aux and it finds the main.aux but not any of the sub-aux.files such as chapter1.aux, chapter2.aux, etc.

The problem seems to be that the path to the output folder is not included in the main.aux. When I change the path there manually for example from \@input{1_intro.aux} to \@input{output/1_intro.aux} everything compiles fine.

Is there any way to make pdflatex write the proper paths into the main.aux?

I am using TexStudio on a Linux machine. Thanks a lot!

  • Welcome to [tex.se]! – Andrew Swann Apr 28 '17 at 09:35
  • 2
    The next one making his/her own life more difficult by using -output-directory. – Ulrike Fischer Apr 28 '17 at 09:53
  • Is it not recommended? I had about 60 files of wildly mixed types in the same directory and -output-directory seemed to be the prefered solution for that. – heuamoebe Apr 28 '17 at 09:57
  • 1
    I never use it. And your question shows why: In LaTeX outputfiles are often also inputfiles, and sorting out all the tools when you move some of your input files somewhere else can be complicated. Search the site for related questions. – Ulrike Fischer Apr 28 '17 at 10:12
  • I changed it back to cluttering the main folder but I'd still be thankful for any advice concerning the problem described above. I don't get why Latex doesn't use a special directory for temporary/auxiliary files anyway. They are almost never useful for the user and quite frankly annoy me a lot... – heuamoebe Apr 28 '17 at 13:03
  • @heuamoebe You may want to have a look at https://tex.stackexchange.com/a/313228/36296 – samcarter_is_at_topanswers.xyz Apr 28 '17 at 13:13
  • Check out the question here: https://tex.stackexchange.com/q/12686/128181 I know it's a bit late, but this may help others. – David M. Mar 28 '18 at 19:35

1 Answers1

1

It's late, I leave this for future generations...

Do you need to use \include or may you use \input? If you use the latter, a unique .aux file is created (instead of one for each .tex file), and you get away with calling bibtex from the main directory like you already do:bibtex ./output/%.aux

(not my idea, credits to https://tex.stackexchange.com/a/518934)

julio
  • 11