With RefTeX C-c [ invokes reftex-citation which first asks for a citation format (what citation macro to use, e.g. \cite or \footcite), then it asks for a regex to search the bibliography database and after you input one it shows the search results (in a buffer named *RefTeX Select*) and lets you choose one bibliography item to put in the citation macro. The list which contains the search results can look like the following screenshot:

Screenshot of *RefTeX Select*

Notice that the list includes the key for each item as well as information such as author and title but that the year or date for an item is not displayed. Is is possible to configure RefTeX so that the date is listed for each item in *RefTeX Select*?

The reason I am asking for this is that including dates in the list might make it easier to distinguish between similar entries (which may not be exemplified by the included screenshot).

I am using RefTeX 4.31 in GNU Emacs 23.3.1. On my setup the variable reftex-bib-year-face's value is font-lock-comment-face.

  • Reftex is supposed to be showing you the year between the title and the page/chapter info (red in your screenshot). What version of emacs/reftex do you have installed? What is the value of the variable reftex-bib-year-face (you can see this by switching to the *scratch* buffer and typing "reftex-bib-year-face" followed by C-j
    – Aaron
    Jan 17, 2012 at 8:20
  • @Aaron I have edited my question to include the requested info.
    – N.N.
    Jan 17, 2012 at 9:53
  • My bibtex keys all have a year in them, so I've never noticed this…
    – Seamus
    Feb 29, 2012 at 15:56
  • @Seamus Yes, it seems to be that RefTeX recognizes the bibtex key date but not year.
    – N.N.
    Feb 29, 2012 at 17:05

2 Answers 2


Reftex does not display the date field in the citation list, by design, only the year field. There is no option to tweak to correct this. You can fix this by modifying the responsible code directly, however.

It's a rather long function, and it only requires a very small change. I've modified the 'year' value that is displayed, so that it will contain both the year and the date. I assume there will only ever be one or the other, so you should see what you want. Add this to your .emacs and see how it works:

(eval-after-load "reftex-cite" 
  '(defun reftex-format-bib-entry (entry)
     ;; Format a BibTeX ENTRY so that it is nice to look at
         ((auth-list (reftex-get-bib-names "author" entry))
          (authors (mapconcat 'identity auth-list ", "))

          ;; modified code here:
          (year      (concat (reftex-get-bib-field "year" entry)
                             (reftex-get-bib-field "date" entry)))
          ;; end modified code

          (title     (reftex-get-bib-field "title" entry))
          (type      (reftex-get-bib-field "&type" entry))
          (key       (reftex-get-bib-field "&key"  entry))
            ((equal type "article")
             (concat (reftex-get-bib-field "journal" entry) " "
                     (reftex-get-bib-field "volume" entry) ", "
                     (reftex-get-bib-field "pages" entry)))
            ((equal type "book")
             (concat "book (" (reftex-get-bib-field "publisher" entry) ")"))
            ((equal type "phdthesis")
             (concat "PhD: " (reftex-get-bib-field "school" entry)))
            ((equal type "mastersthesis")
             (concat "Master: " (reftex-get-bib-field "school" entry)))
            ((equal type "inbook")
             (concat "Chap: " (reftex-get-bib-field "chapter" entry)
                     ", pp. " (reftex-get-bib-field "pages"   entry)))
            ((or (equal type "conference")
                 (equal type "incollection")
                 (equal type "inproceedings"))
             (reftex-get-bib-field "booktitle" entry "in: %s"))
            (t ""))))
       (setq authors (reftex-truncate authors 30 t t))
       (when (reftex-use-fonts)
         (put-text-property 0 (length key)     'face
                            (reftex-verified-face reftex-label-face
         (put-text-property 0 (length authors) 'face reftex-bib-author-face
         (put-text-property 0 (length year)    'face reftex-bib-year-face
         (put-text-property 0 (length title)   'face reftex-bib-title-face
         (put-text-property 0 (length extra)   'face reftex-bib-extra-face
       (concat key "\n     " authors " " year " " extra "\n     " title "\n\n"))))
  • Thanks! This does not work if I place it in my .emacs and restart Emacs but it does work if I visit my .emacs and evaluate it.
    – N.N.
    Jul 25, 2012 at 8:03
  • Huh. I'll take a look at when it needs to load this evening. Maybe it should be eval-after-load "auctex".
    – Tyler
    Jul 25, 2012 at 11:35
  • It seems eval-after-load "auctex" neither helps.
    – N.N.
    Jul 29, 2012 at 14:06
  • The function that gets redefined is in reftex-cite.el, not reftex.el. I changed the call above, it should work now (it does in my tests).
    – Tyler
    Jul 30, 2012 at 12:52

In my version of RefTeX (which I installed as part of TeX Live 2011), the behavior you'd like to see is enabled automatically. I took a look at some of the RefTeX configuration options, and one thing for you to try might be the reftex-sort-bibtex-matches, which can be done by year. That's the option that's enabled for me by default.

  • I am not asking for how to sort entries but how to explicitly list their date. For me reftex-sort-bibtex-matches is set to reverse-year (sort entries by decreasing year) and that is the default value.
    – N.N.
    Jan 16, 2012 at 15:16
  • Sorry that didn't work. I understood your question---this was a crack at which customization option might change the display behavior. FWIW, I've received useful feedback at the AucTeX forum on Nabble in re: questions having to do with RefTeX: old.nabble.com/Gnu---AUCTeX---General-f1475.html
    – Bernhard
    Jan 16, 2012 at 15:23
  • Appreciated. I tried to set reftex-sort-bibtex-matches to year but that did not help. I think the variable only controls what to sort by and not what to show.
    – N.N.
    Jan 16, 2012 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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