My appendix consits of a chapter which tells the TOC that an appendix exists. All other headings in my appendix are sections.
Now I want that a section header looks like:
Appendix A. Some Text
Appendix B. Some Text
Appendix C. Some Text
But the following line
\renewcommand{\thesection}{\Alph{section}}
which can be found on most of the appendix articles won't work.
My minimal example looks like the following:
\documentclass[a4paper,12pt,headsepline,smallheadings,parident, numbers=noenddot, appendixprefix=true]{scrreprt}
\usepackage{appendix}
...
\begin{document}
\chapter{Chapter1}
\section{Section1}
\section{Section2}
%Appendix
\appendix
\renewcommand\thesection{\appendixname\ \Alph{section}}
\pagestyle{empty}
%for linking the appendix to toc without pagenumber
\phantomsection
\hypertarget{link.appendix}{}
\addchap*{Anhang}
\addtocontents{toc}{\protect\usekomafont{chapterentry}%
\protect\hyperlink{link.appendix}{Anhang}}
\refstepcounter{chapter}
\newpage
%other try ...
%\renewcommand{\thesection}{\Alph{section}}
\section*{Class diagram} \label{class-diagram}
\section*{List of UI-Elementen} \label{list-ui-elements}
\section*{CD}
\end{document}
Best Answer
First of all you are using the starred version of
\section
with a label. This version doesn't provide any anchors for the label so your labeling false. A simple example shows this behavior.The redefinition of
\thesection
doesn't influence the command\section*
because\section*
print only formated text with a predefined skip above and below.Nevertheless you can do the following. Use
\section
instead of\section*
. The benefits\thesection
,With the current settings the section will be shown up in the toc. Avoiding this you can set the counter
tocdepth
to zero after the command `appendix.