Hi Tassilo,
Arash Esbati <[email protected]> writes:
> I'm voting for the key binding n since `reftex-label-alist-builtin' has
> this entry:
>
> ("\\footnote[]{}" ?n "fn:" "~\\ref{%s}" 2
> (regexp "footnotes?" "Fussnoten?"))
>
> When hitting C-c ) the user then needs to press n twice to get the macro
> and the labels completion. I think this is easier than hitting t or o
> and then n.
>
> Any comments? I will prepare a patch for Emacs master then.
Nobody complained, please find attached two patches against Emacs
master. I also touched `reftex-label-alist-builtin' (second patch).
Can you please install them? I made 2 change sets in case we don't want
to change the builtin value.
>From 67b6f7bd1c54bc5b8b2c2ebefa6e7bf1df450597 Mon Sep 17 00:00:00 2001
From: Arash Esbati <[email protected]>
Date: Thu, 17 Jun 2021 22:59:32 +0200
Subject: [PATCH 1/2] Support new LaTeX kernel macro \footref
* lisp/textmodes/reftex-vars.el (reftex-ref-style-alist): Add
entry for \footref macro which is part of LaTeX kernel 2021-06-01.
---
lisp/textmodes/reftex-vars.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 0d6bfb5d86..a8ca780b31 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -1059,7 +1059,7 @@ reftex-multiref-punctuation
(defcustom reftex-ref-style-alist
'(("Default" t
- (("\\ref" ?\C-m) ("\\Ref" ?R) ("\\pageref" ?p)))
+ (("\\ref" ?\C-m) ("\\Ref" ?R) ("\\footref" ?n) ("\\pageref" ?p)))
("Varioref" "varioref"
(("\\vref" ?v) ("\\Vref" ?V) ("\\vpageref" ?g)))
("Fancyref" "fancyref"
@@ -1079,7 +1079,7 @@ reftex-ref-style-alist
`reftex-ref-macro-prompt'.) The keys, represented as characters,
have to be unique."
:group 'reftex-referencing-labels
- :version "27.1"
+ :version "28.1"
:type '(alist :key-type (string :tag "Style name")
:value-type (group (choice :tag "Package"
(const :tag "Any package" t)
--
2.32.0
>From 2b5416be8d6dac2ccc9ab2a034fd499564973c7d Mon Sep 17 00:00:00 2001
From: Arash Esbati <[email protected]>
Date: Thu, 17 Jun 2021 23:12:00 +0200
Subject: [PATCH 2/2] Use \footref when referencing a footnote label
* lisp/textmodes/reftex-vars.el (reftex-label-alist-builtin): Use
\footref as `reference-format' for \footnote macro.
---
lisp/textmodes/reftex-vars.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index a8ca780b31..96065ee69e 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -121,7 +121,7 @@ reftex-label-alist-builtin
(regexp "tables?" "tab\\." "Tabellen?"))
("table*" ?t nil nil caption)
- ("\\footnote[]{}" ?n "fn:" "~\\ref{%s}" 2
+ ("\\footnote[]{}" ?n "fn:" "~\\footref{%s}" 2
(regexp "footnotes?" "Fussnoten?"))
("any" ?\ " " "~\\ref{%s}" nil)
--
2.32.0
Best, Arash