From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id xq/vIJNvJWRPKAEASxT56A (envelope-from ) for ; Thu, 30 Mar 2023 13:16:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MAUpH5NvJWTBLwAAG6o9tA (envelope-from ) for ; Thu, 30 Mar 2023 13:16:35 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E68CB282F5 for ; Thu, 30 Mar 2023 13:16:34 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phqFu-00089v-C9; Thu, 30 Mar 2023 07:15:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phqFp-00089U-D5 for emacs-orgmode@gnu.org; Thu, 30 Mar 2023 07:15:42 -0400 Received: from mailer-211-160.hitrost.net ([91.185.211.160]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phqFm-0004RE-Rh for emacs-orgmode@gnu.org; Thu, 30 Mar 2023 07:15:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=christianmoe.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: In-reply-to:Subject:To:From:References:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=pySNYtFZeOz9ikcUpRI+Y1pPgkRsTwQuzV+Vw3AEpJs=; b=E2M1nhz/69ACoK8iWbRRxZAsih XJBI3he8s63okUO9ckvg85toK3KD8JOYj/p2w/gXapEcmKHVpn+k1vO2oo4QZJb046fi0nuXR4w9P kP1Xi5lwWWT4J6IIMT6mVv9PkGnKAZQ7e4LjNdOg1DQE5RRQmSdoZQLndJQAEBzK2KfVWmEkKXTjw 9H2z6WaU7d4+92CnHcjQircSEqleIiK7ALC68lea+VDA66tFRi3Al4y61mHntHQJtNfZDXBzUsvoi mZ3USH10EcRl8osz5voSsHviioO+EsLzK71w1cQW7WPrCrsgy8knvSzdiZDn4Wso6Iu7cgg2jL62H ueDJEHBQ==; Received: from 92-63-16-127.dynamic.telemach.net ([92.63.16.127] helo=Tauriel) by b1.hitrost.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1phqFj-001oQe-0t; Thu, 30 Mar 2023 13:15:35 +0200 References: <2409256.jE0xQCEvom@pluto> <871ql7s1ig.fsf@christianmoe.com> <45437000.fMDQidcC6G@pluto> User-agent: mu4e 1.2.0; emacs 27.2 From: Christian Moe To: emacs-orgmode@gnu.org Subject: Re: File generation from LaTeX src fails due to temporary PDF in wrong directory In-reply-to: <45437000.fMDQidcC6G@pluto> Date: Thu, 30 Mar 2023 13:15:34 +0200 Message-ID: <87y1neqyll.fsf@christianmoe.com> MIME-Version: 1.0 Content-Type: text/plain X-GeoIP: Country [IP], SI [92.63.16.127] X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-Authenticated-Id: mail@christianmoe.com Received-SPF: pass client-ip=91.185.211.160; envelope-from=mail@christianmoe.com; helo=mailer-211-160.hitrost.net X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680174995; a=rsa-sha256; cv=none; b=k7Ce7Rgy5lELZBqMol8OhiUk0c80dTfFCps5jm0WGjeIhCaveMOkGJ5+mCodUDpTL4iy+b eiSpEPFI2rxFQVThznbNkT96wowLdXyvHxkS4dk+9g87NS60R+L0gHUeNeeAI1h4tqatCy cbaIUUjsKmFJixXTT8GAPrtrpiTzEM9m/rm++quLDH0zaBVe3SrKZKKnx52OSCl3O3TvH9 SnI+3m+WyxZKy/+zG4UCc55Yv6WN7H+KiwAHY13UUbz2qeSzMTlRUtuPLX0Ih9S3xYHWoD KsUR4CzEAPYYhxMUkGr3+p0Hgvsr5ytnsm9BhXyP0F49cRyy6pce6nOPSsL1ow== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b="E2M1nhz/"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680174995; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=pySNYtFZeOz9ikcUpRI+Y1pPgkRsTwQuzV+Vw3AEpJs=; b=dtolx0hPN/CYQf8NUFyNvBekz/gcCmRf1S1D9/C/6dEbfMKLhF2ZLNhx+POAWe8X6Ha+Uv 1xd+m5+Litid7uxfXREtFKY+RVMQhPtkQVMQ7W0xBokB6vumSL0ghyurOECrmH6OCnvMv0 Asv0Gc531vsMqJcrPAI1jJCRNEvOOsK6K2TokBEQc1Gim3vQgcXUH+Gk8vMegZyOYo3Y/q NSgCvJGACnlJ0T4m/ItZcE5P2aWWR+KYIB2RpoTpltiPw2XYd2rTrzEEjZAsHMxnm9jJiU xqiStWl/BVBeUTbW9aYvAtBhRb0k7yYKzmHe1PLF9N0FMOYJh0aGmBxSyJs1Eg== X-Migadu-Spam-Score: -4.02 X-Spam-Score: -4.02 X-Migadu-Queue-Id: E68CB282F5 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b="E2M1nhz/"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-TUID: KVF5u+59qwUL chris writes: > On Wednesday, 29 March 2023 23:15:03 CEST Christian Moe wrote: >> >> Hi, >> >> Pardon the noise: It turned out to be a pretty obvious problem with my >> setup that has now been resolved. >> >> I had modified org-latex-pdf-process to use xelatex, and for some reason >> my setup lacked the =-output-directory %o= switch. I should probably >> have thought of that first, but the omission has had no ill effects on >> ordinary PDF export, so I didn't run into any problem before trying to >> use Babel with LaTeX. >> >> Ihor and Pedro, thanks for checking. >> >> Chris, I don't know why your attempts fail, but I'll be trying similar >> things over the next days, so maybe I'll come back to you. >> > > For one thing I don't understand 90% of the options, that can explain a lot. > Another point, the gibberish output I was speaking about are "similar" those > of > [[https://emacs.stackexchange.com/questions/68823/minimal-working-example-of-tikz-to-svg-in-orgmode]] > Actually the svg image they get is an image containing the `tikz` instructions > transformed as image. What I get is the svg instructions that should generate > the image: an image showing a `svg` listing. I am seeing the same problem, and think I have a solution below, but it's confusing and I'm wondering if other people have this working out of the box somehow. The difference between what you are seeing, and what they are seeing in the stackexchange thread, comes down to whether =:headers '("\\usepackage{tikz}")= is specified. Without it, all they get is an SVG of the glyphs in the arguments to the tikz commands. With it, we get an SVG of the glyphs in the SVG for the image. So when the extension is .svg, the intermediate PDF that is converted into SVG does not contain the image, but a listing of the SVG, which has *already* been generated! The reason, I think, is that org-babel-latex-preamble includes this definition: : \def\pgfsysdriver{pgfsys-tex4ht.def} So what happens, I think, is that tex4ht already generates SVG from the TikZ code. When Org then uses org-babel-latex-pdf-svg-process to call an external utility, by default inkscape, to convert the PDF to SVG, we are converting not an image but a code listing already in SVG. It is not at all clear to me why tex4ht is invoked in the default preamble. I wonder if it still serves a purpose. If it makes better SVG from LaTeX than the other utilities, it would be nice to use it directly somehow. But perhaps it is just a leftover from a stage in development when htlatex was used to produce the SVG, before the two-part-process ->PDF->SVG with org-babel-latex-pdf-svg-process was defined. If so it should probably be changed. Here's the relevant thread, I think, for people wanting to look into that: https://list.orgmode.org/873608ajfn.fsf@bzg.fr/t/ Solution: Redefine org-babel-latex-preamble to remove the offending line. (setq org-babel-latex-preamble '(lambda (_) "\\documentclass[preview]{standalone}")) With this setup, my example #+header: :fit yes :headers '("\\usepackage{tikz}") #+begin_src latex :exports results :results raw file :file test-tikz-triangle.svg \begin{tikzpicture} \draw[draw=black, fill=blue!10] (0,4) -- (3,0) -- (-3,0) -- cycle; \end{tikzpicture} #+end_src exports correctly to an .svg file. Yours, Christian