emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Christian Straßer" <christian.strasser@ugent.be>
To: emacs-orgmode@gnu.org
Subject: Mathjax export taking into account custom macros
Date: Thu, 8 Sep 2011 19:20:35 +0200	[thread overview]
Message-ID: <CAJEGfDckKO+_b=TEvX4K+Z44q7tPV7EOWGHYWWYOALiF4cPJaw@mail.gmail.com> (raw)

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

                 reply	other threads:[~2011-09-08 17:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAJEGfDckKO+_b=TEvX4K+Z44q7tPV7EOWGHYWWYOALiF4cPJaw@mail.gmail.com' \
    --to=christian.strasser@ugent.be \
    --cc=emacs-orgmode@gnu.org \
    /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).