Inkscape.org
Beginners' Questions What happened to 'Save as pdf + tex?'
  1. #1
    noca noca @noca

    Hi all,

    I've just gotten a new M1 MacBook and installed the latest (1.1.1) Inkscape, and I seem to be missing the option save I always used to have, which is 'Save as pdf + tex'.

    (I can see the option to save as 'LaTeX with PStricks macros', which I suppose is supposed to do something similar, but isn't quite the same, I think?)

    As far as I'm aware I never installed any extensions (though maybe my memory is bad) to do this. Is there something I need to do to enable this feature? Has it been deprecated in the newer versions of Inkscape?

    If it's not a default thing, does anybody know of an up-to-date extension that reinstates this functionality? Previously I could save a figure as pdf + tex and include the file in a LaTeX document where it would compile any tex labels in the diagram when I compiled the LaTeX document.

    Thanks for your help!

  2. #2
    Tyler Durden Tyler Durden @TylerDurden

    Maybe this from the release notes: 

    Extensions that have been replaced:

    • Render → LaTeX: The EQTeXSVG extension (Render → LaTeX) that could be used to convert an inline LaTeX equation into SVG paths using Python was dropped, due to its external dependencies. It has been replaced by the extension Render → Mathematics → LaTeX (pdflatex) which serves the same purpose.

    https://wiki.inkscape.org/wiki/index.php/Release_notes/1.0#extension_updates

  3. #3
    noca noca @noca

    Hum, thanks - that looks like it might do the job. Only problem is that the LaTeX (pdflatex) is greyed out: presumably I need to point inkscape to where the LaTeX distribution is installed somehow. Any ideas on how to do this?

    (I can't find anything on the internet - the only thing that seems plausible is from 2016 and references a directory (/Applications/Inkscape.app/Contents/Resources/script) that doesn't exist for me.)

  4. #4
    Tyler Durden Tyler Durden @TylerDurden
    🙏

    A few developers regularly visit the user chat channel... they may be more helpful than just the release notes. Please chime back if you arrive at a solution.
    https://chat.inkscape.org/channel/inkscape_user

  5. #5
    noca noca @noca
    🏆🏆*

    Update: I found a solution to replace the old functionality of 'save as pdf + tex'.

    It seems the modern solution is to essentially divorce the tex work from Inkscape entirely, and use the package 'svg' for LaTeX. This allows one to save an Inkscape svg with LaTeX text in it, and include the svg into the tex file natively as one would any other graphic. At this point, the package strips the text from the svg and write separate files - one with the image, and one with the pdf_tex which contains the text of the svg compiled with latex. It then includes the whole thing into the document by some magic --- just like the old save as pdf + tex did.

    Some technical know-how that I had to sleuth: on a mac (and elsewhere) you have to make sure that inkscape is properly known to the system via path. It seems you do this by typing

    alias inkscape="/Applications/Inkscape.app/Contents/MacOS/inkscape" 

    into terminal, if your inkscape installation is in the usual place. (Apparently this should also just happen automatically. You can check this by typing 'inkscape' into terminal and seeing if it opens.)

    You also have to make sure you compile with the --shell-escape flag enabled, so that the tex file can run external commands i.e. inkscape. If you're running pdflatex straight from the command line, the right way to do this is simply navigating via terminal to the folder your .tex file (and svg files) are in, and running

    pdflatex example.tex --shell-escape

    This is a good sanity check that you've got everything else set up right, if you're having troubles with the flag in your tex program.

    If you're using TeXShop, as most people are on MacOS, the way to enable this automatically is TeXShop --> Preferences --> Engine and add

    --shell-escape

    to the end of the list of flags under the pdfTex --> Latex field here.

    Note: you should probably be careful what you compile after enabling this, as it seems to give it quite a lot of access for someone nefarious to do bad things to your system.

    There is more documentation (and an example) at the homepage of the package here: https://ctan.org/pkg/svg?lang=en

  6. #6
    Samir Ouchene Samir Ouchene @s.ouchene
    *

    To export to PDF + Tex, proceed as follows:

    • Save your document as PDF.
    • In the dialog that appears, choose the option: "Omit text in PDF and create LaTeX file"
       

    You should get two files: a pdf file and a file with pdf_tex extension.

     

    You can also achieve that using the command line as follows:

     

    inkscape --export-type=PDF --export-latex document.svg

Inkscape Inkscape.org Inkscape Forum Beginners' Questions What happened to 'Save as pdf + tex?'