From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id yCL7I7GNd2fXzQAAe85BDQ:P1 (envelope-from ) for ; Fri, 03 Jan 2025 07:11:45 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id yCL7I7GNd2fXzQAAe85BDQ (envelope-from ) for ; Fri, 03 Jan 2025 08:11:45 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=UeIJBigZ; 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=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735888305; 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=3Du5KUMvsIoPO9wF2dNjY4gwdF8AeV/Nnq9vnLccU7w=; b=fqj9+a9bC2OnHaBCKJIqdM/a25UoPrx+jNQWn+5Nh0j79WficiD8XPu6vyF2T0+fQugkRg v2+kQK+Ck5griPi8wn0HfOnC76fapINk/Ub7Z8RXiJTmMndwrEIu9TMbTnq/aAgIXQE08l ctRkONQjzmc2QCKJHF6+9egwuboqzPTmLc9DsLStxHkQKwF9DJXvWS7XnmEg6A2KeCuYoV 7H62C/daJ9cQIKmHxcLixv/lrDVPvsOCd08QsZ9liuGPNCiRIS4Z4GXZRKjB8m/i0RMqqd wuJI3clnBE+5TveFtP2nme2ELePU/K6PjhfoD5fvwDitTW+zgRfVapebedvmAg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=UeIJBigZ; 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=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735888305; a=rsa-sha256; cv=none; b=WnhnvoDyEMh9CYVfhjA53zExE6mo2uQJjlsj+m4npweEBaKYjjkRzXEBDChhcxW2ddUfmm iKzio4BdOgFtCrT4qGPpOjqBZveaPvq9QnnrrXrG/8387CmCAVbSWjg0CKwQwvS22bNoBE 7CLw28AuldhjvJQhOm4wLITzFtvWRL4O1hiDf/RvuU6DWmzMH7oJMmZ4AzWILIjrRzj98D R16HkzGhOFptlktB6/IvtJgyHBVfjSne5mdNDjgka5BHfxijBNNWCuuXsrAJPwvTwQSSXY Y9qnndL7lddqaQhMMm/A1hi8r9uS+50MexMWO3phLwiOvCYc9Xp+WBqTjhW1Kg== 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 0CEEA27258 for ; Fri, 03 Jan 2025 08:11:45 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTbpf-0000j6-HO; Fri, 03 Jan 2025 02:10:55 -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 1tTbpS-0000iI-TA for emacs-orgmode@gnu.org; Fri, 03 Jan 2025 02:10:44 -0500 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTbpP-0002hO-Mc for emacs-orgmode@gnu.org; Fri, 03 Jan 2025 02:10:42 -0500 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5d3e9f60bf4so20909255a12.3 for ; Thu, 02 Jan 2025 23:10:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735888237; x=1736493037; darn=gnu.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=3Du5KUMvsIoPO9wF2dNjY4gwdF8AeV/Nnq9vnLccU7w=; b=UeIJBigZgwX+GEh/4DrXSYIyzzQjR5UY7iGVh0Pp121MN4qd3UDoc6fIS+0bLUaVyO HG5J3X/DeubzJnbK98qaRgQ46ARLDKoTAUodozEW1HXMhEJ3/tzjPw9orTfjrtOQUprv 9PV9ON2msbYiNW9z1St/wpONFAOGToVXFUxzTtuGZRtopI9lzJO4oaYRWtcERYTVj1tE ElZcJMpzWVR5B4sVBSwcDnGkFbUSqTozILZcqOVO9nfSNEiXaBv7OwK1jPaOmBOf+RUk vKINOgaVw22VTs2pb1VUprAhfsUG5/qDJrkFCe0CDX8N9vSV/VQxb036ivaXHHCw5DAL 2kqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735888237; x=1736493037; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3Du5KUMvsIoPO9wF2dNjY4gwdF8AeV/Nnq9vnLccU7w=; b=XN3f7PiOpE8KdrQ58SmXy2ihDCHvmzcFE1URXOg6TTl14tbaxFitVrLaIBOjTFTk2I 1HLzPY4vI0+GSKXEs4XaTFDT5O6u1Burpro0x0eujqd1tr/Lb8eAj3m97NSA3KB4iuCD SlqVK0XMsYb6v+uuZt9MXG4iQgFf9I0BB8Ja8loCVlUDJbje/LBNDsNS8L99iFeOa3+B WJ4853ftVn5/6P54WvxqsmUUQKaGZeR1LwbBGVim1ySKreKry/0sIIFkZ6LSGefxNbF/ hC5JuckEDhmW8tAGTvozCRh0p4CvmTpPxamTEIMv6WcwVf2p2Hc4YlZgyNUDn0TWzkxE 8AFA== X-Forwarded-Encrypted: i=1; AJvYcCUlKn/FX5DqFJmm+wEZsNvRm7ey/efMUosINDd2QDfMLmbowjQ12v7vsbSp8+dJa4J3X+bajq3y8nZpZKRU@gnu.org X-Gm-Message-State: AOJu0YxZehp/6SXnC+4zQWcEEIVQDBsAutPJGkmBEI/JENq/utzVGkc3 mbpVGRW7GJO0OjT79sPMsLHnEM4wedkp01IzkKdygPNrbJnByqskeCkk76AKMGAdWlPcMvPFNso 8QUTEMW/V9gKSzolySWXfmrzOhiQ= X-Gm-Gg: ASbGnctrRBJ3H2rfo/qM2kX1iLU45D4HadMpQewyP1bvc7HcWrH7JtsuT9cQTm6C4yC 5oQutfvjI4y08icJNeSKALTSN6EkDTUMQeZQ/6w== X-Google-Smtp-Source: AGHT+IGTFtOSMO9IOaCXexnIbZ4KPTP9aclRSL6YFABWEl+01XJ27sHtu6mSUyzjVk9j1QIk+W1wWtAeIyBgkbSVVYY= X-Received: by 2002:a05:6402:210a:b0:5d3:d8b9:674d with SMTP id 4fb4d7f45d1cf-5d81dc79b24mr41388296a12.0.1735888236348; Thu, 02 Jan 2025 23:10:36 -0800 (PST) MIME-Version: 1.0 References: <495AE5B0-0551-40EC-B501-B681E479D261@gmail.com> <87wmfl3ttn.fsf@localhost> <87r05t3szf.fsf@localhost> <87v7v12juz.fsf@localhost> <87ikqyfxvm.fsf@localhost> <871pxlrvh9.fsf@localhost> In-Reply-To: <871pxlrvh9.fsf@localhost> From: Pedro Andres Aranda Gutierrez Date: Fri, 3 Jan 2025 08:10:10 +0100 Message-ID: Subject: Re: [PATCH]: ox-latex.eel: handle unnumbered sections in TOC correctly To: Ihor Radchenko , Org Mode List Content-Type: multipart/alternative; boundary="000000000000b28e6c062ac7f992" Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=paaguti@gmail.com; helo=mail-ed1-x52c.google.com 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -3.46 X-Spam-Score: -3.46 X-Migadu-Queue-Id: 0CEEA27258 X-TUID: EpTRIePgVyiI --000000000000b28e6c062ac7f992 Content-Type: text/plain; charset="UTF-8" Hi Ihor, yes, the patch is just a step towards consistency, but I think is is an important one, because it makes org-mode not generate illegal/faulty LaTeX code. As for the photo-finish, I have been thinking the following that we can use the 'toc' document property. Values nil and t work as intended in all backends. This means rewriting this part in ox-latex.el. Additionally, we add a new value 'toc:latex' to keep the current behaviour in ox-latex (at least, other backends could also implement it). Coming from the LaTeX world, I lean towards the current ToC handling in ox-latex.el (once fixed). It is closer to what I have been doing for the last couple of decades ;-) Once we agree on a way forward, I'll start coding. Best, /PA On Thu, 2 Jan 2025 at 18:09, Ihor Radchenko wrote: > Pedro Andres Aranda Gutierrez writes: > > >> (1) At the moment, some export backends do not obey this > >> specification. For example, LaTeX export excludes every unnumbered > >> headline from the table of contents. > >> > > > > But this happens because of the way LaTeX works... > > Sure. But I thought that your patch is working around the LaTeX defaults > by adding \addcontentsline{toc}... > > > So, ox-latex is technically not right when it ignores unnumbered > >> headings in TOC. > >> > > > > The basis is there... we might need to rewrite (org-latex-headings) a > lot - > > I fear. > > Doesn't your patch have everything needed to add unnumbered headings to > TOC? AFAIU, all we need ti simply adding \addcontentsline{toc}... not > just when there is ALT_TITLE attribute, but also when UNNUMBERED is t > (but not "notoc"). It is just that in the latter case we use actual > title in place of ALT_TITLE. > > > BTW, since my patch produces correct LaTeX code vs. the current state, > > could you please apply it to avoid the error which triggered all this > until > > we get something better. > > The documentation would need to modified slightly to > > I can. I just feel that the patch is one step away from being fully > consistent with other export backends. Unless I miss something. > > -- > Ihor Radchenko // yantar92, > Org mode maintainer, > Learn more about Org mode at . > Support Org development at , > or support my work at > -- Fragen sind nicht da, um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler Headaches with a Juju log: unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run a leader-deposed hook here, but we can't yet --000000000000b28e6c062ac7f992 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Ihor,

