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

percent in math mode doesn't work right #43

Closed
kcrisman opened this issue Feb 4, 2015 · 6 comments
Closed

percent in math mode doesn't work right #43

kcrisman opened this issue Feb 4, 2015 · 6 comments

Comments

@kcrisman
Copy link
Contributor

kcrisman commented Feb 4, 2015

<m>0\leq x <percent /> m &lt;m</m>

If I leave it as %, it works fine in html but not latex. If I leave it this way, it doesn't show up in HTML. Exactly the thing that <percent /> was supposed to avoid... sigh. It's my fault for putting non-math in there, I know, but anyway thought it was worth reporting. I have a feeling some other such things will also not render properly in math mode. My workaround was to get the % out of the math and put it in a code tag for now.

@kcrisman
Copy link
Contributor Author

kcrisman commented Feb 4, 2015

It also doesn't appear to work in a Sage block:

<input>[ x <percent /> 6 for x in [1, 7, 13, 19, 25, -5, -11, 6001, -17]]</input>

I tried using % there because it works in html, but apparently messes up the tex (unsurprisingly). Apparently % works fine there.

@rbeezer
Copy link
Collaborator

rbeezer commented Feb 4, 2015

Right, in a Sage block you only need to escape the ampersand and the less-than, using XML syntax like &amp;.

Anything inside <m> or its cousins strictly follows LaTeX syntax, so you need to do whatever you would do in "regular" LaTeX, in this case use \% (which I have tested).

Note you can use \lt in your example rather than escaping the less-than character - MathJax predefines it, as does MBX LaTeX preamble.

Everything is behaving as expected, so I am going to close this.

@rbeezer rbeezer closed this as completed Feb 4, 2015
@kcrisman
Copy link
Contributor Author

kcrisman commented Feb 4, 2015

Anything inside or its cousins strictly follows LaTeX syntax, so you need to do whatever you would do in "regular" LaTeX, in this case use % (which I have tested).

Okay, that makes sense.

So... is it a bug that <percent /> doesn't work, though? Shouldn't it do the right thing anyway? (Hence wondering why this is closed.)

@rbeezer
Copy link
Collaborator

rbeezer commented Feb 4, 2015

Definitely not a bug. Inside <m> and its ilk, absolutely no processing is requested, so I think that <percent /> will just be ignored like it didn't exist. Content inside "math" delimiters is totally LaTeX (well, the subset that MathJax supports, really). Only. End of story. If you want something more, then maybe you really are not in math land anyway. So no plans to support any XML elements inside math.

So closed because everything here is behaving exactly as designed and expected.

@kcrisman
Copy link
Contributor Author

kcrisman commented Feb 5, 2015

Got it. Maybe you can add that to the sample article 😉

@rbeezer
Copy link
Collaborator

rbeezer commented Feb 5, 2015

I added this to #33 (rolling documentation patch).

On 02/04/2015 06:17 PM, kcrisman wrote:

Got it. Maybe you can add that to the sample article 😉


Reply to this email directly or view it on GitHub
#43 (comment).

rbeezer pushed a commit that referenced this issue Nov 1, 2023
Fix an issue with the WeBWorK interactive javascript in which the fee…
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