From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: Problems with LaTeX source block Date: Mon, 15 Jul 2013 10:57:17 +0200 Message-ID: <87wqos42vm.fsf@med.uni-goettingen.de> References: <8761wcjk5y.fsf@free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyebA-0007Q7-L3 for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 04:57:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uyeb7-0002UP-2d for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 04:57:36 -0400 Received: from plane.gmane.org ([80.91.229.3]:47590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uyeb6-0002UJ-SG for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 04:57:32 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Uyeb4-0001hc-AD for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 10:57:30 +0200 Received: from genepi110.genepi.med.uni-goettingen.de ([134.76.140.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Jul 2013 10:57:30 +0200 Received: from andreas.leha by genepi110.genepi.med.uni-goettingen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Jul 2013 10:57:30 +0200 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: emacs-orgmode@gnu.org Hi Julien, Julien Cubizolles writes: > I'm struggling with LaTeX source blocks and am not sure anymore if one > can use the :results file header. > > I have a csv file to be processed by tikz to get a png picture displayed > in my org buffer. > > Here is what I tried > > #+NAME: python-tikz > #+header: :results file :file py2tikz_sin.png > #+header: :fit yes :headers '("\\usepackage{tikz,pgfplots}") > #+BEGIN_SRC latex :exports results > \begin{tikzpicture} > \begin{axis} > \addplot table {sin_py2csv.csv}; > \end{axis} > \end{tikzpicture} > 'py2tikz_sin.png' > #+END_SRC > > #+RESULTS: python-tikz > #+BEGIN_LaTeX > [[file:py2tikz_sin.png]] > #+END_LaTeX > > Two problems with that: the py2tikz_sin.png file isn't produced (the > latex code is correct though) and I was under the impression that the > :results file header should give a #RESULTS without the LaTeX block > (it's what I get for python blocks anyway). > > The data is produced by python (I can get python-babel to work !) and I > could get a png directly through python-babel but latex-babel should be > able to do it, right ? > > Julien. try that instead --8<---------------cut here---------------start------------->8--- #+NAME: python-tikz #+header: :results raw :file py2tikz_sin.png #+header: :imagemagick yes :fit yes :headers '("\\usepackage{tikz,pgfplots}") #+BEGIN_SRC latex :exports results \begin{tikzpicture} \node[red!50!black] (a) {A}; \node (b) [right of=a] {B}; \draw[->] (a) -- (b); \end{tikzpicture} #+END_SRC --8<---------------cut here---------------end--------------->8--- for problem one: you are missing the :imagemagick yes header argument, which is necessary to do the latex->png conversion. Also, the filename is inserted for you and is, thus, not part of the latex block. for problem two: :results raw solves that, although I agree, that :results file should work here. Regards, Andreas