From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id PgdXIeYOt16LOwAA0tVLHw (envelope-from ) for ; Sat, 09 May 2020 20:13:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yATELfMOt17GVwAAbx9fmQ (envelope-from ) for ; Sat, 09 May 2020 20:13:39 +0000 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 5314D940B28 for ; Sat, 9 May 2020 20:13:37 +0000 (UTC) Received: from localhost ([::1]:44834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXVqq-0002Ut-UC for larch@yhetil.org; Sat, 09 May 2020 16:13:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXVqS-0002UQ-CI for emacs-orgmode@gnu.org; Sat, 09 May 2020 16:13:12 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:36115) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXVqQ-0004Ft-Kc for emacs-orgmode@gnu.org; Sat, 09 May 2020 16:13:12 -0400 Received: by mail-vs1-f65.google.com with SMTP id s11so3235221vsm.3 for ; Sat, 09 May 2020 13:13:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=llE6patKczebYkUGgYQbfXQJVYlx10peJDuPD2XthDY=; b=gBh9T92slUO1sPQpSMlvP2ugc/UYofvH8hV/yRiZeIzVI3vKnkeqYoapkRrjb8DpiD onGMHKRwKcal+BmhL+O2ElgGjoBcjwioLSCDv4EYgag2vU5WxsKfohMzjdgxzYN6a+xc hSTFQDEc19rVR1AgHlpvasiuZG/o60AYyPAiFqbgC78UbKqcSCbJcfGygzB1I3FnT6HD tQj8vAilhElMxa5GagzPKwc3kmcakvJKKrD2W7J9U43nAdRBMnQP/PLY4JSrVijbFItG ukIk2N0LB5uQPpqS4LuLfiw6PxeXnMEyOI8cprTATBYsDkS00kNr1Mf5IvAih8ITo4nv alRQ== X-Gm-Message-State: AGi0PuYe4GIvw4G69bTTUhQCe7r94xUgmtz0uCwwC7F73VrtiCaYdPtT VT4eFwY4D/FwdBN8Y+tpAqKdbP6WEsUyjruJ2Lvr7Q== X-Google-Smtp-Source: APiQypJZZTBAkZVpmdWDN9fx7uCcGMRHkG6jOWSVNgjz0FX9AQpdJXZcT8Me9gmy07EYlTTvNWE4AdT1vOmnr4BdKFA= X-Received: by 2002:a67:8bc3:: with SMTP id n186mr6624160vsd.67.1589055188958; Sat, 09 May 2020 13:13:08 -0700 (PDT) MIME-Version: 1.0 References: <87o8qz5wy2.fsf@nicolasgoaziou.fr> In-Reply-To: <87o8qz5wy2.fsf@nicolasgoaziou.fr> From: Yuri Lensky Date: Sat, 9 May 2020 13:12:57 -0700 Message-ID: Subject: Re: [Patch] Do not ignore headers argument in ob-latex To: Yuri Lensky , "emacs-orgmode@gnu.org" Content-Type: multipart/mixed; boundary="00000000000011249405a53cbefe" Received-SPF: pass client-ip=209.85.217.65; envelope-from=ydlensky@gmail.com; helo=mail-vs1-f65.google.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/09 16:13:09 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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" X-Scanner: scn0 X-Spam-Score: 0.49 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [0.49 / 13.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; GENERIC_REPUTATION(0.00)[-0.54003287977321]; MX_INVALID(1.00)[cached]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.09), country: US(-0.00), ip: 209.51.188.17(-0.54)]; HAS_ATTACHMENT(0.00)[]; DWL_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~,4:~]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; R_DKIM_NA(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FROM_NEQ_ENVFROM(0.00)[ydl@ydl.cm,emacs-orgmode-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[ydl.cm:email,nicolasgoaziou.fr:email]; MIME_GOOD(-0.10)[multipart/mixed,multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; DMARC_NA(0.00)[ydl.cm]; HAS_LIST_UNSUB(-0.01)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: X4NicTyHkZWu --00000000000011249405a53cbefe Content-Type: multipart/alternative; boundary="00000000000011249205a53cbefc" --00000000000011249205a53cbefc Content-Type: text/plain; charset="UTF-8" Hi, I have updated the attached patch to use `mapconcat' as requested. `org-format-latex-header' is already declared earlier in ob-latex.el. I am not sure what kind of test you have in mind, since this feature isn't completely internal to org-mode. For example, the preview compiles but the produced PDF is incorrect before this fix, and I believe the org preview machinery ignores errors from the latex compiler. Best, YL On Thu, May 7, 2020 at 1:37 PM Nicolas Goaziou wrote: > Hello, > > Yuri Lensky writes: > > > Subject: [PATCH] lisp/ob-latex.el: Stop ignoring headers argument > > Thank you. > > > During default "png" export, the "headers" argument is no longer > > explicitly ignored. > > According to the TODO in that function, this is not the first time it > happens. Would you mind writing a test for it? > > > + (let ((org-format-latex-header > > + (concat org-format-latex-header "\n" > > + (string-join headers "\n")))) > > + (org-create-formula-image > > + body out-file org-format-latex-options in-buffer))) > > This looks hackish but I don't know how to do it otherwise. However > could you use `mapconcat' instead of `string-join'? > > Also, you need to declare `org-format-latex-header' in order to silence > byte-compiler. > > Regards, > > -- > Nicolas Goaziou > --00000000000011249205a53cbefc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I have updated the attached patch t= o use `mapconcat' as requested. `org-format-latex-header' is alread= y declared earlier in ob-latex.el.

