Closed etiennebacher closed 3 months ago
Interesting. I wonder if there's a way to know what specific log files get created. I wouldn't want to delete a user's log files for other projects!
I wouldn't want to delete a user's log files for other projects!
Hum, I hadn't thought about this. I see that you're using tinytex::xelatex()
, maybe there's an arg that you can pass to engine_args
of latexmk()
? I have no clue about this, I don't even know where to look for in the LaTeX manual
I looked into this a bit, but I can't find a way to catch the log file names easily. I guess I could capture output and parse, but that seems like a lot of work for a minor annoyance.
I understand it's not great, but realistically, I probably won't invest more time into this.
Would be happy to consider a proposed design or PR, of course.
@vincentarelbundock could you reopen this? I understand it's low-priority but it's really annoying to have random .log
files popping in the git pane (and I don't want to ignore all log files since I have some "useful" ones).
Maybe one solution would be to detect the difference in log files before and after running tinytex::xelatex()
. For example, here:
one could use:
existing_log_files <- list.files(wd, pattern = "\\.log$", full.names = TRUE)
tinytex::xelatex(f, pdf_file = output)
new_log_files <- setdiff(
list.files(wd, pattern = "\\.log$", full.names = TRUE),
existing_log_files
)
# "remove_log_files " could be a function param
if (remove_log_files && length(new_log_files ) > 0) {
invisible(file.remove(existing_log_files))
}
unlink(f)
What do you think about this?
I can make a PR if interested.
Yep that sounds like a reasonable workaround. I'd be happy to merge something like that.
When the table is large and the output is "pdf" there is a warning because the table is truncated. As shown in #234, this can be solved with
theme_tt("resize")
but the fact that there's a warning also means that there's a.log
file in the output directory. When several tables are generated like this, it creates a bunch of useless files.I know this is quite low-priority, but it would nice to have a mechanism to automatically clean up the output directory at some point.