# Cite in theorem environment argument

When I try to cite a book in such a way

\begin{theorem}[\cite[p.~90]{bibitem}]
Theorem body.
\end{theorem}


I've got an error because of multiple use of [ and ]. Is it possible to cite in such a way in theorem argument? Would be great if it could be done without redefine of \cite command.

-

If you need to pass a ] inside an optional argument, just enclose the argument in figure braces:
\begin{theorem}[{\cite[p.~90]{bibitem}}]

Without this, it's the \cite[p.~90 (everything up to the first ]) that gets passed as the argument, while the remaining text is typeset afterwards.
It may be worth pointing out why this happens. The [ and ] bracketing of optional arguments in LaTeX isn't as robust as the { ... } bracketing of TeX. In particular, [ is matched by the next ] that is in the same group (with regard to { ... } grouping) as it. It doesn't look to see if the ] should have matched an intervening [. The solution is (as Andrey says) to ensure that any intervening [ and ]s are in a different TeX group by enclosing them in braces. –  Loop Space Mar 21 '11 at 8:09