0

I'm using \includesvg from the svg package with pdflatex, which is very convenient. Unfortunately, when I try to use xelatex, this approach is not working any more. I'd like xelatex to have more options with font selection.

Any suggestions to carry on using \includesvg will be appreciated.

Thanks in advance!

  • If you're just concerned about font selection you may also try lualatex. – TeXnician Nov 10 '17 at 17:54
5

You don't say what error you got, this worked for me with xelatex --shell-escape

enter image description here

\documentclass{article}
\usepackage{svg}
\usepackage{fontspec}
\setmainfont{Arial}

\begin{document}

a Á Γ →

\fbox{\includesvg{drawing.svg}}

\end{document}

In case you feel inspired by the artwork and wish to use it in your own documents, drawing.svg is

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="210mm"
   height="297mm"
   viewBox="0 0 210 297"
   version="1.1"
   id="svg8"
   inkscape:version="0.92.1 r"
   sodipodi:docname="drawing.svg">
  <defs
     id="defs2" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="0.35"
     inkscape:cx="-154.28571"
     inkscape:cy="548.57143"
     inkscape:document-units="mm"
     inkscape:current-layer="layer1"
     showgrid="false"
     inkscape:window-width="1920"
     inkscape:window-height="1001"
     inkscape:window-x="0"
     inkscape:window-y="29"
     inkscape:window-maximized="1" />
  <metadata
     id="metadata5">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1">
    <path
       style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="m 39.008304,8.2621167 c -1.25992,-0.503968 -2.49242,-1.082791 -3.77976,-1.511903 -0.45353,-0.151178 -3.17655,0 -3.77977,0 -2.51984,0 -5.03968,0 -7.55952,0 -0.7097,0 -3.34661,-0.144386 -3.77976,0 -0.33807,0.112688 -0.43722,0.596582 -0.75595,0.755951 -0.22539,0.112692 -0.57778,-0.178181 -0.75596,0 -0.39842,0.398421 -0.35753,1.113483 -0.75595,1.511904 -0.92074,0.920739 -1.68896,0.354105 -2.26786,1.5119053 -0.93093,1.861873 2.19433,-0.6824233 -0.75595,2.267853 -0.39842,0.39843 -1.11348,0.35753 -1.5119,0.75596 -0.39842,0.39842 -0.50397,1.00793 -0.75596,1.5119 -0.25198,0.50397 -0.61929,0.96528 -0.75595,1.511911 -0.12223,0.48892 0.12223,1.022979 0,1.5119 -0.27331,1.09326 -1.09338,1.9775 -1.5119,3.02381 -0.2959397,0.73985 -0.4600097,1.52801 -0.7559597,2.26786 -0.20926,0.52315 -0.61929,0.96527 -0.75595,1.5119 -0.30557,1.2223 0.20713,2.53699 0,3.77976 -0.131,0.78601 -0.56269,1.49481 -0.75595,2.26786 -0.0611,0.24446 0.0611,0.51149 0,0.75595 -0.19326,0.77306 -0.59968,1.48649 -0.75595,2.26786 -0.0988,0.494181 0.12223,1.02298 0,1.5119 -0.13666,0.54664 -0.6193,0.96528 -0.75595,1.511909 -0.12223,0.488921 0,1.007941 0,1.511911 0,1.25992 0,2.519839 0,3.779761 0,3.527769 0,7.055548 0,10.583328 0,1.511911 0,3.023812 0,4.53572 0,0.50396 -0.0988,1.01772 0,1.511901 0.25198,0.755949 0.50396,1.511901 0.75595,2.26786 0.25198,0.251981 0.64326,0.41788 0.75595,0.755949 1.72985,5.189551 -2.8945,-3.521138 0.75595,3.779761 0.15937,0.318741 0.55828,0.459441 0.75595,0.755949 0.31255,0.468831 0.5039697,1.007941 0.7559597,1.511911 0.25198,0.50397 0.64545,0.95939 0.75595,1.511901 0,0.755959 0,1.511908 0,2.26786 0.25198,0.251978 0.64326,0.41788 0.75595,0.755949 0.15937,0.47811 -0.15937,1.033801 0,1.511911 0.22429,0.672849 2.04357,1.59499 2.26786,2.26785 0.15937,0.47811 -0.22538,1.06114 0,1.511908 0.11269,0.22538 0.5169,-0.0797 0.75595,0 0.53454,0.178181 1.11348,0.357532 1.51191,0.755952 0.17818,0.178178 -0.17818,0.57777 0,0.755949 1.41054,1.410549 2.21457,0.35134 3.02381,0.755951 0.31873,0.159369 0.50396,0.503968 0.75595,0.75596 0.86492,0.86492 0.89487,1.05424 2.26786,1.5119 0.4781,0.15937 1.00793,0 1.5119,0 1.76389,0 3.52778,0 5.29167,0 2.26785,0 4.53571,0 6.80357,0 0.75595,0 1.52658,0.14826 2.26786,0 1.39905,0.561499 1.38644,-1.29155 2.26785,-1.5119 0.73338,-0.183351 1.52659,0.148249 2.26786,0 3.04205,-0.60841 0.34733,-0.551641 2.26786,-1.511911 0.71272,-0.35636 1.48649,-0.599671 2.26786,-0.755949 2.883077,-0.57662 0.125698,1.071078 3.779758,-0.755952 0.318741,-0.159369 0.43721,-0.596588 0.755949,-0.755949 2.458701,-1.229349 1.798171,-0.190849 3.77976,-1.511911 0.296511,-0.197668 0.417881,-0.643258 0.75596,-0.755949 0.478099,-0.159369 1.02298,0.12223 1.511901,0 0.546629,-0.13666 1.00794,-0.50397 1.511911,-0.755949 0.50396,-0.251992 1.043077,-0.44341 1.511898,-0.755952 0.593021,-0.395348 0.874432,-1.19317 1.5119,-1.511908 0.225391,-0.112692 0.577782,0.178178 0.75596,0 0.39842,-0.39842 0.443399,-1.04308 0.755952,-1.511901 0.19767,-0.29651 0.503967,-0.50397 0.755949,-0.755959 0.251989,-0.251982 0.437221,-0.59658 0.755948,-0.755952 0.225391,-0.112689 0.546291,0.139782 0.755963,0 4.383079,-2.922058 0.559779,-0.36362 1.511898,-2.26786 0.159371,-0.318738 0.50397,-0.503968 0.755951,-0.755949 0.503971,-0.503971 1.084279,-0.941729 1.511909,-1.511901 1.85701,-0.269549 0.313941,-1.604848 0.755951,-2.26786 0.395349,-0.593018 1.084271,-0.941729 1.511909,-1.511908 0.338071,-0.450761 0.41788,-1.061141 0.755952,-1.511901 0.641448,-0.85526 1.674839,-1.378331 2.26786,-2.26786 2.201098,-3.301651 -0.33505,0.249179 0.755949,-3.023809 0.112688,-0.338072 0.50396,-0.503971 0.755949,-0.755952 0,-0.503968 -0.12223,-1.02298 0,-1.511909 -0.455639,-1.368221 1.2246,-1.405929 1.5119,-2.267849 0.23345,-0.70032 -0.24145,-3.055401 0,-3.779761 0.178192,-0.53454 0.6193,-0.965279 0.75596,-1.511911 0.17132,-0.6853 0,-2.90159 0,-3.779758 0,-0.603221 0.15117,-3.326231 0,-3.779761 -0.356359,-1.069081 -1.238589,-1.930551 -1.511909,-3.023809 -0.122229,-0.488921 0.12223,-1.022991 0,-1.511911 -0.131529,-0.52613 -0.853241,-1.93852 -1.5119,-2.26785 -0.22538,-0.11269 -0.577771,0.17818 -0.755949,0 -0.178192,-0.17818 0,-0.50397 0,-0.75596 -0.251992,-0.50396 -0.357542,-1.11348 -0.755962,-1.5119 -0.35636,-0.35636 -1.155539,0.35636 -1.511898,0 -0.356362,-0.35636 0.356359,-1.15554 0,-1.5119 -0.178181,-0.17819 -0.530572,0.11268 -0.755952,0 -1.67146,-0.83573 -0.23459,-0.46918 -0.75596,-1.51191 -1.57304,-3.14609 0.0522,0.80814 -1.5119,-0.75595 -0.178179,-0.178181 0.178181,-0.57778 0,-0.75595 -0.0469,-2.12857 -1.704409,-0.1925 -2.26786,-0.75596 -0.178179,-0.17818 0.112691,-0.53057 0,-0.75595 -0.159369,-0.31874 -0.503968,-0.50397 -0.755949,-0.755951 -0.251982,-0.251979 -0.437222,-0.596589 -0.755949,-0.755959 -0.22538,-0.11268 -0.577782,0.17819 -0.755963,0 -0.178167,-0.17817 0.178181,-0.57777 0,-0.75595 -0.39842,-0.398421 -0.977357,-0.57777 -1.511897,-0.75595 -0.239052,-0.0797 -0.577771,0.17818 -0.755952,0 -0.178178,-0.17818 0,-0.503971 0,-0.75595 -0.251989,-0.25199 -0.459449,-0.558281 -0.75596,-0.75595 -0.46882,-0.312551 -1.04308,-0.443411 -1.5119,-0.755961 -0.68815,-0.45876 -1.59783,-1.93284 -2.26786,-2.26785 -0.22538,-0.11269 -0.530569,0.11269 -0.755949,0 -0.637472,-0.31874 -0.87443,-1.19317 -1.511901,-1.51191 -0.225391,-0.11269 -0.53058,0.11269 -0.75596,0 -0.31873,-0.15937 -0.43721,-0.59658 -0.755949,-0.75595 -0.22538,-0.11269 -0.530571,0.11269 -0.755951,0 -0.637479,-0.31874 -0.87443,-1.193169 -1.511909,-1.5119043 -0.410091,-0.20505 -2.81696,0.206843 -3.023812,0 -0.178167,-0.178181 0.178181,-0.577773 0,-0.755954 -0.356359,-0.35636 -1.155538,0.356359 -1.511897,0 -0.178181,-0.178179 0.178178,-0.577771 0,-0.755952 -0.178181,-0.178178 -0.503971,0 -0.755949,0 -0.25199,0 -0.50397,0 -0.75596,0 -2.51984,0 -5.03968,0 -7.55952,0 z"
       id="path3680"
       inkscape:connector-curvature="0" />
    <path
       style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="m 21.621394,31.696638 c -0.50396,1.00794 -1.09338,1.977501 -1.5119,3.023809 -0.18717,0.467931 0,1.007941 0,1.511911 0,0.395301 -0.0994,2.825041 0,3.023809 0.15937,0.318741 0.50397,0.503971 0.75595,0.755952 0.25199,0.251978 0.43722,0.59658 0.75595,0.755949 0.19877,0.0994 2.62851,0 3.02381,0 0.39531,0 2.82504,0.0994 3.02381,0 3.14609,-1.573041 -0.80814,0.0522 0.75595,-1.511901 0.17818,-0.178178 0.64327,0.22538 0.75596,0 0.30238,-0.604769 -0.30238,-1.663099 0,-2.26786 0.15936,-0.318738 0.59658,-0.437219 0.75595,-0.755949 0.22538,-0.45076 -0.22538,-1.061141 0,-1.511911 0.15937,-0.318738 0.59658,-0.437208 0.75595,-0.755949 0.0994,-0.198771 0,-2.6285 0,-3.02381 0,-0.34045 0.11503,-2.03779 0,-2.26786 -0.15937,-0.31873 -0.59658,-0.43721 -0.75595,-0.75595 -0.11269,-0.22538 0.17818,-0.57777 0,-0.75595 -0.17818,-0.17818 -0.50397,0 -0.75595,0 -1.51191,0 -3.02381,0 -4.53572,0"
       id="path3682"
       inkscape:connector-curvature="0" />
    <path
       style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="m 45.055924,33.208549 c 0,1.511898 0,3.023809 0,4.53571 0,0.525798 -0.13669,3.506388 0,3.779768 1.57305,3.146092 -0.0522,-0.808148 1.5119,0.755952 0.17819,0.178178 -0.17817,0.577768 0,0.755949 0.17819,0.178181 0.50397,0 0.75596,0 0.251978,0 0.503967,0 0.755949,0 0.525787,0 3.50638,0.136689 3.779758,0 3.146099,-1.573051 -0.808138,0.0522 0.755951,-1.511901 0.178179,-0.178189 0.530569,0.112681 0.75596,0 0.658659,-0.32934 1.380371,-1.741728 1.5119,-2.26786 0.006,-0.02529 -0.004,-2.263838 0,-2.26786 0.178179,-0.178178 0.643261,0.22538 0.755949,0 0.22538,-0.45076 0,-1.00793 0,-1.511909 0,-1.259911 0,-2.51984 0,-3.77976 0,-0.25198 0,-0.50396 0,-0.75595 0,-0.25198 0.178181,-0.57777 0,-0.75595 -0.178181,-0.17818 -0.530569,0.11269 -0.755949,0 -0.31874,-0.15937 -0.43721,-0.59658 -0.755951,-0.75595 -0.22538,-0.11269 -0.577771,0.17818 -0.755949,0 -0.178181,-0.17818 0.178178,-0.57778 0,-0.75596 -0.498041,-0.49804 -1.01387,0.49804 -1.511911,0 -0.178179,-0.17818 0.178181,-0.57777 0,-0.75595 -0.178179,-0.17818 -0.503971,0 -0.755949,0 -0.251982,0 -0.503971,0 -0.755949,0 -0.403842,0 -3.563409,-0.10818 -3.779769,0 -0.31873,0.15937 -0.50396,0.50397 -0.75595,0.75595"
       id="path3684"
       inkscape:connector-curvature="0" />
    <path
       style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="m 45.055924,33.208549 c -9.49144,11.526179 -9.82738,8.330798 -9.82738,15.119048 l -1.51191,9.07143"
       id="path3686"
       inkscape:connector-curvature="0" />
    <path
       style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="m 11.038064,69.494259 c 2.01587,-1.25992 3.96956,-2.625281 6.04762,-3.779761 1.29592,-0.71995 0.46797,0.467971 0.75595,0.755949 0.17818,0.178181 0.53057,-0.112689 0.75595,0 3.1461,1.573051 -0.80814,-0.0522 0.75596,1.511911 0.17817,0.178181 0.57777,-0.178181 0.75595,0 1.00794,1.00793 -1.25992,0.755949 0.75595,0.755949 0.18334,0 2.24355,-0.02429 2.26786,0 0.17818,0.178181 -0.17818,0.577771 0,0.755952 0.17818,0.178178 0.50396,0 0.75595,0 1.25992,0 2.51984,0 3.77976,0 3.02381,0 6.04762,0 9.07143,0 0.25199,0 0.50397,0 0.75595,0 0.25199,0 0.57778,0.178178 0.75596,0 0.17818,-0.178181 -0.17818,-0.577771 0,-0.755952 0.35636,-0.356359 1.06114,0.22538 1.5119,0 0.31874,-0.159369 0.43722,-0.59658 0.75595,-0.755949 0.45077,-0.22538 1.06114,0.22538 1.51191,0 0.31874,-0.159369 0.43721,-0.59659 0.75595,-0.75596 0.60476,-0.302371 1.6631,0.30239 2.26786,0 3.146088,-1.57304 -0.80814,0.0522 0.75595,-1.5119 0.35636,-0.35636 1.15555,0.356359 1.51191,0 0.178178,-0.178181 -0.17818,-0.577771 0,-0.755949 1.007927,-1.007941 0.755949,1.259919 0.755949,-0.755952"
       id="path3700"
       inkscape:connector-curvature="0" />
  </g>
</svg>
  • Oh man, there's just absurd amounts of bloat in Inkscape-generated SVGs. – morbusg Nov 10 '17 at 21:17
  • 1
    @morbusg true but the result is a work of pure art, don't you agree? – David Carlisle Nov 10 '17 at 21:21
  • Yes, I do agree. +1 for that alone :) the title of the work brings an air of enigma. – morbusg Nov 10 '17 at 21:26
  • Could not get running includesvg with xelatex with inkscape generated files. So I returned to pdflatex which works flawlessly. Thank you for the advice anyway! – Hermann Gebhard Dec 1 '17 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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