From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [new exporter] no \caption and \label upon export of #+BEGIN_LATEX block Date: Sat, 10 Nov 2012 23:52:26 +0100 Message-ID: <87zk2p840l.fsf@gmail.com> References: <87haoxqfq1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXJyn-0001Ty-OL for emacs-orgmode@gnu.org; Sat, 10 Nov 2012 17:56:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXJyk-0005LZ-Mf for emacs-orgmode@gnu.org; Sat, 10 Nov 2012 17:56:45 -0500 Received: from mail-wi0-f177.google.com ([209.85.212.177]:57144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXJyk-0005LV-GD for emacs-orgmode@gnu.org; Sat, 10 Nov 2012 17:56:42 -0500 Received: by mail-wi0-f177.google.com with SMTP id c10so293904wiw.12 for ; Sat, 10 Nov 2012 14:56:41 -0800 (PST) In-Reply-To: <87haoxqfq1.fsf@gmail.com> (Myles English's message of "Sat, 10 Nov 2012 22:02:14 +0000") 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: Myles English Cc: emacs-orgmode Hello, Myles English writes: > I'd like to use a tikz snippet in a few different documents and it would > be convenient to be able to include it in a latex document like so: > > #+CAPTION: a fine figure > #+NAME: figure:fine_figure > #+ATTR_LaTeX: width=5cm > #+BEGIN_LATEX > \input{/home/myles/tex/tikz_figure.tex} > #+END_LATEX > > What is exported is just the \input line, with no \label or \caption, i.e.: > > \input{/home/myles/tex/tikz_figure.tex} Well, IMO, it doesn't make much sense to add a caption or a label to an export block. Just write whatever you want within the block. I.e.: #+BEGIN_LATEX \caption{\label{figure:fine_figure}a fine figure} \input{/home/myles/tex/tikz_figure.tex} #+END_LATEX Is there any downside to it? > I believe this was possible with current (old) exporter, based on this > thread: > > http://lists.gnu.org/archive/html/emacs-orgmode/2012-10/msg00267.html This thread is about src blocks. Adding a label or a caption is fine for them. > On second thoughts, perhaps another way to do it would be to have a > source block make the tikz graphic as a standalone pdf/eps and then > insert it as a link to the file. The disadvantage of that would be that > the tikz .tex file would need to be expanded to have it's own > \begin/end{document} and would loose some flexibility. Any thoughts on > that route? I don't know. for my graphics, I use Asymptote src-blocks generating links to pdf files. E.g.: #+NAME: app #+BEGIN_SRC asymptote :file application.pdf import graph; defaultpen(fontsize(10pt)); unitsize(2cm); pen p=blue; real f(real x) { return x**2; } real g(real x) { return -x + 2; } draw(graph(f,0,1),p); draw(graph(g,1,2),p); xaxis(xmax=2.3,Ticks(Size=1mm,NoZero),Arrow(6pt)); yaxis(ymax=1.3,Ticks(step=.5,Step=1,Size=1mm,NoZero),Arrow(6pt)); label("$O$",(0,0),SW); label("$C_f$",(1.5,g(1.5)),2N,p); #+END_SRC #+BEGIN_CENTER #+RESULTS: app [[file:application.pdf]] #+END_CENTER Regards, -- Nicolas Goaziou