emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Berthier <nberthier@gmail.com>
To: Joseph Vidal-Rosset <joseph.vidal.rosset@gmail.com>
Cc: "Liste-emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: mathjax vs. imagemagick
Date: Mon, 04 Aug 2014 13:32:14 +0200	[thread overview]
Message-ID: <87mwbkjxs1.fsf@inria.fr> (raw)
In-Reply-To: CAD-VTcGPMZ41FQ6TEeHw=Bnu14kqx7Hxn7uY01TupJO8apKu5Q@mail.gmail.com

You wrote:

> Hello,
>
> In order to convert a tikzpicture into html webpage, one needs 
> #+OPTIONS: tex:imagemagick 
> and it means that the other equations are no more converted via
> Mathjax. 
>
> Is there a mean to combine the use of imagemagick only for
> tikzpicture, and keeping the use of Mathjax to read the other
> equations in the html file? 

Hi,

You don't need to set the tex:imagemagick option globally. With the
example bellow, the HTML export should use Mathjax to render math
fragments:

#+begin_src org
  ,#+TITLE: Test
  ,#+AUTHOR: Blah
  ,#+LATEX_CLASS: article
  ,#+LATEX_CLASS_OPTIONS: [american]
  #
  # Setup tikz package for both LaTeX and HTML export:
  ,#+LATEX_HEADER: \usepackage{tikz}
  ,#+PROPERTY: header-args:latex+ :packages '(("" "tikz"))
  #
  ,#+PROPERTY: header-args:latex+ :imagemagick (by-backend (latex nil) (t "yes"))
  ,#+PROPERTY: header-args:latex+ :exports results :fit yes
  
  ,* One Diamond
  
  ,#+name: diamond
  ,#+header: :iminoptions -density 600 -resample 100x100
  ,#+header: :file (by-backend (latex "diamond.tikz") (t "diamond.png"))
  ,#+begin_src latex :results raw file
    \begin{tikzpicture}
      \draw (1,0) -- (0,1) -- (-1,0) -- (0,-1) -- cycle;
    \end{tikzpicture}
  ,#+end_src
  
  ,#+attr_latex: :float nil :width ""
  ,#+results: diamond
  
  ,* LaTeX
  
  Inline math follows \(\left\{ x \right\}\)…
  
  ,* COMMENT setup
  
  ,#+name: setup
  ,#+begin_src emacs-lisp :results silent :exports none
    (defmacro by-backend (&rest body)
      `(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@body))
  ,#+end_src
  
  # Local variables:
  # eval: (org-sbe "setup")
  # End:
  
#+end_src

Regards,

-- 
Nicolas Berthier                                        FSF Member #7975

  reply	other threads:[~2014-08-04 11:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-03  9:28 mathjax vs. imagemagick Joseph Vidal-Rosset
2014-08-04 11:32 ` Nicolas Berthier [this message]
2014-08-04 13:50   ` 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=87mwbkjxs1.fsf@inria.fr \
    --to=nberthier@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=joseph.vidal.rosset@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).