Inkscape.org
Beginners' Questions Latex equation saved as path when exporting pdf
  1. #1
    Morten10 Morten10 @Morten10

    Hey,

    I've created a figure using Inkscape, I have used several extensions such as https://textext.github.io/textext/  and https://github.com/wanglongqi/WriteTeX to add some equations to the figures.

    They are working fine, but they save the equation as path instead of text, so when exporting the figure as PDF the equation can not be copied.

    When creating a figure in Python using Matplotlib and exporting it as PDF, each individual symbol can be marked and copied.

     

    Even if I create a figure using python and saving it as SVG. Then editing the SVG file using Inkscape and exporting as PDF it converts the equation to path.

     

    Regular text works just fine, and I can copy it when exported to PDF, I am talking about latex rendered text such as $f (x)= \frac{1}{2} x^{2}$

    I am aware to .pdf_tex option, I don't want that. I want a single PDF file

     

    Thank you

  2. #2
    Maren Hachmann Maren Hachmann @Moini

    Yes, that is how these extensions work within Inkscape. The rendered equations are handed to Inkscape as a drawing. Honestly, I don't know what the text would look like anyway. You could try adding equations as transparent text on top of the images, if you know how to write those in plain text.

  3. #3
    Morten10 Morten10 @Morten10

    Thanks for reply, @Moini

    Each rendered symbol should be copyable, just like plain text.

    For example: \textbf{Spring} $\frac{1}{\nu} x^{\omega}$ translates to : Spring 1 ν x ω

    When using TikZ in Overleaf or any other LaTeX editor, the figure created in the PDF file is copyable text, just like PDF figures created by Matplotlib in python as discussed.

    To me, it sounds very simple, all the symbols exists already, instead of render them as path, keep them as text object in Inkscape.

    Try the following thing, open Inkscape and add a text box, type: "This is a test ν x ω symbol", export the file as PDF, you will notice that now you are able to copy the text, simply because the object is a text object and not a path.
     

    So yes, I can go through each symbol manually and replace the path with text, sounds like a lot of unnecessary work, also the font size may not be uniform.

     

    thanks

     

     

  4. #4
    Maren Hachmann Maren Hachmann @Moini

    The suggestion was not to 'replace' them, but to place an invisible text on top, that can be copied, as a fallback for PDF, as a workaround for your needs. Replacing would really be tedious and pretty much useless...

    Inkscape only gets the vector data from LaTeX, so it is impossible to also add a text, the way it is currently implemented.

    Also not sure how any text would be added (invisible object? Aria?...) and whether that then transfers to PDF on export. LaTeX apparently does not support SVG output with real text.

  5. #5
    Maren Hachmann Maren Hachmann @Moini

    (honestly... if you need something else, you need to use a different method and not refuse doing that - these are the limitations).

Inkscape Inkscape.org Inkscape Forum Beginners' Questions Latex equation saved as path when exporting pdf