emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* working mathjax example
@ 2013-11-27 23:46 Russell L. Carter
  2013-12-03 21:28 ` Russell L. Carter
  2014-01-09 16:30 ` Nick Dokos
  0 siblings, 2 replies; 3+ messages in thread
From: Russell L. Carter @ 2013-11-27 23:46 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I'm trying to bring up a simple mathjax example.  Org-mode is git
current and otherwise works fine.  MathJax is git current and lives in
/opt/mathjax/git/MathJax.js.  Both firefox 26 and chromium 31 display
the MathJax tests perfectly from my org->html test directory.

I've copied the example code from the org manual into a file
containing:

--cut-here----cut-here----cut-here----cut-here----cut-here--

#+HTML_MATHJAX: align:"left" mathml:t path:"/opt/mathjax/git/MathJax.js"
#+options: latex:verbatim

\begin{equation}
x=\sqrt{b}
\end{equation}

If $a^2=b$ and \( b=2 \), then the solution must be
either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \].

--cut-here----cut-here----cut-here----cut-here----cut-here--

I exported per the instructions using org-export-to-html.  The
exported html file has lots of good stuff suggesting that the export
seems to be working.  But both firefox and chrome display the math
bits replaced by [Math Processing Error].  Does anyone have an idea
what I am doing wrong?

The actual exported <body> is (stuff before elided):

<body>
<div id="content">
<h1 class="title">json</h1>
\begin{equation}
x=\sqrt{b}
\end{equation}

<p>
If \(a^2=b\) and \( b=2 \), then the solution must be
either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \].
</p>
</div>
<div id="postamble" class="status">
<p class="author">Author: Russell L. Carter</p>
<p class="date">Created: 2013-11-27 Wed 16:17</p>
<p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 24.3.1
(<a href="http://orgmode.org">Org</a> mode 8.2.3c)</p>
<p class="validation"><a
href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

Thanks!
Russell

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

* Re: working mathjax example
  2013-11-27 23:46 working mathjax example Russell L. Carter
@ 2013-12-03 21:28 ` Russell L. Carter
  2014-01-09 16:30 ` Nick Dokos
  1 sibling, 0 replies; 3+ messages in thread
From: Russell L. Carter @ 2013-12-03 21:28 UTC (permalink / raw)
  To: emacs-orgmode



On 11/27/2013 04:46 PM, Russell L. Carter wrote:
> Hi,
> 
> I'm trying to bring up a simple mathjax example.  Org-mode is git
> current and otherwise works fine.  MathJax is git current and lives in
> /opt/mathjax/git/MathJax.js.  Both firefox 26 and chromium 31 display
> the MathJax tests perfectly from my org->html test directory.
> 
> I've copied the example code from the org manual into a file
> containing:
> 
> --cut-here----cut-here----cut-here----cut-here----cut-here--
> 
> #+HTML_MATHJAX: align:"left" mathml:t path:"/opt/mathjax/git/MathJax.js"
> #+options: latex:verbatim

I took another look at this, and the fix (for me) was trivial.  It
turns out that removing the "mathml:t" property from the example
HTML_MATHJAX line provided in the org-manual section 12.6.8 solves the
problem.  Hopefully this can save other MathJax noobs the time it took
me to wade through ox-html.el and puzzle over the :MMLYES/:MMLNO lines
in there.

Anyway, I can now complete my transition from generating PDFs to
generating HTML and that makes me very happy.

Cheers,
Russell




> 
> \begin{equation}
> x=\sqrt{b}
> \end{equation}
> 
> If $a^2=b$ and \( b=2 \), then the solution must be
> either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \].
> 
> --cut-here----cut-here----cut-here----cut-here----cut-here--
> 
> I exported per the instructions using org-export-to-html.  The
> exported html file has lots of good stuff suggesting that the export
> seems to be working.  But both firefox and chrome display the math
> bits replaced by [Math Processing Error].  Does anyone have an idea
> what I am doing wrong?
> 
> The actual exported <body> is (stuff before elided):
> 
> <body>
> <div id="content">
> <h1 class="title">json</h1>
> \begin{equation}
> x=\sqrt{b}
> \end{equation}
> 
> <p>
> If \(a^2=b\) and \( b=2 \), then the solution must be
> either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \].
> </p>
> </div>
> <div id="postamble" class="status">
> <p class="author">Author: Russell L. Carter</p>
> <p class="date">Created: 2013-11-27 Wed 16:17</p>
> <p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 24.3.1
> (<a href="http://orgmode.org">Org</a> mode 8.2.3c)</p>
> <p class="validation"><a
> href="http://validator.w3.org/check?uri=referer">Validate</a></p>
> </div>
> </body>
> 
> Thanks!
> Russell
> 

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

* Re: working mathjax example
  2013-11-27 23:46 working mathjax example Russell L. Carter
  2013-12-03 21:28 ` Russell L. Carter
@ 2014-01-09 16:30 ` Nick Dokos
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Dokos @ 2014-01-09 16:30 UTC (permalink / raw)
  To: emacs-orgmode

"Russell L. Carter" <rcarter@pinyon.org> writes:

> Hi,
>
> I'm trying to bring up a simple mathjax example.  Org-mode is git
> current and otherwise works fine.  MathJax is git current and lives in
> /opt/mathjax/git/MathJax.js.  Both firefox 26 and chromium 31 display
> the MathJax tests perfectly from my org->html test directory.
>
> I've copied the example code from the org manual into a file
> containing:
>
> --cut-here----cut-here----cut-here----cut-here----cut-here--
>
> #+HTML_MATHJAX: align:"left" mathml:t path:"/opt/mathjax/git/MathJax.js"
> #+options: latex:verbatim
>
> \begin{equation}
> x=\sqrt{b}
> \end{equation}
>
> If $a^2=b$ and \( b=2 \), then the solution must be
> either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \].
>
> --cut-here----cut-here----cut-here----cut-here----cut-here--
>
> I exported per the instructions using org-export-to-html.  The
> exported html file has lots of good stuff suggesting that the export
> seems to be working.  But both firefox and chrome display the math
> bits replaced by [Math Processing Error].  Does anyone have an idea
> what I am doing wrong?
>
> The actual exported <body> is (stuff before elided):
>
> <body>
> <div id="content">
> <h1 class="title">json</h1>
> \begin{equation}
> x=\sqrt{b}
> \end{equation}
>
> <p>
> If \(a^2=b\) and \( b=2 \), then the solution must be
> either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \].
> </p>
> </div>
> <div id="postamble" class="status">
> <p class="author">Author: Russell L. Carter</p>
> <p class="date">Created: 2013-11-27 Wed 16:17</p>
> <p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 24.3.1
> (<a href="http://orgmode.org">Org</a> mode 8.2.3c)</p>
> <p class="validation"><a
> href="http://validator.w3.org/check?uri=referer">Validate</a></p>
> </div>
> </body>
>

[This goes in the Better late than never? drawer...]

This works fine for me if I delete the path spec in your HTML_MATHJAX
line, so my guess would be that there's some problem with your local
mathjax setup. Are you sure that your other tests use your local setup?
Maybe they go offsite?

BTW, with mathjax providing a proper CDN, is there any point of having a
local setup[fn:1] or even the default setup at orgmode.org? Maybe the
out-of-the-box default in org should be "let the mathjax CDN handle it."

Footnotes:

[fn:1] ... assuming that you want to *use* mathjax, not hack it.

Nick

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

end of thread, other threads:[~2014-01-09 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-27 23:46 working mathjax example Russell L. Carter
2013-12-03 21:28 ` Russell L. Carter
2014-01-09 16:30 ` Nick Dokos

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).