From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6GQtHEw6KmNxCwAAbAwnHQ (envelope-from ) for ; Wed, 21 Sep 2022 00:10:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aFwqG0w6KmOP6wAAG6o9tA (envelope-from ) for ; Wed, 21 Sep 2022 00:10:20 +0200 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 3D4173A843 for ; Wed, 21 Sep 2022 00:10:19 +0200 (CEST) Received: from localhost ([::1]:48554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oalRa-0006Tq-DF for larch@yhetil.org; Tue, 20 Sep 2022 18:10:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oagt3-0001zu-JB for emacs-orgmode@gnu.org; Tue, 20 Sep 2022 13:18:24 -0400 Received: from mout01.posteo.de ([185.67.36.65]:34333) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oagt1-0000yc-HO for emacs-orgmode@gnu.org; Tue, 20 Sep 2022 13:18:21 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 36199240026 for ; Tue, 20 Sep 2022 19:18:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1663694296; bh=FZMFD5vVw7tMZWrVr/UtBMris4vQ04qumM+wN13IF3o=; h=From:To:Cc:Subject:Date:From; b=FLOyOOKLMEWzTO02A9nQmC1NTQ09g4r5MWp4fvbwrOXkPbgrvT5+uAHTpTV697GXf tSuKUvx+n3Zi1+ikbUQ+L5amaYrGxgdgjkhMuh0gGq2pf2sC9GFUMfVXOeYoXYMdO4 cYl0UFxYN5hVI3+W3dT9kyX9eeGkP1AFydSgJ7eWSOiqTO04YGboOMlnxwwtmU77+j 0HkWW0Ogg5eQ3ciHYosjYO66Urn8Ib1Z7B09ubQ1dEO/ZpULGI5C6OhYj64kDltyDN KuO34l8y0SiF3Pj4Vu+Phb1GM/afUtFKoQ0YlwYaDkSCkdbno3dUCnK1i8oRrI4B5n ND6MkjkgRC7ug== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MX7Y10Yk4z6tmW; Tue, 20 Sep 2022 19:18:12 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Ihor Radchenko Cc: orgmode Subject: Re: [Patch] Pre-/postpend arbitrary LaTeX code to a section References: <87o7vcsw8m.fsf@posteo.net> <87czbqyy5i.fsf@localhost> Date: Tue, 20 Sep 2022 17:18:09 +0000 In-Reply-To: <87czbqyy5i.fsf@localhost> (Ihor Radchenko's message of "Tue, 20 Sep 2022 21:26:49 +0800") Message-ID: <87sfkmdkxa.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, 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663711819; 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=uDVKxmoSb1UGs9DJ3MppNpX9+Mh6mrTNFiBIYNQPfwA=; b=kqg6zoUsAMcjdYlDrkjMXthpH4HVyJTfW9PqNqSQNV3HZ1nXzvATbew57BpaKTAalnUXAx 7hQqeYuqKUGs5yHLL0WkimMf72ItJ5LbhjEV6nIXTbpNmCMrhnwDUgwypyAiKpP4dDd1U+ 5ln9uDAlHrEDq3NMhJ3DCkZKeBGuIPoN2WxIkhIKvFBDtPee3Cjn+lJT7OEjMF/EnXiW+y 5fPwB8CKt33NSRVt5DQ9RheDA/iCE2GJlqo2rRCqsIXgk7bbPi6aZXfMeg5U8gqS9RulHr cgacAh4fB6D7KxEQVHJg6WiFyJPU0IMMiDLDMtNxAWkf97aIVYhQfv9L6+9CqQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663711819; a=rsa-sha256; cv=none; b=r9juturlgWXvywIh8fWm7giNYgibblQqKKZInCS6QqMpk1ICR1M/j9d8FgG6fl/zetAi6R jnEeCqVsCP4oUsFm2uuh+zZFMPt9HspS7KAndapuSDLapK9HBD/KwHU60cENsti7EmGScw ro7//dyHK41b9NUaTTHXHDCIccvYuz5gfb9wr8fMgpG16pqr1h5L+wJZ0wvou5zwbDxeln y6wt+4+GTjQQ0LKWlwMv5y8Nhd/jA6bOIF6AsYQKJv3MlqnJUsnsofr0yLvF7MK4lgjMBZ 9w0FvsdSFkuMVkusOHQw9hrqzO82lHZt/V6sQOdo5kkj8ZpxOQ+Xd/hlJffOqg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=FLOyOOKL; 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" X-Migadu-Spam-Score: -2.53 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=FLOyOOKL; 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" X-Migadu-Queue-Id: 3D4173A843 X-Spam-Score: -2.53 X-Migadu-Scanner: scn1.migadu.com X-TUID: bGE14CYycaX4 Ihor Radchenko writes: > I do not like this idea. > Please remember that headlines may be exported as parts, sections, > subsections, list items, or paragraphs depending on the headline level. > Arbitrary pre/post commands may unexpectedly break things during export. I don't see why, if the user knows LaTeX and knows what he/she is doing. Sometimes it's just adding an "\addtocontents" just before the section/subsection,etc. The property that adds the string before and the property that adds the string after are understood to affect the entire heading at the current level and its contents, including lower levels. For example, if someone wants the current heading (and all its sublevels) not to be included in the TOC but to be included in the headers of the pages, it would suffice to (I keep here the original name of the properties that I proposed in the patch, but I think Maxim's proposed name is more accurate): ----------------------------------- * Section :PROPERTIES: :presec: \setcounter{secnumdepth}{0} :presec+: \addtocontents{toc}{\protect\setcounter{tocdepth}{0}\ignorespa= ces} :postsec: \setcounter{secnumdepth}{2} :postsec+: \addtocontents{toc}{\protect\setcounter{tocdepth}{2}\ignorespa= ces} :END: Lorem ipsum dolor. ** Subsection one lorem ** Subsection two ipsum Which would pass to LaTeX as: \setcounter{secnumdepth}{0} \addtocontents{toc}{\protect\setcounter{tocdept= h}{0}\ignorespaces} \section{Section} Lorem ipsum dolor. \subsection{Subsection one} lorem \subsection{Subsection two} ipsum \setcounter{secnumdepth}{2} \addtocontents{toc}{\protect\setcounter{tocdept= h}{2}\ignorespaces} ---------------------------------- (The above can even be simplified from LaTeX by defining a simple environment, but I've exemplified it like this to make it look better). In what situations might this return unexpected results? > However, I do agree that per-heading control over latex export is > currently cumbersome. > > The canonical ox-latex approach to customize headline export is > org-latex-classes variable. This variable defines (among other things) > pre/post commands during headline export: Apologies in advance if I misunderstood what you're suggesting, but isn't the "org-latex-classes" property supposed to affect the structure of the entire document? What I'm proposing here is rather something specific to particular headings (and its entire content), like the ":ALT_TITLE:" property. If I understand correctly, what you are suggesting is that org-latex-classes can have "local values" for specific headings, if such headings are 'marked' with some property? Best regards, Juan Manuel=20 ------------------------------------------------------ Juan Manuel Mac=C3=ADas=20 https://juanmanuelmacias.com https://lunotipia.juanmanuelmacias.com https://gnutas.juanmanuelmacias.com