TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Executing BibTeX via Auctex (RefTeX) in emacs (24.2.1) only creates a .bbl file for the master file in a multifile document. Yet, if one wants bibliographies for each chapter, BibTeX has to be run on each .aux file seperately. Is there a hidden option in Auctex (RefTeX) that activates this feature?

In the minimal example attached, only a .bbl file for main.tex is generated, but not for incl.tex and incl2.tex. Copying main.bbl to incl.bbl and incl2.bbl resolves the situation and both the citations and bibliographies can be found in the document.

TeX distro version: texlive 2012

RefTeX version: 4.31






%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 


\chapter{chap 1}


\bibliography{testbib} % BibTeX-File(s)

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "main"
%%% End: 



some text and a ref: \cite{test_01}
%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "main"
%%% End:


\chapter{chap 2}

some text in chap2  and same ref: \cite{test_01}

\bibliography{testbib} % BibTeX-File(s)

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "main"
%%% End: 


    title = {Test},
    publisher = {Test},
    author = {Adam Smith},
    year = {1982}
share|improve this question
Welcome to TeX.SX! – Claudio Fiandrino Nov 6 '13 at 7:50
No, AUCTeX cannot cope with this situation, but you can run latexmk from AUCTeX, which instead is able to run bibtex on the relevant files. On this site there are some suggestions about how to setup latexmk in AUCTeX, I'm using the configuration suggested here. – giordano Nov 6 '13 at 8:49
Then I'm wondering why the reftex manual is claiming support for chapterbib.. Also is there a link missing in your comment giordano? Cheers – cass Nov 6 '13 at 22:20
@StefanKuczera running the appropriate commands (latex, bibtex, etc...) is up to AUCTeX, not RefTeX, RefTeX just scans bibliography databases files to help you inserting bibliography entries ;-). Which link are you referring to? P.S. when you want to address someone in comments please start the message with @USERNAME, otherwise he/she won't be notified. – giordano Nov 7 '13 at 9:52
@giordano in your first comment you write "On this site there are...", but maybe you meant stackexchange. I guess it is not worth to submit this as an auctex problem again. – cass Nov 9 '13 at 0:16

First, execute customize-group TeX-command. Expand TeX-command-list. Under the name field BibTeX, change the command field to bibtex %B

Next, go down to TeX-expand-list and insert a new key, %B. Add the following in the field for expander: (lambda () (substring (TeX-current-file-name-master-relative) 0 -4))

["-4" above gets rid of the extension ".tex" from the file name that will be provided to BibTeX.]

Finally, save the customization.

The above steps will ensure that when you do BibTeX on a chapter in a subdirectory, the corresponding bbl file is created in that directory. I have tried this successfully on Windows and Mac Mavericks implementations.

share|improve this answer
Hi Simant, thanks for the answer and sorry for the late reply. Your command works in some cases. Yet it does not work if you execute C-c C-c from "inp.tex". Also the situation gets more complicated if you have multiple includes. I've updated the question, maybe someone wants to give it a go. – cass May 28 '14 at 13:46
I can confirm that it works for Biber in Mac Mavericks. – Nathanael Farley Sep 16 '14 at 9:16

Your Answer


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.