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 23:06:34 +0200 Message-ID: <874nbv4jol.fsf@med.uni-goettingen.de> References: <8761wcjk5y.fsf@free.fr> <87wqos42vm.fsf@med.uni-goettingen.de> <87oba4gly6.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]:38286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uypyt-0008Ie-FF for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 17:06:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uypyq-0006kq-3W for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 17:06:51 -0400 Received: from plane.gmane.org ([80.91.229.3]:40816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uypyp-0006km-Sn for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 17:06:48 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Uypyp-0000G1-54 for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 23:06:47 +0200 Received: from vpn-2057.gwdg.de ([134.76.2.57]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Jul 2013 23:06:47 +0200 Received: from andreas.leha by vpn-2057.gwdg.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Jul 2013 23:06:47 +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: > Hi Andreas > > Andreas Leha writes: > >> try that instead >> >> #+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 > > > >> 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. > > Thanks for clarifying it, in the worg page: > The standard :file header argument associated with a LaTeX source code > block by itself can take the name of either a Portable Network Graphics > (png) or a Portable Document Format (pdf) file. File names for other > bitmap file types can be supplied in conjunction with the :imagemagick > header argument, described below. > the "other bitmap file types" led me to believe that imagemagick was not > needed for png. Indeed, I forgot about that possibility. I think that was introduced to support much simpler 'formulas' -- the same way that latex snippets are supported. But still, it should work, I guess, with tikz code as well. As to my understanding, if you do not explicitly specify the :imagemagick header, internally (org-create-formula-image ) is called which might run through dvipng -- depending on your setting of org-latex-create-formula-image-program. I guess, that you have set this to dvipng. In that case tikz is going to fail as it does not work with 'plain' latex. But interestingly, I do not see the \usepackage{tikz} in the generated /tmp/....tex file at all when the :imagemagick yes header argument is missing. So there is an issue there as well. At this point I hope, that more knowledgeable people chime in and clarify, whether there is some intentional limitation on latex blocks without the :imagemagick yes header argument. > >> for problem two: :results raw solves that, although I agree that >> :results file should work here. > > If it were to work, what would be the difference ? Would I need to add a > command in the LaTeX code to print the name of the file I want to link > to ? > I actually expected the behaviour that we see with 'raw' to be the same with 'file' -- without any change to the code of the latex block. Regards, Andreas