leo-colisson / robust-externalize

A LaTeX library to cache pictures (including tikz, python code, and more) in a robust, customizable, and pure way.
8 stars 2 forks source link

Remove warnings 'Writing or overwriting python files' #47

Open kiryph opened 3 months ago

kiryph commented 3 months ago

When I use robust-externalize version 2.9, I get following warnings:

document.tex|| LaTeX Warning: Writing or overwriting file `robExt-remove-old-figures.py'.
document.tex|| LaTeX Warning: Writing or overwriting file `robExt-prepare-for-arxiv.py'.

I would prefer it when I do not get warnings about things which IMHO I should not be warned about.

It is possible to silence the warnings with

\RequirePackage{silence}
\WarningFilter{latex}{Writing or overwriting file}
\documentclass...

which adds IMHO unnecessary lines of code to a manuscript.

Is theoverwrite option for the environments filecontents really necessary?

\begin{filecontents}[noheader,overwrite]{robExt-remove-old-figures.py}

These files do not change when I recompile. Removing the overwrite option actually avoids unnecessary disc IO as well.

tobiasBora commented 3 months ago

Uhm, so I started to introduce overwrite because I wanted this file to get updated when upgrading the library, to prevent weird bugs from occuring. It does produce a bit of IO… but it is quite negligible and this simplifies the maintenance of the package as otherwise I would need to read this file, compare the md5 with a reference md5 that I'd need to update whcn I change the file… bugs would inevitably occur. I can try to see if I can disable the warning without hidding all similar warnings, hopefully WarningFilter works locally.

kiryph commented 3 months ago

I understand when user updating their texlive packages the python files in their document directories can become outdated.

For comparison: asymptote provides an asymptote.sty and a binary asy. They are both installed into the texmf tree and both get updated when I update my texlive installation. IMHO robust-externalize should provide them similarly.

Side effects: