我有一份使用 memoir 类的文档,我使用该bibunits
包生成章节式参考书目。这会按预期生成每章中的章节式参考书目,但在目录中,参考书目显示为章节。我希望它们也显示为章节式。我该怎么做?
这是一个最小工作示例:
\documentclass{memoir}
\usepackage[sectionbib]{bibunits}
\begin{document}
\bibliographyunit[\chapter]
\tableofcontents
\chapter{First chapter}
\section{First section}
This is the first chapter with one citation \cite{alonso1992phy}.
\putbib[references]
\end{document}
references.bib
文件在哪里
@book{alonso1992phy,
author = {Alonso, Marcelo and Finn, Edward J.},
title = {Physics},
year = {1992}
}
答案1
该类memoir
默认\bibsection
定义为,如果使用,\@memb@bchap
则会添加到目录中。\bibintoc
重新定义\bibsection
为使用\@memb@bsec
只是部分解决方法,因为这会添加编号部分作为参考书目单元。稍微重新定义一下就可以\@memb@bsec
解决这个问题,并且会使用\section*
或\section
,具体取决于 的状态\ifnumberedbib
。
\documentclass{memoir}
\makeatletter
\newif\ifnumberedbib
\numberedbibfalse % False by default anyway
\AtBeginDocument{%
\renewcommand{\@memb@bsec}{%
\ifnumberedbib
\section{\bibname}
\else
\section*{\bibname}%
\fi
\bibmark
\ifnobibintoc\else
\ifnumberedbib\else
\phantomsection
\addcontentsline{toc}{section}{\bibname}%
\fi
\fi
\prebibhook
}
\renewcommand{\bibsection}{\@memb@bsec}
}
\makeatother
\usepackage[numbers]{natbib}
\usepackage[sectionbib]{bibunits}
\begin{document}
\bibliographyunit[\chapter]
\tableofcontents
\chapter{First chapter}
\section{First section}
This is the first chapter with one citation \cite{alonso1992phy}
\putbib[larsreferences]
\section{Second section}
This is the first chapter with one citation \cite{alonso1992phy}
\end{document}