From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: tikz for multiple targets Date: Tue, 16 Jul 2013 12:31:12 +0100 Message-ID: <87vc4ahhbz.fsf@ucl.ac.uk> References: <87k3kztlam.fsf@ucl.ac.uk> <87wqoyagmh.fsf@gmx.us> <87obaa65uu.fsf@ucl.ac.uk> <87ehb62lhe.fsf@med.uni-goettingen.de> <878v1d7his.fsf@gmail.com> <878v1ds73o.fsf@med.uni-goettingen.de> <87ehb55bcn.fsf@gmail.com> <87zjtspvzr.fsf@ucl.ac.uk> <87y59c39yc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uz3TZ-0005L5-Be for emacs-orgmode@gnu.org; Tue, 16 Jul 2013 07:31:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uz3TX-0001ae-JW for emacs-orgmode@gnu.org; Tue, 16 Jul 2013 07:31:25 -0400 Received: from mail-db9lp0249.outbound.messaging.microsoft.com ([213.199.154.249]:49209 helo=db9outboundpool.messaging.microsoft.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uz3TX-0001aC-Aw for emacs-orgmode@gnu.org; Tue, 16 Jul 2013 07:31:23 -0400 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: Eric Schulte Cc: emacs-orgmode@gnu.org Hi Eric et al., I now have a system I am happy with mostly for using LaTeX code blocks heading to multiple export targets. The solution I am using is a combination of what has been discussed in this thread (by-backend customisation of headers for babel) and using noweb substitution for the main content. I have two LaTeX babel source blocks, one for PDF export and the other for HTML export. Each of these has a tikzpicture environment which then includes the actual instructions for drawing brought in using noweb. The problem I have remaining is how to get the version used to export to PDF via LaTeX to use a figure environment with captioning. I had thought that something along these lines would work: #+begin_src org ,#+name: picturecontents ,#+begin_src latex :noweb yes :exports none \node[red!50!black] (a) {A}; \node (b) [right of=a] {B}; \draw[->] (a) -- (b); ,#+end_src ,#+name: flowdiagram ,#+header: :exports (if (and (boundp 'backend) (eq (org-export-backend-name backend) (intern "latex"))) "results" "none") ,#+header: :results latex ,#+header: :noweb yes ,#+begin_src latex \begin{tikzpicture} <> \end{tikzpicture} ,#+end_src ,#+caption: Testing figure caption for figure going to multiple destinations ,#+results: flowdiagram #+end_src as I expected the export to put the results of the flowdiagram code block after the results line. This doesn't work: the exported LaTeX has no figure environment etc. The diagram does come out but it is placed directly into the document. I hope this all makes sense? Any suggestions? thanks, eric -- : Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.0.5-337-g9f3bed