我有以下 MWE,其中我有一个参考书目(使用 biblatex)和一个未编号的章节,我想让它们在目录中对齐,不是与章节编号对齐,而是与章节标题对齐。
我已经使用\dottedcontents
titletoc 中的命令自定义了章节、节、小节和小小节的对齐方式,但不知道如何让它们适用于参考书目标题和未编号章节。我尝试使用,\dottedcontents{numberless-entry-format}[4pc]{}{4pc}{0.3pc}
但没有成功。
妇女权利委员会:
\documentclass[a4paper, 12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{filecontents}
\begin{filecontents}{mwe.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
\end{filecontents}
\usepackage[style=abnt, justify, extrayear]{biblatex}
\addbibresource{mwe.bib}
\usepackage[a4paper, top=3cm, bottom=2cm, left=3cm, right=2cm]{geometry}
\usepackage{titletoc}
\dottedcontents{chapter}[4pc]{}{4pc}{0.3pc}
\dottedcontents{section}[4pc]{}{4pc}{0.3pc}
\dottedcontents{subsection}[4pc]{}{4pc}{0.3pc}
\dottedcontents{subsubsection}[4pc]{}{4pc}{0.3pc}
\dottedcontents{numberless-entry-format}[4pc]{}{4pc}{0.3pc}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
\title{MWE}
\author{Me}
\date{November 2021}
\begin{document}
\maketitle
\tableofcontents
\chapter{Introduction}
Just to cite the bibliography \cite{A01}.
\section{1st section}
\chapter{2nd chapter}
\section{Section}
\subsection{Subsection}
\subsubsection{Subsubsection}
\chapter*{No numbers!}
\addcontentsline{toc}{chapter}{No numbers!}
\printbibliography[
heading=bibintoc,
title={My Bibliography}
]
\end{document}
这个想法是让“不...”和“我的...”与“Sub...”对齐,即 4pc。
我很乐意接受任何帮助,因为我整天都在谷歌搜索这个问题,而且我开始打开与今天早些时候相同的链接。
答案1
受到 Ulrike Fischer 回答的启发,您需要在序言中放置以下内容
\titlecontents{chapter}[4pc]{}{\contentslabel{4pc}}{}{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{section}[4pc]{}{\contentslabel{4pc}}{}{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{subsection}[4pc]{}{\contentslabel{4pc}}{}{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{subsubsection}[4pc]{}{\contentslabel{4pc}}{}{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{numberless-entry-format}[4pc]{}{\contentslabel{4pc}}{}{\titlerule*[0.3pc]{.}\contentspage}
平均能量损失
\documentclass[a4paper, 12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{filecontents}
\begin{filecontents}{mwe.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
\end{filecontents}
\usepackage[style=abnt, justify, extrayear]{biblatex}
\addbibresource{mwe.bib}
\usepackage[a4paper, top=3cm, bottom=2cm, left=3cm, right=2cm]{geometry}
\usepackage{titletoc}
\titlecontents{chapter}[4pc]{}{\contentslabel{4pc}}{}{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{section}[4pc]{}{\contentslabel{4pc}}{}{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{subsection}[4pc]{}{\contentslabel{4pc}}{}{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{subsubsection}[4pc]{}{\contentslabel{4pc}}{}{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{numberless-entry-format}[4pc]{}{\contentslabel{4pc}}{}{\titlerule*[0.3pc]{.}\contentspage}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
\title{MWE}
\author{Me}
\date{November 2021}
\begin{document}
\maketitle
\tableofcontents
\chapter{Introduction}
Just to cite the bibliography \cite{A01}.
\section{1st section}
\chapter{2nd chapter}
\section{Section}
\subsection{Subsection}
\subsubsection{Subsubsection}
\chapter*{No numbers!}
\addcontentsline{toc}{chapter}{No numbers!}
\printbibliography[
heading=bibintoc,
title={My Bibliography}
]
\end{document}