Insert an Inkscape SVG file in LaTeX with different font size

inkscapeoverleafsvgtext;

I am new in Inkscape/SVG world and I encountered some problems when I insert an SVG file created with Inkscape in my LaTeX document. LaTeX font size is the default one, say 13pt, and I wrote some 22pt text in my SVG file, when I insert this file in my LaTeX document (\includesvg{}), the text is reduced at 13pt, obviously I wanted it in 22pt. Where can I set this LaTeX settings? I am working in Overleaf.

Adoptable solutions:

  1. I write the text in Inkscape the way I wanted to see it in the pdf (font, size, everything), then I convert the text from object to path (top menu -> path -> from object to path), it won't be a simple text in LaTeX anymore;
  2. @mrpiggi solution in the comments.

Best Answer

Package svg provides the key pretex for \includesvg[pretex=...]{...} which is executed right before the actual inclusion of the generated pdf graphic file. You could use this to adapt either relative to the font size used in the document itself with something like \includesvg[pretex=\huge]{...} or set it absolutely with \includesvg[pretex=\fontsize{22pt}{26pt}]{...}.

Edit: There has been a similar question, the given answer should neatly sum up the whole thing.