GNU bug report logs -
#64768
biblatex detection in reftex is too naive, multiple bib files are problematic
Previous Next
Full log
Message #14 received at 64768 <at> debbugs.gnu.org (full text, mbox):
"Philipp G. Haselwarter" <philipp <at> haselwarter.org> writes:
> In main.tex, I have the line "\input{mypreamble}", and in
> mypreamble.tex, there's a line with "\usepackage{biblatex}". I also
> have several "\addbibresource{foo.bib}", "\addbibresource{bar.bib}",
> etc, either in main.tex or in mypreamble.tex . I would want reftex to
> be aware of the references in foo.bib and bar.bib whenever main.tex is
> set as TeX-master, i.e. either while editing main.tex directly or
> while editing some-section.tex, where some-section.tex sets TeX-master
> to main.tex.
Thanks the clarification. \addbibresource is a preamble only command
and AFAIU, RefTeX looks for this macro only in the main file; it doesn't
go through each \input'ed file in order to find any \addbibresource.
I'd suggest you change your setup a little and rename your
mypreamble.tex to mypreamble.sty and replace there:
\usepackage{biblatex}
with
\RequirePackage{biblatex}
and delete any \addbibresource calls. Now you do this in your main.tex:
\usepackage{mypreamble}
\addbibresource{foo.bib}
\addbibresource{bar.bib}
Now the final step is to write a small AUCTeX style file for your
mypreamble.sty called mypreamble.el which looks like this:
(TeX-add-style-hook
"mypreamble"
(lambda ()
(TeX-run-style-hooks "biblatex"))
:latex)
and save this file in the directory specified in the variable
`TeX-style-private' (or adjust it accordingly first).
Now restart Emacs and open your main.tex. AUCTeX should load
mypreamble.el and biblatex.el subsequently which gets an entry in
`TeX-active-styles' and you should be done.
Best, Arash
This bug report was last modified 1 year and 321 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.