I do use the \substack-command in text for creating a small (2,1)-Vector. Unfortunately it does not work in the title of a section.
Here a minimal example, which does not work:
\documentclass{scrreprt}
\usepackage{amsmath}
\begin{document}
\section{$\substack{ a\\b }$}
\end{document}
To my surprise it works, if I use \section* instead of \section.
I am far from understanding enough about TeX to tell why this happens, but can anyone give me an advise how I can fix it?
PS: I also tried to substitute \substack by smallmatrix, which did work for the first two times I compiled the file. After the third compilation I got the same problems.
EDIT:
The Problem was solved, using the \protect-command. But now I want to use the same sectiontitle for a beamer presentation, using the beamer-class. Also using the \protect-command I receive an error. How can I solve this?


\protectwill help: What is the difference between Fragile and Robust commands? – Qrrbrbirlbel Mar 03 '13 at 19:52\protection. :-) – Peter Grill Mar 03 '13 at 19:53