I modify a little Gonzalo's method, in order to not hard-code the spacings and really use rather a true enumerate
environment. (edit: to illustrate I add a \usepackage{enumerate}
.) (edit2: I amend my original code which, in the case of options passed to the enumerate environment, compiled only if the toc
file already existed...)
Edited: I propose three increasingly complicated methods. The first was a modification of Gonzalo
's approach, in order to allow to use a real enumerate environment. For that, egreg
has since provided a yet simpler way. Then I added support for subsections and subsubsections so that one could use formatting options of packages like enumitem
to customize the look of the hacked table of contents (method 2). Finally (method 3) I modify once more to add hyperref
support. So in the end we reconstitute a mock table of contents with possible hyperlinks. The links are put in the names of sections and subsections, but could also be inserted in the labels of the item (using enumitem
). Page numbers are just not used. But if I understand the OP's aim would be more to use here an itemize
environment, so I did not try to put the links in the item labels.
Here is for example how a table of contents with sections, subsections and subsubsections may appear:

And all names (or letters for the subsubsections) are hyperref
-links (the names are the ones used in the document body for the titles of the sections, subsections, subsubsections, they are not generated by the code). The code to get this is the third proposal below.
First proposal:
\documentclass{scrartcl}
\usepackage{titlesec}
\usepackage{lipsum}
\usepackage{enumerate}
\setcounter{tocdepth}{1}
\newtoks\agendatoks
\newif\ifexisttoc
\makeatletter
\renewcommand\tableofcontents{%
\@starttoc{toc}\ifexisttoc
\begin{enumerate}[(A)] % <- customize this, for example if you use the
% enumitem package, to specify the spacings etc...
\the\agendatoks
\end{enumerate}
\fi}
\renewcommand*\l@section[2]{%
\let\ex\expandafter
\let\numberline\@gobble
\ifnum \c@tocdepth >\z@
\toks0=\ex{\ex\item #1}%
\global\agendatoks=\ex\ex\ex{\ex\the\ex\agendatoks\the\toks0}%
\global\existtoctrue
\fi}
\makeatother
\titleformat{\section}
{\normalfont\Large\bfseries\sffamily}{}{0em}{}
\begin{document}
\tableofcontents
\section{Agenda item one}
\lipsum[4]
\section{Agenda item two}
\lipsum[4]
\section{Agenda item three}
\lipsum[4]
\section{Agenda item four}
\lipsum[4]
\end{document}
Caveat: I did not look more than casually at the contents of a .toc
file, so the method is only tested on the OP's Gonzalo's example!

Second proposal:
% Time-stamp: <30-10-2012 21:26:48 CET jfb>
% http://tex.stackexchange.com/questions/79682/can-i-get-a-list-of-all-sections-as-a-simple-enumerate-list
\documentclass{article}
\usepackage{enumitem} % to use its formatting options for enumerate, itemize, description
\usepackage{titlesec} % to generate unnumbered sections and subsections in the body
%------------ macros to format the table of contents to one's arbitrary wishes
%------------ use is self-explanatory: customize \headeri, \headerii, \headeriii
%------------ none of the above two packages is necessary for the working of the macros
\newtoks\agendatoks
\newif\ifexisti
\newif\ifexistii
\newif\ifexistiii
\makeatletter
%------------ here we use options made available by package enumitem
\newcommand\headeri{\begin{enumerate}[font=\LARGE,label=\fbox{\arabic*}, itemsep=24pt]}
\newcommand\footeri{\end{enumerate}} % keep it in sync with \headeri!
\newcommand\headerii{\begin{enumerate}[font=\ttfamily\bfseries, leftmargin=1.5cm,%
itemsep=18pt]}
\newcommand\footerii{\end{enumerate}}
\newcommand\headeriii{\begin{itemize}[itemsep=12pt]}
\newcommand\footeriii{\end{itemize}}
%------------ our beautiful macros
\renewcommand\tableofcontents{%
\@starttoc{toc}%
\ifexisti
\the\agendatoks
\ifexistiii\footeriii\fi
\ifexistii\footerii\fi
\footeri
\fi}
\renewcommand\l@section[2]{%
\let\ex\expandafter
\let\numberline\@gobble
\ifexistiii\toks0=\ex{\footeriii}\else\toks0={}\fi
\global\existiiifalse
\ifexistii\toks0=\ex{\the\toks0\noexpand\footerii}\fi
\global\existiifalse
\ifexisti\else\toks0=\ex{\headeri}\fi
\global\existitrue
\toks0=\ex{\the\toks0\noexpand\item}%
\toks0=\ex\ex\ex{\ex\the\ex\toks0#1}%
\global\agendatoks=\ex\ex\ex{\ex\the\ex\agendatoks\the\toks0}%
% \showthe\agendatoks % for debugging
}
\renewcommand\l@subsection[2]{%
\let\ex\expandafter
\let\numberline\@gobble
\ifexistiii\toks0=\ex{\footeriii}\else\toks0={}\fi
\global\existiiifalse
\ifexistii\else\toks0=\ex{\headerii}\fi
\global\existiitrue
\toks0=\ex{\the\toks0\noexpand\item}%
\toks0=\ex\ex\ex{\ex\the\ex\toks0#1}%
\global\agendatoks=\ex\ex\ex{\ex\the\ex\agendatoks\the\toks0}%
% \showthe\agendatoks
}
\renewcommand\l@subsubsection[2]{%
\let\ex\expandafter
\let\numberline\@gobble
\ifexistiii\toks0={}\else\toks0=\ex{\headeriii}\fi
\global\existiiitrue
\toks0=\ex{\the\toks0\noexpand\item}%
\toks0=\ex\ex\ex{\ex\the\ex\toks0#1}%
\global\agendatoks=\ex\ex\ex{\ex\the\ex\agendatoks\the\toks0}%
% \showthe\agendatoks
}
\makeatother
% the following (from package titlesec) only influences the look of the body,
% not the table of contents
\titleformat{\section}
{\normalfont\LARGE\bfseries\sffamily}{}{0em}{}
\titleformat{\subsection}
{\normalfont\Large\sffamily}{}{1em}{}
\titleformat{\subsubsection}
{\normalfont\large\ttfamily}{}{2em}{}
\begin{document}\thispagestyle{empty}
\centerline{\bfseries THIS IS THE TABLE OF CONTENTS}
\tableofcontents
\section{First}
\subsection{primo}
\subsection{secondo}
\subsubsection{i}
\subsubsection{ii}
\subsection{tertio}
\subsubsection{i}
\subsubsection{ii}
\subsubsection{iii}
\section{Second}
\subsection{primo}
\subsubsection{i}
\subsubsection{ii}
\subsubsection{iii}
\subsection{secondo}
\section{Third}
\subsection{tertio}
\section{Fourth}
\subsection{quarto}
\subsubsection{i}
\subsubsection{ii}
\subsubsection{iii}
\end{document}
Here is the first page:

Third proposal: with hyperref
support (works also if hyperref
is not there)
% Time-stamp: <31-10-2012 10:56:36 CET jfb>
% http://tex.stackexchange.com/questions/79682/can-i-get-a-list-of-all-sections-as-a-simple-enumerate-list
% Third version: now compatible with hyperref.
\documentclass{article}
\usepackage{enumitem} % to use its formatting options for enumerate, itemize, description
\usepackage{titlesec} % to generate unnumbered sections and subsections in the body
\usepackage{kantlipsum}
\usepackage{hyperref}
\newtoks\agendatoks
\newif\ifexisti
\newif\ifexistii
\newif\ifexistiii
%------------ here we use options made available by package enumitem
%------------ for the top level, and redefine \item for the inner levels
\makeatletter
\newcommand\headeri{\begin{enumerate}[font=\LARGE, %
label=\fbox{\arabic*}, itemsep=18pt]%
\sffamily\bfseries\Large}
\newcommand\footeri{\end{enumerate}} % keep it in sync with \headeri!
\newcommand\headerii{ \begingroup\normalfont\ttfamily(\def\item{, }\@gobble}
\newcommand\footerii{)\endgroup}
\newcommand\headeriii{\begingroup\scshape
\let\item-$^\bgroup\hbox\bgroup\scriptsize\@gobble}
\newcommand\footeriii{\egroup\egroup$\endgroup}
\makeatother
%------------ our beautiful macros
\makeatletter
\renewcommand\tableofcontents{%
\@starttoc{toc}%
\ifexisti
\the\agendatoks
\ifexistiii\footeriii\fi
\ifexistii\footerii\fi
\footeri
\fi}
\renewcommand\l@section[2]{%
\let\@xp\expandafter
\let\numberline\@gobble
\def\hyper@linkstart{\noexpand\hyper@linkstart}%
\def\hyper@linkend{\noexpand\hyper@linkend}%
\edef\@jfbutmp{#1}%
\ifexistiii\toks0={\footeriii}\else\toks0={}\fi
\global\existiiifalse
\ifexistii\toks0=\@xp{\the\toks0 \footerii}\fi
\global\existiifalse
\ifexisti\else\toks0={\headeri}\fi
\global\existitrue
\toks0=\@xp{\the\toks0 \item}%
\toks0=\@xp{\the\toks0\@jfbutmp}%
\global\agendatoks=\@xp\@xp\@xp{\@xp\the\@xp\agendatoks\the\toks0}%
}
\renewcommand\l@subsection[2]{%
\let\@xp\expandafter
\let\numberline\@gobble
\def\hyper@linkstart{\noexpand\hyper@linkstart}%
\def\hyper@linkend{\noexpand\hyper@linkend}%
\edef\@jfbutmp{#1}%
\ifexistiii\toks0={\footeriii}\else\toks0={}\fi
\global\existiiifalse
\ifexistii\else\toks0={\headerii}\fi
\global\existiitrue
\toks0=\@xp{\the\toks0 \item}%
\toks0=\@xp{\the\toks0\@jfbutmp}
\global\agendatoks=\@xp\@xp\@xp{\@xp\the\@xp\agendatoks\the\toks0}
}
\renewcommand\l@subsubsection[2]{%
\let\@xp\expandafter
\let\numberline\@gobble
\def\hyper@linkstart{\noexpand\hyper@linkstart}%
\def\hyper@linkend{\noexpand\hyper@linkend}%
\edef\@jfbutmp{#1}%
\ifexistiii\toks0={}\else\toks0={\headeriii}\fi
\global\existiiitrue
\toks0=\@xp{\the\toks0 \item}%
\toks0=\@xp{\the\toks0\@jfbutmp}%
\global\agendatoks=\@xp\@xp\@xp{\@xp\the\@xp\agendatoks\the\toks0}%
}
\makeatother
% the following (from package titlesec) only influences the look of the body,
% not the table of contents
\titleformat{\section}
{\normalfont\LARGE\bfseries\sffamily}{}{0em}{}
\titleformat{\subsection}
{\normalfont\Large\sffamily}{}{1em}{}
\titleformat{\subsubsection}
{\normalfont\large\ttfamily}{}{2em}{}
\begin{document}\thispagestyle{empty}
\tableofcontents
\section{First}
\kant[1]
\subsection{primo}
\kant[11]
\subsection{secondo}
\kant[12]
\subsubsection{i}
\kant[121]
\subsubsection{ii}
\kant[122]
\subsection{tertio}
\kant[13]
\subsubsection{i}
\kant[131]
\subsubsection{ii}
\kant[132]
\subsubsection{iii}
\kant[133]
\section{Second}
\kant[2]
\subsection{primo}
\kant[21]
\subsubsection{i}
\kant[111]
\subsubsection{ii}
\kant[112]
\subsubsection{iii}
\kant[113]
\subsection{secondo}
\kant[22]
\section{Third}
\kant[3]
\subsection{tertio}
\kant[33]
\section{Fourth}
\kant[4]
\subsection{quarto}
\kant[44]
\subsubsection{i}
\kant[141]
\subsubsection{ii}
\kant[142]
\subsubsection{iii}
\kant[143]
\end{document}
\l@section
which defines what is written to thetoc
file to write\item
. – David Carlisle Oct 30 '12 at 11:00article
class? Are there also numbered sections or not? – egreg Oct 30 '12 at 11:58scrartcl
class. No, I only use unnumbered sections (section*{bla}
). – Martin Thoma Oct 30 '12 at 12:03