每章末尾都有一个参考书目。
我有一个主文件:
\documentclass[b5paper,8pt,twoside,parskip=half,numbers=noenddot,bibliography=tot ocnumbered,listof=totoc]{scrbook}
\input{formatAndDefs}
\input{mycommands}
\usepackage[utf8]{inputenc}
\usepackage{natbib}
\usepackage{chapterbib}
\sectionbib{\section}{section}
\DeclareUnicodeCharacter{00A0}{ }
\begin{document}
\pagenumbering{roman}
\input{TitlePage}
\frontmatter
\dominitoc
\input{Preface}
\input{AppendedPapers}
\tableofcontents
\listoffigures
\adjustmtc
\mainmatter
\input{chapter1}
\include{biblio1}
\adjustmtc
\input{chapter2}
\include{biblio2}
\adjustmtc
\input{chapter3}
\include{biblio3}
\adjustmtc
\end{document}
每个 biblio1、biblio2、biblio3 文件都有以下行:
biblio1.tex:\nocite{*} \bibliographystyle{plain} \bibliography{1}
biblio2.tex:\nocite{*} \bibliographystyle{plain} \bibliography{2}
biblio3.tex:\nocite{*} \bibliographystyle{plain} \bibliography{3}
最后,我有三个.bib
文件:1.bib
,,2.bib
和3.bib
例如,该文件3.bib
包含:
@article{3clock,
author = "S. Knappe; P. Schwindt; V. Gerginov; V. Shah; L. Liew; J. Moreland; H. Robinson; L. Hollberg; J. Kitching",
title = "Microfabricated atomic clocks and magnetometers",
journal = "Journal of Optics A",
volume ="8",
number= "7",
year = "2006"
}
@article{3sel,
author = "S. Seltzer; D. Rampulla; S. Rivillon-Amy; Y. Chabal; S. Bernasek; M. Romalis",
title = "Testing the effect of surface coatings on alkali atom polarization lifetimes",
journal = "Journal of Applied Physics",
year = "2008"
}
@article{3anderson,
author = "L. Anderson; F. Pipkin; J. Baird",
title = "Hyperfine structure of hydrogen, deuterium, and tritium",
journal = "Physical Review",
volume ="120",
number= "4",
year = "1960"
}
最后,在 chapter3.tex 中我有:
Posteriormente, en 1957, H. Dehmelt\cite{3anderson} introdujo la posibilidad de determinar un campo magnético mediante la medición de la frecuencia de precesión de Larmor de los spin atómicos que habían sido previamente polarizados. Esta idea fue exitosamente llevada a cabo de manera experimental por W. Bell y A. Bloom\cite{3sel}.
我希望每章末尾有完整的参考书目,并在章节中引用的位置有相应的编号。但我得到的却是一个问号。
我是这样编译的:
pdflatex 论文.tex bibtex biblio1.aux bibtex biblio2.aux bibtex biblio3.aux pdflatex 论文.tex pdflatex 论文.tex
这是问号的图片:
答案1
\documentclass[b5paper,8pt,twoside,parskip=half,numbers=noenddot,bibliography=tot ocnumbered,listof=totoc]{scrbook}
\input{formatAndDefs}
\input{mycommands}
\usepackage[utf8]{inputenc}
\usepackage[sectionbib]{natbib} %sectionbib add as option to natbib
\usepackage{chapterbib}
\sectionbib{\section}{section}
\DeclareUnicodeCharacter{00A0}{ }
\begin{document}
\pagenumbering{roman}
\input{TitlePage}
\frontmatter
\dominitoc
\input{Preface}
\input{AppendedPapers}
\tableofcontents
\listoffigures
\adjustmtc
\mainmatter
\input{chapter1}
\include{biblio1}
\adjustmtc
\input{chapter2}
\include{biblio2}
\adjustmtc
\input{chapter3}
\include{biblio3}
\adjustmtc
\end{document}
您可以根据需要保留所有文件。编译编译如下:
pdflatex thesis.tex
bibtex biblio1
bibtex biblio2
bibtex biblio3
pdflatex thesis.tex
pdflatex thesis.tex
顺便说一句,这 \nocite{*}
不是一个好的引用方式。每个参考书目中的每个条目都将被引用,任何人都可能忘记删除条目。
答案2
我找到了一个解决方案:
问题是章节是用 \input 命令而不是 \include 命令添加的。因此,当你第一次编译时
pdflatex thesis.tex
您没有生成任何 chapter.aux 文件,其中有 \cite{} 命令。那么您无法使用 bibtex 编译该章节,并且您得到的是问号而不是引用编号。
一个解决方案是:
\documentclass[b5paper,8pt,twoside,parskip=half,numbers=noenddot,bibliography=tot ocnumbered,listof=totoc]{scrbook}
\input{formatAndDefs}
\input{mycommands}
\usepackage[utf8]{inputenc}
\usepackage{natbib}
\usepackage{chapterbib}
\sectionbib{\section}{section}
\DeclareUnicodeCharacter{00A0}{ }
\begin{document}
\pagenumbering{roman}
\input{TitlePage}
\frontmatter
\dominitoc
\input{Preface}
\input{AppendedPapers}
\tableofcontents
\listoffigures
\adjustmtc
\mainmatter
\include{chapter1}
%\include{biblio1} %copy the content of that file at the end of chapter1
\adjustmtc
\include{chapter2}
%\include{biblio2} %copy the content of that file at the end of chapter2
\adjustmtc
\include{chapter3}
%\include{biblio3} %copy the content of that file at the end of chapter3
\adjustmtc
\end{document}
并且由于 \cite{*} 命令,章节末尾还提供了完整的参考书目。
编译的顺序是:
pdflatex thesis.tex
bibtex chapter1.aux
bibtex chapter2.aux
bibtex chapter3.aux
pdflatex thesis.tex
pdflatex thesis.tex