I have built my .bib file using parentheses, like this:

author="Campbell, K. and McKay, M.D. and Williams, B.J.",
title="Sensitivity Analysis when Model Outputs are Functions",
journal="{Reliability Engineering \& System Safety}",

When typing C-c [ and then CampbTab, RefTeX correctly proposes Campbell2006, but on pressing Ret, I get the message Sorry, no matches found.

I found that replacing the opening and closing parentheses by braces makes it work. However I suppose that it is possible to configure Emacs and RefTeX so as to spare with this reformatting. Is it?


The correct place to fix this is the regular expressions that RefTeX uses to parse the BibTeX file. However, in the version of RefTeX (4.31) that I am looking at it seems that [{(] shows up every place you would expect.

EDIT: After poking at it a bit, it seems the issue is that in reftex.el ( and ) are defined as punctuation is the reftex-syntax-table and not a deliminator characters. This causes the (up-list 1) in reftex-extract-bib-entries (which calls it's body in in a way that uses the modified syntax table) to fail and go on to the next result.

To get this to work you need to change

(unless reftex-syntax-table
  (setq reftex-syntax-table (copy-syntax-table))
  (modify-syntax-entry ?\( "." reftex-syntax-table)
  (modify-syntax-entry ?\) "." reftex-syntax-table))


(unless reftex-syntax-table
  (setq reftex-syntax-table (copy-syntax-table))
  (modify-syntax-entry ?\( "(" reftex-syntax-table)
  (modify-syntax-entry ?\) ")" reftex-syntax-table))

in reftex.el (in my version it is on line 314). However, there is some reason that the developers went out of there way to make () punctuation (which I do not know) which makes me a little nervous about making this change.

edit: patch submitted to auctex.devel http://article.gmane.org/gmane.emacs.auctex.devel/2707/

| improve this answer | |

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.