如果你允许的话,我将从一个(不那么)简单的例子开始biblatex:带有章节名称的分段参考书目哪些refsegment=chapter
用途比布拉特克斯并将对选项进行细微的更改,即添加加号refsegment=chapter+
。
\documentclass{memoir}
\usepackage{lipsum}
\usepackage[american]{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\makeatletter
\renewcommand{\@chapapp}{Segment}
\makeatother
\usepackage{nameref}
\usepackage[T1]{fontenc}
\usepackage[
backend=biber,
%bibencoding=utf8,
% refsection=chapter,
refsegment=chapter+,
url=false,
sorting=none,
sortcites=true,
sorting=nyt,
style=apa
%style=numeric
]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\makeatletter
%\newcommand*{\currentname}{\@currentlabelname}
\makeatother
% segmented bibliography
\defbibheading{subbibliography}{\subsection*{References for Segment~\ref{refsegment:\therefsection\therefsegment}: \nameref{refsegment:\therefsection\therefsegment} }}
\DefineBibliographyStrings{english}{%
references = {Works Cited},
}
\addbibresource{biblatex-examples.bib}
\usepackage[]{hyperref}
\hypersetup{
colorlinks=false,
}
\begin{document}
\author{John Doe}
\title{Bla bla}
\tableofcontents
\chapter{First, there was light}
% \label{chapter1}
\lipsum[0-1]
Cite an author not previously cited~\cite{cicero}.
Note: Alphabetcially, K comes before S.
\section{A Section}
\lipsum[0-1]
Cite an author not previously cited~\cite{cicero}.
Note: Alphabetcially, K comes before S.
\chapter{Then, there was a power outage}
% \label{chapter2}
\lipsum[0-1]
And then again cite some authoprs cited previously~\cite{kastenholz}.
At vero eos et accusam et justo duo dolores et ea rebum~\cite{sigfridsson}.
\printbibheading
% \bibbysection[heading=subbibliography]
\bibbysegment[heading=subbibliography]
\end{document}
这样做我会收到错误:
(/usr/local/texlive/2018/texmf-dist/tex/latex/biblatex/biblatex.cfg)
! Package biblatex Error: Option 'refsegment=chapter+' invalid.
See the biblatex package documentation for explanation.
Type H <return> for immediate help.
...
l.13809 \blx@processoptions
?
这是为什么?
该chapter+
选项位于 biblatex 文档的第 52 页。
答案1
下列的https://github.com/plk/biblatex/issues/773和https://github.com/plk/biblatex/pull/809chapter+
像“sectioning-valued”选项这样的扩展值是在biblatex
v3.12 中引入的。如果您使用的是旧版本,则应考虑更新您的系统。
请注意,在较新版本中biblarex
,biblatex-apa
您不再需要\DeclareLanguageMapping{american}{american-apa}
任何内容。从biblatex-apa
7.5 和biblatex
3.8(2017 年 11 月)开始,语言映射将自动应用。
对于正确的 APA 样式,您需要替换sorting=none, sortcites=true, sorting=nyt, style=apa,
简单
style=apa,