I am not sure w= hat kind of test you have in mind, since this feature isn't completely = internal to org-mode. For example, the preview compiles but the produced PD= F is incorrect before this fix, and I believe the org preview machinery ign= ores errors from the latex compiler.

Best,

YL

--00000000000011249205a53cbefc-- --00000000000011249405a53cbefe Content-Type: application/octet-stream; name="0001-lisp-ob-latex.el-Stop-ignoring-headers-argument.patch" Content-Disposition: attachment; filename="0001-lisp-ob-latex.el-Stop-ignoring-headers-argument.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ka02324l0 RnJvbSBmNmNkYTAyMTJmZDIyODZkNDNiOGY0ZTYxN2EzZTM5YzBlOGMwNzBkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiAiWXVyaSBELiBMZW5za3kiIDx5ZGxAeWRsLmNtPgpEYXRlOiBX ZWQsIDYgTWF5IDIwMjAgMTI6NTA6MTEgLTA3MDAKU3ViamVjdDogW1BBVENIXSBsaXNwL29iLWxh dGV4LmVsOiBTdG9wIGlnbm9yaW5nIGhlYWRlcnMgYXJndW1lbnQKCkR1cmluZyBkZWZhdWx0ICJw bmciIGV4cG9ydCwgdGhlICJoZWFkZXJzIiBhcmd1bWVudCBpcyBubyBsb25nZXIKZXhwbGljaXRs eSBpZ25vcmVkLgotLS0KIGxpc3Avb2ItbGF0ZXguZWwgfCA3ICsrKysrLS0KIDEgZmlsZSBjaGFu Z2VkLCA1IGluc2VydGlvbnMoKyksIDIgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9v Yi1sYXRleC5lbCBiL2xpc3Avb2ItbGF0ZXguZWwKaW5kZXggMjM3NmI5ODdiLi40YjM0M2RkMTQg MTAwNjQ0Ci0tLSBhL2xpc3Avb2ItbGF0ZXguZWwKKysrIGIvbGlzcC9vYi1sYXRleC5lbApAQCAt MTA5LDggKzEwOSwxMSBAQCBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBieSBgb3JnLWJhYmVsLWV4 ZWN1dGUtc3JjLWJsb2NrJy4iCiAJICAgIC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