Hi Rens,

Rens Oliemans <[email protected]> writes:

> I have a LaTeX file in which I add some listings "inline" with `C-c C-e
> lstlisting RET caption=abc RET`, This works good and RefTeX can find these
> labels. However, I also have some listings which refer to rather big files,
> which I include in the following way:
>
>     \lstinputlisting[float=tbp,caption=Nondeterminism in
>     Modest,label=lst:{mdp/nondet}]{code/nondet.modest}
             label={lst:mdp/nondet} ?

> I can refer to this listing via `\ref{lst:mdp/nondet}` just fine, but RefTeX
> unfortunately does not find and autocomplete this listing when I do `C-c ) RET
> l`.

Thanks for raising this issue.  This is sort of shortcoming in
`reftex-label-regexps' which you can fix yourself easily.  Enter

  M-x customize-variable RET reftex-label-regexps RET

and add '\|lstinputlisting' after 'ctable', it should then look like
this:
And then hit 'Apply and Save' and you should be done.

> it's specifically the \lstinputlisting macro that doesn't work.  Is
> there a way for RefTeX to find out about these listings?

I will add 'lstinputlisting' to that variable so it should be available
with Emacs 31.

Best, Arash

Reply via email to