# Arrowheads are wrong color in svg graphic

I have created a svg graphic with inkscape and use it in my LaTeX document. The graphic has a couple colorful lines with corresponding colorful arrowheads. Unfortunately pdflatex seems to arbitrarily assign the colors to the arrowheads. Exporting the svg to png in inkscape results in the correct arrowheadcolors, but then of course my math looks ugly. Has anyone experienced the same and knows of a way to get the correct arrowhead colors? There are already two different colors, so it's not like all arrowheads are treated the same.

Here is my minimal example

\documentclass{article}
\usepackage{svg}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\caption{wrong colors of arrowheads in svg version}
\end{figure}
\begin{figure}
\caption{correct colors in png version}
\end{figure}
\end{document}


Here is the resulting pdf (screenshot thereof)

Here the png exported with inkscape (pngarrowhead.png)

And here is the original svg file. Sorry, but I cannot input it here directly, so I share it via a filehoster.

<svg width="98.852mm" height="46.58mm" version="1.1" viewBox="0 0 98.852 46.58" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="Arrow1Mend" overflow="visible" orient="auto">
<path transform="matrix(-.4 0 0 -.4 -4 0)" d="m0 0 5-5-17.5 5 17.5 5z" fill="context-stroke" fill-rule="evenodd" stroke="context-stroke" stroke-width="1pt"/>
</marker>
<marker id="Arrow1Mstart" overflow="visible" orient="auto">
<path transform="matrix(.4 0 0 .4 4 0)" d="m0 0 5-5-17.5 5 17.5 5z" fill="context-stroke" fill-rule="evenodd" stroke="context-stroke" stroke-width="1pt"/>
</marker>
</defs>
<g transform="translate(-35.241 -73.283)">
<path d="m37.042 119.06 47.625-21.167" fill="#0f0" marker-start="url(#Arrow1Mstart)" stop-color="#000000" stroke="#008000" stroke-dasharray="8, 8" style="font-variation-settings:normal"/>
<g>
<path d="m84.667 95.25-47.625-21.167" fill="none" marker-end="url(#Arrow1Mend)" stroke="#f0f"/>
<path d="m84.667 95.25 47.625-21.167" fill="none" marker-end="url(#Arrow1Mend)" stroke="#00f"/>
<path d="m84.667 95.25 47.625 21.167" fill="#0f0" marker-end="url(#Arrow1Mend)" stroke="#0f0"/>
<path d="m37.042 116.42 47.625-21.167" fill="#f00" marker-end="url(#Arrow1Mend)" stop-color="#000000" stroke="#f00" style="-inkscape-stroke:none;font-variation-settings:normal"/>
</g>
<text x="72.760414" y="82.020821" fill="#000000" font-family="sans-serif" font-size="10.583px" letter-spacing="0px" stroke-width=".26458" word-spacing="0px" style="line-height:1.25" xml:space="preserve"><tspan x="72.760414" y="82.020821" stroke-width=".26458">$x^2$</tspan></text>
</g>
</svg>

• something odd with the svg arrow heads, firefox doesn't show heads at all ... chrome shows them all black Apr 20 at 8:16
• I added the svg to your question (not sure why you said you needed a file share, it is not very big?) Apr 20 at 8:22
• Yes, I noticed the weird firefox and chrome behavior as well. Gnome image viewer shows it correctly though. And what puzzles me is that latex shows 2 different arrow head colors, instead of the requested 4. Ah, yeah, thanks for embedding the file. Just did not occur to me. Apr 20 at 8:26
• Optimizing the svg before saving makes it even smaller, but does not change the result in latex. The plain svg output option does not help either. Apr 20 at 8:37
• Well, the export to pdf is flawed, so probably an issue which should be reported to the Inkscape team Apr 20 at 10:56