I managed to setup the SVG package so it would successfully import an SVG file.

Here is the full config:

\RequirePackage[width=\textwidth]{svg}      % In my custom package
\PassOptionsToPackage{svgpath={uml/}}{svg}  % In the file

I then include the SVG file (uml/uml.svg) with:


This works with no errors or warnings.

However, the original SVG file looked like this:Original file (Sorry this is awful, but you can't upload SVG files directly). Notice the arrows on the top-left.

Here is the resulting file: Resulting file

I'm fine with that, except that the three arrows on the top-left disappeared from some reason.

When reading the doc I found the lastpage option, however it is to fix a bug in Inkscape 0.91, and I'm running 0.92.1 r15371.

The SVG file was generated with UMLet (but that cannot be the problem, the first picture is after the generation). However, the missing arrows are the first I added when creating the diagram, that seems a bit too big of a coincidence -- however I don't know how SVG works so I don't really know if that has an influence or not.

UXF file generated by UMLet | SVG file generated by UMLet | Temporary PDF file generated by the svg package

Minimal working example:





You need to add the file uml.svg in the same folder.

  • Can you share the .svg file (for example copy and paste the content of the file to pastebin.com) – samcarter_is_at_topanswers.xyz Nov 24 '18 at 19:24
  • As a vector format SVG lines and other features can have several personal attributes. Two of these (visibility and opacity) may have been set for the first few lines then changed after that. Another possibility is Z order where those lines may be prior to a transparent border/frame which is later made opaque then the visible items are in the foreground. Simple solution redraw the missing lines worst case is some minor duplication unless the dead uns appear as zombies later. – user170109 Nov 25 '18 at 16:29
  • @samcarter edited to include links to the files – CLOVIS Nov 26 '18 at 9:46
  • @CLOVIS Thanks for the links to the files. Can you also add a compilable minimal working example (MWE) to your question? – samcarter_is_at_topanswers.xyz Nov 26 '18 at 15:42
  • @samcarter added MWE – CLOVIS Dec 13 '18 at 14:43

This seems to be a bug of inkscape. After the conversion of svg to pdf all pages above 25 seems to be missing in the ./svg-inkscape/uml_svg-tex.pdf_tex file. You can edit the file and add them like in the code below.

To not accidentally overwrite your file, you might want to change the name and include it with


instead of \includesvg[width=\textwidth]{uml}

%% Creator: Inkscape inkscape 0.91, www.inkscape.org
%% PDF/EPS/PS + LaTeX output extension by Johan Engelen, 2010
%% Accompanies image file 'uml_svg-tex.pdf' (pdf, eps, ps)
%% To include the image in your LaTeX document, write
%%   \input{<filename>.pdf_tex}
%%  instead of
%%   \includegraphics{<filename>.pdf}
%% To scale the image, write
%%   \def\svgwidth{<desired width>}
%%   \input{<filename>.pdf_tex}
%%  instead of
%%   \includegraphics[width=<desired width>]{<filename>.pdf}
%% Images with a different path to the parent latex file can
%% be accessed with the `import' package (which may need to be
%% installed) using
%%   \usepackage{import}
%% in the preamble, and then including the image with
%%   \import{<path to file>}{<filename>.pdf_tex}
%% Alternatively, one can specify
%%   \graphicspath{{<path to file>/}}
%% For more information, please see info/svg-inkscape on CTAN:
%%   http://tug.ctan.org/tex-archive/info/svg-inkscape
    \errmessage{(Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded}%
    \errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}%
      \setlength{\unitlength}{\unitlength * \real{\svgscale}}%
    \put(0.2928475,0.34128286){\makebox(0,0)[lb]{\smash{Personne }}}%

enter image description here

alternatively you could do the conversion from .svg to .pdf yourself and prevent the creation of separate layers, see e.g. https://tex.stackexchange.com/a/350175/36296

|improve this answer|||||
  • I'm not sure I understand. My UML file will be modified often so I want a script that can fix this, and I really don't understand what you're saying here. Are you proposing I add this manually? – CLOVIS Dec 13 '18 at 15:54
  • @CLOVIS yes, I am proposing to do this manually. This is the only possible fix from the latex side. If you want inkscape to be fixed, you should make a bug report for inkscape. – samcarter_is_at_topanswers.xyz Dec 13 '18 at 15:55
  • @CLOVIS Another approach: use latex to draw your diagram (e.g. with tikz) – samcarter_is_at_topanswers.xyz Dec 13 '18 at 15:56
  • Will the solution you gave work for other files? Since I have ~7 files that might need to be updated about every week – CLOVIS Dec 13 '18 at 15:56
  • I used pgf-umlcd before, but in this case it's not possible because my team doesn't know LaTeX. Worst case scenario, I'll just export to PNG (since that doesn't require Inkscape) and include that, but it's just... ugly – CLOVIS Dec 13 '18 at 15:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.