PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : manuelle Einträge in das Inhaltsverzeichnis



Arik
07-08-2008, 00:32
Hallo,

habe da mal ein vielleicht etwas komlizierteres Problem:

ich habe folgenden Code



\newcommand{\addy}[2]{
\addcontentsline{toc}{section}{#2}
\addcontentsline{toc}{subsection}{#1}
\begin{minipage}{\breiteMinipage}
\begin{tabular}{p{\spalteEins}l}
Name: & \textbf{ \textit{#1} } \\
Stadt: & \textbf{ \textit{#2} } \\
\end{tabular}
\end{minipage} \vspace{1em}
}


Das ist natürlich nur ein Minimal-Beispiel und sollte für meine Frage reichen :D

Dieses Kommando baut mir also eine Minipage.

wenn ich nun in meinem Document



\addy{Name1}{Stadt1}
\addy{Name2}{Stadt2}
\addy{Name3}{Stadt1}
\addy{Name4}{Stadt3}
\addy{Name5}{Stadt3}
\addy{Name6}{Stadt3}

erhalte ich folgendes Inhaltsverzeichnis


Inhaltsverzeichnis
Stadt1 1
Name1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Stadt2 1
Name2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Stadt1 1
Name3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Stadt3 1
Name4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Stadt3 1
Name5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Stadt3 1
Name6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1


ich hätte aber gerne:
Inhaltsverzeichnis
Stadt1 1
Name1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Name3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Stadt2 1
Name2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Stadt3 1
Name4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Name5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Name6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1
( Einrücken tut er es bei mir richtig, nur hier nicht ;), das ist auch nicht das Problem ;) )


Frage:
Wie kann ich verhindern, dass ich doppelte Einträge habe?

Also als Pseudocode:


Wenn ( Eintrag für section existiert)
Dann (
Wenn(Eintrag für subsection exisitert)
Dann(mache nichts)
Sonst(trage die Subsection unter der Section ein)
)
Sonst(mache nichts)


Hoffe das ist einigermaßen klar geworden.