Thursday 8 July 2021

struggles with Inkscape's pdflatex extension, II

or the nightmare of pdflatex.py.

<smartass mode="on"> --- I added the time.sleep(50) lines in suitable places in the extension's code, so as to check if the temporary files (latex, pdf, svg) are correct. They are perfect, as expected. Which proves that something goes really wrong when the plugin starts including the temporary svg to the svg that is being edited. The rule seems to be: the more formulas you already have in your svg, the bigger the probability that you get junk when trying to include a new one.

Meanwhile I discovered how big those test files have grown, about 2.5MB; doing nothing smarter than Ctrl-A + Ctrl-C and then pasting to a new file, reduced the size to about 300kB. I also tried pressing "Clean Up Document" which perhaps removes some junk parts/tags from the svg. But the problem with pdflatex still occurs, in fact it becomes unusable and frustrating. ("I'm going to stand here and fix this damn thing every time it jams..." --- RMS!)

So I switched to my older machine which runs inkscape version 0.92, and it's just perfect. I found the extension's code; the way it's done looks different, even the good old dvips is in use there, and some other mechanism for including the newly created svg to the edited one. Perhaps it's worth to combine the two approaches to get something that works ok (not only with new/empty svg). By the way --- importing pdf via File -> Import works fine. I have no idea what happens in pdflatex.py from v. 1.1 --- those set_random_id etc. Looks like some reptilian piece of fxxxxn' witchcraft.

No comments:

Post a Comment