auctex-devel
[Top][All Lists]
Advanced

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

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


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

Mosè Giordano <address@hidden> writes:

> 2017-01-03 12:17 GMT+01:00 Arash Esbati <address@hidden>:
>>>>> 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).
>>>
>>> The citations are to be formatted as "{key1}{key2}{key3}", can this be
>>> done with RefTeX?
>>
>> You can run `reftex-citation' with NO-INSERT argument.  Try this snippet
>> in a file of yours, it should do the trick:
>>
>>     (insert "\n" (mapconcat (lambda (key)
>>                               (format "{%s}" key))
>>                             (reftex-citation t)
>>                             ""))
>
> Wow, cool, thanks for the tip!  I think I'll do it!  Actually
> `LaTeX-arg-biblatex-cites' prompts for prenote and postnote for each
> entry, and I don't think this can be done with this workflow, but this
> is a minor issue (also because `TeX-arg-cite-note-p' is nil by
> default, so probably not many users will miss it).

You're welcome.  I've never used biblatex, but the way I get it the
syntax for §3.8.3 Qualified Citation Lists is like this:

\parencites(multiprenote)(multipostnote)
           [prenote][postnote]{key_1}
           [prenote][postnote]{key_2}
           ...
           [prenote][postnote]{key_n}

I don't understand why `LaTeX-arg-biblatex-cites' has this:

  (let ((items t) (noinsert nil))
    (while items
      ...
      (setq items (TeX-completing-read-multiple
                   (TeX-argument-prompt optional prompt "Key")
                   (LaTeX-bibitem-list)))

If only one key is needed, why `TeX-completing-read-multiple'?  I think
you can have it all by doing something like:

    (setq items (if (and (fboundp 'reftex-citation)
                         (fboundp 'reftex-plug-flag)
                         (reftex-plug-flag 3))
                    (reftex-citation t)
                  (completing-read
                   (TeX-argument-prompt optional prompt "Key")
                   (LaTeX-bibitem-list))))

And further down:

    (TeX-argument-insert items optional)

Or am I missing something?

>> You can again mark the bib-items with `m' and close with RET.
>
> Yes, thanks, I saw that in the manual.  There is only one thing I
> still can't do: how to show all entries?  SPC, like in
> `reftex-reference', doesn't work.  I used "." regexp to hopefully
> catch them all, but thought there was a key-binding for that.

That is somewhat hidden in the manual:  Try `='.

7. Commands[1]

Command: reftex-citation
         ...
         While entering the regexp, completion on knows citation keys is
         possible. ‘=’ is a good regular expression to match all entries
         in all files.

Best, Arash

Footnotes: 
[1]  https://www.gnu.org/software/auctex/manual/reftex.html#SEC56



reply via email to

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