From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joseph Vidal-Rosset Subject: Re: mathjax vs. imagemagick Date: Mon, 4 Aug 2014 15:50:44 +0200 Message-ID: References: <87mwbkjxs1.fsf@inria.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf307f31c8b7551904ffce079c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEIfL-0000kM-7g for emacs-orgmode@gnu.org; Mon, 04 Aug 2014 09:51:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEIfJ-0005ke-Fl for emacs-orgmode@gnu.org; Mon, 04 Aug 2014 09:51:07 -0400 Received: from mail-vc0-x22b.google.com ([2607:f8b0:400c:c03::22b]:41351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEIfJ-0005ka-9f for emacs-orgmode@gnu.org; Mon, 04 Aug 2014 09:51:05 -0400 Received: by mail-vc0-f171.google.com with SMTP id hq11so11037698vcb.2 for ; Mon, 04 Aug 2014 06:51:04 -0700 (PDT) In-Reply-To: <87mwbkjxs1.fsf@inria.fr> 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: Nicolas Berthier Cc: "Liste-emacs-orgmode@gnu.org" --20cf307f31c8b7551904ffce079c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 : > 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\}\)=E2=80=A6 > > ,* 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 > --20cf307f31c8b7551904ffce079c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Many thanks for this help Nicolas. I do not= succeed=C2=A0 to adapt your example to my file. I am afraid that it is too= complicated for me.

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

Thanks again

Best regards

Jo.


2014-08-04 13:32 G= MT+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
=C2=A0 ,#+TITLE: Test
=C2=A0 ,#+AUTHOR: Blah
=C2=A0 ,#+LATEX_CLASS: article
=C2=A0 ,#+LATEX_CLASS_OPTIONS: [american]
=C2=A0 #
=C2=A0 # Setup tikz package for both LaTeX and HTML export:
=C2=A0 ,#+LATEX_HEADER: \usepackage{tikz}
=C2=A0 ,#+PROPERTY: header-args:latex+ :packages '(("" "= tikz"))
=C2=A0 #
=C2=A0 ,#+PROPERTY: header-args:latex+ :imagemagick (by-backend (latex nil)= (t "yes"))
=C2=A0 ,#+PROPERTY: header-args:latex+ :exports results :fit yes

=C2=A0 ,* One Diamond

=C2=A0 ,#+name: diamond
=C2=A0 ,#+header: :iminoptions -density 600 -resample 100x100
=C2=A0 ,#+header: :file (by-backend (latex "diamond.tikz") (t &qu= ot;diamond.png"))
=C2=A0 ,#+begin_src latex :results raw file
=C2=A0 =C2=A0 \begin{tikzpicture}
=C2=A0 =C2=A0 =C2=A0 \draw (1,0) -- (0,1) -- (-1,0) -- (0,-1) -- cycle;
=C2=A0 =C2=A0 \end{tikzpicture}
=C2=A0 ,#+end_src

=C2=A0 ,#+attr_latex: :float nil :width ""
=C2=A0 ,#+results: diamond

=C2=A0 ,* LaTeX

=C2=A0 Inline math follows \(\left\{ x \right\}\)=E2=80=A6

=C2=A0 ,* COMMENT setup

=C2=A0 ,#+name: setup
=C2=A0 ,#+begin_src emacs-lisp :results silent :exports none
=C2=A0 =C2=A0 (defmacro by-backend (&rest body)
=C2=A0 =C2=A0 =C2=A0 `(case (if (boundp 'backend) (org-export-backend-n= ame backend) nil) ,@body))
=C2=A0 ,#+end_src

=C2=A0 # Local variables:
=C2=A0 # eval: (org-sbe "setup")
=C2=A0 # End:

#+end_src

Regards,

--
Nicolas Berthier =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0FSF Member #7975

--20cf307f31c8b7551904ffce079c--