我正在写一份book
文档,其中必须放入一个bibliography
,包含文中引用的所有参考文献,以及出版物列表,该列表应作为附录出现在参考书目之后。
出版物列表可能包含已出现在中的条目bibliography
。
以下 MWE 描述了我目前想到的内容:
\documentclass{book}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\cleardoublepage
\chapter{x}
\lipsum[1-4]
\section{a}
\lipsum[1-4]
\section{b}
\lipsum[1-4]
\cite{goossens}
\section{c}
\lipsum[1-4]
\chapter{y}
\lipsum[1-4]
\section{a}
\lipsum[1-4]
\section{b}
\lipsum[1-4]
\section{c}
\lipsum[1-4]
% references
\makeatletter
\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{plain}
\bibliography{bibliotest}
\cleardoublepage
% appendices
\appendix
\addcontentsline{toc}{chapter}{List of Publications}
\renewcommand{\bibname}{List of Publications}
\begin{thebibliography}{1}
\bibitem{goossensdifferent}
Michel Goossens, Frank Mittlebach, and Alexander Samarin.
\newblock {\em The Latex Companion A}.
\newblock Addison-Wesley, Reading, Massachusetts, 1993.
\end{thebibliography}
\cleardoublepage
\chapter{another app}
\end{document}
文件bibliotest.bib
包含以下内容:
@book{goossens,
author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
title = "The Latex Companion A",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
问题有两个:
- 所有链接都指向正确的目的地,除了目录中指向参考书目和出版物列表的两个链接外。
- 尽管目录中出现了正确的标题 (
List of Publications
),但该章节没有编号。
使用该multibib
包的问题
如果我加载multibib
,我解决了第 1 点(所有链接都是正确的),但是:
- 此章仍未编号。
- 参考文献编号在第一个参考书目的最后一个参考文献之后继续。
MWE 的代码现在如下所示:
\usepackage{multibib}
\newcites{pub}{List of Publications}
...
\appendix
\phantomsection
\addcontentsline{toc}{chapter}{List of Publications}
\renewcommand{\refname}{List of Publications}
\bibliographystylepub{plain}
\bibliographypub{bibliotest}
\nocitepub{*}
答案1
这是使用的解决方案multibib
。我使用tocbibind
包来处理章节编号。从您的问题中不清楚常规书目和参考文献列表是否都应该是编号章节,还是仅仅是出版物列表。我假设是后者,因此书目是一个未编号的章节,而出版物列表是一个常规编号的附录。为此,我创建了一个切换\numbib
书目tocbibind
编号布尔值的用户命令。此命令在参考文献列表之前用于为其章节编号。
如果你想两个都参考书目和出版物列表为常规编号章节,您不需要使用此命令,而是可以将选项传递[numbib]
给tocbibind
包。
\documentclass{book}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage[resetlabels]{multibib} % option to reset the bib item numbering
\usepackage{tocbibind} % to have bibliographies with numbered or unnumbered chaps
\makeatletter
\newcommand*{\numbib}{\@donumbibtrue} % command to number the bib
\makeatother
\begin{filecontents}{bibtest.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
}
@misc{C03,
author = {Cuthor, C.},
year = {2003},
title = {Charlie},
}
\end{filecontents}
\newcites{pub}{List of Publications}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\cleardoublepage
\chapter{x}
\lipsum[1-4]
\section{a}
\lipsum[1-4]
\section{b}
\lipsum[1-4]
\cite{A01,B02}
\section{c}
\lipsum[1-4]
\chapter{y}
\lipsum[1-4]
\section{a}
\lipsum[1-4]
\section{b}
\lipsum[1-4]
\section{c}
\lipsum[1-4]
% references
\phantomsection
\bibliographystyle{plain}
\bibliography{bibtest}
\cleardoublepage
% appendices
\appendix
\numbib
\renewcommand{\refname}{List of Publications}
\numbib
\bibliographystylepub{plain}
\bibliographypub{bibtest}
\nocitepub{*}
\cleardoublepage
\chapter{another app}
\end{document}
答案2
尽管这个问题的答案布伦特提到不能完全解决您的问题,biblatex
这是可行的方法。以下是可以满足您要求的采用版本:
\documentclass{article}
\usepackage[defernums=true]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
}
@misc{C03,
author = {Cuthor, C.},
year = {2003},
title = {Charlie},
}
\end{filecontents}
\bibliography{\jobname}
\begin{document}
\begin{refsegment}
Some text \autocite{A01,B02}.
\printbibliography[segment=\therefsegment]
\end{refsegment}
\nocite{*}
\printbibliography[title={Further Reading}]
\end{document}
请注意,您需要一个相对较新的版本biblatex
才能支持title={Further Reading}
该\printbibliography
命令的选项。
编辑:以下解决方案基于(作为您的 MWE)book
类,还处理相应目录条目的编号。主要区别在于使用\defbibheading
为您的参考和完整书目。
\documentclass{book}
\usepackage{filecontents}
\usepackage[defernums=true]{biblatex}
% Define typesetting of references heading
\defbibheading{references}[References]{%
\chapter{#1}%
\markboth{#1}{#1}%
}
% Define typesetting of bibliography heading
\defbibheading{bibliography}[Complete Bibliography]{%
% define as above if you want to have this numbered as well:
\chapter*{#1}%
\addcontentsline{toc}{chapter}{#1}
\markboth{#1}{#1}%
}
% The filtecontent package is just used to create an example .bib-File
% automatically out of the following (for the MWE)
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
}
@misc{C03,
author = {Cuthor, C.},
year = {2003},
title = {Charlie},
}
\end{filecontents}
% The bibtex database to use (\bibliography{bibliotest} in your case)
\bibliography{\jobname}
\begin{document}
\tableofcontents
\cleardoublepage
\chapter{First Chapter}
% We start a new references segement
% All \cite commands of this segment contribute
% to the segment-specific bibliography
\begin{refsegment}
Some text \autocite{A01,B02}.
% print the segment-specific bibliography (using the references style
% defined above for the heading
\printbibliography[heading=references,segment=\therefsegment]
\end{refsegment}
\nocite{*}
% print the full bibliography (using the bibliography style
% defined above for the heading above
\printbibliography[heading=bibliography]
\end{document}