Re: [O] html-encode in mathjax latex fragments
Hi Rick, Rick Frankel r...@rickster.com writes: Not sure why `org-html-protect-char-alist' is a custom and not just a var, but IMHO, `org-html-encode-plain-text' is the correct solution. I made `org-html-protect-char-alist' a defvar. -- Bastien
Re: [O] html-encode in mathjax latex fragments
On 2014-06-30 06:54, Nicolas Goaziou wrote: Hello, Eric Schulte schulte.e...@gmail.com writes: From the link above it sounds like replacing just , and should be sufficient, if the full html encoding in my previous patch was too heavy weight. By default, `org-html-encode-plain-text' just takes care about , and , which is what you're looking. However, it is configurable through `org-html-protect-char-alist', which may cause trouble. FWIW I think a hard-coded function dedicated to the task, or simply a hard-coded replacement within `org-html-format-latex', may be safer in the long run. Anyway Rick Frankel may have an opinion here. Not sure why `org-html-protect-char-alist' is a custom and not just a var, but IMHO, `org-html-encode-plain-text' is the correct solution. rick
Re: [O] html-encode in mathjax latex fragments
Nick Dokos ndo...@gmail.com writes: Nicolas Goaziou m...@nicolasgoaziou.fr writes: Hello, Eric Schulte schulte.e...@gmail.com writes: I noticed equations with 's weren't displaying correctly in HTML export using mathjax. The attached patch fixes this by html-encoding latex fragments for mathjax HTML export. I imagine this change would be generally useful and could be applied to master. I am a bit puzzled. I just tried exporting the following buffer: \(1 2\) and the result looked good. Could you provide an example of a failed export? See http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-in-html-documents for some gotchas. Thanks, the link does describe the problem well. My particular problem formula included id in part of a larger equation. From the link above it sounds like replacing just , and should be sufficient, if the full html encoding in my previous patch was too heavy weight. Best, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D (see https://u.fsf.org/yw)
Re: [O] html-encode in mathjax latex fragments
Hello, Eric Schulte schulte.e...@gmail.com writes: From the link above it sounds like replacing just , and should be sufficient, if the full html encoding in my previous patch was too heavy weight. By default, `org-html-encode-plain-text' just takes care about , and , which is what you're looking. However, it is configurable through `org-html-protect-char-alist', which may cause trouble. FWIW I think a hard-coded function dedicated to the task, or simply a hard-coded replacement within `org-html-format-latex', may be safer in the long run. Anyway Rick Frankel may have an opinion here. Regards, -- Nicolas Goaziou
Re: [O] html-encode in mathjax latex fragments
Hello, Nick Dokos ndo...@gmail.com writes: See http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-in-html-documents for some gotchas. Thank you. Regards, -- Nicolas Goaziou
[O] html-encode in mathjax latex fragments
I noticed equations with 's weren't displaying correctly in HTML export using mathjax. The attached patch fixes this by html-encoding latex fragments for mathjax HTML export. I imagine this change would be generally useful and could be applied to master. Best, Eric From 8c4efca17f2a6fbc836c5a8b6b0f628b6c9fff33 Mon Sep 17 00:00:00 2001 From: Eric Schulte schulte.e...@gmail.com Date: Sun, 29 Jun 2014 14:38:03 -0400 Subject: [PATCH] html-encode text in mathjax latex fragments * lisp/ox-html.el (org-html-format-latex): Html-encode text in mathjax latex fragments. --- lisp/ox-html.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index df392a9..03037f5 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2610,7 +2610,8 @@ a symbol among `mathjax', `dvipng', `imagemagick', `verbatim' nil and t. See `org-html-with-latex' for more information. INFO is a plist containing export properties. (let ((cache-relpath ) (cache-dir )) -(unless (eq processing-type 'mathjax) +(if (eq processing-type 'mathjax) + (setq latex-frag (org-html-encode-plain-text latex-frag)) (let ((bfn (or (buffer-file-name) (make-temp-name (expand-file-name latex temporary-file-directory -- 2.0.0 -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D (see https://u.fsf.org/yw)
Re: [O] html-encode in mathjax latex fragments
Hello, Eric Schulte schulte.e...@gmail.com writes: I noticed equations with 's weren't displaying correctly in HTML export using mathjax. The attached patch fixes this by html-encoding latex fragments for mathjax HTML export. I imagine this change would be generally useful and could be applied to master. I am a bit puzzled. I just tried exporting the following buffer: \(1 2\) and the result looked good. Could you provide an example of a failed export? Regards, -- Nicolas Goaziou
Re: [O] html-encode in mathjax latex fragments
Nicolas Goaziou m...@nicolasgoaziou.fr writes: Hello, Eric Schulte schulte.e...@gmail.com writes: I noticed equations with 's weren't displaying correctly in HTML export using mathjax. The attached patch fixes this by html-encoding latex fragments for mathjax HTML export. I imagine this change would be generally useful and could be applied to master. I am a bit puzzled. I just tried exporting the following buffer: \(1 2\) and the result looked good. Could you provide an example of a failed export? See http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-in-html-documents for some gotchas. -- Nick