使用数字编号时使用 \citet 和 \chapterbib

使用数字编号时使用 \citet 和 \chapterbib

我正在写论文,论文分为几章,我想为每一章都添加参考书目。我使用的是数字样式。目前我只使用通用的 unsrt 参考书目样式。问题是,当我想使用 \citet 插入作者姓名(即“bob lawblaw et al (1)”)时,我得到的是 (name?)(1)。在切换到 chapterbib 之前,我没有遇到过这个问题

以下是从其他地方借用的一个工作示例:

 \documentclass[12pt, twoside]{book}
 \usepackage[utf8]{inputenc}
 \usepackage[english]{babel}
 \usepackage{graphicx}
 \usepackage[pagestyles]{titlesec}
 \titleformat{\chapter}[display]{\normalfont\bfseries}{}{0pt}{\Huge}
 %\newpagestyle{mystyle}
%{\sethead[\thepage][][\chaptertitle]{}{}{\thepage}}
%\pagestyle{mystyle}\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Don't use this                                               %
%\usepackage[semicolon,round,sort&compress,sectionbib]{natbib} %
%\usepackage[sectionbib]{chapterbib}                           %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Replacement                                                  %
\usepackage[number,sectionbib]{natbib}  %
\usepackage{chapterbib}                                        %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]            
{geometry} % this was incomplete
\usepackage{filecontents}
% Create bib file for Introduction chapter
\begin{filecontents*}{bib0.bib}
@article{acemoglu2000,
title={The colonial origins of comparative development: An empirical         investigation},
author={Acemoglu, Daron and Johnson, Simon and Robinson, James A},
year={2000},
institution={National bureau of economic research}
}
@book{acemoglu2012,
title={Why nations fail: the origins of power, prosperity and poverty},
author={Acemoglu, Daron and Robinson, James A and Woren, Dan},
volume={4},
year={2012},
publisher={SciELO Chile}
}
\end{filecontents*}
%
% Create bib file for chapter 1. Note that it is not a requirement to have     different bib files for each chapter.
\begin{filecontents*}{bib1.bib}
@article{acemoglu2000,
title={The colonial origins of comparative development: An empirical investigation},
author={Acemoglu, Daron and Johnson, Simon and Robinson, James A},
year={2000},
institution={National bureau of economic research}
}
@article{ackerberg2006,
    title={Structural identification of production functions},
author={Ackerberg, Daniel and Caves, Kevin and Frazer, Garth},
year={2006}
}
%
%Create Introduction
\end{filecontents*}
\begin{filecontents*}{chap0.tex}
\chapter{Introduction}
This is Chapter ``Introduction'' from included file chap0.tex. \\
This is a citation for \cite{acemoglu2000} from bib0. \\
\citep{acemoglu2012} is a citation for the second reference. \\
The Reference list for introductory chapter appears next. \\
\bibliographystyle{unsrt}
\bibliography{bib0}
\end{filecontents*}
%
% Create Chapter 1
\begin{filecontents*}{chap1.tex}
\chapter{chap1}
This is Chapter 1 from included file chap1.tex. \\
This is a citation for \cite{acemoglu2000} from bib1. \\
\citet{ackerberg2006} is a citation for the second reference. \\
The Reference list for the chapter appears next. \\
\bibliographystyle{unsrt}
\bibliography{bib1}
\end{filecontents*}
\begin{document}

\include{chap0}
\include{chap1}
\end{document}

答案1

natbib需要与作者年份兼容的样式才能显示作者姓名\citetunsrt没有提供必要的信息,您必须使用natbib替换unsrtunsrtnat

\bibliographystyle{unsrt}用。。。来代替

\bibliographystyle{unsrtnat}

一切将会顺利。

这应该和没什么关系chapterbib

相关内容