I have a LaTeX document where I include another TeX file with a relative path like \include{../Meta/commands.tex}
. If I compile it on my local machine all works fine.
Now I also want to use the CI feature of GitLab. I have my runner working in a way that following file gets compiled without an error.
\documentclass{article}
\begin{document}
Hello World!
\end{document}
My .gitlab-ci.yml
files looks like this:
compile_pdf:
image: aergus/latex
script:
- latexmk -pdf -interaction=nonstopmode ./Test/main.tex
artifacts:
paths:
- main.pdf
expire_in: 1 week
If now the main.tex
file contains a relative path to \include{../Meta/commands.tex}
, then I get the following error:
Latexmk: Missing input file: '../Meta/commands.tex' from line
'! LaTeX Error: File `../Meta/commands.tex' not found.'
Does anybody know how to resolve this unpleasant issue? Most likely I have to resolve the relative paths but I do not know how...
Thanks for any help!
cd Test; latexmk main.tex
so you are running in the documents directory?\include{../Meta/commands.tex}
may fail anyway it would need to write../Meta/commands.aux
and by default tex is prevented from writing to files not under the document directory (paths starting../
)cd Test; ...
worked! Thank you very much!