我的目标是为每一章创建单独的参考列表,并自定义页眉和页脚。对于前者,我正在使用biblatex
,对于后者,我正在使用titlesec
。使用附加的 tex 文件,第二页出现问题 --- 参考资料破坏了我的页眉和页脚。要么是我没有正确的选项,要么是两个包之间不兼容。
非常感谢您的帮助。所有代码均来自 TeX Live 2015。我的操作系统是 Linux Mint Rosa。
\documentclass[12pt]{book}
\begin{filecontents}{matrix.bib}
@book{golub.vanloan,
author = "Gene Golub and Charles {Van Loan}",
title = "Matrix Computations",
edition = "4th Edition",
publisher = "The Johns Hopkins University Press",
address = "Baltimore, Maryland",
year = "2013",
}
\end{filecontents}
\usepackage[bibencoding=ascii,sorting=none,backend=biber]{biblatex}
%\DefineBibliographyStrings{english}{references={Works Cited},}
\addbibresource{matrix.bib}
\usepackage[explicit,pagestyles]{titlesec}
\titleformat{\section} % command
{\Large\bfseries} % format
{Section \thesection\ ---} % label
{.5em} % sep
{\filright#1} % before code
%\assignpagestyle{\chapter}{empty}
\newpagestyle{headingstyle}[\large\sffamily]{%
\headrule
\sethead[\sectiontitle][][\thesection]% even
{\thesection}{}{\sectiontitle}% odd
\setfoot{}{\usepage}{}%
}
\pagestyle{headingstyle}
\begin{document}
\begin{refsection}
\chapter{This is the chapter title.}
\section{A Big Matrix}
Now is the time for all good men to come to the aid of their county.
Golub and VanLoan \cite{golub.vanloan} is a good book.
Now is the time for all good men to come to the aid of their county.
\newpage
Now is the time for all good men to come to the aid of their county.
Now is the time for all good men to come to the aid of their county.
\printbibliography[heading=subbibliography]
%\printbibliography
\end{refsection}
\chapter{Another Chapter}
\section{A Little Matrix}
Now is the time for all good men to come to the aid of their county.
\newpage
Now is the time for all good men to come to the aid of their county.
\end{document}
答案1
titlesec
已知和之间不兼容:请参阅手册biblatex
中的以下文本biblatex
该
titlesec
软件包重新定义了用户级文档划分命令,例如\chapter
或\section
。此方法与 BibLaTeX 应用的内部命令更改refsection
以及refsegment
§ 3.1.2.1 中描述的选项设置不兼容。
因此,您必须寻找其他解决方案。如果我正确理解了您的要求,您可以重新定义参考书目bibheading
。
\defbibheading{bibliography}[\bibname]{%
\section*{#1}}
此定义将用于\section*
打印\bibname
,并且不会在节标记中保存任何值(因此它们不包含在页眉和页脚中)。此外,您还从中删除heading=subbibliogaphy
了\printbibliography
。
答案2
Guido 的回答提供了正确的想法,但我们不要在没有先用尽所有保护婴儿的选择的情况下就把婴儿和洗澡水一起倒掉。
无需切换到普通的\printbibliography
,而放弃subbibliography
。 只需重新定义相应参考书目环境的标题即可。 在您的例子中, 是subbibliography
而不是bibliography
。 并且\refname
可能比 更合适,bibname
因为人们很少想要每章都有参考书目(而不是参考文献列表)。
\begin{filecontents}{\jobname.bib}
@book{golub.vanloan,
author = "Gene Golub and Charles {Van Loan}",
title = "Matrix Computations",
edition = "4th Edition",
publisher = "The Johns Hopkins University Press",
address = "Baltimore, Maryland",
year = "2013",
}
\end{filecontents}
\documentclass[12pt]{book}
\usepackage[bibencoding=ascii,sorting=none,backend=biber]{biblatex}
%\DefineBibliographyStrings{english}{references={Works Cited},}
\addbibresource{\jobname.bib}
\defbibheading{subbibliography}[\refname]{%
\section*{#1}}
\usepackage[explicit,pagestyles]{titlesec}
\titleformat{\section} % command
{\Large\bfseries} % format
{Section \thesection\ ---} % label
{.5em} % sep
{\filright#1} % before code
%\assignpagestyle{\chapter}{empty}
\newpagestyle{headingstyle}[\large\sffamily]{%
\headrule
\sethead[\sectiontitle][][\thesection]% even
{\thesection}{}{\sectiontitle}% odd
\setfoot{}{\usepage}{}%
}
\pagestyle{headingstyle}
\begin{document}
\begin{refsection}
\chapter{This is the chapter title.}
\section{A Big Matrix}
Now is the time for all good men to come to the aid of their county.
Golub and VanLoan \cite{golub.vanloan} is a good book.
Now is the time for all good men to come to the aid of their county.
\newpage
Now is the time for all good men to come to the aid of their county.
Now is the time for all good men to come to the aid of their county.
\printbibliography[heading=subbibliography]
%\printbibliography
\end{refsection}
\chapter{Another Chapter}
\section{A Little Matrix}
Now is the time for all good men to come to the aid of their county.
\newpage
Now is the time for all good men to come to the aid of their county.
\end{document}