From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Christian_Stra=DFer?= Subject: Mathjax export taking into account custom macros Date: Thu, 8 Sep 2011 19:20:35 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1iHc-0006xp-Ra for emacs-orgmode@gnu.org; Thu, 08 Sep 2011 13:21:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1iHb-0005gX-Ms for emacs-orgmode@gnu.org; Thu, 08 Sep 2011 13:21:00 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]:62612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1iHb-0005gQ-EL for emacs-orgmode@gnu.org; Thu, 08 Sep 2011 13:20:59 -0400 Received: by fxg9 with SMTP id 9so2106948fxg.0 for ; Thu, 08 Sep 2011 10:20:57 -0700 (PDT) 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 Hello, there is an asymmetry between the html-export of latex-formulas by means of dvipng on the one hand and by means of mathjax on the other hand. The asymmetry concerns the handling of information provided by the #+LaTeX_HEADER: parameter. The parameter is taken into account when exporting by means of dvipng, but not when exporting by means of mathjax. Let me give a small example: *Scenario 1* Say we have a file "test.org" which looks as follows: #+OPTIONS: LaTeX:dvipng #+LaTeX_HEADER: \newcommand{\vd}{\vdash} * Header 1 $\vd$ Now exporting this file into html produces a png image with the "|-" symbol. *Scenario 2* Now our file "test.org" looks as follows: #+OPTIONS: LaTeX:t #+LaTeX_HEADER: \newcommand{\vd}{\vdash} * Header 1 $\vd$ [the only change is in line 1] Exporting this file produces a html file with \vd in red (meaning mathjax doesn't have a subroutine dealing with the command "\vd"). I am not sure if this is the intended behavior. I personally would prefer if the mathjax export would take into account the commands specified in the LaTeX_HEADER. A similar scenario we get with respect to the org-export-latex-default-packages-alist. I have a small style package with all my custom definitions that is listed in org-export-latex-default-packages-alist (with snippet toggled to 't'). Again the LaTeX:dvipng option takes into account the package while the mathjax export ignores it. For the example illustrated in the two examples I used a minimal setup with the following .emacs file: (setq load-path (cons "~/.emacs.d/org-mode/lisp" load-path)) (setq load-path (cons "~/.emacs.d/org-mode/contrib/lisp" load-path)) (require 'org-install) The org-mode is an up-to-date clone from git: M-x org-version returns: Org-mode version 7.7 (release_7.7.264.gbe69) Thanks! Best, Christian