我该如何修复参考文献缩进ToC
?
我知道可以用它tocloft
来调整\cftsetindents{section}
章节等,但参考文献呢?我已经尝试过,\cftchapterindent }{0em}
但对参考文献不起作用。我需要将参考文献缩进为章节,即使它没有编号。见末尾的图片。
\documentclass[a5paper]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\selectlanguage{brazil}
\usepackage[style=abnt-numeric,language=brazilian,backend=biber]{biblatex}
\addbibresource[]{sample.bib}
\usepackage{filecontents}
\begin{filecontents}{sample.bib}
@book{ASM,
title = {Book's title},
author = {Author, Some},
location = {The City},
publisher = {Publisher},
date = {2005},
}
\end{filecontents}
\begin{document}
\tableofcontents*
\chapter{Bla bla 1}
\cite{ASM}
\chapter{Bla bla 3}
\chapter{Bla bla 3}
\printbibliography
\end{document}
答案1
该biblatex
手册明确指出了与 相关的恶作剧memoir
并建议heading=...
和\defbibheading
。
我用了
\defbibheading{bay}[\bibname]{%
\chapter*{#1}%
\markboth{#1}{#1}%
\addcontentsline{toc}{chapter}{\protect\numberline{}\bibname}
}
chapter
即像往常一样添加标题和空number
条目,即该\bibname
条目像其他章节条目一样缩进。
然後使用\printbibliography[heading=bay]
。
\documentclass[a5paper]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\selectlanguage{brazil}
\usepackage[style=numeric,language=brazilian,backend=biber]{biblatex}
\addbibresource[]{sample.bib}
\usepackage{filecontents}
\begin{filecontents}{sample.bib}
@book{ASM,
title = {Book's title},
author = {Author, Some},
location = {The City},
publisher = {Publisher},
date = {2005},
}
\end{filecontents}
\begin{document}
\tableofcontents*
\chapter{Bla bla 1}
\cite{ASM}
\chapter{Bla bla 3}
\chapter{Bla bla 3}
\defbibheading{bay}[\bibname]{%
\chapter*{#1}%
\markboth{#1}{#1}%
\addcontentsline{toc}{chapter}{\protect\numberline{}\bibname}
}
\printbibliography[heading=bay]
\end{document}
答案2
@ChristianHupfer 的回答更受欢迎,因为它是基于对biblatex
手册的阅读...这里有一个更麻烦的破解方法。
我添加它hyperref
仅仅是为了测试兼容性。
\documentclass[a5paper]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\selectlanguage{brazil}
%\usepackage[style=abnt-numeric,language=brazilian,backend=biber]{biblatex}
\usepackage[language=brazilian,backend=biber]{biblatex}
\addbibresource[]{sample.bib}
\usepackage{filecontents}
\begin{filecontents}{sample.bib}
@book{ASM,
title = {Book's title},
author = {Author, Some},
location = {The City},
publisher = {Publisher},
date = {2005},
}
\end{filecontents}
\usepackage{hyperref}
\makeatletter
\newif\if@intoc
\AtBeginDocument{%
\let\oldbibname\bibname
\renewcommand*{\bibname}{\tocbibname@prefix\oldbibname}%
\DeclareRobustCommand*{\tocbibname@prefix}
{\if@intoc\expandafter\chapternumberline\fi{}}%
}
\newenvironment{intoc}{\@intoctrue}{}
\makeatother
\begin{document}
\begin{intoc}
\tableofcontents*
\end{intoc}
\chapter{Bla bla 1}
\cite{ASM}
\chapter{Bla bla 3}
\chapter{Bla bla 3}
\printbibliography
\end{document}