4

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.

5
  • 2
    I don't understand you :S the 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 as equation and flalign* 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 \[ ... \]
    – Au101
    Commented Dec 12, 2015 at 22:54
  • 2
    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.) Commented Dec 12, 2015 at 22:54
  • you're correct that the amsmath documentation doesn't spell out the meaning or use of \[ ... \]. i've added that to the bugs list. Commented Dec 12, 2015 at 23:21
  • @barbarabeeton - As \[ 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 the amsmath package. I think it may suffice to state explicitly in the user guide that the cases 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.
    – Mico
    Commented Dec 13, 2015 at 8:39
  • @Mico -- the "fix" i had in mind is simply to state that \begin{equation*} ... \end{equation*} is equivalent to \[ ... \]. i would have assumed it to be obvious that any new command or environment described in the amsmath 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 ...) Commented Dec 13, 2015 at 13:02

1 Answer 1

5

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?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .