From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id UCGRFlYIyGWT6QAAqHPOHw:P1 (envelope-from ) for ; Sun, 11 Feb 2024 00:35:50 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id UCGRFlYIyGWT6QAAqHPOHw (envelope-from ) for ; Sun, 11 Feb 2024 00:35:50 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Bs3BXUg9; dmarc=pass (policy=none) header.from=posteo.net; 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=1707608150; 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=rVFbg/bN6qtKkKE/cv1UfHGgJSfpKz7jUciXOERjvbU=; b=s6rVZkPDW/kwLwmlDUzQ6XbCZWhJsuWoRa8rN4vNvwD06l7oy4ca55dOrGDWfP5mg5YCNa CccMpB/8A7yMKvgFDba2fSHvy61wMJARlshicRzeNBOo8tqEP547IWdEKtebGwl1WAGS6P 3SyAnqlIy7AOlCpil7X81Pq6+pOujHGzb47inYjq7BBXnijo+YswfrfWWD38J8hoQj/M4G DfTov4XUCA8pA3mkjRS+eYjVar++hzCi/GtLJXzJ0ZED0HxNQ31MPXf7kycCSIV2hZjv5+ ckRCrykIsnnr68TC3sNUQ0KR5lpVLsvBadwMLhg7zRBwXdoa+BsMJ1t9gHKkwA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Bs3BXUg9; dmarc=pass (policy=none) header.from=posteo.net; 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-Seal: i=1; s=key1; d=yhetil.org; t=1707608150; a=rsa-sha256; cv=none; b=dWWmCncz9fRtHitqSZ5vS/sAEKr+OEUnzYeKdoT2m4FrTccCcUL9XCvkSlEa/3nlWb2KMV DkU07w1iCxe7y9r3h1gwh1d5CkihP41a4HC9xsvAkvaE1CMpCHpW+mVNMHUUCQaAWYjWIL hrwqTgSbt2kxanCQBLy+ZYmYeeF0u4JRLMSi3yPr69Y2FPWfUriElg8g8Id/G239FYfXDS I+oFNn9lDMV43Gxzr7Q0Mf1rpuPu1cX8dNaEKB+BYmjBX2ojrIoFwacI6yv5uawnkzYh9d agrOTwJjbjcx0ZglxDZTGUpfe6KmXYLwzG5v0aI6fDXtvHZLJm5jz+C8V1xV8g== 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 4B09C17F56 for ; Sun, 11 Feb 2024 00:35:50 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYws9-0000WL-Vf; Sat, 10 Feb 2024 18:35:02 -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 1rYws8-0000W4-0X for emacs-orgmode@gnu.org; Sat, 10 Feb 2024 18:35:00 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYws5-0000PV-Ti for emacs-orgmode@gnu.org; Sat, 10 Feb 2024 18:34:59 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id D632A240101 for ; Sun, 11 Feb 2024 00:34:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1707608094; bh=//ykj3E2CkafvZz7SYrMf6gRBctAMakp8+j388rACcQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=Bs3BXUg90LBf+RyrIXksCWWjVm5s4loYWAn2wjMvw3zkbO+yrTq/3g8rkuGoZnS9X B0dUN/v9chov86/3XzLMZ3acLStEdpdjNWdxYY0pivXOWccLLvNA0ove3mOy0nHeGo 9XIfNjf0xsMbzC85hu1EVKYOxo/6iWhJPU7pNNQXMyWbCWQEwKLyAnksR0YvO8tZed VPQH1qUd5a5JN78N4FSNv+BVpTWIx+2uTmrJcB3yjaC6oAofvK5tSKCyTLUgcXRIr/ SPEH04x9xwg71vCLLAemcEXOxNGHIOpz3jGxHaNEM9xe3IDdYcUoyD+u6XyeK28048 P1h/1osYntLiQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TXRsB1Y7Cz9rxB; Sun, 11 Feb 2024 00:34:53 +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: <87cyt4do4h.fsf@localhost> (Ihor Radchenko's message of "Sat, 10 Feb 2024 21:07:42 +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> Date: Sat, 10 Feb 2024 23:34:51 +0000 Message-ID: <87mss799lw.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.66; envelope-from=maciaschain@posteo.net; helo=mout02.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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -8.96 X-Spam-Score: -8.96 X-Migadu-Queue-Id: 4B09C17F56 X-Migadu-Scanner: mx12.migadu.com X-TUID: s9uMrNBfmere Ihor Radchenko writes: > Juan Manuel Mac=C3=ADas writes: > >> I am attaching a new patch with this idea incorporated. I have also >> changed the name from full-to-pdf to standalone. >> >> + (process (cdr (assq :process params))) >> + (org-preview-latex-default-process (if (and process >> + (string-suffix-p ".png" out-file) >> + (not imagemagick)) > > Considering that 'imagemagick is one of the variants in > `org-preview-latex-process-alist', it might be reasonable to allow > :process imagemagick =3D=3D :imagemagick yes I wouldn't equate it. ':imagemagic yes' uses 'org-latex-convert-pdf'. Instead, =C2=AB:process 'imagemagick=C2=BB depends on: (imagemagick :programs ("latex" "convert") :description "pdf > png" :message "you need to install the programs: latex and imagema= gick." :image-input-type "pdf" :image-output-type "png" :image-size-adjust (1.0 . 1.0) :latex-compiler ("pdflatex -interaction nonstopmode -output-director= y %o %f") :image-converter ("convert -density %D -trim -antialias %f -quality = 100 %O"))=09=20=20=20=20=20=20 Also, one may want to put =C2=AB:imagemagick yes=C2=BB and compile the PDF with another compiler or with a custom script: :imagemagick yes :process '(...) > Also, it feels incomplete to be able to define latex command for :file > foo.pdf, but be limited to a pre-defined list of symbols for :file .png. The ".png" method without ":imagemagick" does not depend on 'org-latex-pdf-process' but on 'org-create-formula-image', and this in turn depends on the value of 'org-preview-latex-default-process': ... ((and (string-suffix-p ".png" out-file) (not imagemagick)) (let ((org-format-latex-header (concat org-format-latex-header "\n" (mapconcat #'identity headers "\n")))) (org-create-formula-image body out-file org-format-latex-options in-buffer))) ... If you put :file foo.png without :imagemagick, and want to control the process or change the compiler, you can do it with: :process '(foo :latex-compiler ("some LaTeX command"))=20 since this syntax is what org-preview-latex-default-process expects. In all other cases, including :imagemagick, the compilation process depends on the value of org-latex-pdf-process. Anyway, I don't understand why that feature option (convert to an image without :imagemagick method) is limited to .png, when other graphic files a= re possible. I can define something like this: (setq org-preview-latex-default-process '(my-process :programs ("lualatex" "convert") :description "pdf > jpg" :image-input-type "pdf" :image-output-type "jpg" :latex-compiler ("lualatex -interaction nonstopmode -output-directory %o %= f") :image-converter ("convert -density %D -trim -antialias %f -quality 100 %O= "))) But if I put :file foo.jpg nothing happens. Maybe that part should be corrected... Something like (string-match-p "\\.png\\|\\.jpg\\|..." out-fil= e)? Best regards, Juan Manuel=20 --=20 Juan Manuel Mac=C3=ADas -- Composici=C3=B3n tipogr=C3=A1fica, tratamiento d= e datos, dise=C3=B1o editorial y ortotipograf=C3=ADa