leo-colisson / robust-externalize

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

In doc: quotes are turned into another utf-8 char, creating errors. #11

Closed dflvunoooooo closed 7 months ago

dflvunoooooo commented 7 months ago

If I try to run the CacheMeCode example I copied from the documentation, it wasn't working because of some wrong utf8 character (The code I pasted used ’ (U+2019) instead of ' (U+0027)). This was probably only a conversion error of the editor. But there was no robust-externalize log about this and the latex log was unprecise. If run with python directly, it said:

  File "test.py", line 5
    plt.xlabel(’Year’)
               ^
SyntaxError: invalid character '’' (U+2019)

Texstudio again only threw the error Package robExt Error: The pdf file. So maybe related to issue #9 ?

Here is the robust-externalize part of the latex log:

…
\openout5 = `robust-externalize_python-robExt-tmp-file-you-can-remove.tmp'.

runsystem(mkdir -p robustExternalize/)...executed.

\openout5 = `robustExternalize/robExt-639F27F5FB7B81D83A1534DF719478E7.deps'.

\openout5 = `robustExternalize/robExt-639F27F5FB7B81D83A1534DF719478E7.tex'.

Source saved in robustExternalize/robExt-639F27F5FB7B81D83A1534DF719478E7.tex.
[robExt]We will start the compilationusing: cd robustExternalize/ && python "ro
bExt-639F27F5FB7B81D83A1534DF719478E7.tex".
runsystem(cd robustExternalize/ && python "robExt-639F27F5FB7B81D83A1534DF71947
8E7.tex")...executed.

! Package robExt Error: The pdf file
(robExt)               
robustExternalize/robExt-639F27F5FB7B81D83A1534DF719478E7.pdf
(robExt)                is not present. The compilation command "cd
(robExt)                robustExternalize/ && python
(robExt)                "robExt-639F27F5FB7B81D83A1534DF719478E7.tex"" used
(robExt)                to compile the environment on line 21 certainly
(robExt)                failed, see logs above or in
(robExt)               
robustExternalize/robExt-639F27F5FB7B81D83A1534DF719478E7.log.

Type <return> to continue.
 ...                                              

l.21 \end{CacheMeCode}

LaTeX does not know anything more about this error, sorry.

Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.

Finished to include the file. [1

] (./robust-externalize_python.aux) ) 
…
tobiasBora commented 7 months ago

Yes, this error is exactly like https://github.com/leo-colisson/robust-externalize/issues/9 : this error message would be print in the command line, but for some reasons this is not written in the log directly… The problem of the copy/pasted character is however good to know, I'll try to see what I can do.

dflvunoooooo commented 7 months ago

Yes, but this time there is not even a log in the robust-extrenalized. Don't know if that matters.

Edit: The log which is named in the latex log does not exist.

tobiasBora commented 7 months ago

Yes, this is normal: the .log is actually created by latex when it compiles the cached image, but python does not create any log file by default… explaining why the log file does not exist.

dflvunoooooo commented 7 months ago

I see. Thank you for the clarification.

tobiasBora commented 7 months ago

The doc should be fixed now.