EPS/LaTeX export: certain text characters (e.g. underscore) produce invalid LaTeX code

Bug #719320 reported by Jonas T.
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Inkscape
Won't Fix
Undecided
Johan Engelen

Bug Description

affects inkscape 0.48.

when using "save as" -> "eps" -> "eps + latex" to export an svg drawing, the resulting tex file can not be compiled if the text contains one of the following characters:
- "{" , "}"
- underscore ("_")
- 2 or more successive newline/carriage return characters (CR/LF)

reproduce: open the attached files in inkscape 0.48, save a copy as EPS, using LaTex text export. try to include the exported graphic using the recommended way:

        \def\svgwidth{\columnwidth} % sets the image width, this is optional
        \input{drawing.eps_tex} % includes the tex+eps files

-> latex will not compile.

inkscape latex export should probably check the input text for sanity, such that problematic characters are escaped/encoded properly.

Revision history for this message
Jonas T. (jo-t) wrote :
su_v (suv-lp)
tags: added: eps exporting latex
Jonas T. (jo-t)
description: updated
description: updated
description: updated
Revision history for this message
Jonas T. (jo-t) wrote :

that bug here

https://bugs.launchpad.net/inkscape/+bug/628677

is probably related to my multiple_newlines.svg sample file.

Revision history for this message
Andreas Becker (abecker) wrote :

Underscores or braces shall not be escaped, because they belong to the latex markup. If you want to export to latex, the text has to be valid latex code. Escaping would destroy complex latex code like for example formulas.

Of course, multiline text support would be great, but this is another bug.

Revision history for this message
Johan Engelen (johanengelen) wrote :

Indeed :-)
So: won't fix... *cannot* fix really

Changed in inkscape:
assignee: nobody → Johan Engelen (johanengelen)
status: New → Won't Fix
Revision history for this message
malcolm cook (malcolm-cook) wrote :

Would you consider adding an option to auto-escape any latex special characters found in any text during conversion with --export-latex? Something like, --latex-escape

Or, perhaps more generally, an option to 'filter' all text, which might be used like `--latex-filter-text 'sed s/%/\%/'.`

I am trying to support a workflow which produces figures having '%' on plot labels.
They are being converted to multiple file formats (.svg/.pdf/.png).
The files can be assured NOT to required any 'special' character.
I would like to use inkscape accordingly.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.