yes, the patch is just a step = towards consistency, but I think is is an important one, because it
makes org-mode not generate illegal/faulty LaTeX code.=C2=A0
<= br>
As for the photo-finish, I have been thinking the following t= hat we can use the 'toc' document property.

Values nil and t work as intended in all backends. This means rewriting t= his part in ox-latex.el.
Additionally, we add a new value 'to= c:latex'=C2=A0 to keep the current behaviour in ox-latex (at least, oth= er backends could also implement it).

Coming from = the LaTeX world, I lean towards the current ToC handling in ox-latex.el (on= ce fixed). It is closer to what I have been doing for the last couple of de= cades ;-)

Once we agree on a way forward, I'll= start coding.

Best, /PA

On Thu, 2 Jan 2025 at 18:09, Ihor Radchenko <yantar92@posteo.net> wrote:
Pedro Andres Aranda Gutierrez <paaguti@gmail.com> w= rites:

>>=C2=A0 =C2=A0 (1) At the moment, some export backends do not obey t= his
>> specification.=C2=A0 For example, LaTeX export excludes every unnu= mbered
>> headline from the table of contents.
>>
>
> But this happens because of the way LaTeX works...

Sure. But I thought that your patch is working around the LaTeX defaults by adding \addcontentsline{toc}...

> So, ox-latex is technically not right when it ignores unnumbered
>> headings in TOC.
>>
>
> The basis is there... we might need to rewrite (org-latex-headings) a = lot -
> I fear.

Doesn't your patch have everything needed to add unnumbered headings to=
TOC? AFAIU, all we need ti simply adding \addcontentsline{toc}... not
just when there is ALT_TITLE attribute, but also when UNNUMBERED is t
(but not "notoc"). It is just that in the latter case we use actu= al
title in place of ALT_TITLE.

> BTW, since my patch produces correct LaTeX code vs. the current state,=
> could you please apply it to avoid the error which triggered all this = until
> we get something better.
> The documentation would need to modified slightly to

I can. I just feel that the patch is one step away from being fully
consistent with other export backends. Unless I miss something.

--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,=
or support my work at <https://liberapay.com/yantar92>


--
Fragen sind nich= t da, um beantwortet zu werden,
Fragen sind da um gestellt zu werd= en
Georg Kreisler

Headaches with a Juju l= og:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation = we should run a leader-deposed hook here, but we can't yet

--000000000000b28e6c062ac7f992--