在信中添加入学号码

在信中添加入学号码

在给大学写信时,我需要提供我的学号。有没有办法把它包含在信头中,比如

\setkomavar{customer}[\customername]{DE-112233}

我希望得到类似“入学编号:DE-112233”的输出。有没有办法定义自己的 komavar?

谢谢!

我的代码如下:

\documentclass[
    fontsize=12pt,
    parskip=full,
    paper=A4,   
    fromalign=right,
    fromphone=true,
    fromemail=true, 
    version=last,
]{scrlttr2}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}


\begin{document}
\setkomavar{fromname}{My Name}
\setkomavar{fromaddress}{Myadress 1\\12345 Foo}
\setkomavar{fromphone}{+49 123 456789}
\setkomavar{fromemail}{[email protected]}
\setkomavar{place}{Bar-place}
\setkomavar{date}{\today}
\setkomavar{subject}{interesting letter}

\setkomavar{customer}[\customername]{DE-112233} % <---- I would like to rename this or something like that

\begin{letter}{
    Some addresse\\
    not my street 2\\
    54321 Town
}

\opening{Hello everyone,}

Loreß "`ipsum"'  sit amet, consectetur adipiscing elit. Aliquam faucibus euismod nibh. Nulla condimentum, odio in vehicula bibendum, tellus libero varius sapien, vel aliquam elit mauris ut leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla vitae dapibus felis, ut euismod lectus.
 
Vestibulum at auctor urna, in iaculis lectus. Nullam vitae magna metus. Praesent lacinia massa ac lobortis ullamcorper. Vestibulum laoreet, ligula ut tincidunt auctor, ligula lacus accumsan lectus, vitae aliquet justo diam et risus. Etiam suscipit magna vel velit tristique, quis egestas justo aliquam. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum sit amet elementum lacus, ac nulla.

\closing{Greetings}

\end{letter}

\end{document}

答案1

您可以重复使用其中一个 komavar,并将名称替换为“入学编号”。例如传真变量:

添加到 \documentclass[]

fromfax=true

并更改名称

\setkomavar{fromfax}[matriculation number: ]{DE-112233}

您可以在以下位置找到此信息及更多信息KOMA-Script 文档在第196页。

相关内容