![为什么目录中显示的是参考书目的最后一页码,而不是参考书目的第一页?](https://linux22.com/image/464635/%E4%B8%BA%E4%BB%80%E4%B9%88%E7%9B%AE%E5%BD%95%E4%B8%AD%E6%98%BE%E7%A4%BA%E7%9A%84%E6%98%AF%E5%8F%82%E8%80%83%E4%B9%A6%E7%9B%AE%E7%9A%84%E6%9C%80%E5%90%8E%E4%B8%80%E9%A1%B5%E7%A0%81%EF%BC%8C%E8%80%8C%E4%B8%8D%E6%98%AF%E5%8F%82%E8%80%83%E4%B9%A6%E7%9B%AE%E7%9A%84%E7%AC%AC%E4%B8%80%E9%A1%B5%EF%BC%9F.png)
MWE如下:
\documentclass[12pt,a4paper,oneside]{book}
\usepackage[a4paper,width=150mm,top=30mm,bottom=30mm,bindingoffset=6mm]{geometry}
\usepackage[nottoc]{tocbibind}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{bm}
\usepackage{nccmath}
\usepackage{amsfonts, graphicx, verbatim, mathtools,amssymb, amsthm, mathrsfs,amsmath}
\usepackage{color}
\usepackage{array}
\usepackage{setspace}
\usepackage{fancyhdr}
\usepackage{rsfso}
\usepackage{enumitem}
\usepackage{tikz}
\usetikzlibrary{babel, arrows.meta, positioning, quotes}
\usepackage{lipsum}
\usepackage{geometry}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\usepackage[thinc]{esdiff}
\usepackage{ae}
\usepackage [english]{babel}
\usepackage [autostyle, english = american]{csquotes}
\usepackage[style=numeric,maxbibnames=200,sortcites=true,backend=bibtex]{biblatex}
\allowdisplaybreaks
\usepackage{mwe}
\usepackage{undertilde}
\usepackage{dsfont}
\usepackage{xcolor}
\usepackage{tocloft}
\pagenumbering{roman}
\setlength\bibitemsep{0.5\baselineskip}
\addbibresource{biblio.bib}
\begin{document}
\frontmatter
\newpage
\pagestyle{fancy}
\fancyhf{}
\fancyhead[EL]{\nouppercase\leftmark}
\fancyhead[OR]{\nouppercase\rightmark}
\fancyhead[ER,OL]{\thepage}
\begin{titlepage}
\begin{center}
\begin{figure}
\centering
\includegraphics[width=9cm]{example-image-a}
\end{figure}
\rule[0.5cm]{15cm}{0.1cm}
\Huge
{aaaaa}
\rule{15cm}{0.1cm}
\\
{\normalsize \it{aaaa}} \\
{\normalsize \it{aaaaa}} \\
{\normalsize \it{aaaa}} \\
{\normalsize \it{aaaa}}\\
\vfill
\vspace{5cm}
{\normalsize by} \\
{\normalsize aaa}\\
{\normalsize aaaa}\\
{\normalsize aaaa}\\
{\normalsize aaaa}\\
\rule{15cm}{0.1cm}
\end{center}
\end{titlepage}
\mainmatter
\chapter{Introduction}
\chapter{main1}
\chapter{main2}
\printbibliography
\addcontentsline{toc}{chapter}{Bibliography}
\end{document}
好吧,它不会显示在 MWE 中,因为没有任何引用,但是例如,如果我要在参考书目中设置三页,从第 10 页开始到第 12 页结束,则在目录中,它不会显示“参考书目...... 10”,而是显示“参考书目...... 12”。有什么原因吗?我该如何解决这个问题?
答案1
... 我怎样才能解决这个问题?
我建议你更换
\printbibliography
\addcontentsline{toc}{chapter}{Bibliography}
和
\clearpage
\addcontentsline{toc}{chapter}{Bibliography}
\printbibliography
这样,\addcontentsline
指令就会在参考书目的开头而不是结尾发出。
答案2
使用\printbibliography
的可选参数提供一个heading
值,将条目添加到目录。您可能需要bibintoc
,但还有其他可能的值(请参阅第 99-100 页这biblatex
)。
然后您就可以而且应该摆脱它\addcontentsline
。
\documentclass[12pt,a4paper,oneside]{book}
\usepackage[nottoc]{tocbibind}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[autostyle, english=american]{csquotes}
\usepackage[backend=bibtex, style=numeric, sortcites=true, maxbibnames=200,]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\tableofcontents
\chapter{Foo}
Lorem \autocite{sigfridsson}
\nocite{*}
\printbibliography[heading=bibintoc]
\end{document}