I am using scrreprt-class and I am trying to modify the appearance of the appendix titles in the pdfbookmark.
In the image below, you can see what I have at the moment. I am using the appendices-environment and each appendix is a chapter on its own.
Now, I "only" want to add a colon in the ToC for the appendix entries. E.g. Appendix A: I am Appendix a, etc.
Please note that I want to stick to the KOMA-class "scrreprt".
Thanks in advance.
MWE (This is my first one - so I am not sure if it is as minimal as possible)
\documentclass[12pt, longdoc, bigchapter, colorback, numbersubsubsec, twoside, openright, chapterprefix]{scrreprt}
\usepackage[ngerman]{babel} % deutsche Trennregeln
\usepackage{lmodern} % fixes bug with \usepackage[T1]{fontenc}; ändert Schriftart zudem in Latin Modern
\usepackage[T1]{fontenc} % für europäische Autoren ratsam; % wichtig für Trennung von Wörtern mit Umlauten
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\hypersetup{linktocpage=true, linktoc=all,bookmarks=true, bookmarksopen=true, colorlinks, linkcolor = black}
\usepackage[all]{hypcap} % needed to help hyperlinks direct correctly;
\usepackage[numbered]{bookmark}
\usepackage{booktabs}
%https://tex.stackexchange.com/questions/202928/remove-last-dot-in-title-numbering
\makeatletter
\g@addto@macro{\appendix}{%
\patchcmd{\@@makechapterhead}% <cmd>
{\endgraf\nobreak\vskip.5\baselineskip}% <search>
{\hspace*{-0.5em}:\space}% <replace>
{}{}% <success><failure>
\patchcmd{\@chapter}% <cmd>
{\addchaptertocentry{\thechapter}}% <search>
{\addchaptertocentry{Appendix~\thechapter:}}% <replace>
{}{}% <success><failure>
\addtocontents{toc}{%
\protect\patchcmd{\protect\l@chapter}% <cmd>
{1.5em}% <search>
{6.5em}% <replace>
{}{}}% <success><failure>
}
\renewcommand{\autodot}{}% Remove all end-of-counter dots
%%% No Spacing Between Chapter Title and Prefix
\RedeclareSectionCommand[innerskip=0pt]{chapter} % <--- Vary distance here (Thanks @esdd!)
\usepackage[titletoc]{appendix}
\usepackage{lipsum}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%% TOC
\phantomsection
\pdfbookmark{Inhaltsverzeichnis}{toc} %Inhaltsverzeichnis in die Hyperlink-Navigation mit aufnehmen
%\addcontentsline{toc}{chapter}{Inhaltsverzeichnis}
\setcounter{tocdepth}{4}
\tableofcontents
%%% Testpage
\chapter{Test}
\lipsum
%%%% APPENDIX
\begin{appendices}
\renewcommand\chaptername{Anhang}
\chapter{This is a test heading}
\end{appendices}
\end{document}
hyperref
into account, also, it adds to\appendix
but you are using theappendices
env. I never use the KOMA stuff, so cannot help here. Note chapter does not actually use\chaptername
but rather\@chapapp
(at least in normal classes), this points to\chaptername
whenever appendix is not active. Thus that\renewcommand
does nothing.\patchcmd