From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Question about the math mode table exporting for latex and html Date: Tue, 07 Jan 2014 12:14:13 +0100 Message-ID: <8761pw6o3e.fsf@gmx.us> References: <87ha9gi0o1.fsf@pku.edu.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0UYb-00079M-2u for emacs-orgmode@gnu.org; Tue, 07 Jan 2014 06:10:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0UYV-0002nv-MF for emacs-orgmode@gnu.org; Tue, 07 Jan 2014 06:10:49 -0500 Received: from plane.gmane.org ([80.91.229.3]:38064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0UYV-0002nS-2N for emacs-orgmode@gnu.org; Tue, 07 Jan 2014 06:10:43 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W0UYT-0000DF-Ka for emacs-orgmode@gnu.org; Tue, 07 Jan 2014 12:10:41 +0100 Received: from 109.201.152.246 ([109.201.152.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Jan 2014 12:10:41 +0100 Received: from rasmus by 109.201.152.246 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Jan 2014 12:10:41 +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: emacs-orgmode@gnu.org Cc: n.goaziou@gmail.com Hi Bing and Nicholas, bsun@pku.edu.cn writes: > ------------------------------------------------------------------------ > #+ATTR_LATEX: :mode math :environment pmatrix :math-prefix \mathbf{H}= > | \vdots | 0 | \vdots | > | \vdots | H | \vdots | > | \vdots | 0 | \vdots | > ------------------------------------------------------------------------ > > These lines generate perfect latex code. But the html exporter omits > the #+attr_latex line (which is correct), and produces a plain text > table. I have noticed this "bug" as well, but forgot to report it since it isn't really a bug. > The question is, is it possible to export the math mode table as latex > code in html exporting? Maybe there is some option like > "#+attr_html: :mode latex"? No. AFAIK, mathjax supports amsmath matrices, e.g. the third example here¹ . Thus, we'd really just want to insert the output of org-latex-table in the html-file. Perhaps something like the following would be OK? Nicholas? #+ATTR_HTML: :mode latex #+ATTR_LATEX: :mode math :environment pmatrix :math-prefix \mathbf{H}= | \vdots | 0 | \vdots | | \vdots | H | \vdots | | \vdots | 0 | \vdots | This would tell ox-html.el to transcode the table via ox-latex-tabel and feed the string via org-html-format-latex (assuming latex-frag is a string). Of course ox-html could also check out ATTR_LATEX but this would lead to a spurious solution since LaTeX ≠ HTML IMO. Alternatively, you'd have to use one the following hooks described in ox.html (since filters would work on a transcoded elements). ;; Eventually, two hooks (`org-export-before-processing-hook' and ;; `org-export-before-parsing-hook') are run at the beginning of the ;; export process and just before parsing to allow for heavy structure ;; modifications. Nicholas, if you want I can look into this. –Rasmus Footnotes: ¹ http://www.mathjax.org/demos/tex-samples/ -- This is the kind of tedious nonsense up with which I will not put