How can I use a cases environment inside \section or \subsection directives, like this:

\section{$y(t) = \begin{cases} case1 \\ case  \end{cases}$}

With pdflatex I get:

Use of \begin doesn't match its definition. ...begin{cases} case1 \ case \end{cases}$}


  • 7
    that's a very weird heading!!!!, but you could use \section[something reasonable for the page head]{$.....$} Commented Aug 9, 2017 at 13:13
  • 4
    \protect\begin and \protect\end maybe?
    – egreg
    Commented Aug 9, 2017 at 13:18

2 Answers 2


You may achieve your typesetting objective using either a cases or an array environment; the latter will be spaced a bit more tightly. The trick, as pointed out by @egreg in a comment, is to \protect the \begin and \end directives.

enter image description here

\usepackage{amsmath} % for "cases" env.


\section{$y_t=\left\{ \protect\begin{array}{@{}c@{}} a_1 \\ a_2
              \protect\end{array} \right.$}

\section{$y_t=\protect\begin{cases} a_1 \\ a_2 

If the math material in the section header has to be typeset in bold, just insert the directive \boldmath immediately before $y_t=.


enter image description here

de gustibus non est disputandum



\savebox{\hmm}{$y(t) = \begin{cases} case1 \\ case  \end{cases}$}


\section[something reasonable for the page head]{\usebox{\hmm}}


You must log in to answer this question.

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