2

I use the document class scrartcl for my work and until the creation of my attachment everything was wonderful. Unfortunately, I have not been able to put the word "Appendix" before the letters in the appendix (both in the appendix itself and in the table of contents)

The option \ appendixprefix is unfortunately not available in the document class scrartcl to my knowledge.

Does anyone have an idea how else to solve it? Here is my minimal example:

\documentclass[a4paper,11pt,captions=nooneline, headsepline, parskip, headinclude, footinclude=false, toc=left, listof=flat, listof=totoc, bibliography=totoc]{scrartcl} 
\usepackage{hyperref} 

\begin{document} 

\tableofcontents 
\phantomsection 
\addcontentsline{toc}{subsection}{content} 

\section{Introduction} 
\subsection{Aim of the thesis} 
\section{Analysis} 
\subsection{Dynamics} 

\appendix 
\section{engines} 
\subsection{performance} 
\subsection{moment} 
\section{transmission} 
\subsection{moment} 

\end{document}

The result should look something like this:

1 Introduction
1.1 Aim of the thesis

2. Analysis
2.1 Dynamics

Appendix A Engines
A.1. performance
A.2. moment

Appendix B Transmission
B.1 moment


Many thanks for your help!

2 Answers 2

2

Here is suggestion that needs KOMA-Script version 3.18 or newer. Note that current version is 3.26!

\documentclass[
  %a4paper,11pt,%default
  captions=nooneline, headsepline, parskip, headinclude, footinclude=false,
  toc=flat, listof=flat,
  listof=totoc, bibliography=totoc,
  numbers=noendperiod% <- added
]{scrartcl}
\usepackage{hyperref}

\setuptoc{toc}{totoc}% adds an TOC entry for TOC

\newcommand*\appendixmore{%
  \let\originalsectionformat\sectionformat
  \renewcommand*\sectionformat{\appendixname~\originalsectionformat}%
  \let\originalsectionmarkformat\sectionmarkformat
  \renewcommand*\sectionmarkformat{\appendixname~\originalsectionmarkformat}%
  \let\originaladdsectiontocentry\addsectiontocentry
  \renewcommand*\addsectiontocentry[2]{%
    \IfArgIsEmpty{##1}
      {\originaladdsectiontocentry{##1}{##2}}
      {\originaladdsectiontocentry{}{\appendixname\ ##1\ ##2}}%
  }
}
\providecommand*\appendixname{Appendix}


\begin{document} 
\tableofcontents 

\section{Introduction} 
\subsection{Aim of the thesis} 
\section{Analysis} 
\subsection{Dynamics} 

\appendix 
\section{engines} 
\subsection{performance} 
\subsection{moment} 
\section{transmission} 
\subsection{moment} 
\end{document}

enter image description here

2

Hello the following example is taken from the KOMASkript * documentation page~447:

\documentclass[a4paper,11pt,captions=nooneline, headsepline, parskip, headinclude, footinclude=false, toc=left, listof=flat, listof=totoc, bibliography=totoc ]{scrartcl} 
%
\newcommand*{\appendixmore}{% 
\renewcommand*{\othersectionlevelsformat}[3]{% 
\ifstr{##1}{section}{\appendixname~}{}% 
##3\autodot\enskip} \renewcommand*{\sectionmarkformat}{% 
\appendixname~\thesection\autodot\enskip}} 

\begin{document} 

\tableofcontents 

\section{Introduction} 
\subsection{Aim of the thesis} 
\section{Analysis} 
\subsection{Dynamics} 

\appendix 
\section{engines} 
\subsection{performance} 
\subsection{moment} 
\section{transmission} 
\subsection{moment} 

\end{document}

By the way, I think you mean torque

3
  • 1
    I get nothing like the OP wants. Besides, if I ask for \show\appendixname I get “undefined control sequence”.
    – egreg
    Commented Jul 9, 2019 at 11:24
  • it works for me just as I wanted it. But thank you for the impeccable. the "appendix" was only for understanding
    – David
    Commented Jul 9, 2019 at 11:31
  • Then you are using an really old KOMA-Script version (3.17 or older, current is 3.26) or you set an deprecated option resulting in a compatibility mode and the warning that version=first is used. Command \othersectionlevelsformat does nothing since version 3.18 and is really deprecated.
    – esdd
    Commented Jul 9, 2019 at 11:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .