我使用以下语法将章节的参考书目添加为一个部分
\defbibheading{bibliography}{\section{References for \chaptername\space\thechapter}}
但是,上述语法会将参考文献添加为包含编号的普通部分。我希望部分编号为空。因此,我尝试使用
\defbibheading{bibliography}{%
% Generate the heading
\section*{References for \chaptername\space\thechapter}
% Add it to the TOC (without adding the section number)
\addtocontents{toc}{
\protect \contentsline{section}{\protect\numberline{}\noindent References for \chaptername\space\thechapter}{\thepage}{page.\thepage}
}
}
hyperref
然后会跳转到参考文献的正确页面,但不会跳转到添加章节的确切位置。我希望链接的行为与使用未加星号的版本完全相同,但不\section
包含参考文献部分的章节编号。
\begin{filecontents*}{sample.bib}
@article{aldaoudeyeh2016,
title={{Photovoltaic-battery scheme to enhance PV array characteristics in partial shading conditions}},
author={Aldaoudeyeh, Al-Motasem},
journal={IET Renewable Power Generation},
volume={10},
number={1},
pages={108--115},
year={2016},
publisher={IET}
}
\end{filecontents*}
\documentclass{book}
\usepackage{tocloft}
\usepackage[x11names]{xcolor}
\usepackage{hyperref}
\hypersetup{colorlinks=true}
\usepackage[style=ext-numeric, maxnames=5, minnames=1]{biblatex}
\addbibresource{sample.bib}
\defbibheading{bibliography}{%
% Generate the heading
\section*{References for \chaptername\space\thechapter}
% Add it to the TOC (without adding the section number)
\addtocontents{toc}{
\protect \contentsline{section}{\protect\numberline{}\noindent References for \chaptername\space\thechapter}{\thepage}{page.\thepage}
}
}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\chapter{New Chapter}
\blindtext
\nocite{*}
\printbibliography
\end{document}
答案1
biblatex
做支持将参考书目添加到目录中。查看选项heading
。\printbibliography
你可能需要heading=subbibintoc
。
\documentclass{book}
\usepackage{tocloft}
\usepackage[style=ext-numeric, maxnames=5, minnames=1]{biblatex}
\usepackage[x11names]{xcolor}
\usepackage{hyperref}
\hypersetup{colorlinks=true}
\usepackage{blindtext}
\addbibresource{biblatex-examples.bib}
\begin{document}
\tableofcontents
\chapter{New Chapter}
\blindtext
\nocite{sigfridsson}
\printbibliography[title=References for \chaptername\space\thechapter, heading=subbibintoc]
\end{document}
您的定义没有完全链接到正确的位置,因为链接标签设置为page.\thepage
,而您可能希望它直接转到部分锚点,这就是我会使用的原因\addcontentsline{toc}{section}{...}
。
的定义\addsec
取自\defbibheading{subbibintoc}
于book
类biblatex.def
(命令名称取自 KOMA-Script,它提供了一个功能大致相同但更加复杂的命令)
\makeatletter
\newcommand*{\addsec}[1]{%
\section*{#1}%
\addcontentsline{toc}{section}{#1}%
\if@twoside\markright{\abx@MakeMarkcase{#1}}\fi}
\makeatother
\defbibheading{bibliography}{%
\addsec{References for \chaptername\space\thechapter}}