From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Problems producing TikZ PNGs from LaTeX src blocks Date: Fri, 28 Sep 2018 11:39:12 +0200 Message-ID: <87efdenepr.fsf@christianmoe.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5pVc-0001Fh-1C for Emacs-orgmode@gnu.org; Fri, 28 Sep 2018 05:56:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5pVW-0006gU-QM for Emacs-orgmode@gnu.org; Fri, 28 Sep 2018 05:56:27 -0400 Received: from mailer-211-160.hitrost.net ([91.185.211.160]:39607) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g5pVW-0006eO-IL for Emacs-orgmode@gnu.org; Fri, 28 Sep 2018 05:56:22 -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" To: Emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi, I am trying to generate a PNG file with a TikZ picture from a LaTeX src block, looking at instructions here: https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html I try this: #+header: :file "tikzpic.png" :fit yes :results raw file :exports results :headers '("\\usepackage{tikz}") #+begin_src latex \begin{tikzpicture} \draw [fill=green] (0,4) -- (3,0) -- (-3,0) -- cycle; \end{tikzpicture} #+end_src Expected result: A tikzpic.png image of a green triangle. Actual result: A tikzpic.png image (attached) that only shows the line of TikZ code. It seems that the :headers argument isn't working. If I add a #+LATEX_HEADER: \usepackage{tikz} line to my document, I can export latex blocks as well as latex src blocks as drawings within an exported PDF. But exporting the image as a PNG file continues to fail (in this case, for some reason, the above src block results in an empty image, no longer showing either the code or the intended picture). What might I be missing? Yours, Christian --=-=-= Content-Type: image/png Content-Disposition: attachment; filename=tikzpic.png Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAOcAAAAOCAMAAADjYftYAAAAM1BMVEX///8AAADAwMDw8PDQ0NBQ UFDg4OBAQECAgIAgICBgYGBwcHCgoKAQEBCwsLAwMDCQkJBCSZ99AAAACXBIWXMAAA7EAAAOxAGV Kw4bAAAC7klEQVRIDZ1Wi7KrIAxMEZAqx/L/X3t3E0CqtnVuZooQNo9NkCoPN4mIdxww4++u+CU1 6JXZ5Nvu+LyP/JjLteMxiM3fQj2g8yFOQfKf09/Z4JMmNZ4byhTztu3Agqkb1m1HkWVtO9XoCimE UuI9uIGHkXx2Ic/ZSQz64PS+dJ4LbOAgt/SlzPRC9UGomqPMFdmMLpDd+ib8EIhxRi6VJ1HUv+2d Td81jeeG7rlVZFJ2wETjWTrvZkekhCgLn4PRGSkKJegenMiDvHEBz/Rc0ooUzzyd27bkc9hKFq/n UsccnGNmjWdCgXTOokEm55Sxa+fa1BiJhEzBroFudEY26F14zG6d8ryKCzidXCgfyzps0vqJZ+WJ LE2m+JLpiYxeZUt4gWX1NkIh8rfznIHpKSOxLMaz95fJqhCJ+6BYO3ejM1IMehdOB2j8Csebniss wKfme8lTE9LBwxh0tABlQQ+TjargQaj9YvMGnrjBjadYV7VqUT2qArOCUw7ZjWzD6rtDvXO6+A0v lkp8Ck5MXYBnzRehzv3UDGwITq8WNto4VWZUHHhmBnqqWU5peSYm2GiZt6rwqLljWDS+G52QagtP 7h68JoYO9FzZjaa+4rmfWxwBFdLihSzRxmM/17rvcW0W/des76d1zZzoSGR5gSAqAiTd0UhvsQHG KaGUe/DIQqG0Gbez1AXSrvkiFAqbn0tMj8QHf+rdhjDPeKuhRMwtOxxIHatBr1bOgCc3rbD907TR T6hUP7gzzVS2LaAaRFajC2RX3YRbevW/rGdZs0YoO0BvyfQFexNZoA/STsWkfYvWgNoGmuDOO4gh 9esLTcRmNTojxaC0vwVvgYbwTYWn+8qT/REdBpNh2niKvoy2MXyURbsbBgM0cK/aD+QIpYtfcGJC /d/ifBTYfusnPnBcvvxKNSedZ3uRod55DMoh5v7p8At5sP8JRxCvH+tDtDqFLV+6/xRvl75aXzi5 UBF6ob5QfXL6wYPCvw3/AB32FfFigaGQAAAAAElFTkSuQmCC --=-=-=--