Saving (or not) .log files: knitting from RMarkdown to PDF

Hi, I have a script to runs several .Rmd files and generates many pdf output files as a result. For each .pdf file that is generated, a .log file is also generated to to working directory. How can I control whether these log files are saved, and if they are, where they go? I'd prefer they go to a separate directory and not clutter the working directory, but can't figure out where to set this. Thanks!

Take a look at help(output_format); it appears it may be possible to redirect this kind of file away. I haven't tried it myself.

Are this log file, the latex log file ?
Because using pdf_document will give latex log file that are removed afterward if no error.
Are those files stating in your working directory ?

1 Like

Yes, they look like latex log files (first line says "This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017) (preloaded format=xelatex 2017.5.23)") and they are staying in the working directory after the script finishes running. It used to be the case tat they are removed afterward, but not now. I wonder now if that's because there are numerous warnings of the type:

"Package microtype Warning: Unknown slot number of character
(microtype) \~A' (microtype) in font encoding TU' in inheritance list
(microtype) `microtype.cfg/358(protrusion)'.
"
I don't actually use the microtype package, so I couldn't figure it out, but maybe that's the way to dig to get rid of these log files. thank you!

Does the document renders ok ?

I think render(...., clean = TRUE) should delete those if everything results with no error. But they is maybe another option to change somewhere... :man_shrugging:

1 Like

Thank you! still saves the output files (with the warnings only, no errors), so I'll keep digging. Thanks again.

If you can provide a reproducible example with this issue, I can try and dig with you.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.