auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reftex-reference: beamer label for frames is not found by reftex


From: Uwe Brauer
Subject: Re: reftex-reference: beamer label for frames is not found by reftex
Date: Sun, 10 Jan 2021 14:03:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>>> "TH" == Tassilo Horn <tsdh@gnu.org> writes:

> Uwe Brauer <oub@mat.ucm.es> writes:
> Hi Uwe,

>> I presume this is more a reftex than an auctex problem. 

> Yes, but your are correct here anyway.

>> I did not pay much attention to the fact that in a beamer document I
>> can refer to a specific slide using (I attach a complete document just
>> in case)
>> 
>> \begin{frame}[label={sec:orge783ce1}]{First section}
>> 
>> The point is that if I use the command reftex-reference, this
>> particular label is not offered.  So I think it would be good to add
>> that functionality to reftex, I think

> You are right.  I've added that feature to reftex in the emacs master
> branch so it'll be available out-of-the-box in emacs 28.1.  Until then,
> you can customize `reftex-label-regexps'.

Thanks for the fast reply. I pulled your change and run 

 git diff HEAD~1

Which showed me

+        (regexp-opt '("lstlisting" "dmath" "dseries" "dgroup"
+                      "darray" "frame"))
         ;; closing brace, optional spaces
         "}[[:space:]]*"
         ;; Now for macros
@@ -919,9 +920,9 @@ reftex-derive-label-parameters
         "\\[[^][]*"
         ;; Allow nested levels of chars enclosed in braces
         "\\(?:{[^}{]*"
-         "\\(?:{[^}{]*"
-         "\\(?:{[^}{]*}[^}{]*\\)*"
-         "}[^}{]*\\)*"
+        "\\(?:{[^}{]*"
+        "\\(?:{[^}{]*}[^}{]*\\)*"
+        "}[^}{]*\\)*"


The second change indicated only a different indent, so I changed the
reftex-label-regexp via custom to 


 '(reftex-label-regexps
   '("\\\\label{\\(?1:[^}]*\\)}" 
"\\\\\\(?:begin[[:space:]]*{\\(?:d\\(?:array\\|group\\|math\\|series\\)\\|frame\\|lstlisting\\)}[[:space:]]*\\|\\(?:ctable\\)\\)\\[[^][]*\\(?:{[^}{]*\\(?:{[^}{]*\\(?:{[^}{]*}[^}{]*\\)*}[^}{]*\\)*}[^][]*\\)*\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^]
 ,}.
        %]+\\)[^]]*\\]"))

and that seems to solve my issue. 

One last comment thou: if I run 
reftex-reference

I have to select all, which is fine for short documents but a bit
cumbersome for long one. 

So I thought of modifying 
 reftex-label-alist 
adding 

          ("frame"   ?F "label=frm:%f:"  "~\\ref{%s}" nil ("frame"  "slide"))

But that did not work, any idea how to achieve that?

Thanks

Uwe 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]