ipython
ipython copied to clipboard
Use relative filename in latex and dvips commands of latex_to_png_dvipng
This prevents problems with temporary directories with special characters in them.
Fixes #13678
Similar to one of the earlier PR of yours, could you please add a what's-new entry that describes the change to users?
https://github.com/ipython/ipython/tree/master/docs/source/whatsnew/pr
@MrMino Could you review again?
Come to think of it, maybe there's actually a way of making
latexaccept the tilde?Have a look at https://tex.stackexchange.com/questions/425954/tilde-in-a-image-path.
Have you tried to do a
str.replace("~", "\string~")on that path when passing it tolatex?
The link is about using a title inside a latex document, this PR is about a title in a command line argument to latex. I tried to put the argument inside "", escape the ~ (with \ or \string), but did not manage to get it working that way.
I understand, but from my experience with latex, IIRC it parses some of its arguments as if they are written in latex. Unfortunately I don't have the environment ready to check this, so that's why I'm asking about it.
I'll check the code, and if there truly is no way to achieve that, we'll merge.
I understand, but from my experience with
latex, IIRC it parses some of its arguments as if they are written in latex. Unfortunately I don't have the environment ready to check this, so that's why I'm asking about it.I'll check the code, and if there truly is no way to achieve that, we'll merge.
@MrMino Any update on this? On my system
In [78]: import tempfile; tempfile.mkdtemp()
Out[78]: 'C:\\Users\\EENDEB~1\\AppData\\Local\\Temp\\tmpnzyikr5c'
The ~ in the output should not only be parsed properly by latex, but somehow the name 'C:\Users\EENDEB~1\AppData\Local\Temp\tmpnzyikr5c' should also be expanded to `'C:\Users\EENDEBAKPT\AppData\Local\Temp\tmpnzyikr5c'.
Thanks, let's try.