From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: Re: tikz for multiple targets
Date: Wed, 10 Jul 2013 22:44:45 +0200 [thread overview]
Message-ID: <87ehb62lhe.fsf@med.uni-goettingen.de> (raw)
In-Reply-To: 87obaa65uu.fsf@ucl.ac.uk
Hi Eric,
Eric S Fraga <e.fraga@ucl.ac.uk> writes:
> Rasmus <rasmus@gmx.us> writes:
>
> [...]
>
>> Tikz/pgf works for the latex exporter. Just insert it as a file link
>> (with extension tikz or pgf) or as latex verbatim code.
>
> Yes, thanks. However, I guess I didn't explain very well what I was
> looking for.
>
> I use tikz all the time and typically enclose it in a #+begin_LaTeX
> ... #+end_LaTeX block. That is fine for most of my documents where I
> only wish to export to PDF via LaTeX.
>
> However, what I would like is to be able to use the same code, inline
> within the org file and not as a separate .tikz file, in some cases to
> export to both LaTeX and HTML (or ODT for that matter). The code in the
> link I posted used to do this by dynamically setting the :exports and/or
> :results options using org babel headers with emacs lisp code. A
> variation of this worked with the old exporter but doesn't with the new
> one.
>
> Thanks again,
> eric
I updated the example again. Try this:
--8<---------------cut here---------------start------------->8---
#+LATEX_HEADER: \usepackage{tikz}
* Tikz test
#+name: contents
#+header: :exports (if (and (boundp 'backend) (eq (org-export-backend-name backend) (intern "latex"))) "results" "none")
#+header: :results latex
#+begin_src latex
\begin{tikzpicture}
\node[red!50!black] (a) {A};
\node (b) [right of=a] {B};
\draw[->] (a) -- (b);
\end{tikzpicture}
#+end_src
#+header: :exports (if (and (boundp 'backend) (eq (org-export-backend-name backend) (intern "latex"))) "none" "results")
#+header: :results raw :file test.png
#+header: :imagemagick yes :iminoptions -density 600 :imoutoptions -geometry 400
#+header: :fit yes :noweb yes :headers '("\\usepackage{tikz}")
#+begin_src latex
<<contents>>
#+end_src
--8<---------------cut here---------------end--------------->8---
Regards,
Andreas
next prev parent reply other threads:[~2013-07-10 20:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-09 22:34 tikz for multiple targets Eric S Fraga
2013-07-10 9:50 ` Rasmus
2013-07-10 9:54 ` Rasmus
2013-07-10 10:16 ` Fabrice Popineau
2013-07-10 10:56 ` Eric S Fraga
2013-07-10 20:44 ` Andreas Leha [this message]
2013-07-11 6:11 ` Eric Schulte
2013-07-11 8:38 ` Rasmus
2013-07-11 16:01 ` Eric Schulte
2013-07-11 10:50 ` Andreas Leha
2013-07-11 16:07 ` Eric Schulte
2013-07-11 18:56 ` Andreas Leha
2013-07-11 19:03 ` Eric Schulte
2013-07-11 23:15 ` Andreas Leha
2013-07-11 22:33 ` Eric S Fraga
2013-07-12 0:20 ` Eric Schulte
2013-07-15 13:11 ` Eric S Fraga
2013-07-16 11:31 ` Eric S Fraga
2013-07-16 12:26 ` Andreas Leha
2013-07-16 15:18 ` Eric S Fraga
2013-07-11 7:21 ` Eric S Fraga
2013-07-11 15:58 ` Eric Schulte
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ehb62lhe.fsf@med.uni-goettingen.de \
--to=andreas.leha@med.uni-goettingen.de \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.