Anhangsverzeichnis nicht eingerückt

Antwort erstellen


Diese Frage dient dazu, das automatisierte Versenden von Formularen durch Spam-Bots zu verhindern.
Smilies
:D :) :( :o :shock: :? 8) :lol: :-x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:

BBCode ist eingeschaltet
[img] ist eingeschaltet
[flash] ist ausgeschaltet
[url] ist eingeschaltet
Smilies sind eingeschaltet

Die letzten Beiträge des Themas

Ich habe die Datenschutzerklärung gelesen und bin damit einverstanden.

   

Ansicht erweitern Die letzten Beiträge des Themas: Anhangsverzeichnis nicht eingerückt

von HenningSch » Fr 3. Mai 2019, 08:06

Funktioniert. Dankeschön!

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} 

Anhangsverzeichnis nicht eingerückt

von HenningSch » Do 2. Mai 2019, 14:34

Hallo zusammen,

ich muss für meine Anhänge ein separates Verzeichnis erstellen. Das funktioniert soweit auch einwandfrei. Das Problem entsteht erst durch die Option listof=entryprefix. Dadurch verschwindet die Einrückung des Anhangsverzeichnisses leider. Ich habe versucht mich etwas bei tocbasic einzulesen, werde da aber nicht fündig. Hat jemand eine Idee?

Minimalbeispiel:
\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
\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}%
}{}{}
\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}

Nach oben