Dear Andrew,
As you are well aware, two things are going on here:
* Runestone is allowing arbitrary input from readers/students.
* Dollar signs as delimiters for math are common.
Students will be better served if they learn the habit early of using an
escaped, asymmetric, set of delimiters, \( and \). Rather than taking the
dollar sign out of circulation.
(Aside: ever written about mathematical finance with LaTeX? I have...)
So a "workaround" would be to require readers to use \( and \). I realize that
almost every thing they see online will contradict this.
Why does PreTeXt not have this problem with author-input?
* Unambiguous delimiters, <m>...</m>.
* The conversion to HTML places a span.process-math around the math bits, and
MathJax is configured to only look there, and ignore the rest of a page.
* The conversion to LaTeX replaces "dangerous" characters with unambiguous or
escaped versions. Like a bare "%" becomes a "\percent" (iirc). I don't think a
percent-sign is a problem for Andrew's example, but a dollar-sign as currency is
a (similar) problem in a short-answer response.
* In the early days, when our skills were not as evolved, we had elements like
<percent/> to deal with this situation.
Are we expecting readers to provide short-answer responses where they escape
dollar signs used as currency (\$)? I'm not even sure if that helps or not?
The conclusion I reach is that Runestone needs to parse reader responses to
identify what is math, and what is not math. And once that hard work is done,
you might as well insert span.process-math along with conversion of
dollar-sign delimiters to parentheses delimiters. Then the rest of the input
can be ignored by MathJax since it will be outside of any span.process-math.
Rob
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to
pretext-dev...@googlegroups.com <mailto:
pretext-
>
dev+uns...@googlegroups.com>.
> To view this discussion visit
https://groups.google.com/d/msgid/pretext-dev/
> CACm44N99MP-x3FjzU0XGCK%2Bz-B-ZdosH%3DSJ%3DMU-FvekvEYfGRw%
40mail.gmail.com
> <
https://groups.google.com/d/msgid/pretext-dev/CACm44N99MP-x3FjzU0XGCK%2Bz-B-
> ZdosH%3DSJ%3DMU-FvekvEYfGRw%
40mail.gmail.com?utm_medium=email&utm_source=footer>.