Hi Bing and Nicholas,

b...@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


Reply via email to