# “itemize” or “enumerate” IN section headings

Is it possible to use lists WITHIN section headings, subsection headings, etc.? I wanted to do so like

\documentclass[11pt]{scrartcl}
\usepackage{enumerate}
%...
\begin{document}

\section{My three favorite flowers are:
\begin{enumerate}
\item Roses
\item Daysies
\item Violets
\end{enumerate}
Now I will tell you stuff about them}

\end{document}


but it doesn't compile. Error is:

Argument of \@sect has an extra }.
<inserted text>
\par

-
What do you mean "it doesn't compile"? What is the error message you receive? Can you provide an MWE starting at \documentclass{...} and ending with \end{document} please? –  darthbith Jun 16 '14 at 15:22
And why exactly do you want this? –  daleif Jun 16 '14 at 15:22
you mean within section headings; please change the text of your title and the description to make this clear. (and, like daleif, i wonder why you want this.) –  barbara beeton Jun 16 '14 at 15:29
Section titles should be as short as possible, without hindering comprehension. An enumerated list in a section title is out of question, in my opinion. –  egreg Jun 16 '14 at 15:35
I know it is very odd to do something like that. There are definately better solutions to do this, but I wanted to make an written report ("Ausarbeitung") which answers a great number of specific questions. Most of those questions have lists in them, and I wanted to cite them in the sections, so they are easy to find with the table of contents. @Werner Your comment gave me the idea to use \section[Name in Table of Contents]{...} Apparently LaTeX did try to put the list in the ToC, which understandably didn't work. –  Josephus Jun 16 '14 at 15:48

The argument of sectional units are fragile and therefore can only contain a limited number of things, unless you're careful. A way out of your situation - against all common uses - is to keep your list inside the section, but provide an alternative "floating argument". This is provided by the optional argument:

\documentclass{scrartcl}
\begin{document}

\section[My three favourite flowers]{My three favourite flowers are:
\begin{enumerate}
\item Roses
\item Daisies
\item Violets
\end{enumerate}
Now I will tell you stuff about them}

\end{document}


If, however, you're only after the sectional unit font, then you can define that and use it accordingly:

\documentclass{scrartcl}
\makeatletter
\newenvironment{SECTION}
{\sectfont\size@section\noindent\ignorespaces}% \begin{SECTION}
{}% \end{SECTION}
\makeatother
\begin{document}

\begin{SECTION}
My three favourite flowers are:
\begin{enumerate}
\item Roses
\item Daisies
\item Violets
\end{enumerate}
Now I will tell you stuff about them
\end{SECTION}

\end{document}


You could even add the section number to it by perhaps using

\makeatletter
\newenvironment{SECTION}
{\refstepcounter{section}%
\sectfont\size@section\noindent%
{}% \end{SECTION}
\makeatother


Of course, this would remove all sectional functionality, but I'm not sure whether this is required in your instance.

To match Steven's stack, you can also use this definition:

\documentclass{scrartcl}
\begin{document}

\tableofcontents

\section{\protect\tabular[t]{@{}l}
My three favourite flowers are: \\
~~1. Roses \\
~~2. Daisies \\
~~3. Violets \\
Now I will tell you stuff about them
\protect\endtabular}

\end{document}


The \protection allows for safer travel of fragile arguments.

-
It works! Thank you very much for your time and effort, your different ways of accomplishing my goal, and your clean, structured, and educational writing. –  Josephus Jun 16 '14 at 18:02

You can fake it with a stack:

\documentclass[11pt]{scrartcl}
\usepackage{enumerate}
\usepackage[usestackEOL]{stackengine}
\begin{document}
\tableofcontents

\section{\Longunderstack[l]{
My three favorite flowers are:\\
~~1. Roses\\
~~2. Daysies\\
~~3. Violets\\
Now I will tell you stuff about them
}}
Does it work?
\section{Blah Blah}
More stuff
\end{document}


-
This is magnificent! Unfortunatley I don't have the package in TeXLive 2012. "LaTeX Error: File `stackengine.sty' not found." Do I need to use a newer version? –  Josephus Jun 16 '14 at 16:10
@Josephus You can download the sty file and documentation at ctan.org/pkg/stackengine –  Steven B. Segletes Jun 16 '14 at 16:13