von esdd » Do 2. Mai 2019, 15:21
Die Option listof=entryprefix setzt außerdem automatisch auch listof=flat. Die Wirkung von listof=flat erstreckt sich allerdings nicht nur auf Listen mit owner=float, sondern auch auf alle anderen mit Ausnahme des Inhaltsverzeichnisses mit Endung toc.
Als Workaround kannst Du das folgende nutzen:
\documentclass[listof=totoc,listof=entryprefix]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{hyperref}
\usepackage{bookmark}
% Anhangsverzeichnis (nach https://komascript.de/comment/5578#comment-5578)
\DeclareNewTOC[owner=\jobname,listname={Anhang},name={Anhang}]{atoc}
\makeatletter
\AfterTOCHead[atoc]{\let\if@dynlist\if@tocleft}% <- ergänzt, gleiches Verhalten wie toc
\newcommand*{\useappendixtoc}{%
\renewcommand*{\ext@toc}{atoc}%
\scr@ifundefinedorrelax{hypersetup}{}{
\hypersetup{bookmarkstype=atoc}%
}%
}
\newcommand*{\usestandardtoc}{%
\renewcommand*{\ext@toc}{toc}%
\scr@ifundefinedorrelax{hypersetup}{}{
\hypersetup{bookmarkstype=toc}%
}%
}
\makeatother
\usepackage{xpatch}
\xapptocmd\appendix{%
\useappendixtoc%
\listofatocs%
\addcontentsline{toc}{section}{\appendixname}%
}{}{}
\makeatother
\newcommand{\postappendix}{%
\usestandardtoc%
% \bookmarksetup{startatroot}% siehe bookmark-Anleitung
}
% LoF
\renewcaptionname{ngerman}{\figurename}{Abb.}
\BeforeStartingTOC[lof]{\renewcommand*\autodot{:}}
\begin{document}
\tableofcontents
\listoffigures
\newpage
\section{Kapitel 1}
\begin{figure}
\centering
\rule{10cm}{3cm}
\caption{Testbild}
\end{figure}
\subsection{Kapitel 1.1}
\subsubsection{Kapitel 1.1.1}
\newpage
\appendix
\section{Anhang A}
\subsection{Anhang A.1}
\subsubsection{Anhang A.1.1}
\newpage
\postappendix
\section{Post-Anhang 1}
\subsection{Post-Anhang 1.1}
\subsubsection{Post-Anhang 1.1.1}
\end{document}
Alternativ kannst Du auch mit listof=gratuated das implizite listof=flat wieder aufheben und anschließend die Einträge für Abbildungen und Tabellen entsprechend anpassen:
\documentclass[listof=totoc,listof=entryprefix]{scrartcl}
\KOMAoptions{listof=graduated}% <- aufheben von listof=flat
\DeclareTOCStyleEntries[
indent=0pt,% <- kein Einzug
dynnumwidth% <- automatische Anpassung der benötigten Breite für die Eintragsnummern
]{default}{figure,table}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{hyperref}
\usepackage{bookmark}
% Anhangsverzeichnis (nach https://komascript.de/comment/5578#comment-5578)
\DeclareNewTOC[owner=\jobname,listname={Anhang},name={Anhang}]{atoc}
\makeatletter
\newcommand*{\useappendixtoc}{%
\renewcommand*{\ext@toc}{atoc}%
\scr@ifundefinedorrelax{hypersetup}{}{
\hypersetup{bookmarkstype=atoc}%
}%
}
\newcommand*{\usestandardtoc}{%
\renewcommand*{\ext@toc}{toc}%
\scr@ifundefinedorrelax{hypersetup}{}{
\hypersetup{bookmarkstype=toc}%
}%
}
\makeatother
\usepackage{xpatch}
\xapptocmd\appendix{%
\useappendixtoc%
\listofatocs%
\addcontentsline{toc}{section}{\appendixname}%
}{}{}
\makeatother
\newcommand{\postappendix}{%
\usestandardtoc%
% \bookmarksetup{startatroot}% siehe bookmark-Anleitung
}
% LoF
\renewcaptionname{ngerman}{\figurename}{Abb.}
\BeforeStartingTOC[lof]{\renewcommand*\autodot{:}}
\begin{document}
\tableofcontents
\listoffigures
\newpage
\section{Kapitel 1}
\begin{figure}
\centering
\rule{10cm}{3cm}
\caption{Testbild}
\end{figure}
\subsection{Kapitel 1.1}
\subsubsection{Kapitel 1.1.1}
\newpage
\appendix
\section{Anhang A}
\subsection{Anhang A.1}
\subsubsection{Anhang A.1.1}
\newpage
\postappendix
\section{Post-Anhang 1}
\subsection{Post-Anhang 1.1}
\subsubsection{Post-Anhang 1.1.1}
\end{document}
Die Option [tt]listof=entryprefix[/tt] setzt außerdem automatisch auch [tt]listof=flat[/tt]. Die Wirkung von [tt]listof=flat[/tt] erstreckt sich allerdings nicht nur auf Listen mit [tt]owner=float[/tt], sondern auch auf alle anderen mit Ausnahme des Inhaltsverzeichnisses mit Endung [tt]toc[/tt].
Als Workaround kannst Du das folgende nutzen:
[code]
\documentclass[listof=totoc,listof=entryprefix]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{hyperref}
\usepackage{bookmark}
% Anhangsverzeichnis (nach https://komascript.de/comment/5578#comment-5578)
\DeclareNewTOC[owner=\jobname,listname={Anhang},name={Anhang}]{atoc}
\makeatletter
\AfterTOCHead[atoc]{\let\if@dynlist\if@tocleft}% <- ergänzt, gleiches Verhalten wie toc
\newcommand*{\useappendixtoc}{%
\renewcommand*{\ext@toc}{atoc}%
\scr@ifundefinedorrelax{hypersetup}{}{
\hypersetup{bookmarkstype=atoc}%
}%
}
\newcommand*{\usestandardtoc}{%
\renewcommand*{\ext@toc}{toc}%
\scr@ifundefinedorrelax{hypersetup}{}{
\hypersetup{bookmarkstype=toc}%
}%
}
\makeatother
\usepackage{xpatch}
\xapptocmd\appendix{%
\useappendixtoc%
\listofatocs%
\addcontentsline{toc}{section}{\appendixname}%
}{}{}
\makeatother
\newcommand{\postappendix}{%
\usestandardtoc%
% \bookmarksetup{startatroot}% siehe bookmark-Anleitung
}
% LoF
\renewcaptionname{ngerman}{\figurename}{Abb.}
\BeforeStartingTOC[lof]{\renewcommand*\autodot{:}}
\begin{document}
\tableofcontents
\listoffigures
\newpage
\section{Kapitel 1}
\begin{figure}
\centering
\rule{10cm}{3cm}
\caption{Testbild}
\end{figure}
\subsection{Kapitel 1.1}
\subsubsection{Kapitel 1.1.1}
\newpage
\appendix
\section{Anhang A}
\subsection{Anhang A.1}
\subsubsection{Anhang A.1.1}
\newpage
\postappendix
\section{Post-Anhang 1}
\subsection{Post-Anhang 1.1}
\subsubsection{Post-Anhang 1.1.1}
\end{document}
[/code]
Alternativ kannst Du auch mit [tt]listof=gratuated[/tt] das implizite [tt]listof=flat[/tt] wieder aufheben und anschließend die Einträge für Abbildungen und Tabellen entsprechend anpassen:
[code]
\documentclass[listof=totoc,listof=entryprefix]{scrartcl}
\KOMAoptions{listof=graduated}% <- aufheben von listof=flat
\DeclareTOCStyleEntries[
indent=0pt,% <- kein Einzug
dynnumwidth% <- automatische Anpassung der benötigten Breite für die Eintragsnummern
]{default}{figure,table}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{hyperref}
\usepackage{bookmark}
% Anhangsverzeichnis (nach https://komascript.de/comment/5578#comment-5578)
\DeclareNewTOC[owner=\jobname,listname={Anhang},name={Anhang}]{atoc}
\makeatletter
\newcommand*{\useappendixtoc}{%
\renewcommand*{\ext@toc}{atoc}%
\scr@ifundefinedorrelax{hypersetup}{}{
\hypersetup{bookmarkstype=atoc}%
}%
}
\newcommand*{\usestandardtoc}{%
\renewcommand*{\ext@toc}{toc}%
\scr@ifundefinedorrelax{hypersetup}{}{
\hypersetup{bookmarkstype=toc}%
}%
}
\makeatother
\usepackage{xpatch}
\xapptocmd\appendix{%
\useappendixtoc%
\listofatocs%
\addcontentsline{toc}{section}{\appendixname}%
}{}{}
\makeatother
\newcommand{\postappendix}{%
\usestandardtoc%
% \bookmarksetup{startatroot}% siehe bookmark-Anleitung
}
% LoF
\renewcaptionname{ngerman}{\figurename}{Abb.}
\BeforeStartingTOC[lof]{\renewcommand*\autodot{:}}
\begin{document}
\tableofcontents
\listoffigures
\newpage
\section{Kapitel 1}
\begin{figure}
\centering
\rule{10cm}{3cm}
\caption{Testbild}
\end{figure}
\subsection{Kapitel 1.1}
\subsubsection{Kapitel 1.1.1}
\newpage
\appendix
\section{Anhang A}
\subsection{Anhang A.1}
\subsubsection{Anhang A.1.1}
\newpage
\postappendix
\section{Post-Anhang 1}
\subsection{Post-Anhang 1.1}
\subsubsection{Post-Anhang 1.1.1}
\end{document} [/code]