-
Notifications
You must be signed in to change notification settings - Fork 205
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
Write mathematics as HTML script tags? #611
Comments
My reaction is that it is crazy to consider doing this in the
next year. Maybe maybe it speeds things up (but there are
other things under discussion that could improve the page
rendering speed), at the cost of abandoning the simplicity
and naturalness of letting MathJax work as it was originally intended.
I also do not understand the point being made by \label{}.
This was made worse by my inability to find an example of a reference to
a numbered equation in the sample article.
…On Mon, 3 Jul 2017, Rob Beezer wrote:
With paragraph bust-up in place at #515 we could consider writing math/LaTeX/mathjax as script elements:
http://docs.mathjax.org/en/latest/advanced/model.html#mathjax-script-tags
This might greatly simplify cross-references to equations (HTML id rather than MathJax LaTeX \label{} mechanism). Maybe it
would remove step from page loading and give a speed-up? Identifying mathematics with proper elements might have other
benefits?
Not sure I see a downside, other than some uglieness to accomodate IE quirks. Benefits may be marginal.
Reactions?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the
thread.[AAM6LMb5c3TPc_waqajFjwzG6n2RjhIJks5sKVylgaJpZM4OMsmP.gif]
|
Okay, I found an example of a referenced numbered equation. It looks like there is Since there is no way to replicate the numbering in the PDF unless the numbers are |
On 07/05/2017 06:45 PM, davidfarmer wrote:
My reaction is that it is crazy to consider doing this in the
next year. Maybe maybe it speeds things up (but there are
other things under discussion that could improve the page
rendering speed), at the cost of abandoning the simplicity
and naturalness of letting MathJax work as it was originally intended.
My understanding is that the first thing MathJax does is cruise the page and
translate $, \(, etc into these script tags. So we would just be saving a step.
No idea how much savings that would be. The page would be easier for others
to parse, but I don't know why somebody would do that. ;-)
I also do not understand the point being made by \label{}.
This was made worse by my inability to find an example of a reference to
a numbered equation in the sample article.
I think you are right. Now that we open a knowl for a cross-reference to a
displayed equation, the point is moot. In th very early days, it was a real
fiddle to hyperlink to a displayed equation when it was identified by a
"\label". See the MathJax config at the top of a page with bits like
"useLabelIDs". (It hooks up PTX ids with MathJax-generated ids manufactured
from labels. IIRC, which may be in doubt.)
This *will be* necessary for HTML output where there are not knowls, so not for
naught. But we could ban it from straight HTML output. Nice catch. ;-)
#612
Rob
|
Right. ;-) Very good.
…On 07/05/2017 06:55 PM, davidfarmer wrote:
Okay, I found an example of a referenced numbered equation. It looks like there is
a \label in the HTML source, but it is ignored because the HTML has a hard-coded
\tag, and the reference also has that tag hard-coded.
Since there is no way to replicate the numbering in the PDF unless the numbers are
directly written into the HTML, I don't get what the \label is doing, or how an
HTML id
could be of any use.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#611 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABy2cjav8I0-xlODD8eP4cqusBZ9UuWwks5sLD6ZgaJpZM4OMsmP>.
|
It has been four years now. |
In the CAT example I saw earlier today, the page used MathJax 2. My weak understanding is that MJ2 finds all the My equally weak understanding of MathJax3 is that it does not work this way. It does not build However, MJ3 can be configured to look for A bonus effect of using |
The CAT does not use the typeset inline math. For display math the HTML Also, the CAT is fine with "<" in the input source, because that is intercepted I am not seeing the benefit of this idea. |
100% unambiguous. Math/LaTeX delimited by HTML/XHTML/XML syntax. Not a convenient syntax for people authoring one-off web pages outside of PreTeXt. Suppose somebody "accidentally" authors Alex is getting this script version back from WW servers. I had to put this in bare HTML so an author's |
Actually that hack is worse than I thought. At present we can do:
|
If the only change to inline math is replacing The MathJax setup for the page should change so that Will someone be allowed to define Are there any changes to display math? If |
Yes.
No. Print latex would still regnize and use
It would also replace |
How about PreTeXt never outputs backslash square bracket,
instead begin(equation*} or whatever is the equivalent?
…On Sat, 22 May 2021, Alex Jordan wrote:
Would that eliminate the need to do [unicode-no-width-space-here]( ?
Yes.
Will someone be allowed to define ( as a macro for \left(?
No. Print latex would still regnize and use \( for its math opening delimiter.
Are there any changes to display math?
It would also replace \[ with the same script tag, with another attribute mode=display.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, orunsubscribe.[AABTULEHAWBE7FDJCO7WP2TTO7JI7A5CNFSM4DRSZGH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVX
HJKTDN5WW2ZLOORPWSZGOGJZXZMI.gif]
|
I was about to say that I think that is the way it is now! @Alex-Jordan: If MJ is configured to only look for the |
With MathJax, it will process For this, you would put the script tag with |
For inline math, this is actually a good change which helps the CAT. As much as possible, I prefer data over code. What I mean is that data Almost everything is xml, so its opening and closing tags are described by Switching to But what about display math? If I still need to supply |
If you have
and you drop the script tag and have |
Right. Except PTX HTML output had a Not sure I'm tracking the CAT scenario, but |
The user of the CAT only types the contents of the display math, Wrapping the content in |
Maybe way off-base, but is the following a solution? Maybe not a good solution, but a demonstration that I am understanding. <div class="displaymath" latex-env="equation">
x^2+y^2=25
</div> and then PTX JS gets this before MathJax does and injects the |
Will the CAT be delving into |
Will the CAT be delving into mrow level markup? In other words, will CAT users write \\, or will
they use the CAT to move to a new row?
I am still thinking about multiline, and there are two specific ideas
I am currently considering:
a) leave a blank line to separate the `mrow` s
b) Something like what I wrote for Space Math:
https://aimath.org/~farmer/spacemath/#aligned
In either case, the alignment is automatic unless the author
inserts an ampersand.
|
Here are the MathJax instructions for using script tags in MJ3: As I read the configuration code, it seems that it is not important to literally use So a rough outline is: based on the value of In the other direction, it could take what an author writes and infer:
based on what the user typed in. The only thing I can't think of an automated inference for is If I understood right, the redundancy of setting |
I looked at the way MJ3 replaces If we decide to make the switch, it should be done when we have time to focus on it. |
Not imminent. ;-) |
MathJax 3 allows for marking elements it will ignore, and marking elements it will process. There still needs to be LaTeX delimiters, but since we know whare math is, we can isolate the intrepration of these delimiters. So a different solution to the proposal here. Guts of the change at d5ef68f |
With paragraph bust-up in place at #515 we could consider writing math/LaTeX/mathjax as
script
elements:http://docs.mathjax.org/en/latest/advanced/model.html#mathjax-script-tags
This might greatly simplify cross-references to equations (HTML id rather than MathJax LaTeX
\label{}
mechanism). Maybe it would remove step from page loading and give a speed-up? Identifying mathematics with proper elements might have other benefits?Not sure I see a downside, other than some uglieness to accomodate IE quirks. Benefits may be marginal.
Reactions?
The text was updated successfully, but these errors were encountered: