auctex-devel
[Top][All Lists]

## Re: [AUCTeX-devel] Questions about cleveref.el

 From: Arash Esbati Subject: Re: [AUCTeX-devel] Questions about cleveref.el Date: Tue, 03 Jan 2017 08:03:05 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.91

Hi Mosè,

Mosè Giordano <address@hidden> writes:

> 2016-12-30 11:34 GMT+01:00 Arash Esbati <address@hidden>:
>> Hi all,
>>
>> I've just fixed 2 typos in cleveref.el and 2 things occurred to me if
>> you're a C-c RET' centric, RefTeX-plugged-into-AUCTeX user:
>>
>> 1) This style uses TeX-arg-label' and not TeX-arg-ref'.  It means an
>>    extra RET in the "SELECT A REFERENCE FORMAT" window, which is useless
>>    since you've already selected a format.
>
> You're right, TeX-arg-ref' should be used here.

Thanks for checking.

>> 2) TeX-arg-cleveref-multiple-labels' does not let you use RefTeX to
>>    select label(s) which is much more convenient.
>>
>> Item 1) is fixed easily, 2) should also be doable with a check againt
>> reftex-label' and such.  My question is if there was a particular
>> reason to implement the code this way?
>
> Can reftex-label' query for more than one label?

Consider a file like this where * is point:

\documentclass{article}
\usepackage{cleveref}
\begin{document}

\section{Section One}
\label{sec:section-one}

\section{Section Two}
\label{sec:section-two}

*
\end{document}

With RefTeX enabled, I hit C-c C-m cref RET', choose a label type, here
<space>' for all, and get *RefTeX select* window with the labels.  I
mark the labels I want with m' and hit a' when I'm done and get the
following line inserted:

\cref{sec:section-one,sec:section-two}

> I had a similar problem in biblatex: there are macros taking more than
> one reference, but this isn't particularly easy to do with RefTeX, so
> I defined a hand-made function (LaTeX-arg-biblatex-cites').

The procedure above works also works for citing command using
TeX-arg-cite'.  Can you please check if this is what you want?  Then we
can modify LaTeX-arg-biblatex-cites' to support this (I hope).

>> And I think (font-latex-set-syntactic-keywords)' in the fontification
>> part is also not needed.
>
> Because there are no verbatim like macros, right?  I think you're right.

Thanks.

> While looking to clevere.el, I remembered that in tex-style.el is
> defined a custom option, LaTeX-reftex-ref-style-auto-activate', that
> controls whether a RefTeX reference style (for \ref & friends) should
> be automatically enabled.  Maybe you could define a similar option (t
> by default) for \cite & friends, to be used for example in biblatex.

Sure, I would have to patch biblatex.el, harvard.el, jurabib.el and
natbib.el, but it is not a big deal.

Best, Arash



reply via email to