emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] displaymath environment and MathJax
@ 2010-12-07 17:42 Łukasz Stelmach
  2010-12-09 11:04 ` Carsten Dominik
  2010-12-12 12:16 ` Carsten Dominik
  0 siblings, 2 replies; 3+ messages in thread
From: Łukasz Stelmach @ 2010-12-07 17:42 UTC (permalink / raw)
  To: emacs-orgmode

Greetings All.

The following patch makes MathJax consider \begin{displaymath} and
\end{displaymath} as math environmetn boundaries. For someone who, like
me, keeps "The not so short introduction to LaTeX2e" alway around, the
displaymath environment is the default way to introduce a block of math.

In fact '\[' and '\]' are also mentioned there but the environment is
used in every single example so the patch minimizes the surprise.

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org-html.el b/lisp/org-html.el
index d1fe06d..2380c12 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -290,7 +290,7 @@ You can also customize this for each buffer, using something like
                      \"TeX/noUndefined.js\"],
         tex2jax: {
             inlineMath: [ [\"\\\\(\",\"\\\\)\"] ],
-            displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ],
+            displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"], [\"\\\\begin{displaymath}\",\"\\\\end{displaymath}\"] ],
             skipTags: [\"script\",\"noscript\",\"style\",\"textarea\",\"pre\",\"code\"],
             ignoreClass: \"tex2jax_ignore\",
             processEscapes: false,
--8<---------------cut here---------------end--------------->8---

-- 
Miłego dnia,
Łukasz Stelmach

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

* Re: [PATCH] displaymath environment and MathJax
  2010-12-07 17:42 [PATCH] displaymath environment and MathJax Łukasz Stelmach
@ 2010-12-09 11:04 ` Carsten Dominik
  2010-12-12 12:16 ` Carsten Dominik
  1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2010-12-09 11:04 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: emacs-orgmode

Hi Lukasz,

this looks like a MathJax bug to me.  MathJax does understand
equation and many other environments - so I do not really understand
why it does not take displaymath.

So I believe you should file a report to MathJax and see what their
answer is.

If I understand correctly, the displaymath environment is
somehow fragile.  When using amsmath.sty (which is a good
idea), then displaymath is redefined anyway to fall back
to equation*.

Do the LaTeX experts on this group have a comment on this issue?
It seems strange that displaymath would need special configuration
of MathJax while all the other environments do work out of the box.

- Carsten

On Dec 7, 2010, at 6:42 PM, Łukasz Stelmach wrote:

> Greetings All.
>
> The following patch makes MathJax consider \begin{displaymath} and
> \end{displaymath} as math environmetn boundaries. For someone who,  
> like
> me, keeps "The not so short introduction to LaTeX2e" alway around, the
> displaymath environment is the default way to introduce a block of  
> math.
>
> In fact '\[' and '\]' are also mentioned there but the environment is
> used in every single example so the patch minimizes the surprise.
>
> --8<---------------cut here---------------start------------->8---
> diff --git a/lisp/org-html.el b/lisp/org-html.el
> index d1fe06d..2380c12 100644
> --- a/lisp/org-html.el
> +++ b/lisp/org-html.el
> @@ -290,7 +290,7 @@ You can also customize this for each buffer,  
> using something like
>                      \"TeX/noUndefined.js\"],
>         tex2jax: {
>             inlineMath: [ [\"\\\\(\",\"\\\\)\"] ],
> -            displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ],
> +            displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"], [\"\\ 
> \\begin{displaymath}\",\"\\\\end{displaymath}\"] ],
>             skipTags: [\"script\",\"noscript\",\"style\",\"textarea 
> \",\"pre\",\"code\"],
>             ignoreClass: \"tex2jax_ignore\",
>             processEscapes: false,
> --8<---------------cut here---------------end--------------->8---
>
> -- 
> Miłego dnia,
> Łukasz Stelmach
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [PATCH] displaymath environment and MathJax
  2010-12-07 17:42 [PATCH] displaymath environment and MathJax Łukasz Stelmach
  2010-12-09 11:04 ` Carsten Dominik
@ 2010-12-12 12:16 ` Carsten Dominik
  1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2010-12-12 12:16 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: emacs-orgmode

Hi Lukasz

I have accepted this patch after all - I could not see
anything about displaymath on the MathJax site.  So
this seems to be a fix worth trying.

- Carsten

On Dec 7, 2010, at 6:42 PM, Łukasz Stelmach wrote:

> Greetings All.
>
> The following patch makes MathJax consider \begin{displaymath} and
> \end{displaymath} as math environmetn boundaries. For someone who,  
> like
> me, keeps "The not so short introduction to LaTeX2e" alway around, the
> displaymath environment is the default way to introduce a block of  
> math.
>
> In fact '\[' and '\]' are also mentioned there but the environment is
> used in every single example so the patch minimizes the surprise.
>
> --8<---------------cut here---------------start------------->8---
> diff --git a/lisp/org-html.el b/lisp/org-html.el
> index d1fe06d..2380c12 100644
> --- a/lisp/org-html.el
> +++ b/lisp/org-html.el
> @@ -290,7 +290,7 @@ You can also customize this for each buffer,  
> using something like
>                      \"TeX/noUndefined.js\"],
>         tex2jax: {
>             inlineMath: [ [\"\\\\(\",\"\\\\)\"] ],
> -            displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ],
> +            displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"], [\"\\ 
> \\begin{displaymath}\",\"\\\\end{displaymath}\"] ],
>             skipTags: [\"script\",\"noscript\",\"style\",\"textarea 
> \",\"pre\",\"code\"],
>             ignoreClass: \"tex2jax_ignore\",
>             processEscapes: false,
> --8<---------------cut here---------------end--------------->8---
>
> -- 
> Miłego dnia,
> Łukasz Stelmach
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2010-12-12 12:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-07 17:42 [PATCH] displaymath environment and MathJax Łukasz Stelmach
2010-12-09 11:04 ` Carsten Dominik
2010-12-12 12:16 ` Carsten Dominik

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).