From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giovanni Ridolfi Subject: problems with mathjax CDN and HTML export Date: Mon, 07 Nov 2011 17:02:31 +0100 Message-ID: <83obwnkjjc.fsf@yahoo.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNReW-0004ML-Fa for emacs-orgmode@gnu.org; Mon, 07 Nov 2011 11:02:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNReR-0004EG-Bu for emacs-orgmode@gnu.org; Mon, 07 Nov 2011 11:02:28 -0500 Received: from nm3.bullet.mail.ukl.yahoo.com ([217.146.182.224]:24904) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RNReR-0004E0-4Z for emacs-orgmode@gnu.org; Mon, 07 Nov 2011 11:02:23 -0500 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Jambunathan K Hello everybody, I have a problem with HTML export and Mathjax. On the Mathjax site it is written that:" There are two ways to access MathJax: the easiest way is to use the copy of MathJax available from our distributed network service at cdn.mathjax.org, [and some lines below: "We recommend using the CDN service"] but you can also download and install a copy of MathJax on your own server, or for use locally on your own hard disk (with no need for network access)." So I went for the CDN service. Incidentally, if it worked, we could drop the http://orgmode.org/mathjax/MathJax.js support. In the section "Putting mathematics in a web page" of the [[http://www.mathjax.org/docs/1.1/start.html#putting-mathematics-in-a-web-page][Mathjax documentation]] it is written that: "To put mathematics in your web page, you can use either TeX and LaTeX notation or MathML notation or both within the same page;" and this is done putting two scripts in the html file[1] "The default math delimiters are $$...$$ and \[...\] for displayed mathematics, and \(...\) for in-line mathematics." Now if I try to export to HTML the following file -------------------------------------- -*- mode: org -*- * mathjax test :PROPERTIES: :EXPORT_TITLE: :EXPORT_FILE_NAME: 000000-bbbbb.html :EXPORT_OPTIONS: H:3 num:nil toc:nil \n:t @:t ::t |:t ^:t f:nil *:t tags:nil TeX:t LaTeX:nil skip:t p:nil author:nil email:nil creator:nil timestamp:t :END: #+STYLE: #+STYLE: #+MATHJAX: align:"left" mathml:t path:"https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js" ** Test *** $$ $$ \alpha = \frac{1}{L_{0}} \left( \frac{L_2-L_1}{T_2-T_1} \right) = \frac{1}{L_0}\frac{\Delta L}{\Delta T} $$ *** @$$ @$$ \alpha = \frac{1}{L_{0}} \left( \frac{L_2-L_1}{T_2-T_1} \right) = \frac{1}{L_0}\frac{\Delta L}{\Delta T} @$$ #+END_SRC *** #+BEGIN_HTML #+BEGIN_HTML $$ \alpha = \frac{1}{L_{0}} \left( \frac{L_2-L_1}{T_2-T_1} \right) = \frac{1}{L_0}\frac{\Delta L}{\Delta T} $$ #+END_HTML *** nothing u(\alpha) = \delta\alpha = { \Bigg( \left[\frac{-(\Delta L+c)}{L_{0}\cdot (T_1 -T_0)^{2}} \delta T_1 \right]^2 + --------------------------------------------------------------------------------------------- the math snippets are always "converted" in HTML format e.g.: α = \frac{1}{L0} :-( unless they're inside the #+BEGIN_HTML block. Is there another way to tell the HTML exporter to copy verbatim the lines inside the math delimiters? cheers, Giovanni [1] C-h v org-export-html-mathjax-options : org-export-html-mathjax-options is a variable defined in `org-html.el'. Its value is ((path "http://orgmode.org/mathjax/MathJax.js") (scale "100") (align "center") (indent "2em") (mathml nil)) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: problems with mathjax CDN and HTML export Date: Mon, 07 Nov 2011 21:47:58 +0100 Message-ID: <4EB843FE.4050706@christianmoe.com> References: <83obwnkjjc.fsf@yahoo.it> Reply-To: mail@christianmoe.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:42399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNW3j-0001nD-Sd for emacs-orgmode@gnu.org; Mon, 07 Nov 2011 15:44:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNW3i-0006yX-RG for emacs-orgmode@gnu.org; Mon, 07 Nov 2011 15:44:47 -0500 Received: from b1.hitrost.net ([91.185.211.67]:50643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNW3i-0006wH-MD for emacs-orgmode@gnu.org; Mon, 07 Nov 2011 15:44:46 -0500 In-Reply-To: <83obwnkjjc.fsf@yahoo.it> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Giovanni Ridolfi Cc: emacs-orgmode@gnu.org, Jambunathan K On 11/7/11 5:02 PM, Giovanni Ridolfi wrote: > the math snippets are always "converted" in HTML format e.g.:α = \frac{1}{L0} Do I understand correctly that this is your problem? (Not very clear from your long example, which starts with the CDN service.) If so, I can't reproduce it. Your $$ \alpha = \frac{1}{L_{0}} \left( \frac{L_2-L_1}{T_2-T_1} \right) = \frac{1}{L_0}\frac{\Delta L}{\Delta T} $$ exports verbatim for me, and is correctly formatted. Yours, Christian From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giovanni Ridolfi Subject: Re: problems with mathjax CDN and HTML export Date: Tue, 08 Nov 2011 17:09:17 +0100 Message-ID: <83ty6ek34i.fsf@yahoo.it> References: <83obwnkjjc.fsf@yahoo.it> <4EB843FE.4050706@christianmoe.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:43592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNoEc-0003Sm-79 for emacs-orgmode@gnu.org; Tue, 08 Nov 2011 11:09:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNoEX-0000eK-Lt for emacs-orgmode@gnu.org; Tue, 08 Nov 2011 11:09:14 -0500 Received: from nm6-vm0.bullet.mail.ukl.yahoo.com ([217.146.183.234]:30658) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RNoEX-0000eC-7L for emacs-orgmode@gnu.org; Tue, 08 Nov 2011 11:09:09 -0500 In-Reply-To: <4EB843FE.4050706@christianmoe.com> (Christian Moe's message of "Mon, 07 Nov 2011 21:47:58 +0100") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: mail@christianmoe.com Cc: emacs-orgmode@gnu.org, Jambunathan K Christian Moe writes: Hi Christian, thank you for checking, > On 11/7/11 5:02 PM, Giovanni Ridolfi wrote: >> the math snippets are always "converted" in HTML format e.g.:α = \frac{1}{L0} > > Do I understand correctly that this is your problem? yes. > (Not very clear > from your long example, which starts with the CDN service.) sorry for that > > If so, I can't reproduce it. Your > > $$ > \alpha = \frac{1}{L_{0}} \left( \frac{L_2-L_1}{T_2-T_1} \right) > = \frac{1}{L_0}\frac{\Delta L}{\Delta T} > $$ > > exports verbatim for me, and is correctly formatted. I tried. Yes and no. Yes, You're right. It is exported correctly and correctly formatted if you export only *this* subheading. The subheading "** $$". But, if you export the whole subtree, from the "* mathjax test " heading, the equation is "converted" in HTML format e.g.:α = \frac{1}{L0} Giovanni From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: problems with mathjax CDN and HTML export Date: Wed, 09 Nov 2011 10:09:39 +0100 Message-ID: <4EBA4353.8050106@christianmoe.com> References: <83obwnkjjc.fsf@yahoo.it> <4EB843FE.4050706@christianmoe.com> <83ty6ek34i.fsf@yahoo.it> Reply-To: mail@christianmoe.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:43961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RO46x-0007Cv-JD for emacs-orgmode@gnu.org; Wed, 09 Nov 2011 04:06:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RO46w-0000pO-Ja for emacs-orgmode@gnu.org; Wed, 09 Nov 2011 04:06:23 -0500 Received: from b1.hitrost.net ([91.185.211.67]:54880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RO46w-0000l7-ET for emacs-orgmode@gnu.org; Wed, 09 Nov 2011 04:06:22 -0500 In-Reply-To: <83ty6ek34i.fsf@yahoo.it> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Giovanni Ridolfi Cc: emacs-orgmode@gnu.org, Jambunathan K On 11/8/11 5:09 PM, Giovanni Ridolfi wrote: > Yes, You're right. It is exported correctly and correctly formatted > if you export only *this* subheading. The subheading "** $$". > > But, if you export the whole subtree, from the > "* mathjax test " heading, the equation is > "converted" in HTML format e.g.:α = \frac{1}{L0} > > Giovanni Ah, I see. The problem is that the "$$" in the subheading is interpreted as an unclosed math snippet. (Interesting that it's still exported as a heading.) After that, math closes when it should open. Try closing the subheading: "* $$ $$" and exporting again. Getting "$$" as a subheading is not quite straightforward, but the following will work. Create a user-defined dollar-sign entity (org doesn't have one by default): (setq org-entities-user '(("dollar" "\\$" nil "$" "$" "$" "$"))) Now "* \dollar\dollar" should work. Yours, Christian From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giovanni Ridolfi Subject: Re: SOLVED problems with mathjax CDN and HTML export Date: Wed, 09 Nov 2011 15:56:23 +0100 Message-ID: <83ty6dpco8.fsf_-_@yahoo.it> References: <83obwnkjjc.fsf@yahoo.it> <4EB843FE.4050706@christianmoe.com> <83ty6ek34i.fsf@yahoo.it> <4EBA4353.8050106@christianmoe.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RO9Zf-0002Kj-ND for emacs-orgmode@gnu.org; Wed, 09 Nov 2011 09:56:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RO9Zb-0005zi-TB for emacs-orgmode@gnu.org; Wed, 09 Nov 2011 09:56:23 -0500 Received: from nm20.bullet.mail.ukl.yahoo.com ([217.146.183.194]:28338) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RO9Zb-0005zW-K3 for emacs-orgmode@gnu.org; Wed, 09 Nov 2011 09:56:19 -0500 In-Reply-To: <4EBA4353.8050106@christianmoe.com> (Christian Moe's message of "Wed, 09 Nov 2011 10:09:39 +0100") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: mail@christianmoe.com Cc: emacs-orgmode@gnu.org Christian Moe writes: Hi, Christian, thank you for cheching again.... well *MY* mistake was setting the option: :EXPORT_OPTIONS: H:3 num:nil toc:nil \n:t @:t ::t |:t ^:t f:nil *:t tags:nil TeX:t LaTeX:nil ^^^^^^ Consequently the LaTeX fragments are "converted" in HTML format e.g.: u(α) = δα = {\left( \left[\frac{-(Δ L+c)}{L0⋅ [...] Why not, since I set this option? :-( Sorry for the noise and thank you again for your time, Giovanni