public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* MathJax, equation environment/equation numbering
@ 2017-11-07 16:12 Clayton Hayes
       [not found] ` <e25b580c-24bb-4b75-a9c7-5d6eb328d9f2-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Clayton Hayes @ 2017-11-07 16:12 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1559 bytes --]

This might be a feature request for the GitHub page, but I figured I'd post 
here first. It's a handful of related issues involving LaTeX to HTML 
transforms via MathJax.

First, there doesn't seem to be any native way to turn on equation 
numbering for MathJax. This seems like a pretty easy add, as its just 
another code snipped included before the MathJax <script> call.

Second, equation environments are getting transformed into basic display 
math. Since traditional equation numbering in LaTeX (e.g. \label{eq:1}) 
doesn't work outside of the equation environment, this isn't ideal.

Alternatively, using the MathJax option {autonumber:"all"} (instead of the 
default "AMS") would number all display math and would require users to 
include "\notag" or "\nonumber" in any display math they don't want to be 
numbered. It's a decent quick workaround, but would require some extra work 
for users as they're more likely to be using the equation environment when 
writing in LaTeX.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e25b580c-24bb-4b75-a9c7-5d6eb328d9f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2111 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* MathJax, equation environment/equation numbering
       [not found] ` <e25b580c-24bb-4b75-a9c7-5d6eb328d9f2-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-11-08  6:23   ` Kolen Cheung
  2017-11-08  6:30   ` Kolen Cheung
  1 sibling, 0 replies; 3+ messages in thread
From: Kolen Cheung @ 2017-11-08  6:23 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1027 bytes --]

Yes, there’s numerous similar issue on the subject. And no, it isn’t an easy fix in terms of modifying pandoc to handle this “natively”. However, it is an easy fix when you provide your own `header-include` to setup MathJax. There’s an issue on the ordering of MathJax config and loading the script (pandoc’s template put the `header-include` after loading MathJax but config need to be before that. A custom template can change this.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ec8c84c6-0d70-44d5-ab34-6596da922e18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* MathJax, equation environment/equation numbering
       [not found] ` <e25b580c-24bb-4b75-a9c7-5d6eb328d9f2-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2017-11-08  6:23   ` Kolen Cheung
@ 2017-11-08  6:30   ` Kolen Cheung
  1 sibling, 0 replies; 3+ messages in thread
From: Kolen Cheung @ 2017-11-08  6:30 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1573 bytes --]

Just to say a bit more, pandoc designed to work with not only multiple formats, but also multiple ways of handling Maths, where MathJax is only one such option. So while MathJax offers the functionality you and I need, pandoc cannot simply use them because it would only works when MathJax is used. Even worse, pandoc’s AST currently doesn’t have a way to handle equation no. as in LaTeX (but just a global numbering).

From my experience, currently the simplest solution to work around this, if you only need HTML+MathJax and LaTeX output, is to setup MathJax in the way described above.

There’s pandoc filter handling some kind of numbering, I doubt you’ll be interested in it, but if so, browse the pandoc-extra wiki on pandoc’s GitHub. I also wrote a pandoc-amsthm filter in the past, that allow uses of the LaTeX amsthm env. in pandoc (currently only HTML output only, but I am in the progress of generalizing it (although I’m busy so that progress is somewhat halted)).

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/af595b38-64a7-48da-93cc-7babb3aa83fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-08  6:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07 16:12 MathJax, equation environment/equation numbering Clayton Hayes
     [not found] ` <e25b580c-24bb-4b75-a9c7-5d6eb328d9f2-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-11-08  6:23   ` Kolen Cheung
2017-11-08  6:30   ` Kolen Cheung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).