0

I'm having a hard time figuring this out. Using a very simple document, compiling with the auxdir option results in an undefined reference (latexmk report --pdf -auxdir=export). Without the auxdir argument it works just fine (latexmk report --pdf). I've also tried this without the --pdf option, and the results are the same. Any ideas to determine what's causing this would be appreciated.

Document used:

\documentclass[11pt]{article}

\begin{document}
\section{Section}\label{sec:one}
Section \ref{sec:one} is broken...
\end{document}

I've done some searching, and the auxdir option seems to cause trouble with glossaries and bibliographies (e.g. Latexmk with makeglossaries and auxdir and outdir?), but nothing on references.

edit: Partial compiler output

Latexmk: This is Latexmk, John Collins, 1 January 2015, version: 4.41.
Latexmk: making auxiliary directory 'test2'
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': Rules & subrules not known to be previously run:
   pdflatex
Rule 'pdflatex': The following rules & subrules became out-of-date:
      'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -recorder -aux-directory="test2"  "report.tex"'
------------
pdflatex: unrecognized option '-aux-directory=test2'
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
user2699
  • 101
  • 1
    If you want to stay sane, don't use auxdir! – Snobbish Hi-rep users Apr 25 '19 at 19:03
  • @valerie, that's the impression I'm starting to get... Especially if it doesn't handle something as simple as this. – user2699 Apr 25 '19 at 19:27
  • What is your motivation for wanting to use auxdir? Maybe there is another solution? – Snobbish Hi-rep users Apr 25 '19 at 19:29
  • @valerie, mostly just to keep the directory with my main file a little bit cleaner. – user2699 Apr 25 '19 at 19:31
  • There is some tool like latexmk that automatically compiles your code, but instead of compiling it in the current folder it does so in a tmp folder thus keeping your directory clean. Because it actually copies all the files to the tmp folder and the results back, it does work out of the box without worrying about auxdirs and such. Unfortunately I cannot remember the name, maybe someone else can help. – Snobbish Hi-rep users Apr 25 '19 at 19:36
  • @user2699 See this tool: https://tex.stackexchange.com/a/192554/187536 – Snobbish Hi-rep users Apr 25 '19 at 19:43
  • @DavidCarlisle well, when it's time to pick one file out it's nice not to scroll through a few dozen unneeded files. In general, it's a good option to be able to store files where the user wants rather than where the software wants. – user2699 Apr 25 '19 at 19:44
  • @user2699 Your example works perfectly fine for me, if I use MiKTeX. But if instead I use TeXLive, -auxdir is not supported, and if you try using it there is a prominent error message explaining the problem. (With TeXLive, only -outdir is supported, and it does work with your example.) So the real problem is something different. You need to show a detailed listing of the output, so that we can make a diagnosis. – John Collins Apr 25 '19 at 20:08
  • 1
    @DavidCarlisle A number of us really disagree on the auxdir and outdir options. We find it a lot more convenient to have generated files in a different directory. But ultimately that's a matter of personal preference, of course. However, if you are using latexmk, there's absolutely no need to reconfigure a tool chain. Latexmk with -auxdir or -outdir does robustly take care of everything, in every case I know of. So as I said in another comment, the real problem is elsewhere. – John Collins Apr 25 '19 at 20:29
  • @JohnCollins I've added some of the output, it looks like my installation has a version of pdflatex that doesn't support the aux-directory option. I shouldn't have stopped scanning the output at the first error I saw... – user2699 Apr 25 '19 at 20:38
  • @user2699 Problem solved. Since you are using TeXLive (the standard distribution on linux), the best you can do is to use the -outdir option. I notice you are running a quite old version of latexmk, so the relevant error message is the one from pdflatex, and the later messages from latexmk aren't very informative. The recent versions of latexmk attempt to diagnose the error better; with those you'd see a more useful error message at the end of the screen output. – John Collins Apr 25 '19 at 21:57
  • @JohnCollins, Thanks, that's good to know. Unfortunately, the ubuntu software repository tends to be rather out of date. – user2699 Apr 25 '19 at 22:08

0 Answers0