I don't want the .aux, .log and .synctex.gz files when using pdflatex

后端 未结 10 809
庸人自扰
庸人自扰 2020-12-23 16:58

I just want to have a .tex file which I compile with pdflatex and end up with a .pdf file. I don\'t want all the other .aux

相关标签:
10条回答
  • 2020-12-23 17:20

    For people on Linux the equivalent to -aux-directory appears to be -output-directory, unfortunately it doesn't play nicely with \include{...} (included files' .aux files still get dumped in the current directory).

    See also: the man page.

    0 讨论(0)
  • 2020-12-23 17:20

    IIRC \nofiles in your file suppresses the .aux output.

    0 讨论(0)
  • 2020-12-23 17:22

    Use pdflatex with -enable-write18 option and write at the end of your LaTeX file

    \write18{del *.aux}
    \write18{del *.log}
    \write18{del *.gz}
    

    or more pricise

    \write18{del \jobname.aux}
    \write18{del \jobname.log}
    \write18{del \jobname.synctex.gz}
    \write18{del \jobname.toc}
    \write18{del \jobname.loc}
    

    del is a DOS-function. Use rm for UNIX.

    0 讨论(0)
  • 2020-12-23 17:23

    Write a shell-script wrapper which removes the files:

    #!/bin/sh
    pdflatex "$@" && rm -f *.aux *.log *.synctex.gz
    

    Bonus-assignment: modifying the script to only remove the files actually created by pdflatex.

    0 讨论(0)
提交回复
热议问题