Post by Jacqueline ObermillerHallo Martin,
ich habe genau gelesen was du geschrieben hast ............ vielleicht NUR
nicht
genau verstanden ...........scheinbar immer noch nicht, denn es klappt
nicht. :-(
Hallo Jacqueline,
dann versuche ich es nochmal: Du nimmst das Beispiel von Markus und
ersetzt den Teil zwischen \begin{document} und \end{document} durch
deinen Text. Damit erhält man (Längere Kommentare habe ich entfernt):
8>-------------------------------------------------
\documentclass[a4paper,12pt]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
\usepackage{filecontents}
\begin{filecontents}{appendixtoc.sty}
%
% appendixtoc.sty
% Copyright (c) Markus Kohm, 2013-2014
% See `appendixtocexample.tex' for license informations. Distribution
without
% `appendixtocexample.tex' is forbidden!
\ProvidesPackage{appendixtoc}[2014/01/22 unsupported LaTeX2e package]
\RequirePackage{scrbase}[2013/12/19]
\RequirePackage{tocstyle}
\usetocstyle{KOMAlike}
\newenvironment*{tocconditional}[1]{%
\expandafter\ifx\csname ***@toccond@#1\expandafter\endcsname
\csname iftrue\endcsname
\else
\value{tocdepth}=-10000\relax
\fi
\typeout{tocdepth in `#1': \the\***@tocdepth}%
}{%
}
\AtBeginDocument{%
\addtocontents{toc}{\string\begin{tocconditional}{main}}
}
\BeforeClosingMainAux{%
\addtocontents{toc}{\string\end{tocconditional}}%
}
\newcommand*{\newtocconditional}[2][false]{%
\expandafter\newif\csname ***@toccond@#2\endcsname
\csname @toccond@#2#1\endcsname
}
\newcommand*{\settocconditional}[2]{%
\csname @toccond@#1#2\endcsname
}
\newtocconditional[true]{main}
\newtocconditional{appendix}
\***@addto@macro\appendix{%
% \addtocontents{toc}{\string\end{tocconditional}^^J
% \string\begin{tocconditional}{main}}%
\begingroup
\@ifundefined{***@listhead}{%
\@ifundefined{chapter}{% und falls \chapter nicht definiert ist,
\section*{\listofappendixname}% \section* verwenden
}{% aber falls \chapter definiert ist,
\chapter*{\listofappendixname}% \chapter* verwenden
}%
% und noch die Kolumnentitel passend setzen.
\@mkboth{\csname MakeMarkcase\endcsname{\listofappendixname}}%
{\csname MakeMarkcase\endcsname{\listofappendixname}}%
}{% Falls \***@heading definiert ist,
\def\@currext{appendix}% initialisieren
\***@listhead{\listofappendixname}% und verwenden
}%
\endgroup
\addtocontents{toc}{\string\end{tocconditional}^^J
\string\begin{tocconditional}{appendix}}%
\appendixtableofcontents
}
\newcommand*{\appendixtableofcontents}{%
\showtoc[{ %
\aliastoc{\tocstyleTOC}{toc}%
\settocconditional{main}{false}%
\settocconditional{appendix}{true}%
}]{toc}%
}
\newcommand*{\postappendix}{%
%\renewcommand{\thechapter}{\arabic{chapter}} %Um Kapitel wieder
arabisch weiterzuzählen
\addtocontents{toc}{\string\end{tocconditional}^^J%
\string\begin{tocconditional}{main}}%
}
\newcommand*{\listofappendixname}{Table of appendices}
\AtBeginDocument{%
\providecaptionname{american,australien,british,canadian,english,UKenglish,USenglish}\listofappendixname{Table
of appendices}%
\providecaptionname{german,ngerman,austrian,naustrian,swissgerman,nswissgerman}\listofappendixname{Anhangsverzeichnis}%
}%
\end{filecontents}
\usepackage{tocbasic}
\usepackage{appendixtoc}
\setuptoc{appendix}{totoc}
\begin{document}
\tableofcontents
\chapter{Überschrift1}
\chapter{Überschrift2}
\chapter{Überschrift3}
\chapter{Überschrift4}
\appendix
\listofappendixname
\chapter{Anhang1}
\chapter{Anhang2}
\chapter{Anhang3}
\chapter{Anhang4}
\postappendix
\chapter{Erklärung}
\end{document}
% Ende ---------------------------- test-anhangsverzeichnis.tex
Ich hoffe, das hilft dir weiter. Für größere Dokumente sollte man das
Paket wohl auch tatsächlich als solches in eine eigene .sty-Datei packen.
Gruß
Martin
--
FAQ: http://www.dante.de/faq/de-tex-faq/
Durchsuchbares Archiv: http://tinyurl.com/cdcb6
Unsubscribe/Verwaltung: http://tinyurl.com/b9tod