Using STEM with Embeddable HTML

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using STEM with Embeddable HTML

devunwired
Hello -

I would like to use the STEM support to embed equations in the HTML document, and this seems to be working with a straight build of the document. However, when I move to building embeddable HTML (-s command line flag), the equation is no longer rendered with MathJax. The raw text is simply placed in between some delimiters.

Is there a way to correct this?
Reply | Threaded
Open this post in threaded view
|

Re: Using STEM with Embeddable HTML

mojavelinux
Administrator
Dave,

This gets to the very core of the difference between the standalone and embeddable outputs. The standalone output provides the framing around the content, which includes all the library integrations that the content needs to properly render. When you produce an embeddable document, you only get the body. It's up to you to provide the framing and library integrations.

Therefore, all you need to do to support MathJax with your embeddable document is to add the MathJax script to your page template. We do exactly that on the asciidoctor.org site.


(sorry for the screwed up syntax highlighting on GitHub).

I think the standalone vs embeddable output needs to be covered better in the user manual. I've opened an issue. See https://github.com/asciidoctor/asciidoctor.org/issues/171.

-Dan

On Fri, Feb 26, 2016 at 3:13 PM, devunwired [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello -

I would like to use the STEM support to embed equations in the HTML document, and this seems to be working with a straight build of the document. However, when I move to building embeddable HTML (-s command line flag), the equation is no longer rendered with MathJax. The raw text is simply placed in between some delimiters.

Is there a way to correct this?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Using-STEM-with-Embeddable-HTML-tp4419.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: Using STEM with Embeddable HTML

devunwired
Thanks Dan -

I had tried including the JS file to the document, but that didn't work. It seems I also needed that MathJax.Hub.Config script in the link you provided. Now it's working.
Reply | Threaded
Open this post in threaded view
|

Re: Using STEM with Embeddable HTML

mojavelinux
Administrator
Excellent!

The reason you need the MathJax.Hub.Config (and not the default) is because we configure MathJax in a special way that prevents the generated markup from interfering with other AsciiDoc markup. In other words, we can't use the default MathJax.Hub.Config because it will break things.

-Dan

On Mon, Feb 29, 2016 at 3:52 PM, devunwired [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks Dan -

I had tried including the JS file to the document, but that didn't work. It seems I also needed that MathJax.Hub.Config script in the link you provided. Now it's working.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Using-STEM-with-Embeddable-HTML-tp4419p4447.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen