From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Xiaolong Zhang (HKUCS)" Subject: How to specify the output format for each LaTeX fragment when exporting to HTML? Date: Fri, 23 Jan 2015 16:55:48 +0800 Message-ID: <54C20C94.10004@cs.hku.hk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020008050200050000050203" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEa2C-0001C0-QP for emacs-orgmode@gnu.org; Fri, 23 Jan 2015 03:56:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEa28-0006mR-P9 for emacs-orgmode@gnu.org; Fri, 23 Jan 2015 03:56:08 -0500 Received: from mail.cs.hku.hk ([147.8.176.10]:36346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEa28-0006lo-6R for emacs-orgmode@gnu.org; Fri, 23 Jan 2015 03:56:04 -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 This is a multi-part message in MIME format. --------------020008050200050000050203 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi List, When I'm exporting LaTeX fragments to HTML, there is a per file option: > #+OPTIONS: tex:tDo the right thing automatically (MathJax) > #+OPTIONS: tex:nilDo not process LaTeX fragments at all > #+OPTIONS: tex:verbatimVerbatim export, for jsMath or so I like the default (MathJax) way since it looks much better. However, MathJax can't render everything in LaTeX such as the "algorithmic" package. For large fragments, I use the method described in http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html by using org-babel to export a png file and include it in the resulting HTML file. This works good now when I set the global TeX export option to MathJax, and manually make fragments that Mathjax can't render as images. However when the formula is simple, this is not a good solution. For example, \coloneqq is a command from package "mathtools", which MathJax doesn't support currently. Using the org-babel solution will not only make the source code messy, but also can't make the image inline. (Maybe it can, how?) I can set #+OPTIONS: tex:dvipng such that formula $a \coloneqq b$ can rendered inline, without much extra work. So I'm wondering whether I can specify some of the fragments exporting as images, while use MathJax for the rest. An example file is attached. If there is any solution/workaround, please let me know. Thanks for your reading! Best regards, Xiaolong --------------020008050200050000050203 Content-Type: text/plain; charset=UTF-8; name="test.org" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.org" IytPUFRJT05TOiB0ZXg6dAoKJGEgPSB4IFx0aW1lcyB5JCBpcyByZW5kZXJlZCBhcyBNYXRo amF4LgokYSBcY29sb25lcXEgYiQgaXMgcmVuZGVyZWQgd3JvbmcuCgpGb3IgbGFyZ2UgZW52 aXJvbm1lbnQsIHVzZSBvcmcgYmFiZWwgZm9yIHJlbmRlcmluZy4KIytoZWFkZXI6IDpleHBv cnRzIHJlc3VsdHMgOmZpbGUgdGVzdC5wbmcgOnJlc3VsdHMgdmFsdWUgcmF3IGZpbGUgYXBw ZW5kCiMraGVhZGVyOiA6aW1hZ2VtYWdpY2sgeWVzIDppbWlub3B0aW9ucyAtZGVuc2l0eSA2 MDAgIC10cmltIDppbW91dG9wdGlvbnMgLWdlb21ldHJ5IDQwMCAKIytoZWFkZXI6IDpmaXQg eWVzIDpoZWFkZXJzICcoIlxcdXNlcGFja2FnZXthbGdvcml0aG1pY30iKQojK2JlZ2luX3Ny YyBsYXRleApcYmVnaW57YWxnb3JpdGhtaWN9ClxSRVBFQVQKXFNUQVRFICQgXHRoZXRhX2og XGNvbG9uZXFxIFx0aGV0YV9qIC0gXGFscGhhIFxmcmFje1xwYXJ0aWFsfXtccGFydGlhbCBc dGhldGFfan0gSihcdGhldGFfMCxcdGhldGFfMSkgJCBcQ09NTUVOVHtmb3IgXChqID0gMFwp IGFuZCBcKGogPSAxXCl9ClxVTlRJTHtjb252ZXJnZW5jZX0KXGVuZHthbGdvcml0aG1pY30K IytlbmRfc3JjCgoKCgo= --------------020008050200050000050203--