From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id EJcsO/98p2WAQwAAqHPOHw:P1 (envelope-from ) for ; Wed, 17 Jan 2024 08:08:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id EJcsO/98p2WAQwAAqHPOHw (envelope-from ) for ; Wed, 17 Jan 2024 08:08:48 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pm.me header.s=protonmail3 header.b=ZusQxNOc; 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=quarantine) header.from=pm.me ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705475327; 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: 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=1f3QcZt+KZltsENSmzboi+Nlxr3uQcc3OddMqpvuQqA=; b=KlAucEQTLQAF19wu/gj6dzXXuVeBY0Md+hU6sqSqIvQmqj9R0i4embnPSstUWwyMwRGM7H R/WZfd9/Rrin0g2vLs7Rm22t8WxF6fquGwPIfePzRqyCQzmzfsesbfZdr716VkRshaYyW0 ROsIKjPqZBmbOuNvHDuCgvdKMBtJ3WVgHbj59uMoxmG/BoJ9kpJdiGb68Z1YkbIdS1MOWo DfO22+m3zhpFwNjzYsMUxZR4sTjllimh7ArFr54bbrk6PWcD7wBW/hDPi2Xl9QPcAoQKRa mmfmOIIr+uV4uRICndd7CLSAkDm5s8NNUL5Ygo/Xegv7fH+7h2ZS5d/l8EPBRw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=pm.me header.s=protonmail3 header.b=ZusQxNOc; 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=quarantine) header.from=pm.me ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705475327; a=rsa-sha256; cv=none; b=c8ozOtS7uZ8KKb0Ax5kYBrQoFVyoOn07/iXJBmh1A/HqFatFEIPTtQb7oAo+RA5+R4zWAB XJ38nJl29KUfnaodu1qu9GAfNVbv3e0vLBo0oezapr05R6FsNx0peNZs4ToPAvY8+N/2k0 g3v/hXsHZHmqmXAAuitoMIA3owEpwaiRc5GT9iHwEaM84E5MC/cGNH7Cp3IQ1XLf5wwGTv ZSha3M3c/ibFtPhqb6GwF43RwGW2UYtoY2OD4cYblJFIIrShY+AbCUL62aV9ZWAUbk0YcY oaVd2CrU0REWArHTqTVmJMykpMBBELLpBZ/MHKubqSSq3wEeBQLzu8q+3RRaVw== 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 AD7373A97E for ; Wed, 17 Jan 2024 08:08:47 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQ01N-00042Y-I3; Wed, 17 Jan 2024 02:07:33 -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 1rPUMK-0001RC-Ft for emacs-orgmode@gnu.org; Mon, 15 Jan 2024 16:19:04 -0500 Received: from mail-4322.protonmail.ch ([185.70.43.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPUMH-0001hE-Oq for emacs-orgmode@gnu.org; Mon, 15 Jan 2024 16:19:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1705353536; x=1705612736; bh=1f3QcZt+KZltsENSmzboi+Nlxr3uQcc3OddMqpvuQqA=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=ZusQxNOcBjJ1z36AsVR20safc98QuVAZEkuA/FEzrxXisBZgWw/ybdP52z0ft6CXt 3ncVHwIyWTdyE7kI+EeS86xDZh1C8G+sDTAF3hh6kWFeRY4Hw3GkeqqQZApsFiv4To teIkLELRHEYWlxOEaOhe/jWGJU5Zlpb12lSZVLl/2e1jDlwiWWhDYLzhRpa2bYUA/L 2mBr7gJvuFW16tXPL7YrWQgaEhowkKlo5P/N37S1ZCiMgfgPRKL6Qdp+ldoimRnSsX 7pM+/18yyBMm/6IG6OA1J8FMqwCdJg/+1RsKfGuJUF2Haf6OXPHuqx/htd+lG6BdYm clkTYyMD7/iYw== Date: Mon, 15 Jan 2024 21:18:40 +0000 To: emacs-orgmode@gnu.org From: Mads Bach Villadsen Subject: Re: [PATCH] ox-latex.el: Fix the case of latex-caption-above t Message-ID: In-Reply-To: References: Feedback-ID: 59043447:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.43.22; envelope-from=mvilladsen@pm.me; helo=mail-4322.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 17 Jan 2024 02:07:31 -0500 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: -9.05 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -9.05 X-Migadu-Queue-Id: AD7373A97E X-TUID: AecEswZFwBEh #+OPTIONS: html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil=20 email:nil tex:dvipng d:nil #+STARTUP: hidestars indent inlineimages :PROPERTIES: :reply-to:=20 ("/var/folders/b9/gky2rvnj4xxd0gl0x7n92j8r0000gn/T/mm-kl9uCr.html"=20 "/var/folders/b9/gky2rvnj4xxd0gl0x7n92j8r0000gn/T/cidvUcUMz") :attachment: nil :alternatives: (utf-8 html) :END: My message seems to have been HTML-ified by mistake, so I'm=20 sending it again. The documentation for `org-latex-caption-above=E2=80=99 seems to imply=20 that it can be set to a non-nil value to always place captions at=20 the start of environments, instead of the end. However, with a=20 non-nil value which is not a sequence, exporting something like=20 the following from org causes an error: \begin{align*} x \end{align*} The issue is that in `org-latex-latex-environment=E2=80=99, in the=20 expression (memq type (append (plist-get info :latex-caption-above)=20 =E2=80=99(math))))) the first argument to `append=E2=80=99 gets expanded to the value of=20 `org-latex-caption-above=E2=80=99 (at least for this example), which may=20 not be a sequence. I think the attached patch fixes this, but I don=E2=80=99t write much=20 lisp, so maybe there=E2=80=99s a better way to handle this. Best, Mads >From f28da9e3c80f03d70a9a6eced5029e12fc75ab99 Mon Sep 17 00:00:00=20 2001 From: Mads Bach Villadsen Date: Mon, 15 Jan 2024 15:37:29 -0500 Subject: [PATCH] ox-latex.el: Fix the case of latex-caption-above=20 t * lisp/ox-latex.el: (org-latex-latex-environment): Check whether=20 the property `:latex-caption-above' is a sequence or not, and handle them=20 separately. Correctly handle the case where org-latex-caption-above is non-nil=20 and not a list of symbols. The documentation of=20 org-latex-caption-above implies that it can be set to a non-nil value to place captions at=20 the beginning of all environments. TINYCHANGE --- lisp/ox-latex.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index b36c46f13..4f2a94a20 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2682,7 +2682,9 @@ CONTENTS is nil. INFO is a plist holding=20 contextual information." =09=09=09(org-latex--label latex-environment info nil t) =09=09 (org-latex--caption/label-string latex-environment=20 info))) =09 (caption-above-p -=09 (memq type (append (plist-get info :latex-caption-above)=20 '(math))))) + (let ((latex-caption-above (plist-get info=20 :latex-caption-above))) + (if (sequencep latex-caption-above) (memq type=20 (append latex-caption-above '(math))) + latex-caption-above)))) (if (not (or (org-element-property :name latex-environment) =09=09 (org-element-property :caption latex-environment))) =09 value -- 2.39.3 (Apple Git-145) --citation follows this line (read-only)-- Mads Bach Villadsen writes: Hi, The documentation for `org-latex-caption-above=E2=80=99 seems to imply=20 that it can be set to a non-nil value to always place captions at=20 the start of environments, instead of the end. However, with a non-nil value=20 which is not a sequence, exporting something like the following=20 from org causes an error: latexpCfhTz_350451aa2511e1a6f5ea1cf164b4329f062726cb.png The issue is that in `org-latex-latex-environment=E2=80=99, in the=20 expression (memq type (append (plist-get info=20 :latex-caption-above) =E2=80=99(math))))) the first argument to `append=E2=80=99 gets expanded to the value of=20 `org-latex-caption-above=E2=80=99 (at least for this example), which may=20 not be a sequence. I think the attached patch fixes this, but I don=E2=80=99t write much=20 lisp, so maybe there=E2=80=99s a better way to handle this. Best, Mads >From f28da9e3c80f03d70a9a6eced5029e12fc75ab99 Mon Sep 17 00:00:00=20 2001 From: Mads Bach Villadsen Date: Mon, 15 Jan 2024 15:37:29 -0500 Subject: [PATCH] ox-latex.el: Fix the=20 case of latex-caption-above t lisp/ox-latex.el: (org-latex-latex-environment): Check whether the=20 property `:latex-caption-above=E2=80=99 is a sequence or not, and handle them=20 separately. Correctly handle the case where org-latex-caption-above is non-nil=20 and not a list of symbols. The documentation of=20 org-latex-caption-above implies that it can be set to a non-nil value to place captions at the=20 beginning of all environments. TINYCHANGE =E2=80=94 lisp/ox-latex.el | 4 +- 1 file changed, 3=20 insertions(+), 1 deletion(-) diff =E2=80=93git a/lisp/ox-latex.el b/lisp/ox-latex.el index=20 b36c46f13..4f2a94a20 100644 =E2=80=94 a/lisp/ox-latex.el +=20 b/lisp/ox-latex.el @@ -2682,7 +2682,9 @@ CONTENTS is nil. INFO is a plist holding contextual information.=E2=80= =9C=20 (org-latex=E2=80=93label latex-environment info nil t)=20 (org-latex=E2=80=93caption/label-string latex-environment info))) (caption-above-p ,* (memq type (append (plist-get info :latex-caption-above)=20 =E2=80=99(math))))) ,* (let ((latex-caption-above (plist-get info=20 :latex-caption-above))) ,* (if (sequencep latex-caption-above) (memq type (append=20 latex-caption-above =E2=80=99(math))) ,* latex-caption-above)))) (if (not (or (org-element-property=20 :name latex-environment) (org-element-property :caption=20 latex-environment))) value =E2=80=93 2.39.3 (Apple Git-145)