4

I am writing a document with chapters where references for each are sectioned in a 'global' bibliography (Using biblatex/biber). I get properly sectioned bibliographies (e.g. 'References for Segment 4').

My question is if instead of saying segment 4 if it could reprint the name of the section/chapter in question (I use a Springer Verlag template, but it could also be memoir--as in the MWE below).

The MWE below is, well, working, but if I modify it to include a section label, it breaks with a memory error.

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

here is an excerpt of the log:

{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].

Here is the working example--can I modify this MWE to print the chapter name with each bibliography segment?

\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 Answer 1

3

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

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .