Seitenzahl im Anhangsverzeichnis ragt über den Seiterand

Inhalt, Abbildungen, Tabellen, Quellcodes und andere Verzeichnisse


Holla

Seitenzahl im Anhangsverzeichnis ragt über den Seiterand

Beitrag von Holla »

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

Benutzeravatar
u_fischer
Forum-Meister
Forum-Meister
Beiträge: 4300
Registriert: Do 22. Nov 2012, 11:09
Kontaktdaten:

Beitrag von u_fischer »

\newcommand*{\appendixtoc}{% Anhangsinhaltsverzeichnis
  \begingroup
    \renewcommand\@pnumwidth{7ex}%<---- Mehr Platz für Zahlen.
 ..........

Holla

Beitrag von Holla »

Genial, Ulrike, du bist spitze.
Tausendfacher Dank


Gruß
Holla, die Waldfee

Antworten