Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When using emacs+reftex-mode I may hit "C-c [" and get a nice citation search menu for \cite command. Is there a way to get the same menu for csquotes' integrated quotations (e.g. \displaycquote)?

share|improve this question
    
The point of reftex's interactive cite feature is to help you get the bibliography key right. I don't understand how csquotes would benefit from the same feature... –  Seamus Jan 11 '11 at 22:21
3  
Csquotes offers a couple of commands and environments which allow to specify a citation key for a quotation (e.g. "displaycquote" environment). I'd like to use interactive cite when inserting such quotations. –  Alexey B. Jan 12 '11 at 1:16
add comment

1 Answer

up vote 5 down vote accepted

The simplest way would probably be to add to your .emacs configuration the following (for the \textquote macro):

(TeX-add-symbols
'("textquote" [ TeX-arg-cite ] [ "Punctuation" ] t)
)

(see AUCTeX adding Macros doc)

TeX-arg-cite should call the RefTeX citation search. It seems to behave oddly, as even if it's defined as an optional argument, it forces you to choose a citation.

The is also a way to add environment, so

(LaTeX-add-environments
 `("displayquote" LaTeX-env-args
   [TeX-arg-cite [ "Punctuation" ] t]))

should define the displayquote environment according to the documentation, but for some reasons, that doesn't work for me.

As explained in the documentation, it would be cleaner to do this in a style hook to define the commands only for buffers that actually use the csquotes package:

(TeX-add-style-hook
 "csquotes"
 (lambda ()
   (TeX-add-symbols
    '("textquote" [ TeX-arg-cite ] [ "Punctuation" ] t)
    )
   (LaTeX-add-environments
    `("displayquote" LaTeX-env-args
      [TeX-arg-cite [ "Punctuation" ] t])
    )
   )
 )

However, you should check that you do not override some AUCTeX default when doing this.


The not so clean way of doing it would be to hack a new cite format for the quotation by specifying a new reftex-cite-format, but that seems quite ugly to me.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.