emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Cc: n.goaziou@gmail.com
Subject: Re: Question about the math mode table exporting for latex and html
Date: Tue, 07 Jan 2014 12:14:13 +0100	[thread overview]
Message-ID: <8761pw6o3e.fsf@gmx.us> (raw)
In-Reply-To: 87ha9gi0o1.fsf@pku.edu.cn

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

  reply	other threads:[~2014-01-07 11:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07  9:47 Question about the math mode table exporting for latex and html bsun
2014-01-07 11:14 ` Rasmus [this message]
2014-01-07 16:39   ` Nicolas Goaziou
2014-01-07 21:17     ` Rick Frankel
2014-01-09 10:53       ` Nicolas Goaziou
2014-01-18 20:40     ` Rasmus
2014-01-21 17:48       ` Nicolas Goaziou
2014-01-07 12:55 ` puzzling org-mime-htmlize Joseph Vidal-Rosset
2014-01-07 13:37   ` Nick Dokos
2014-01-07 13:49     ` Joseph Vidal-Rosset
2014-01-08  7:28   ` Fwd: " Joseph Vidal-Rosset
2014-01-08 12:13     ` Nick Dokos
2014-01-08 12:56       ` Joseph Vidal-Rosset
2014-01-08 15:29         ` Nick Dokos
2014-01-08 15:43           ` Josiah Schwab
2014-01-08 17:42           ` Joseph Vidal-Rosset
2014-01-08 17:46             ` Bastien
2014-01-08 17:55               ` Joseph Vidal-Rosset
2014-01-08 23:41                 ` Bastien
2014-01-09  9:03                   ` Joseph Vidal-Rosset
2014-01-08 18:52             ` Nick Dokos
2014-01-08 18:50           ` Joseph Vidal-Rosset
2014-01-08 18:56             ` Joseph Vidal-Rosset
2014-01-08 19:23             ` Nick Dokos
2014-01-08 20:19               ` Joseph Vidal-Rosset
2014-01-08 20:36                 ` Joseph Vidal-Rosset

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761pw6o3e.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).