I'm using latexmk in a Makefile to compile my document. Since I want my output filename to be different from the input filename, I use latexmk's option jobname.

The problem is: it seems to be incompatible with latexmk -c to clean temporary files.

Here's the specific entry in my Makefile:

these.pdf: header.tex $(OBJS)
    latexmk                 \
        -pdf                \
        -pdflatex="$(TEX)"  \
        -jobname="these"    \
        -use-make $<

Input files are header.tex containing the latex instruction header and other latex content files. The output files are these.{aux,bbl,bcf,...}. Then latexmk -c does not remove temporary files: .{aux,bbl,bcf,...} files.


You need also to specify the -jobname option when you use latexmk -c, i.e.,

latexmk -c -jobname=these header.tex
  • I don't think adding the .tex file is necessary. – stefanct Nov 7 '18 at 14:30

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.