emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* mathjax vs. imagemagick
@ 2014-08-03  9:28 Joseph Vidal-Rosset
  2014-08-04 11:32 ` Nicolas Berthier
  0 siblings, 1 reply; 3+ messages in thread
From: Joseph Vidal-Rosset @ 2014-08-03  9:28 UTC (permalink / raw)
  To: Liste-emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 339 bytes --]

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?

Best wishes

Jo.

[-- Attachment #2: Type: text/html, Size: 450 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mathjax vs. imagemagick
  2014-08-03  9:28 mathjax vs. imagemagick Joseph Vidal-Rosset
@ 2014-08-04 11:32 ` Nicolas Berthier
  2014-08-04 13:50   ` Joseph Vidal-Rosset
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Berthier @ 2014-08-04 11:32 UTC (permalink / raw)
  To: Joseph Vidal-Rosset; +Cc: Liste-emacs-orgmode@gnu.org

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mathjax vs. imagemagick
  2014-08-04 11:32 ` Nicolas Berthier
@ 2014-08-04 13:50   ` Joseph Vidal-Rosset
  0 siblings, 0 replies; 3+ messages in thread
From: Joseph Vidal-Rosset @ 2014-08-04 13:50 UTC (permalink / raw)
  To: Nicolas Berthier; +Cc: Liste-emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 2286 bytes --]

Many thanks for this help Nicolas. I do not succeed  to adapt your example
to my file. I am afraid that it is too complicated for me.

I meet always difficulties with html export, and now it is a failure of
bibtex2html...

Thanks again

Best regards

Jo.


2014-08-04 13:32 GMT+02:00 Nicolas Berthier <nberthier@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
>

[-- Attachment #2: Type: text/html, Size: 3064 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-04 13:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-03  9:28 mathjax vs. imagemagick Joseph Vidal-Rosset
2014-08-04 11:32 ` Nicolas Berthier
2014-08-04 13:50   ` Joseph Vidal-Rosset

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).