2

I followed this answer to use a svg image in my LaTeX document, but LaTeX changes the font I used when I created the image. How can I keep the "original" I set in Inkscape?

Ntakwetet
  • 631
  • @WillieWong Thank you, it works exactly as I want. Sorry for the foolish question but I am quite new to LaTeX. Just another thing: when I run the command without --export-latex I get a warning: (inkscape:9326): Gtk-WARNING **: 13:32:30.778: Impossibile trovare il motore del tema in module_path: «hcengine»,, which in English means something like "couldn't find the theme engine in module_path «hcengine»,". Is it a problem? – Ntakwetet Sep 05 '19 at 11:34
  • I doubt it; the warning states that it cannot find the hcengine (one of the GTK/Gnome themes for high contrast). You can fix it by installing gtk-engines in your linux distribution, but it shouldn't have an effect on the pdf export of inkscape. – Willie Wong Sep 05 '19 at 18:08

2 Answers2

7

\includesvg apparently treats text in your figure independently, so that it is rendered by LATEX by default.

Probably the best way to solve this is to change the option inkscapelatex to false. Quote from the documentation:

If option inkscapelatex=true is set, the output is split into a seperate PDF/EPS/PS file (see optioninkscapeformat) and a corresponding LATEX file. This is the default setting. Setting inkscapelatex=false will result in a single PDF/EPS/PS file, where any contained text won’t be rendered by LATEX.

Example: \includesvg[inkscapelatex=false,<other params>]{svgfile}.

(Source: https://tex.stackexchange.com/a/498352/194783)

clel
  • 325
1

If you don't want to use the same font as the main document, you should just export the SVG file directly as a PDF (without the --export-latex option) and \includegraphics the PDF file. (The linked answer in your original question is specifically about how to export the graphics part into a PDF file and the text part separately into a TeX file that can be treated using LaTeX to produce a consistent font choice.)

(Above answer copied from comment)

Willie Wong
  • 24,733
  • 8
  • 74
  • 106