From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Huszagh Subject: babel latex headers and image generation commands Date: Mon, 03 Feb 2020 23:39:06 -0800 Message-ID: <874kw6ztr9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:41521) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iysnk-0001wa-Gh for emacs-orgmode@gnu.org; Tue, 04 Feb 2020 02:39:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iysnj-0005IS-6k for emacs-orgmode@gnu.org; Tue, 04 Feb 2020 02:39:16 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:36986) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iysni-00059G-W2 for emacs-orgmode@gnu.org; Tue, 04 Feb 2020 02:39:15 -0500 Received: by mail-pl1-x631.google.com with SMTP id c23so6921416plz.4 for ; Mon, 03 Feb 2020 23:39:14 -0800 (PST) Received: from ryzen3950 (c-98-210-127-71.hsd1.ca.comcast.net. [98.210.127.71]) by smtp.gmail.com with ESMTPSA id b11sm16120624pgg.13.2020.02.03.23.39.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2020 23:39:11 -0800 (PST) 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: "emacs-orgmode@gnu.org" I spent some time today trying to get latex babel source blocks to work for me and discovered that calling `org-babel-execute:latex` ignores the :headers header if the output file is a png without setting imagemagick to t. It's easy to see this in the source code: the conditions mentioned above leads to calling org-create-formula-image without passing in the headers. I think this is a bug, although maybe I missed it somewhere in the documentation? Here's a MWE if you want it #+header: :file "test.png" #+header: :headers '("\\def\\hello{hello}") #+begin_src latex :results output file link \hello #+end_src doesn't work, but #+header: :file "test.png" #+header: :imagemagick t #+header: :headers '("\\def\\hello{hello}") #+begin_src latex :results output file link \hello #+end_src does. However, this got me thinking that I wish executing latex blocks behaved a bit more like latex fragment previews. Particularly, the ability to customize `image-converter`. So, I'm thinking about adding a customization option that allows a user to use the image-converter portion of an existing org-preview-latex-process-alist entry (I guess the most obvious choice would be org-preview-latex-default-process). Although I guess I could just add a new variable like what we have with org-latex-pdf-process. Maybe that's better since we'd only be using one part of the latex-process-alist. What are people's thoughts on this?