From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id CHhRKdr9sGUZgwAAe85BDQ:P1 (envelope-from ) for ; Wed, 24 Jan 2024 13:08:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id CHhRKdr9sGUZgwAAe85BDQ (envelope-from ) for ; Wed, 24 Jan 2024 13:08:58 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=L+lQASlu; 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=1706098138; a=rsa-sha256; cv=none; b=nMFrX8tzAvwCRIHiUZfZEc4Zwt9A37YzLM3rbnBQaelaZYR2XIMzy851UUrLZrs9XZvgK5 DhxEuXXrz0aTyzTvoWwNGnyzDo5wz9RIrrgmDB97trrjbfLqqRDvNmk6DJM64hzpTm2pG7 IhFxLt0S7bdII9REuN1K8oDiHRuq7gqfBWG7Ua3Xb5hclrWq8XBML4QMngg/fOwHjhEpHp 3Qa2z0+bKju4VSENGESO5L7WPaokMYURB6Ba/TvuhS8/h10T9Th71gXEcaNJWHtFq6WTxs w9SrcwKKOIn5JRuZLwGpaC1jqEOr8nd+SxirrbRfiCGzv60niuiFsheyJwB8VA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=L+lQASlu; 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=1706098138; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=RLEoCElJvIvdE03DxINn27mVLcyDNBXXsjBUjsqc7wY=; b=CfjkCNc4jOes4dHoMmf8WobEs1KkjKieVJ59rtlokWI5mPOZAb8S1l0rjBlu7C/Oz6rRQm VfbELy29teJzYk+Zv2TjtMiXTqPwpRomqczoaMdF/Vys6rNzq0btXsgNqMKYNPZW3d6bv3 whWvpuOMTYdtdb3Qzd01WrmhxSz2RqRHJjzYKHJvvuL9CsPaIiX0wxNc/FJpPOBiL87H8I DzEtxOV/HC9wEa4ySHLAmhDbnUtHOKwwMq1PqbjilT8JOByJYjva79ctduP0sW+vBNS2G5 mRigk/o/ujs/qFygLW22jcdKweM9qh+Kki3VqcUIsz+3v7BIQYoj5u24LcqhWA== 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 73FD09D2C for ; Wed, 24 Jan 2024 13:08:58 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSc33-0000x4-Iu; Wed, 24 Jan 2024 07:08:05 -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 1rSc2w-0000uB-Dr for emacs-orgmode@gnu.org; Wed, 24 Jan 2024 07:07:58 -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 1rSc2t-0007tF-3W for emacs-orgmode@gnu.org; Wed, 24 Jan 2024 07:07:58 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 77D37240105 for ; Wed, 24 Jan 2024 13:07:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1706098072; bh=GdgWCKRl7q+4nV7xwdgiUCgLEi6+2EBeXX/glDUaxMg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=L+lQASluhhnOtuhKU9rKfR0yIas8SlwcQgKvuUsyJj9shoEtms/csDFAKV5iCga0P dKhjOHxIpmacJqTgzTjGdPlDZ8nUFnh6ebOoDXZDW+caLj0XQW+bVzAyn2Fy+sgeX0 LSI93YLiRtLAKQ6gTfW9f+YPPIyMjnhR763/D9iboB8nmDyQbGLlfGs+qEUk4FcOsb V/AiFF3Q2Vfa4RqZ1TENd13SlXdKmV0CljcxWWxLYYtuzNg28MjjXLreZybh9qIB0N 8aKx8WrbYYExppTDxp2e3ZXgEkpZsuG7LgrbJs9pGMQ2ljiwoVwcA+10MPep/PKcEZ oD7X76k2LylzQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TKjQG4qDFz9rxN; Wed, 24 Jan 2024 13:07:50 +0100 (CET) From: Ihor Radchenko To: Eric Anderson , Timothy Cc: emacs-orgmode@gnu.org Subject: [BUG] Footnotes in section titles In-Reply-To: References: Date: Wed, 24 Jan 2024 12:11:21 +0000 Message-ID: <87sf2ngcd2.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_SBL_A=0.1 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: mx10.migadu.com X-Spam-Score: -6.89 X-Migadu-Queue-Id: 73FD09D2C X-Migadu-Spam-Score: -6.89 X-TUID: qRwDoIeya0gP Eric Anderson writes: > The resulting LaTeX code (also attached) uses \footnote inside \section and > \paragraph macros, producing compiler errors. A little googling turns up > the following comp.text.tex usenet post > https://comp.text.tex.narkive.com/lkZWQYaS/using-footnotes-in-paragraph, > explaining that \footnote is fragile and cannot be used in those contexts > without \protect. Manually adding \protect before \footnote in the > automatically-generated tex file appears to produce correct results. > > I don't know if the best fix is to always \protect \footnotes in LaTeX > export, or if more contextual smarts are required, but this seems like an > issue worth addressing. Confirmed. \protect is not a good idea. There is a reason why LaTeX refuses footnotes in titles - titles can appear in multiple places in the document (TOC, page footer, etc) and thus references to the footnotes are non-deterministic. https://texfaq.org/FAQ-ftnsect suggests to use \usepackage[stable]{footmisc} or to pass optional argument to \section without footnote \section[title]{title\footnote{title ftnt}} The footmisc package is a nice solution, but it has certain requirements about loading order. In particular, it must be loaded after certain packages (setspace, memoir). We cannot yet control the \usepackage ordering in LaTeX preamble and always place default LaTeX packages first - something we cannot do for footmisc. The \section[...]{...} approach may work, but it is tricky - it is completely up to the `org-latex-classes'. So, we may have to use regexp replacement, which might be fragile. So, I prefer the first approach with footmisc. But we can only do it after Timothy's patch introducing more flexible templating system is landed. CCing Timothy. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at