0

I want to reference pages in a citation used in the title of an amsthm:

\documentclass{article}

\usepackage[backend=biber]{biblatex}

\begin{filecontents}{mybib.bib}

@BOOK{Rice2017, AUTHOR = {Rice, Brian AND González-Velasco, Enrique AND Corrigan, Alexander}, YEAR = {2017}, TITLE = {The Life and Works of John Napier - }, EDITION = {}, ISBN = {978-3-319-53282-0}, PUBLISHER = {Springer}, ADDRESS = {Berlin, Heidelberg}, }

\end{filecontents}

\bibliography{mybib.bib}

\usepackage{amsthm} \theoremstyle{definition}% \newtheorem{definition}{Defintion}[section]% \newcommand{\definitionautorefname}{Definition}%

The following work as expected:

This is a definition not covered in \autocite{Rice2017}, in particular not in \autocite[p.123]{Rice2017}.
\begin{definition}
Hello and bye
\end{definition}
\begin{definition}[Definition not in \autocite{Rice2017}]
Hello and bye
\end{definition}

However, this doesn't

\begin{definition}[Definition not in \autocite[p.123]{Rice2017}]
Hello and bye
\end{definition}

enter image description here

How to reference a page in a citation while using it in the title of an amsthm environment?

dtell
  • 113
  • 1
    The [] option parser does not know the concept if corresponding [] pairs. So it takes the first it finds unless you hide it like this: \begin{definition}[{Definition not in \autocite[p.123]{Rice2017}}], it is enough to use {\autocite[p.123]{Rice2017}}. – daleif Mar 10 '22 at 11:57
  • 1
    This is a common problem with nested optional arguments: LaTeX does not keep track of the "nesting level" like it does with curly braces. So you need an additional pair of curly braces to "protect" the inner optional argument. A more detailed explanation can be found in https://tex.stackexchange.com/q/99495/35864. Try \begin{definition}[Definition not in {\autocite[123]{Rice2017}}] – moewe Mar 10 '22 at 12:00
  • Unrelated to your question, but biblatex can automatically add the "p."/"pp." prefix for page numbers/ranges. So you can write \autocite[123]{Rice2017} instead of \autocite[p.123]{Rice2017}. – moewe Mar 10 '22 at 12:00
  • Thanks so much! @moewe nice, any extra option needed? – dtell Mar 10 '22 at 12:01
  • 2
    The "p."/"pp." is automatically added by default unless you or your style disables this behaviour. (There is no complete example document in the question, but the code we can see does not disable this behaviour, so no option needs to be called.) – moewe Mar 10 '22 at 12:03

0 Answers0