From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.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 OCMaHB3VJGbfhgAA62LTzQ:P1 (envelope-from ) for ; Sun, 21 Apr 2024 10:58:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id OCMaHB3VJGbfhgAA62LTzQ (envelope-from ) for ; Sun, 21 Apr 2024 10:58:05 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=mdNECA55; 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=1713689885; a=rsa-sha256; cv=none; b=VvgnVCGPhyJB03ElJX6kjxavtItvuWZ5kdpkB6aeaaMSqxFS8ms3ZRDKOnRc51zwHc3/Nk F+1xP/1ZlJm8jZvRUPCSH0h+1JGMVFErrlqz9KguKv1yO7trJj1FQBkMDwZEGOkQPMt6XD yFiQKdXTsWn9i8SnKF2v6Ih3EneYv8P+Ol/I159XoRnhF/JoFYg0tmBDfvVKVik2ChRaSv V+Dn9BT6zaDyL2KICsuzXSFaB/BvWT/JIHJwKAALuJyNlbrvVrxP0jxGvbTMHbG8NIuugJ jWt11P/f1W+M8LQQnqRcYDn4Z+e+n2UDmqCBhdmmPxVQperrGdVmyfhMfVEkcw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=mdNECA55; 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=1713689885; 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=MlLNMewHfuQAwfAKEHFVjP+olvsTzcbxsZxhGTZT9E0=; b=Tv1BVlmgJ6RNtq11c1KBCv3Mrk68zyAsUzXfpOFrNBoReOQ5hy5S8eLJQi0a6/9XV7ASqb yXCkJPQqA3mVHP3gzRKUZCxODpvcA75ObgMc24ntb77XDVL4OYT5glhDhh1vnCG22cP4FD Wza1/7EGi5IIvmnrGLhMTFGK8X37+4yBLg8d1spH2JKncPN/E2xAceU4uNb7/3kCv1P2S7 h3OdNE+wnNqlkBCvAvbX5kGLPb144Dl2awYJ+hZQVJfOBSVKuf55ejlMKT2dJI4uXKHTv/ yGGH+q25MCVZgEBhwEJjGGZfdTC2LgeaNG26PALWJ2j3nHlJD3mhzVEw/kuAUA== 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 267F2249F3 for ; Sun, 21 Apr 2024 10:58:05 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryT0G-0001eK-FH; Sun, 21 Apr 2024 04:56:52 -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 1ryT0E-0001dx-Qs for emacs-orgmode@gnu.org; Sun, 21 Apr 2024 04:56:50 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ryT0C-000403-Gl for emacs-orgmode@gnu.org; Sun, 21 Apr 2024 04:56:50 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a55323f2ef9so407207966b.1 for ; Sun, 21 Apr 2024 01:56:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713689807; x=1714294607; 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=MlLNMewHfuQAwfAKEHFVjP+olvsTzcbxsZxhGTZT9E0=; b=mdNECA55UMl/GbuKoEQF55oIA3cFIz19k9a4hPrYDcvSkmP2hhxSYFGOED0Y9CRbvC Bl1tiBIyB3kRr09wyg+B21V8nNgegwjXsogmVfh9Q1B04jHh8GUB/qoBD1A6c3J8brq0 n89+7N3wq2WhQLNlpJVsFCNX6796BeNMjGvFmH7SFqEmPUBDtyKf6/al7hSMtWFH+laQ yez2xluhy2JJzpTTgh1ZWL/UNbyfuRyhAIXbKbtlBT3pJ+kaa0cc93NlZZf1pmVV9i5j T/4oU8OurqzGCexTV16mLyAqfimEkSh1qEh9IlEoqRjYwf4ftRA7kAWZgHeM+a43tcrh 1dfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713689807; x=1714294607; 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=MlLNMewHfuQAwfAKEHFVjP+olvsTzcbxsZxhGTZT9E0=; b=BffOcj5f1Vj3OLbIh0jHYrts9k2rcfkr3VXgBVoo7o59zMp6+Z5LYO86VbIRiAcx4c pYLdloMsml60betoio6erpjCEj0BRpcd+Gi9sBfraknbIQOy6ic9v94J/2hXAWBA6JZ2 +EJYviG2Mk+FiKLXuAInAf8vkc8R9j8zfyefv/CHexgG1eBt54dnaZ+PvRtAPy9rbhBd uplfULSKdHSpIzkyzfE3KYAZrhGg+X2+IE4sJecmXf/Nk/VhtHoCC3PqPrdGPFFuEtLd Qh2lXWEJEDcYNEQwmACW3X/Nha+GHt24JDj3k9WKO1rnGo32Ti1ndTA5sfnLhgAI/Y2k TjQg== X-Gm-Message-State: AOJu0Yy9fqldu5iUYAFLAO339/w2ZvMGidt0NUX2rV1kB/FwS5R6aT/s vI9kjH5WT2fDsLYeLjB+43bl9QaTw3kQO6EGVdmwzTclIp2KZW9oJ40i2w== X-Google-Smtp-Source: AGHT+IHinapR/umYVpzIyoikvEc5D63wd1RduQJF+BvUVI5kVo7uOrAvCMYEPxuzjIJlrWdsPmqu3w== X-Received: by 2002:a17:907:7ea7:b0:a55:b2d8:c584 with SMTP id qb39-20020a1709077ea700b00a55b2d8c584mr224780ejc.66.1713689806122; Sun, 21 Apr 2024 01:56:46 -0700 (PDT) Received: from ago-mbp-uni.local (213162081133.public.t-mobile.at. [213.162.81.133]) by smtp.gmail.com with ESMTPSA id ks15-20020a170906f84f00b00a55b0bb8095sm264666ejb.124.2024.04.21.01.56.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 01:56:45 -0700 (PDT) References: User-agent: mu4e 1.10.8; emacs 30.0.50 From: Alexander Gogl To: "Pedro A. Aranda" Cc: Org Mode List Subject: Re: [FR] Please add custom command variable to org-latex-footnote-refere Date: Sun, 21 Apr 2024 10:34:22 +0200 In-reply-to: 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::62a; envelope-from=gogl.alexander@gmail.com; helo=mail-ej1-x62a.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: 267F2249F3 X-Migadu-Spam-Score: -9.69 X-Migadu-Scanner: mx10.migadu.com X-TUID: HB566OHlj5lg --=-=-= Content-Type: text/plain Hi Pedro, dear community, 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-lisp-ox-latex.el-Fixed-typo.patch >From 7ff2baa24dbcfa0675d8e797746f6f2965c19a8c Mon Sep 17 00:00:00 2001 From: Alexander Gogl Date: Sun, 21 Apr 2024 10:41:54 +0200 Subject: [PATCH 3/3] 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/x-patch Content-Disposition: attachment; filename=0002-ox-latex-New-option-to-customize-LaTeX-footnote-comm.patch >From 12d211a5f0c56faf1b829fef26f788f210a31382 Mon Sep 17 00:00:00 2001 From: Alexander Gogl Date: Wed, 17 Apr 2024 21:22:51 +0200 Subject: [PATCH 2/3] 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-added-option-to-customize-latex-footnote-command-in-.patch >From 1c7bee53ac91a8296c144f157ab8646b1a7a6595 Mon Sep 17 00:00:00 2001 From: Alexander Gogl Date: Wed, 17 Apr 2024 16:00:41 +0200 Subject: [PATCH 1/3] 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 --=-=-= Content-Type: text/plain Best, Alexander PS: @Pedro I also use the great koma-script for a lot of my documents :) "Pedro A. Aranda" --- 2024-04-20 Sa 09:04: > /Hi, Alexander Gogl writes: /> ox-latex: New option to customize LaTeX footnote command > > I hope you are aware that with your patch you are not going to be aware to pass > extra options to your foot or side notes, right? And since I'm not familiar with > kaobook, just a question. Are you sure that the foot and side notes will not choke > at a \label{} inside the text? > //> PS: I have a hard time to setup an environment to test the patch because >> my Spacemacs configuration conflicts with the Org mode development >> version. Can anyone provide me a link to a ressource that describes the >> procedure? > > I'm running on a vanilla Emacs and > > ---cut here -- > (let ((org-devel-path (expand-file-name "~/Devel/org-mode/lisp"))) > (when (file-directory-p org-devel-path) > ;; (message "Adding %s to load-path" org-devel-path) > (add-to-list 'load-path org-devel-path))) > ---cut here -- > > in my .emacs.d/early-init.el does the job. I have a general Devel directyl for my development jobs. > > Hope it helps, /PA > > PS: Cool kaobook. I've used koma-script for most of my LaTeX work in the last 15 years +/- ;-) though. --=-=-=--