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

Typesetting uncertainties in scientific notation #2

Open
padawanphysicist opened this issue Aug 28, 2017 · 1 comment
Open

Typesetting uncertainties in scientific notation #2

padawanphysicist opened this issue Aug 28, 2017 · 1 comment

Comments

@padawanphysicist
Copy link

padawanphysicist commented Aug 28, 2017

Redirected from mathjax/MathJax-third-party-extensions#41

The following works just fine in LaTeX:

\SI{1}{\electronvolt} = \SI{1.602176621(98)e-19}{\joule}

However, when rendered using MathJax I have

1 eV = 1.602176621(98)e - 19 J

Where e - 19 shows up instead of the \times usual scientific notation. The package works fine when using regular decimals though.

To render properly I had to use the following workaround:

\SI{1}{\electronvolt} = \num{1.602176621(98)}\times 10^{-19}\,\si{\joule}

Is there a way to typeset this properly? I couldn't find anything similar in the package reference.

I can try to do this as soon as I get familiar with the code (since my JavaScript is quite basic), but I would appreciate if someone can give me some advice =)

@burnpanck
Copy link
Owner

@padawanphysicist: The typesetting with \times notation is already implemented and should be working. Therefore, I suspect the problem is with the parser not properly picking up the combination of bracketed uncertainties and e notation. The initial parser I wrote was hand-written and pretty basic. Then, I set out to re-do the parser using PEG.js. I think the current implementation is already switched to PEG.js, but I'm not 100% sure (since I ran out of time for this project already some time ago). If it is, you can probably start by copy-pasting the PEG.js parser definition into the online exploration tool of PEG.js to identify why the parser does not catch your input properly.

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