I am trying to build a complex latex document (at least it's complex for me). The directory structure looks like this:
- bat.tex
- packages.tex
- {other tex files}.tex
- content
-- {chapter folders}
--- chapter.tex
-- abstract.tex
Till now I built the document with the following bash script:
#!/bin/sh
start=`date +%s`
echo ----------------------------
echo Generating Documentation
echo ----------------------------
echo Generating PDF \(pass 1\)
lualatex --shell-escape --interaction=nonstopmode bat.tex > /dev/null
echo Generating Bibliography
biber bat > /dev/null
echo Generating Glossaries
makeglossaries bat > /dev/null
echo Finishing PDF
lualatex --shell-escape --interaction=nonstopmode bat.tex > /dev/null
end=`date +%s`
runtime=$((end-start))
echo $runtime s
Which works great. But I would like to build it with latexmk.
So I wrote this .latexmkrc
$latex = 'latex %O --shell-escape %S';
$pdflatex = 'lualatex %O --shell-escape %S;
$pdf_mode = 4; $bib_program = 'biber';
$out_dir = 'build';
The problem now is, that it does not find the .aux files from the content subdirectory. I found this thread which does not have any good solution. Since it is rather old I wanted to ask if there is a fix for my problem or another good solution.
Also will my .latexmkrc file work with biber?
Thank you for your help.
tree? – Pablo González L Nov 24 '19 at 23:50$bib_programin.latemkrc. It will have no effect, sincelatexmkautomatically determines whether to runbibtexorbiber. 2. Your line$pdflatex = 'lualatex %O --shell-escape %S;should be$lualatex = 'lualatex %O --shell-escape %S;. – John Collins Nov 26 '19 at 22:38\includein your document? If not there should be no problem with.auxfiles in thecontentsubdirectory. You say that "it does not find the.auxfiles from thecontentsubdirectory". A problem you could encounter is that lualatex or pdflatex may say that it cannot write to the.auxfile(s), which is not the same. You can solve the problem by creating ahead of time a content subdirectory in the build directory. (latexmkdoes this, but only after the first compilation, which is too late to prevent you seeing an error. Later compilations should go fine.) – John Collins Nov 26 '19 at 22:54$pdflatexas you test, I get the errorThe fontspec package requires either XeTeX or LuaTeX.In my main tex file I got the first lines%!TEX TS-program = lualatex– Pascal Dec 03 '19 at 06:53