Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy (and overwrite) on successful compilation, instead of renaming existing file #29

Closed
vqv opened this issue Mar 27, 2018 · 1 comment

Comments

@vqv
Copy link

vqv commented Mar 27, 2018

If the PDF output file already exists, the current behavior of latexmk_emu() is to rename the existing file and to move it back if the compilation failed.

https://github.com/yihui/tinytex/blob/c7d62e178915e56728c7b591f4baa0d0f4874c26/R/latex.R#L135

This causes problems with workflows that use an external PDF viewer that monitor changes to the PDF file. For example, Skim on macOS will retain a pointer to the existing file (which is invariant to the renaming) and not see the newly compiled file. This also prevents the existing file from being removed.

Instead, can the behavior of latexmk_emu() be changed so that the output destination is given a temporary name, and then upon successful compilation the result is copied on top of the existing file?

@yihui
Copy link
Member

yihui commented Mar 27, 2018

Sounds like a good idea!

@vqv vqv mentioned this issue Mar 28, 2018
@yihui yihui closed this as completed in dc83674 Mar 28, 2018
@yihui yihui mentioned this issue Mar 28, 2018
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants