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

[siunitx] \percent not working #38

Closed
SamThilmany opened this issue Mar 14, 2017 · 5 comments
Closed

[siunitx] \percent not working #38

SamThilmany opened this issue Mar 14, 2017 · 5 comments

Comments

@SamThilmany
Copy link

I just noticed that the \percent command doesn't work properly in this MathJax extension, while it perfectly works in the "true" LaTeX package.

Here is my command and it's error:

\SI{95}{/percent}

Error: undefined is not an object (evaluating 'n.apply')
file: https://cdn.mathjax.org/mathjax/2.7-latest/jax/input/TeX/jax.js?V=2.7.0
line: 19
Debugging tips: use 'unpacked/MathJax.js', inspect 'MathJax.Hub.lastError' in the browser console

I hope it helps in resolving the bug. For any more details, you can contact me.

@pkra pkra changed the title \percent not working [siunitx] \percent not working Mar 14, 2017
@pkra
Copy link
Contributor

pkra commented Mar 14, 2017

cc @burnpanck (who wrote the extension)

@SamThilmany
Copy link
Author

@burnpanck There is also a problem with \degreeCelsius. The command works, but the output is weird. It's very small and it does not use the correct font.

Take a look at the screenshot. The first line is \SI{25}{\degreeCelsius}, the second line is simple text inside the MathJax environment \text{25 °C}.

bildschirmfoto 2017-03-14 um 11 04 04

@burnpanck
Copy link
Contributor

burnpanck commented Mar 17, 2017

Hm. The \percent definitely is a bug. Maybe I get around to look at it this weekend. For the degree Celsius, one would have to compare the generated Jax. However, I am not an expert on that side, in fact I'm not sure if any of the units is really rendered correctly.

@pkra
Copy link
Contributor

pkra commented Mar 17, 2017

For the degree Celsius, one would have to compare the generated Jax.

You currently generate

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mn>25</mn>
  <mspace width="mediummathspace" />
  <mi mathvariant="normal">&#x2103;<!-- ℃ --></mi>
</math>

Which seems the right way.

However, the issue described above stems from the fact that not all fonts supported by MathJax have a glyph for ℃ (in particular the default fonts don't) and the system fallback font in the above screenshot is doing rather poorly. (It might actually be considered though a bug @SamThilmany if you can provide more info).

Alternatives could be $\mathrm{°C}$ and (as MathML) <math><mmultiscripts><mi mathvariant='normal'>C</mi><mprescripts><none></none><mi>&#176;</mi></mprescripts></mmultiscripts></math>.

@pkra
Copy link
Contributor

pkra commented Oct 2, 2017

Closining favor of burnpanck/MathJax-siunitx#3

@pkra pkra closed this as completed Oct 2, 2017
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

3 participants