1

When generating a basic plot in Maple 2022:

Expr := x;
with(plots):
inequal(Expr < y, x = -3 .. 3, y = -3 .. 3);

I get the expected output:

enter image description here

But when exporting the plot as an .svg file and adding it to a Latex document, the minus sign is now rendered as "K": enter image description here

What is causing this and how to fix it? The svg looks fine in Chrome/Edge. MWE in Overleaf:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{svg, graphicx, float}

\begin{document}

\begin{figure}[H] \centering \includesvg{test.svg} \caption{Caption} \label{fig:my_label} \end{figure}

\end{document}

Edit: test.svg

Opening the file in Edge/inkscpae:

enter image description here

enter image description here

ZA_
  • 13
  • 2
    please add test.svg to your question, otherwise we can not use your example – David Carlisle Dec 28 '22 at 07:48
  • @DavidCarlisle test.svg added – ZA_ Dec 29 '22 at 11:40
  • 2
    if I view that svg it shows as K and K is in the source <text x="7" xml:space="preserve" y="271" style="clip-path:url(#clipPath6); stroke:none;">K</text> so including in to latex will not change this – David Carlisle Dec 29 '22 at 12:02
  • Seems to be more a problem with the Maple export than a tex problem. Maybe better suited on a Q&A site for maple? – samcarter_is_at_topanswers.xyz Dec 29 '22 at 12:04
  • 1
    What do you mean by "The svg looks fine in Chrome/Edge"? As @DavidCarlisle writes, the svg contains a "K", so why would Chrome/Edge not show a K? -and of cause also LaTeX. On my system, Safari, Chrome, Inkscape and mac preview shows K - that is because it is a K. – hpekristiansen Dec 29 '22 at 12:16
  • @hpekristiansen that's weird, i don't see k when i open it in Edge/Chrome/Inkscape. See the 2 screenshots i added – ZA_ Dec 29 '22 at 13:01
  • 1
    As with @hpekristiansen I see a K in Firefox/Chrome/Inkscape on linux. – daleif Dec 29 '22 at 13:03
  • @ZA_: Could you try to download this file: https://pastebin.com/raw/JPFD9NqF , rename it to temp.svg and open it in inkscape? – hpekristiansen Dec 29 '22 at 13:03
  • A simple solution would be to take the test.svg that you uploaded to pastebin (which has the K in the source) and replace all occurrences of K with -. Of course you would need to do that again if the file changes, but in case the figure is already finished then this would be a quick workaround. – Marijn Dec 29 '22 at 13:11
  • 1
    The OP doesn't see a K in browser because the font is installed (ESSTIXFive). This is presumably a non-Unicode font that Maple uses for symbols. The svg package uses Inkscape for conversion and that isn't doing anything clever with fonts. the K just gets passed through to LaTeX. I doubt there is much worth doing to fix this workflow other than using sed 's/K/\$-\$/' < test.svg. – David Purton Dec 29 '22 at 13:50
  • @DavidPurton this indeed seems to be a font issue. A workaround i found is using .eps instead, which does display a - sign correctly. – ZA_ Dec 29 '22 at 14:45

0 Answers0