我正在使用 biblatex 的 memoir 类,在格式化目录中的参考书目以匹配其他参考书目时遇到了麻烦。(我希望它像章节一样居中并且使用相同的字体。)下面是我的 MWE。我添加了addcontentsline
参考书目,但它被忽略了,所以我将其注释掉了。
\documentclass{memoir}
\let\ordinal\relax
% Bibliography
\usepackage[
backend=biber,
hyperref=auto,
style=authoryear,
backref=true]{biblatex}
\addbibresource{sample.bib}
% TOC title
\makeatletter
\renewcommand{\printtoctitle}[1]{\centering\HUGE\textit{Contents}}
% Chapter
\usepackage{fmtcount}
\renewcommand{\thechapter}{\Numberstring{chapter}}
\renewcommand{\cftchapterleader}{}
\renewcommand{\cftchapterfillnum}[1]{\hspace*{10pt}\huge#1\cftparfillskip\par}
\renewcommand*{\cftchapterfont}{}
\renewcommand\chapternumberline[1]{\hfil\Large\emph{#1}\hfil\strut\huge\par\nopagebreak\hfil}
% Document
\begin{document}
\tableofcontents*
\chapter*[Introduction]{Introduction}
\chapter{The First Chapter}
"Everything is relative" (\cite{einstein}).
\chapter{The Second Chapter}
\phantomsection
\printbibliography\newpage
% \addcontentsline{toc}{chapter}{\protect\chapternumberline{}References}
\end{document}
该sample.bib
文件是
@article{einstein,
author = "Albert Einstein",
title = "On the electrodynamics of moving bodies",
journal = "Annalen der Physik",
}
答案1
\documentclass{memoir}
\let\ordinal\relax
% Bibliography
\usepackage[
backend=biber,
hyperref=auto,
style=authoryear,
backref=true]{biblatex}
\addbibresource{sample.bib}
% TOC title
\renewcommand{\printtoctitle}[1]{\centering\HUGE\textit{Contents}}
% Chapter
\usepackage{fmtcount}
%\setlength{\cftchapterindent}{0pt}
\setlength{\cftchapternumwidth}{0pt}
\renewcommand{\thechapter}{\Numberstring{chapter}}
\renewcommand{\cftchapterleader}{}
\renewcommand{\cftchapterfillnum}[1]{\hspace{10pt}\huge#1\hfill\strut\par}
\renewcommand*{\cftchapterfont}{}
\renewcommand\chapternumberline[1]{\hfil\Large\emph{#1}\hfil\strut\huge\par\hfill}
\newcommand\finalchapternumberline[1]{\nopagebreak\huge\hfill}
% Document
% Patch
\makeatletter
\renewcommand{\blx@head@bibliography}[1][\bibname]{\chapter *{#1}%
\if@twoside \markboth {\abx@MakeMarkcase {#1}}{\abx@MakeMarkcase {#1}}%
\else \markright {\abx@MakeMarkcase {#1}}\fi
\ifmemoirbibintoc {%
\phantomsection
\addcontentsline {toc}{chapter}{\protect\finalchapternumberline{}The References}%
}%
{}%
}
\makeatother
\begin{document}
\tableofcontents*
\chapter*[Introduction]{Introduction}
\chapter{The First Chapter}
"Everything is relative" (\cite{einstein}).
\chapter{The Second Chapter}
\printbibliography
\end{document}
生产
我还修改了其他东西以获得更好的居中效果。