From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Re: MathJax beyond org-html-mathjax-options? Date: Fri, 3 Nov 2017 13:29:53 -0400 Message-ID: References: <87fu9w7rk7.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113dd23ae97c41055d17738a" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAfn5-00006D-O2 for emacs-orgmode@gnu.org; Fri, 03 Nov 2017 13:30:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eAfn1-0001oO-1I for emacs-orgmode@gnu.org; Fri, 03 Nov 2017 13:29:59 -0400 Received: from mail-oi0-x235.google.com ([2607:f8b0:4003:c06::235]:51492) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eAfn0-0001nm-Pj for emacs-orgmode@gnu.org; Fri, 03 Nov 2017 13:29:54 -0400 Received: by mail-oi0-x235.google.com with SMTP id j126so2704208oib.8 for ; Fri, 03 Nov 2017 10:29:54 -0700 (PDT) In-Reply-To: <87fu9w7rk7.fsf@gmx.us> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Rasmus Cc: emacs-orgmode Mailinglist --001a113dd23ae97c41055d17738a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Bottom line: we can't expand org-html-mathjax-options to add in MathJax's cancel.js, etc. Yes, your first "quick-and-dirty" worked just fine. Q: How did you know how to format #+html: \(\require{cancel}\) ? Also, how does the org world know that we're talking about loading MathJax's cancel.js? As you all know I'm not a "developer-class" poster here, so my questions often look dull-witted. Will try the patch once I learn a bit more diff in Emacs lore. . . . On Thu, Nov 2, 2017 at 9:12 AM, Rasmus wrote: > Lawrence Bottorff writes: > > > I'm trying to get a typical Latex strikethrough with MathJax in an HTML > > export, i.e., \cancel{thing} puts line through "thing". This > > tells me how. But I > > don't know how to include this MathJax markup in an org file for HTML > > export. If I forego MathJax -- i.e., #+OPTIONS: tex:dvipng instead > > of #+OPTIONS: tex:t -- \cancel works, but I need to use MathJax. It > doesn't > > look like orhg-html-mathjax-options is expandable. . . . > > For now this works for me: > > #+html: \(\require{cancel}\) > \begin{equation} > \cancel{x =3D 1} > \end{equation} > > Cf. http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-extensions > You could also autoload the extension, cf. https://github.com/mathjax/ > MathJax/blob/master/test/sample-autoload.html > > > That being said, I don=E2=80=99t think extensions were available at the t= ime > #+HTML_MATHJAX was introduced. We could add extension support, but the > questions would be whether to add them to #+HTML_MATHJAX or make a new > keyword, e.g. > > #+HTML_MATHJAX_EXTENSIONS: ext1 ext2 ... extN > > I guess it would default to the "autoload-all" extension. > > One issue is that some of them have configuration options, like "noError"= . > > If you want, you can try the attached patch. > > Rasmus > > -- > Vote for proprietary math! > --001a113dd23ae97c41055d17738a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Bottom line: we can't expand org-html-mathjax-options = to add in MathJax's cancel.js, etc. Yes, your first "quick-and-dir= ty" worked just fine. Q: How did you know how to format=C2=A0#+html: \= (\require{cancel}\) ? Also, how does the org world know that we're talk= ing about loading MathJax's cancel.js? As you all know I'm not a &q= uot;developer-class" poster here, so my questions often look dull-witt= ed. Will try the patch once I learn a bit more diff in Emacs lore. . . .

On Thu, Nov 2,= 2017 at 9:12 AM, Rasmus <rasmus@gmx.us> wrote:
Lawrence Bottorff <borgauf@gmail.com> writes:

> I'm trying to get a typical Latex strikethrough with MathJax in an= HTML
> export, i.e., \cancel{thing} puts line through "thing". This=
> <http://docs.mathjax.org/en/lat= est/tex.html#cancel> tells me how. But I
> don't know how to include this MathJax markup in = an org file for HTML
> export. If I forego MathJax -- i.e., #+OPTIONS: tex:dvipng instead
> of #+OPTIONS: tex:t -- \cancel works, but I need to use MathJax. It do= esn't
> look like orhg-html-mathjax-options is expandable. . . .

For now this works for me:

=C2=A0 =C2=A0 #+html: \(\require{cancel}\)
=C2=A0 =C2=A0 \begin{equation}
=C2=A0 =C2=A0 \cancel{x =3D 1}
=C2=A0 =C2=A0 \end{equation}

Cf. http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-extensions
You could also autoload the extension, cf. https://github.com/mathjax/MathJax/blob/master/test/sample-autoload.html


That being said, I don=E2=80=99t think extensions were available at the tim= e
#+HTML_MATHJAX was introduced.=C2=A0 We could add extension support, but th= e
questions would be whether to add them to #+HTML_MATHJAX or make a new
keyword, e.g.

=C2=A0 =C2=A0 #+HTML_MATHJAX_EXTENSIONS: ext1 ext2 ... extN

I guess it would default to the "autoload-all" extension.

One issue is that some of them have configuration options, like "noErr= or".

If you want, you can try the attached patch.

Rasmus

--
Vote for proprietary math!

--001a113dd23ae97c41055d17738a--