From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: [patch] Problems producing TikZ PNGs from LaTeX src blocks (was: Problems producing TikZ PNGs from LaTeX src blocks) Date: Sun, 30 Sep 2018 21:43:07 +0200 Message-ID: <87o9cebwl0.fsf@christianmoe.com> References: <87efdenepr.fsf@christianmoe.com> <87mus1x6ft.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6hct-00066n-DB for Emacs-orgmode@gnu.org; Sun, 30 Sep 2018 15:43:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6hco-0008AL-Dt for Emacs-orgmode@gnu.org; Sun, 30 Sep 2018 15:43:35 -0400 Received: from mailer-211-194.hitrost.net ([91.185.211.194]:29350) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g6hco-00088x-5Z for Emacs-orgmode@gnu.org; Sun, 30 Sep 2018 15:43:30 -0400 In-reply-to: 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" To: Benjamin Motz Cc: Emacs-orgmode@gnu.org Benjamin Motz writes: > It seems that the function `org-babel-execute:latex' ignores the > property :headers under certain circumstances. Therefore the line > "\usepackage{tikz}" will be missing in your resulting latex document. > > The property is not ignored if you also append the property > ":imagemagick t" to the #+header line. So you can use the following > header as a fix (for another fix, see below): > > #+header: :file "tikzpic.png" :fit yes :results raw file :exports results :headers '("\\usepackage{tikz}") :imagemagick t Thank you. When I try this workaround, I run into another issue, which may be local to my setup. When I add the :imagemagick header, Org tries to generate a PDF. This gives me a message that the file wasn't produced, but in fact a PDF with the correct image is produced -- however, it has a temporary file name, not the one I assigned to it. (The same problem occurs if I try to create file output from this or any other Babel latex block with a .pdf extension instead of .png.) It looks like Org for some reason fails to take a last step in the latex-to-PDF export -- changing the file name and cleaning up temporary files. Probably as a result of this failure, no PNG is created. I have also tried to apply your patch, without effect. Maybe I did it wrong, but it increasingly looks like I have some weird problem with my setup in addition to the issue you uncovered. Yours, Christian Moe