如何在目录中格式化 biblatex 书目参考?

如何在目录中格式化 biblatex 书目参考?

我正在使用 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}

生产

目录

我还修改了其他东西以获得更好的居中效果。

相关内容