The amsmath cases
environment seems to require being placed within \[...\]
. What is that syntax? Amsmath documentation does not include these square brackets, yet cases won't compile without them.
1 Answer
The amsmath cases
environment must be used in math mode. While not absolutely mandatory, cases
environments are generally used in display-style math mode. (The other math mode in TeX is frequently called inline-style.) The Plain-TeX method of initiating and terminating display-style math mode -- $$ ... $$
-- should not be used in LaTeX; instead, one should use \[ ... \]
to get an unnumbered display-style math environment. Of course, cases
environments may be used in numbered equation
environments as well.
For more on the differences between $$ ... $$
and \[ ... \]
, see the posting What are the differences between $$
, \[
, align
, equation
and displaymath
?
cases
environment must appear in math mode. Math mode may be entered by$ ... $
or\( ... \)
for in-line maths and\[ ... \]
for displayed maths. There are also environments, such asequation
andflalign*
which automatically put you in math mode as well, but one way or another, you must be in math mode. The syntax for entering displaymath mode, though, is just\[ ... \]
cases
is math. i believe you mean that this environment needs to be put inside\[ ... \]
, not just ordinary braces. yes, that is true. these are not\textbackslash
, but actual backslashes, and the\[ ... \]
is a pair of commands that indicates display math with no equation number. this is equivalent to\begin{equation*} ... \end{equation*}
(welcome, by the way.)amsmath
documentation doesn't spell out the meaning or use of\[ ... \]
. i've added that to the bugs list.\[
and\]
are set up in the LaTeX kernel, it's probably not necessary to explain in any detail what these instructions are in the user guide of theamsmath
package. I think it may suffice to state explicitly in the user guide that thecases
environment must be embedded in a math environment -- preferably a display-math environment, right? -- and mention a couple of examples of numbered and unnumbered display-math environments.\begin{equation*} ... \end{equation*}
is equivalent to\[ ... \]
. i would have assumed it to be obvious that any new command or environment described in theamsmath
documentation would by necessity have to be within a math environment, but perhaps i'd better add that too. (kind of like the warning on a coffee cup. "the contents may be hot", but ...)