von Holla » Do 6. Aug 2015, 11:42
Hallo Leute,
\documentclass[
,a4paper
,fontsize=12pt
]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%%% Anhangsverzeichnis
\makeatletter% --> De-TeX-FAQ
\newcommand*{\maintoc}{% Hauptinhaltsverzeichnis
\begingroup
\@fileswfalse% kein neues Verzeichnis öffnen
\renewcommand*{\appendixattoc}{% Trennanweisung im Inhaltsverzeichnis
\value{tocdepth}=-10000 % lokal tocdepth auf sehr kleinen Wert setzen
}%
\tableofcontents% Verzeichnis ausgeben
\endgroup
}
\newcommand*{\appendixtoc}{% Anhangsinhaltsverzeichnis
\begingroup
\edef\@alltocdepth{\the\value{tocdepth}}% tocdepth merken
\setcounter{tocdepth}{-10000}% Keine Verzeichniseinträge
\renewcommand*{\contentsname}{% Verzeichnisname ändern
Anhangsverzeichnis}%
\renewcommand*{\appendixattoc}{% Trennanweisung im Inhaltsverzeichnis
\setcounter{tocdepth}{\@alltocdepth}% tocdepth wiederherstellen
}%
\tableofcontents% Verzeichnis ausgeben
\setcounter{tocdepth}{\@alltocdepth}% tocdepth wiederherstellen
\endgroup
}
\newcommand*{\appendixattoc}{% Trennanweisung im Inhaltsverzeichnis
}
\g@addto@macro\appendix{% \appendix erweitern
\cleardoublepage% Neue Seite
\addcontentsline{toc}{section}{\appendixname}% Eintrag ins Hauptverzeichnis
\addtocontents{toc}{\protect\appendixattoc}% Trennanweisung in die toc-Datei
}
\makeatother
\begin{document}
\maintoc
\newpage\section{section}\subsection{subsection}\subsection{subsection}\subsection{subsection}\subsection{subsection}\section{section}\subsection{subsection}\subsection{subsection}\subsection{subsection}\subsection{subsection}\section{section}\subsection{subsection}\subsection{subsection}\subsection{subsection}\subsection{subsection}
\newpage\pagenumbering{Roman}\setcounter{page}{26}\appendix\appendixtoc
\newpage\section{Anhangsection}\subsection{Anhangsubsection}\subsection{Anhangsubsection}\subsection{Anhangsubsection}\section{Anhangsection}\subsection{Anhangsubsection}\subsection{Anhangsubsection}\subsection{Anhangsubsection}
\end{document}
Ich soll ein Anhangsverzeichnis machen. Habe den Codeschnippel irgendwo im Netz gefunden. Doch leider ragen die Seitenzahlen der Subsection aus dem Seitenrand.
Was läuft hier falsch und wie kann ich es ändern?
Gruß
Holla, die Waldfee
Hallo Leute,
[code]\documentclass[
,a4paper
,fontsize=12pt
]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%%% Anhangsverzeichnis
\makeatletter% --> De-TeX-FAQ
\newcommand*{\maintoc}{% Hauptinhaltsverzeichnis
\begingroup
\@fileswfalse% kein neues Verzeichnis öffnen
\renewcommand*{\appendixattoc}{% Trennanweisung im Inhaltsverzeichnis
\value{tocdepth}=-10000 % lokal tocdepth auf sehr kleinen Wert setzen
}%
\tableofcontents% Verzeichnis ausgeben
\endgroup
}
\newcommand*{\appendixtoc}{% Anhangsinhaltsverzeichnis
\begingroup
\edef\@alltocdepth{\the\value{tocdepth}}% tocdepth merken
\setcounter{tocdepth}{-10000}% Keine Verzeichniseinträge
\renewcommand*{\contentsname}{% Verzeichnisname ändern
Anhangsverzeichnis}%
\renewcommand*{\appendixattoc}{% Trennanweisung im Inhaltsverzeichnis
\setcounter{tocdepth}{\@alltocdepth}% tocdepth wiederherstellen
}%
\tableofcontents% Verzeichnis ausgeben
\setcounter{tocdepth}{\@alltocdepth}% tocdepth wiederherstellen
\endgroup
}
\newcommand*{\appendixattoc}{% Trennanweisung im Inhaltsverzeichnis
}
\g@addto@macro\appendix{% \appendix erweitern
\cleardoublepage% Neue Seite
\addcontentsline{toc}{section}{\appendixname}% Eintrag ins Hauptverzeichnis
\addtocontents{toc}{\protect\appendixattoc}% Trennanweisung in die toc-Datei
}
\makeatother
\begin{document}
\maintoc
\newpage\section{section}\subsection{subsection}\subsection{subsection}\subsection{subsection}\subsection{subsection}\section{section}\subsection{subsection}\subsection{subsection}\subsection{subsection}\subsection{subsection}\section{section}\subsection{subsection}\subsection{subsection}\subsection{subsection}\subsection{subsection}
\newpage\pagenumbering{Roman}\setcounter{page}{26}\appendix\appendixtoc
\newpage\section{Anhangsection}\subsection{Anhangsubsection}\subsection{Anhangsubsection}\subsection{Anhangsubsection}\section{Anhangsection}\subsection{Anhangsubsection}\subsection{Anhangsubsection}\subsection{Anhangsubsection}
\end{document}[/code]
Ich soll ein Anhangsverzeichnis machen. Habe den Codeschnippel irgendwo im Netz gefunden. Doch leider ragen die Seitenzahlen der Subsection aus dem Seitenrand.
Was läuft hier falsch und wie kann ich es ändern?
Gruß
Holla, die Waldfee