Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add math into node #7

Open
tobiasBora opened this issue Feb 18, 2020 · 1 comment
Open

Add math into node #7

tobiasBora opened this issue Feb 18, 2020 · 1 comment

Comments

@tobiasBora
Copy link

Hello,

First, thanks a lot for this great software, it looks awesome! I just would like to report some bugs making me unable to display proper math in a node:

<script type="text/tikz">
  \begin{tikzpicture}
  \node at (0,0) {Coucou $\sqrt{2}$};
  \end{tikzpicture}
</script>

Gives:
Screenshot_20200218_194101

@pieffebi
Copy link

pieffebi commented Feb 26, 2021

Hi, I'm experiencing similar problems as tobiasBora.

I think there might be a problem in the "mapping of symbols" (I'm not even sure I'm using the correct terms, though).

Basically, what I observe is that the svg code uses a "£" symbol for the minus sign in the cmsy10 font family, but this is rendered as a "times" sign instead, as demonstrated in this MWE.
From what I can understand, the minus sign should correspond to an inverted exclamation mark: "¡".
This actually produces the expected minus sign. Here's another MWE based on the first one, where all the "£" symbol have been replaced by "¡" symbols.

More detail on how I came up with the inverted exclamation marks in this stackOverflow post.

tobiasBora's problem seems slightly different.
I inserted the same node as in his MWE in my first MWE, and the result is garbled in a different way. In that case the sqrt symbol is the correct one, I think. The problem seems to be the positioning of the radicand ad the bar over it that is part of the sqrt symbol.

I hope this information helps solving the problem. This is a really great project, and I think it is going to be very useful to me.

Thank you very much for this work

% ----------
EDIT: I think that this problem traces back to the dvi2html component. The live demo page looks ok with the default sample document, but has exactly the same issues as above. Try e.g. changing
\[ \int_a^b f(x) \, dx = x^2 + C. \]

into
\[ \int_a^b f(x) \, dx = -x^2 + \sqrt{2}. \]
Neither the minus sign nor the square root render correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants