# scrlttr2 reuse text of subject in letter again

Im tring to reuse the text of subject in the letter so right after \opening{}.

It is predefined like this:

\setkomavar{subject}{MySubjectText}

So im using this line several times in the text again and like to automate the print...

• Maybe you are looking for \usekomavar{subject}? – esdd Dec 5 '16 at 14:52

With \usekomavar{subject} you can reuse your subject text:

\documentclass{scrlttr2}

\setkomavar{subject}{MySubjectText}

\begin{document}
\begin{letter}{xx}
\opening{Hello}

The subject text can be reused: \usekomavar{subject}

\closing{Regards}
\end{letter}
\end{document}


And i found out how to use different parts within the Komavar:

%subject
\newcommand{\presubject}{Appling as }
\newcommand{\subjectmain}{Software Test Engineer }
\newcommand{\subjectend}{(80\%)}

\setkomavar{subjectseparator}{}
\renewcaptionname{english}{\subjectname}{\presubject}
\setkomavar{subject}{\subjectmain\subjectend}


And use just the part of the jobtitle in the letter body like this:

\subjectmain