From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id kBFNNBkeJWb5DAAAqHPOHw:P1 (envelope-from ) for ; Sun, 21 Apr 2024 16:09:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id kBFNNBkeJWb5DAAAqHPOHw (envelope-from ) for ; Sun, 21 Apr 2024 16:09:29 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=R3JIOtA5; dmarc=pass (policy=none) header.from=gmail.com; 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=1713708569; a=rsa-sha256; cv=none; b=U/VdI14Xws3SSUoqJGoCtuSMJFTj6qFtAssnXVeWdQ1lPCnsnyllbLCU0hrnYoTf1GeUIA Z5x8jH0Y0elndCcV+WlN2PRA5oRJg8gFN/XQ0y4BW8fD+NpjMbotKkBOl+oJNAtt3pkoAU DlE0/3Kvjvb4+6ph3z5bjlzBHpgnv+b55nhBIWVmERFeGZBFgJ+HihWqpo0uOTNwJrDsl+ gSPkZkE98jAnAw8E5jhVSt1NmyFXp0xZsduZapl9V8bBoeKRoyPKLN2kSNia3cpZdx7HOp CpPHxADUmoxnFcI8zOzzrUAR1BWvRIc9kJvzB2c9uSN+2uvOBUZzou+7rEXdyw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=R3JIOtA5; dmarc=pass (policy=none) header.from=gmail.com; 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=1713708569; 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=cEG4JZLc8CcHZzTznHVoBxQztcz1KjsVAtSGKvmhkHw=; b=mFAbBDyX5fi5f6IEehiD0dimAZfw7Y47hleboV56XjwozmvUhMose4jhQC71g1+8U7AMNw ivlx1nocsYel6RnPpB5QOUBXQHZ2/G2ZvNyjiQEuSLzTHPWpPjnfgOSIuXTis6nyNjI3f0 +6MvigfjgrnunKrSCzo5LTrd28S1eGgrbnbeMt+b+DvrmMCLv2oPgA0/Ei5woIOtRz6jOd KGQn+AqfXyKf7te01jTfUH2GjWhuu7JdEHbU0yxpIrnJHbgFO71UVssVc9ZxRPgg66gL7R o6ERcTYocSh1GQjm4kqGtdo4iMnchUWEDotnvYij91OarZvgYwUqBKTSgSN2cQ== 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 5E44E774E7 for ; Sun, 21 Apr 2024 16:09:29 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryXs4-0005ib-KR; Sun, 21 Apr 2024 10:08:44 -0400 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 1ryXs2-0005iD-6L for emacs-orgmode@gnu.org; Sun, 21 Apr 2024 10:08:42 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ryXrz-0000IG-BO for emacs-orgmode@gnu.org; Sun, 21 Apr 2024 10:08:41 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-51b09c3a111so630509e87.1 for ; Sun, 21 Apr 2024 07:08:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713708517; x=1714313317; darn=gnu.org; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=cEG4JZLc8CcHZzTznHVoBxQztcz1KjsVAtSGKvmhkHw=; b=R3JIOtA5Q/OltAuWsM+siw/k2VxUVFIn7ZxVmgZDfMn5e0Ia0xKhg39fZXu7xe1V9J RzHINKq1z14INMCNaubIJayrJD8v1W8k+cqzQt6sN4wxBRs1YbKrZoCDyuSnVSLiOM0r /94IfcBWDbee0Se3nkGQ/mt+AO5k9TjUGIAVisriYtUmXGphb7cm0nkAdspJbqc25qHG XCn5MzPwQMrgWbiIhWdtEFPti69ibg1POacqt1qGQV0WEkCoKSY1l7W0ezk6yslpd+xD mvxaAw8QQ9HjDuFtL+SbrohojteE8ZrYqVDcRgG0kaaF4HFmVg0g2/s9CowmMf0aSUgk mY3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713708517; x=1714313317; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cEG4JZLc8CcHZzTznHVoBxQztcz1KjsVAtSGKvmhkHw=; b=aF71ig1JYfxQfGdP4Kz0CQ2DIEGsuJlYyLEKV3mHgSZcik/JowRLXTk1hPoLs6iQ+O edi09Oci9QQrRO+ydAfA0ycQuOZC7GO5hPx7f8Xx43AoOk45B3QCoCPu4StBoTyleyRa vyUMJhVfeFKSHURwxcfbEmUm5EnIEUNbULv5dNAYG15eFL2TerlU8M4k/A5xNmrD6zmJ FaBddVozw06QRJOACm7vOoqiXWWQ3ZeC9QUYX+VvGdYDdudVcEFGZKFkDierQI4+At/4 kbg+Eql1ZQcYpsX7Uy+r1quji8/1JpbIwvOhXmGGZeb1bkDKNC27f477R+rlrUggFnQ2 7oLw== X-Forwarded-Encrypted: i=1; AJvYcCU/pa7Sw9FGd/OJoRFNwf0xb2BSjHGzKwVVAYa6XGoAwtFu6DT9NhRWYJHek/72qchFsLoKsdEcHynX4dzZcaU+sLcBItU= X-Gm-Message-State: AOJu0YyNdCbZ3Ijg8jdM88IiFwlJFfVZcHmX+OwrZ4jXPyX9SCJWZB5c xcqBR1bmgVoI7l+6ZHnuG71+BeF6WX4DpLo9cNSvw+9/I3DIY5X/7Em78Q== X-Google-Smtp-Source: AGHT+IH0lUPVnM4f8PxWGYdr+Dlg2J1H+xnR4aNmEY2p2U5WpjmclQQc7WeHxwe+H1hX2rHMtfHUuQ== X-Received: by 2002:a05:6512:3ab:b0:518:b133:7e2b with SMTP id v11-20020a05651203ab00b00518b1337e2bmr4034723lfp.64.1713708516620; Sun, 21 Apr 2024 07:08:36 -0700 (PDT) Received: from ago-mbp-uni.local (213162081133.public.t-mobile.at. [213.162.81.133]) by smtp.gmail.com with ESMTPSA id q11-20020aa7da8b000000b00571c0ba62c8sm3979688eds.32.2024.04.21.07.08.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 07:08:36 -0700 (PDT) References: <87jzkqq171.fsf@localhost> User-agent: mu4e 1.10.8; emacs 30.0.50 From: Alexander Gogl To: Ihor Radchenko Cc: "Pedro A. Aranda" , Org Mode List Subject: Re: [FR] Please add custom command variable to org-latex-footnote-refere Date: Sun, 21 Apr 2024 16:08:13 +0200 In-reply-to: <87jzkqq171.fsf@localhost> X-Mailer: mu4e 1.10.8; emacs 30.0.50 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=gogl.alexander@gmail.com; helo=mail-lf1-x12d.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, 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-Spam-Score: -9.69 X-Migadu-Queue-Id: 5E44E774E7 X-Migadu-Spam-Score: -9.69 X-Migadu-Scanner: mx10.migadu.com X-TUID: rvHo8oAMGNKR --=-=-= Content-Type: text/plain Dear Ihor, you mean like this? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=patch-ox-latex-footnote-command-option.diff >From 1c7bee53ac91a8296c144f157ab8646b1a7a6595 Mon Sep 17 00:00:00 2001 From: Alexander Gogl Date: Wed, 17 Apr 2024 16:00:41 +0200 Subject: [PATCH] added option to customize latex footnote command in export --- etc/ORG-NEWS | 4 ++++ lisp/ox-latex.el | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index e61bd6988..a579260f5 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -999,6 +999,10 @@ even though it does not have its own ID. By giving files top-level id properties, links to headlines in the file can also be made more robust by using the file id instead of the file path. +*** New option ~latex-default-footnote-command~ + +This new option allows you to define the LaTeX command the org-mode footnotes are converted to (for example ~\\sidenote{%s%s}~). + ** New features *** =colview= dynamic block now writes column width specifications diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 5c19e1fe7..b45d13ca2 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -135,6 +135,9 @@ (:latex-default-table-environment nil nil org-latex-default-table-environment) (:latex-default-quote-environment nil nil org-latex-default-quote-environment) (:latex-default-table-mode nil nil org-latex-default-table-mode) + ;; TODO implement options variable + (:latex-default-footnote-command "\\footnote{%s%s}" nil org-latex-default-footnote-command) + ;; (:latex-diary-timestamp-format nil nil org-latex-diary-timestamp-format) (:latex-engraved-options nil nil org-latex-engraved-options) (:latex-engraved-preamble nil nil org-latex-engraved-preamble) @@ -667,6 +670,14 @@ The function result will be used in the section format string." ;;;; Footnotes +(defcustom org-latex-default-footnote-command "\\footnote{%s%s}" + "Default command used to insert footnotes. + Customize this command if the LaTeX class provides a different notation command like `\\sidenote{%s%s}' that you want to use." + :group 'org-export-latex + :version "24.4" ;; FIXME enter correct version + :package-version '(Org . "9.7") + :type 'string) + (defcustom org-latex-footnote-separator "\\textsuperscript{,}\\," "Text used to separate footnotes." :group 'org-export-latex @@ -780,7 +791,6 @@ default we use here encompasses both." :group 'org-export-latex :type 'string) - ;;;; Tables (defcustom org-latex-default-table-environment "tabular" @@ -2239,7 +2249,7 @@ CONTENTS is nil. INFO is a plist holding contextual information." (t (let ((def (org-export-get-footnote-definition footnote-reference info))) (concat - (format "\\footnote{%s%s}" (org-trim (org-export-data def info)) + (format org-latex-default-footnote-command (org-trim (org-export-data def info)) ;; Only insert a \label if there exist another ;; reference to def. (cond ((not label) "") -- 2.41.0 >From 12d211a5f0c56faf1b829fef26f788f210a31382 Mon Sep 17 00:00:00 2001 From: Alexander Gogl Date: Wed, 17 Apr 2024 21:22:51 +0200 Subject: [PATCH] ox-latex: New option to customize LaTeX footnote command * lisp/ox-latex.el (org-export-define-backend): Add option. (org-latex-default-footnote-command): New custom variable. (org-latex-footnote-reference): Replace string "\\footnote{%s%s}" with custom variable. * etc/ORG-NEWS (New and changed options): Add description to option. Some LaTeX classes define their own footnote commands. For example, kaobook (https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf) has \footnotes and \sidenotes, whereby sidenotes (notes are put into the outter margin) are the dominant form of putting notes in kaobook. It would be great if you could make the footnote command in the footnote function customizable. My proposal is in the attachment. Modified from a feature request by Alexander Gogl. TINYCHANGE --- etc/ORG-NEWS | 12 ++++++++++-- lisp/ox-latex.el | 12 ++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index a579260f5..571ab3c98 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -999,9 +999,17 @@ even though it does not have its own ID. By giving files top-level id properties, links to headlines in the file can also be made more robust by using the file id instead of the file path. -*** New option ~latex-default-footnote-command~ +*** New option ~latex-default-footnote-command~ to customize the LaTeX footnote command -This new option allows you to define the LaTeX command the org-mode footnotes are converted to (for example ~\\sidenote{%s%s}~). +This new option allows you to define the LaTeX command the Org mode +footnotes are converted to (for example ~\sidenote{%s%s}~ instead of +the default ~\footnote{%s%s}~). + +The option can be customized either by + +a) setting the global variable in the ~org-export-latex~ customization + group or +b) by setting the file local variable ~LATEX_FOOTNOTE_COMMAND~ ** New features *** =colview= dynamic block now writes column width specifications diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index b45d13ca2..058b5a31a 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -135,9 +135,7 @@ (:latex-default-table-environment nil nil org-latex-default-table-environment) (:latex-default-quote-environment nil nil org-latex-default-quote-environment) (:latex-default-table-mode nil nil org-latex-default-table-mode) - ;; TODO implement options variable - (:latex-default-footnote-command "\\footnote{%s%s}" nil org-latex-default-footnote-command) - ;; + (:latex-default-footnote-command "LATEX_FOOTNOTE_COMMAND" nil org-latex-default-footnote-command t) (:latex-diary-timestamp-format nil nil org-latex-diary-timestamp-format) (:latex-engraved-options nil nil org-latex-engraved-options) (:latex-engraved-preamble nil nil org-latex-engraved-preamble) @@ -672,9 +670,11 @@ The function result will be used in the section format string." (defcustom org-latex-default-footnote-command "\\footnote{%s%s}" "Default command used to insert footnotes. - Customize this command if the LaTeX class provides a different notation command like `\\sidenote{%s%s}' that you want to use." + Customize this command if the LaTeX class provides a different + command like `\sidenote{%s%s}' that you want to use. +%s +" :group 'org-export-latex - :version "24.4" ;; FIXME enter correct version :package-version '(Org . "9.7") :type 'string) @@ -2249,7 +2249,7 @@ CONTENTS is nil. INFO is a plist holding contextual information." (t (let ((def (org-export-get-footnote-definition footnote-reference info))) (concat - (format org-latex-default-footnote-command (org-trim (org-export-data def info)) + (format (plist-get info :latex-default-footnote-command) (org-trim (org-export-data def info)) ;; Only insert a \label if there exist another ;; reference to def. (cond ((not label) "") -- 2.41.0 >From 7ff2baa24dbcfa0675d8e797746f6f2965c19a8c Mon Sep 17 00:00:00 2001 From: Alexander Gogl Date: Sun, 21 Apr 2024 10:41:54 +0200 Subject: [PATCH] lisp/ox-latex.el: Fixed typo * /ox-latex.el (org-latex-default-footnote-command): fixed typo in description of option TINYCHANGE --- lisp/ox-latex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 058b5a31a..22a9595ab 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -671,7 +671,7 @@ The function result will be used in the section format string." (defcustom org-latex-default-footnote-command "\\footnote{%s%s}" "Default command used to insert footnotes. Customize this command if the LaTeX class provides a different - command like `\sidenote{%s%s}' that you want to use. + command like `\\sidenote{%s%s}' that you want to use. %s " :group 'org-export-latex -- 2.41.0 --=-=-= Content-Type: text/plain Best, Alexander Ihor Radchenko --- 2024-04-21 So 13:45: > Alexander Gogl writes: > >> I have tested the global and buffer local options with kaoscript and the article class. I could't find any problems with the option. Labels and footnotes inside footnotes work. >> >> The current version of the patch (fixed a typo) is attached. > > Thanks! > May you please send the final version of the patch, against main branch > rather than a series of incremental patches? --=-=-=--