# Why does the introduced part-title in letter appear twice?

My intention is to create a letter with multiple appendixes, which are \included and their part-titles will be added to the \encl-list.

My letter looks like:

\documentclass{scrlttr2}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern,textcomp,graphicx}
\usepackage{booktabs}
\usepackage{tabu}

\newcounter{part}
\setcounter{secnumdepth}{-1}
\makeatletter
\newcommand{\part}{\@startsection{part}{-1}{\z@}% name, ebene, einzug
{1ex}% vor-abst
{1ex}% nach-abst
{\normalfont\Large\bfseries}}\\% format
\renewcommand{\thepart}{Anlage \Alph{part}}
\makeatother

\begin{document}
\begin{letter}{to somebody}
\opening{Dear Sirs and Madams,}
...
\closing{Farewell,}

\include{anlage-a}

\end{letter}
\end{document}


The appendix starts as follows:

\part{test part}

My part-content...


Which gets rendered to:

Why does this happen, and how to avoid it?

You need to define \partmark. Every sectioning command should have an accompanying \<level>mark command that's issued as part of the working of \@startsection.

\documentclass{scrlttr2}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern,textcomp,graphicx}
\usepackage{booktabs}
\usepackage{tabu}

\newcounter{part}
\setcounter{secnumdepth}{-1}
\makeatletter
\newcommand{\part}{\@startsection{part}{-1}{\z@}% name, ebene, einzug
{1ex}% vor-abst
{1ex}% nach-abst
{\normalfont\Large\bfseries}}
\renewcommand{\thepart}{Anlage \Alph{part}}
\newcommand{\partmark}[1]{}
\makeatother

\begin{document}
\begin{letter}{to somebody}
\opening{Dear Sirs and Madams,}
...
\closing{Farewell,}

\part{ABC}

Text

\end{letter}
\end{document}


I bet you want \input and not \include.

• You made my day - i haven't found any reference on the \***mark-command - even my LaTeX book is not mentioning it. I used include to let the appendices appear in the pagestyle of the letter (with header/footer). But i'll probably change that - thanks for the help and your hint! :D – florianb Apr 30 '15 at 17:07
• @florianb You find that in source2e.pdf, the commented source of LaTeX – egreg Apr 30 '15 at 17:42
• @ereg - i am so thankful! That's the reference i was looking for! – florianb May 1 '15 at 6:52