[tex-k] Re: [pdftex] bug with closing square brackets in
Robin.Fairbairns at cl.cam.ac.uk
Thu Mar 23 18:06:42 CET 2006
> if in the following code the "\rbkt" is replaced by just "]",
> latex fails to produce a dvi file.
> \item[$a[a\rbkt$] here the problem arrises: just $]$ does not work.
as expected. tex balances braces automatically, but not brackets. so
\item[$a[a]$] is terminated at the first right bracket, and the
optional argument becomes "$a[a", which goes into a box, where it
isn't valid tex.
the normal technique for dealing with this is to put the brackets in
matched braces, but that's not necessarily a good idea in maths code.
More information about the tex-k