Vielen Dank für den Hinweis.
Ich habe auch weiter gesucht und gelesen. Mein nächster Versuch wird sein, die Beispiele mit ntheorem zu setzen. Damit kann ich auch relativ einfach ein entsprechendes Verzeichnis erzeugen. In dieses Verzeichnis will ich dann mit \savebox jeden Kommentar zu den Beispielen versuchen einzubauen.
Das tocbasic-Paket schaue ich mir auch an.
Grüße
Code:
\documentclass{scrartcl}
\usepackage{color}
\definecolor{grey}{rgb}{0.8,0.8,0.8}
\newcounter{semexcount}
\newlength{\semexcountl}
\makeatletter
\@addtoreset{semexcount}{subsection}
\newcommand\listsemexname{Kommentare zu den Beispielen}
\newcommand\listofsemex{%
\section*{\listsemexname}\@starttoc{examples}}
\makeatother
\newenvironment{semex}[2]{%
\setlength{\fboxsep}{6pt} \smallskip \\
\fcolorbox{white}{grey}{%
\parbox{0.8\textwidth}{\textsf{#1}}
}
\stepcounter{semexcount} \hfill \textbf{\thesubsection-\thesemexcount} \smallskip
\settowidth{\semexcountl}{\textbf{\thesubsection-\thesemexcount}}
\label{semex:\thesubsection-\thesemexcount}
\addtocontents{examples}{%
\textbf{\thesubsection-\thesemexcount} \indent \textsf{{#2}}{}\\}
}
\begin{document}
\section{bla}
bla bla bla
\semex{%
text text text text text text text text text text text text text text text
}{kommentar kommentar kommentar kommentar}\\
\semex{%
text text text text text text text text text text text text text text text
}{kommentar kommentar kommentar kommentar}\\
\semex{%
text
}{kommentar kommentar kommentar kommentar}\\
\subsection{blubb}
blubb blubb blubb
\semex{%
text
}{kommentar kommentar}\\
blubb blubb blubb
\semex{%
text text text text text text text text text text text text text text text
}{kommentar kommentar kommentar kommentar}\\
blubb blubb blubb
\semex{%
text
}{kommentar kommentar kommentar kommentar}\\
\section{bla blubb}
bla blub bla blub bla blub
\semex{%
text
}{kommentar kommentar}\\
\semex{%
text text text text text text text text text text text text text text text
}{kommentar kommentar kommentar kommentar}\\
\semex{%
text
}{kommentar kommentar kommentar kommentar kommentar}\\
\semex{%
text
}{kommentar kommentar kommentar kommentar}\\
blubb blubb blubb
\semex{%
text text text text text text text text text text text text text text text
}{kommentar kommentar kommentar kommentar}\\
blubb blubb blubb
\semex{%
text
}{kommentar kommentar kommentar kommentar}\\
\section{bla blubb}
bla blub bla blub bla blub
\semex{%
text
}{kommentar kommentar}\\
\semex{%
text text text text text text text text text text text text text text text
}{kommentar kommentar kommentar kommentar}\\
\semex{%
text
}{kommentar kommentar kommentar kommentar kommentar kommentar kommentar kommentar kommentar kommentar kommentar kommentar kommentar}\\
\subsection{blubb}
blubb blubb blubb
\semex{%
text
}{kommentar kommentar kommentar kommentar}\\
blubb blubb blubb
\semex{%
text text text text text text text text text text text text text text text
}{kommentar kommentar kommentar kommentar}\\
blubb blubb blubb
\semex{%
text
}{kommentar kommentar kommentar kommentar}\\
\appendix
\section*{Anhang}
\listofsemex
\end{document}
Das Beispiel oben setzt ein neues Verzeichnis auf, d. h. es funktioniert ohne \savebox. Jetzt fehlt mir nur noch eine Möglichkeit die Liste im Anhang zu formatieren,
dass die Einträge alle mit Einzug und linksbündig sind. Es gibt einen hässlichen Absatz, wenn die Zahlen länger sind und wenn der Text länger als die Zeile ist.
Danke
Lesezeichen