From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id GHsoHLo2b2U0lwAAauVa8A:P1 (envelope-from ) for ; Tue, 05 Dec 2023 15:42:02 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GHsoHLo2b2U0lwAAauVa8A (envelope-from ) for ; Tue, 05 Dec 2023 15:42:02 +0100 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 4A8F2396D4 for ; Tue, 5 Dec 2023 15:42:02 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=JwR0q5F5; 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=1701787322; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ZVaNJDCINYGwVoKyy31qzqsB7ajFx0WJxsl+uwHk31A=; b=VGxDHMGR9cSRsN41S3jDF54ROMoKPT49uMQyvs/zhpdcIgKSt5T9jPwpcZLYyn4MwKx9wg UKiM37S5Qgy6jEpA6ySGmqYJZmqMRhiP9FVqVeoF5yojPEWEHboXVdhTbXFSpweAVdoCpQ S9Aonw68YNS4MqEn+fZ2IBBJ+qlarVHizdsH/L39tpKR3GKBPbyVE0OmR7b3Ixt4NwW33X EQ1vMgPqTZHbFA0NY/gnRiQ/ZygmDH6IbIiv7HTithpxj0089tqMNI/w3eJXEiVOQf+Jjo dP8/4vIdR9E3oGXtj0impRLqkAwvR/zd+Lv+Q3izzz5OI0KhfT7ghuOBKtrzxQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701787322; a=rsa-sha256; cv=none; b=IJ/S6FelmuEXalI4HzA9SkRhmlKMRitEqPzfIf1jiD+flu8VPqM7KifUZyAPvqHOcujMle ynQqp/3opAOMdS1RD1MUVhrrb7JIbvYrSyj7vfLa2kyCd8laEd5ivNiEKMNbAEAE//4AJ1 p2gBA6WEh7PMRzzCYfYf4366Q2mUnexbL5uwE9t/P5RMi6Bs0ufs3R5Q+AsqXXbuBnqXm8 mxjpnwKCv833v+OXnBXDLdR89txec2mGA1G/tdBIPffRx+7QBw4tYw+K51vD8C2tAkUd1d UUEm5AwWB6Ph48s+KpaWRufoEyu5myl7Sb4niom60ja9CUwMVx9JjtMzcQMJ4A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=JwR0q5F5; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAWbE-0005rD-RT; Tue, 05 Dec 2023 09:40:36 -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 1r8hgl-0003i0-0y for emacs-orgmode@gnu.org; Thu, 30 Nov 2023 09:06:59 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r8hgc-0004I0-8k for emacs-orgmode@gnu.org; Thu, 30 Nov 2023 09:06:40 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40b54261534so8225125e9.3 for ; Thu, 30 Nov 2023 06:06:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701353195; x=1701957995; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:user-agent:from:to:cc :subject:date:message-id:reply-to; bh=ZVaNJDCINYGwVoKyy31qzqsB7ajFx0WJxsl+uwHk31A=; b=JwR0q5F5JnVz7l9BBl19Oy6uCTcigcNJ+b04SD1M0hKI45p36Ff2sqc18jxroUmvay RjXR/HNs52PqP+zT2u7TctD3fwSg1L52Uhb5SVQDR/GsUdfVrB8aRPU2WRLGM0WCBnVU HtTRyEKrAn7r1UKPu2f1groSrFhFMFd4bPC+s5zzxtW8MLfBNjanM5qmVDX3Irw+0M60 sdITHXMYi34fg3L5e9iMYEn6az7vSih2Jr5ye3EsRiOKg6YgRU246LLLRVwk6Y9kwn3P Wogk26uQQYmyrhqM1dGC5+11co7x5RUVMO3zlPXnmvrNE9rBVh00Dxr+Gss/oEOxF8xA zP3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701353195; x=1701957995; h=mime-version:message-id:date:subject:to:from:user-agent :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZVaNJDCINYGwVoKyy31qzqsB7ajFx0WJxsl+uwHk31A=; b=EMTculXU0vMkO4c0P/CTbnXYNo8Ub9TjjIAK2XA4kf0BXt5Y54LdkhAmmaWzgGakeY 6MPGMqmuvXiV7w26CWW2aBsCbOGWQuAbvkCXKBWWhF3vPbDje+G4Nr6eta2Ct2QqdFk6 ggAfjAFp6VGfbiNhkdoYfaIbx6z3HS5QOTukduR4mCg1k4q+WRRtbo/KEyxpIZqSSVJf Ci79maFYJdKBiU9wk5bGKfhcnjDv2e146T/FJ9CyfZVuJ7mavOBxe2Egu3lCZPoKLqi5 Z2LNAG9ETdvNMNE47ub7OmWLTa8SMS8CNadIg4EsDXHs7cHRAK0SzWBnFgFofVY74eRo y/qg== X-Gm-Message-State: AOJu0YxFLszFqyNnpvVX84zD1gTgBXs1IKlEJqBI/NyOqI9Pel6CDVvE /ACHrRf7o71BDACdfhDc+h4SR9X9lRQ= X-Google-Smtp-Source: AGHT+IET74cldl16MMZyS0z/rRyeTMKTwfuLJbHpsZPptZK9ZfYO97rl/K9xDkg9norTxWWVZiUqPA== X-Received: by 2002:a05:600c:3ba5:b0:409:325:e499 with SMTP id n37-20020a05600c3ba500b004090325e499mr15764313wms.32.1701353194822; Thu, 30 Nov 2023 06:06:34 -0800 (PST) Received: from pc75-c847.uibk.ac.at (pc75-c847.uibk.ac.at. [138.232.99.75]) by smtp.gmail.com with ESMTPSA id n10-20020a05600c4f8a00b004053e9276easm5743883wmq.32.2023.11.30.06.06.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 06:06:34 -0800 (PST) User-agent: mu4e 1.10.7; emacs 30.0.50 From: Alexander Gogl To: emacs-orgmode@gnu.org Subject: [FR] Please add custom command variable to org-latex-footnote-reference Date: Thu, 30 Nov 2023 15:00:16 +0100 X-Mailer: mu4e 1.10.7; emacs 30.0.50 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=gogl.alexander@gmail.com; helo=mail-wm1-x336.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 05 Dec 2023 09:40:32 -0500 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -5.46 X-Spam-Score: -5.46 X-Migadu-Queue-Id: 4A8F2396D4 X-TUID: qnYzx8/MyupJ Hello, 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. It could look like this: ;; Replace footnote function to make the latex footnote command customizable (setq org-latex-footnote-command "\\footnote{%s%s}") (defun org-latex-footnote-reference (footnote-reference _contents info) "Transcode a FOOTNOTE-REFERENCE element from Org to LaTeX. CONTENTS is nil. INFO is a plist holding contextual information." (let ((label (org-element-property :label footnote-reference))) (concat ;; Insert separator between two footnotes in a row. (let ((prev (org-export-get-previous-element footnote-reference info))) (when (eq (org-element-type prev) 'footnote-reference) (plist-get info :latex-footnote-separator))) (cond ;; Use `:latex-footnote-defined-format' if the footnote has ;; already been defined. ((not (org-export-footnote-first-reference-p footnote-reference info)) (format (plist-get info :latex-footnote-defined-format) (org-latex--label (org-export-get-footnote-definition footnote-reference info) info t))) ;; Use \footnotemark if reference is within another footnote ;; reference, footnote definition, table cell, verse block, or ;; item's tag. ((or (org-element-lineage footnote-reference '(footnote-reference footnote-definition table-cell verse-block)) (eq 'item (org-element-type (org-export-get-parent-element footnote-reference)))) "\\footnotemark") ;; Otherwise, define it with \footnote command. (t (let ((def (org-export-get-footnote-definition footnote-reference info))) (concat (format org-latex-footnote-command (org-trim (org-export-data def info)) ;; Only insert a \label if there exist another ;; reference to def. (cond ((not label) "") ((org-element-map (plist-get info :parse-tree) 'footnote-reference (lambda (f) (and (not (eq f footnote-reference)) (equal (org-element-property :label f) label) (org-trim (org-latex--label def info t t)))) info t)) (t ""))) ;; Retrieve all footnote references within the footnote and ;; add their definition after it, since LaTeX doesn't support ;; them inside. (org-latex--delayed-footnotes-definitions def info)))))))) Best, Alexander