From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 8AGyOCYR0mWWDQAAe85BDQ:P1 (envelope-from ) for ; Sun, 18 Feb 2024 15:16:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 8AGyOCYR0mWWDQAAe85BDQ (envelope-from ) for ; Sun, 18 Feb 2024 15:16:07 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=aZhWbqyb; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708265766; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=udEWS81GuRSSYVk8pGrlDY7L5ArcPs+j3r5YEdPSSzc=; b=XOYwh12q/JQwjxkO5DRxdiHroa0Qh0a8BCOy0KeEyra66KRzU1yjVbd2Yd5IqcuQCcZRMf XVWdhVdwe+8LK746MLe0oyaYH01YIkIIX8+LyVkDEM8VzBgkln0wWBLAG+sQsnK7ol+SOX 1zCQ2c8lL74oiyqXm07uto/CqxN2rE3Poy02lfxNs0+tnSy+le2KI+wcOY4xU379QAggRZ 6RaL/8ODrRvMdX56PkS1C6O0A+WEDzyS4zvRSy0j9PAwp8cyHdJE57FCJuF3ktgNKk6gF6 Y+9T8FjTl9UTfFEsymh6tWk9RKUj4HKZH3XgPPjUneo5H0CDnloaDfntm9wnJQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=aZhWbqyb; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708265766; a=rsa-sha256; cv=none; b=TCcTtOQ/nL60G3EFkuOYsI73FevNjPLqc/imLTeiaaHceqo+fhjdetCZZX15N3EaZ4LP5o fLfvls2F9IDY2bvwhhWM5WintuwAQgPdp1n3Bm5Hn4YKLoX528fzi614mbX5tI532iDqgG +xZOhdkD2z2DJLnxJikaMiGG+F1t0LziR/z/gesUnrZwyvVNqteXf/4JnggNGwVdvEHjVq 7naGDWLlAmFoMouSAThLOrpYUNdpyKcIhofy7DpK3hpUHnj/b0AsONILYrowNv02veWXa+ lzQ+SSWz3dW0GiixlvrKY/0RfkxPRPMaNUg8imgSiWlqAObaa3H/uDl/8Uz6Pg== 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 CF4CD452BA for ; Sun, 18 Feb 2024 15:16:06 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbhSK-00072p-2k; Sun, 18 Feb 2024 08:43:44 -0500 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 1rbhSI-00072b-KK for emacs-orgmode@gnu.org; Sun, 18 Feb 2024 08:43:42 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbhSG-00050p-SP for emacs-orgmode@gnu.org; Sun, 18 Feb 2024 08:43:42 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BBE3B240027 for ; Sun, 18 Feb 2024 14:43:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1708263817; bh=Vpi3+WrwonnAmha70kMOtG1lN8Ty/Z3engzWSdGMbSw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=aZhWbqybj0RFR0l3ZGH1OL2/SNhc7jnL22P5rckzqA4h5NwM47CVf8cmM33ng6eOh W4T2yYPUHiaC+urA6lHJOwU+aolhb8V6bnBN72Z0Z8Q20x8S2lDf8fTyyj0wpKgGnE 1i0SQUX2PGW+OxRi1bbiQOxY2QKAflc+P+LAGl7jLAEE/Qcv/In7c3gHL9uacITy0O /B+c53fJKxTNrKqVBhlIW3bRz9lQQP1AsiX27oyCXsJIreXYxbg/Six6nUYATSXBEw t719An2xaVPm1WxcZ9KqwQFgjV4BS4OxAC7rOKfRJTregVWec400TFcFuJGs5ICq0j CtBVFaY3c82Wg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Td6MD3VXxz6tvx; Sun, 18 Feb 2024 14:43:36 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Ihor Radchenko Cc: orgmode Subject: Re: [patch] Add two new header args to LaTeX block In-Reply-To: <87il2lsvlb.fsf@localhost> (Ihor Radchenko's message of "Sun, 18 Feb 2024 14:20:00 +0000") References: <87zfw9yt9m.fsf@posteo.net> <87wmrcpepp.fsf@localhost> <875xyw9wic.fsf@posteo.net> <87le7se0qu.fsf@localhost> <87wmrc8b3e.fsf@posteo.net> <87r0hk863m.fsf@posteo.net> <87cyt4do4h.fsf@localhost> <87mss799lw.fsf@posteo.net> <87il2v9i4r.fsf@localhost> <87h6ie7otw.fsf@posteo.net> <87v86slbu4.fsf@localhost> <87zfw45cx9.fsf@posteo.net> <87il2lsvlb.fsf@localhost> Date: Sun, 18 Feb 2024 13:43:34 +0000 Message-ID: <877cj1vqex.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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 X-Migadu-Spam-Score: -9.97 X-Spam-Score: -9.97 X-Migadu-Queue-Id: CF4CD452BA X-Migadu-Scanner: mx11.migadu.com X-TUID: KGOrFQ8dUfPp Ihor Radchenko writes: >> In any case, if the org-create-formula-image method is going to stay, I >> think it is fine as it is (except for extending the allowed file formats >> to more extensions, and not only .png). I also believe that the :process >> argument is sufficient for the user to control the value of >> org-latex-pdf-process or org-preview-latex-default-process, as >> appropriate. > > My concern about your patch is that it creates even more divergence > between different branches of code in `org-babel-execute:latex'. > With the new proposed features only available to some code branches, > `org-babel-execute:latex' will just become more messy and harder to > maintain. > > I'd prefer to refactor `org-babel-execute:latex' first, before adding > new header arguments. org-create-formula-image inserts LaTeX code: ... (with-temp-file texfile (insert latex-header) (insert "\n\\begin{document}\n" "\\definecolor{fg}{rgb}{" fg "}%\n" (if bg (concat "\\definecolor{bg}{rgb}{" bg "}%\n" "\n\\pagecolor{bg}%\n") "") "\n{\\color{fg}\n" string "\n}\n" "\n\\end{document}\n")) ... that, /in principle/, would make it incompatible with the :standalone argument (in my patch), which allows writing all LaTeX code from scratch in the block content. Anyway, it is true that org-babel-execute:latex has grown in a somewhat irregular way. For example, I don't quite understand why the simple output to PDF and the conversion to an image with :imagemagick live in the same conditional: (or (string=3D "pdf" extension) imagemagick) I would propose three main branches in this function: - A PDF branch, using org-format-latex-header with its valid options, and other sub-branches with conversion from the PDF, for example, the use of :imagemagick. Or you could even think of any possible conversion process using a hypothetical :pdf-postprocess - A branch for orf-create-formula-image - a third branch to export to html, with org-babel-latex-htlatex. Having three clearly differentiated branches would make the code easier to maintain. -- Juan Manuel Mac=C3=ADas -- Composici=C3=B3n tipogr=C3=A1fica, tratamiento d= e datos, dise=C3=B1o editorial y ortotipograf=C3=ADa