6

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

@ARTICLE(Campbell2006,
author="Campbell, K. and McKay, M.D. and Williams, B.J.",
title="Sensitivity Analysis when Model Outputs are Functions",
journal="{Reliability Engineering \& System Safety}",
volume=91,
number="10-11",
pages="1468--1472",
year=2006,
publisher="{Elsevier}")

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?

1 Answer 1

8
+50

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))

to

(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/

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .