0

I have the following code:

\documentclass[a4paper]{paper}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

\theoremstyle{definition}
\newtheorem{theorem}{Theorem}
\newtheorem{defn}{Definition}[subsection]

\begin{document}

\begin{defn}[\cite[III.1]{sil}]
Let $E$ 
\end{defn}

\end{document}

The point is that this throws an error, but if I remove the brackets surrounding \cite it works fine. Any ideas what the problem is?

1
  • @Mico Thanks, \protect worked. What's \protect btw? First time seeing it. If you can write an answer, I can accept. – pixel Mar 7 '18 at 16:11
2

You need to enclose the \cite[..]{..} command in extra brackets {...}, otherwise the ] in the cite command gets interpreted as the closing square bracket for the optional argument of the defn.

Sample output

\documentclass[a4paper]{paper}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

\theoremstyle{definition}
\newtheorem{theorem}{Theorem}
\newtheorem{defn}{Definition}[subsection]

\begin{document}

\begin{defn}[{\cite[III.1]{book-minimal}}]
Let $E$
\end{defn}

\bibliographystyle{amsplain}
\bibliography{xampl}

\end{document}

\protect does not help here, it is not a question of a moving argument.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.