biblatex:带有章节名称的分段参考书目

biblatex:带有章节名称的分段参考书目

我正在编写一个包含章节的文档,其中每个章节的参考文献都按“全局”参考书目进行分类(使用 biblatex/biber)。我获得了正确分类的参考书目(例如“第 4 部分的参考文献”)。

我的问题是,如果不说第 4 段,是否可以重印相关部分/章节的名称(我使用 Springer Verlag 模板,但它也可以是回忆录——如下面的 MWE 所示)。

下面的 MWE 可以正常工作,但如果我修改它以包含一个部分标签,它就会因内存错误而中断。

\defbibheading{subbibliography}{\subsection*{References for  Segment~\ref{refsegment:\therefsection\therefsegment}~\currentname}}

以下是日志的摘录:

{c:/texlive/2013/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] [2
]
Package biblatex Info: Reference segment=1 on input line 57.
Package biblatex Info: Setting label 'refsegment:01' on input line 57.
[3] [4
]
Package biblatex Info: Reference segment=2 on input line 63.
Package biblatex Info: Setting label 'refsegment:02' on input line 63.
[5] [6
]
Runaway definition?
->\def \M@currentTitle {References for Segment~\protect \ref {refseg\ETC.
! TeX capacity exceeded, sorry [main memory size=5000000].

这是工作示例 - 我可以修改这个 MWE 以打印每个参考书目部分的章节名称吗?

\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}}}

\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.
\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}

答案1

使用\nameref

\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.
\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}

在此处输入图片描述

相关内容