答案1
我建议不是使用\title
。
键值语法更加方便。
\documentclass{article}
% the following should go in a local class/package file
\ExplSyntaxOn
\NewDocumentCommand{\Facharbeit}{m}
{
\begin{titlepage}
\raggedright
\keys_set:nn { facharbeit/titlepage } { #1 }
\group_begin:
\bfseries
\begin{tabular}{@{}l@{}}
\l_facharbeit_school_tl \\
\l_facharbeit_address_tl
\end{tabular}
\group_end:
\vspace*{\stretch{1}}
\begin{center}
\bfseries
\LARGE Facharbeit \\
\Large im~Seminarfach:~\l_facharbeit_seminar_tl
\end{center}
\vspace*{\stretch{1}}
\begin{center}
\l_facharbeit_title_tl
\end{center}
\vspace*{\stretch{2}}
\group_begin:
\bfseries
Verfasser/in:~\l_facharbeit_author_tl
\par\medskip
Fachlehrer/in:~\l_facharbeit_teacher_tl
\par\medskip
Ausgabetermin:~\l_facharbeit_date_tl
\par\medskip
Abgabetermin:~\l_facharbeit_deadline_tl
\group_end:
\end{titlepage}
}
\keys_define:nn { facharbeit/titlepage }
{
school .tl_set:N = \l_facharbeit_school_tl,
address .tl_set:N = \l_facharbeit_address_tl,
seminar .tl_set:N = \l_facharbeit_seminar_tl,
title .tl_set:N = \l_facharbeit_title_tl,
author .tl_set:N = \l_facharbeit_author_tl,
teacher .tl_set:N = \l_facharbeit_teacher_tl,
date .tl_set:N = \l_facharbeit_date_tl,
deadline .tl_set:N = \l_facharbeit_deadline_tl,
}
\ExplSyntaxOff
\begin{document}
\Facharbeit{
school = School,
address = Some street \\ Somecity,
seminar = SF6,
author = A. Uthor,
teacher = T. Eacher,
date = 28 February 2021,
deadline = 28 February 2021,
title = Besondere Primzahlen,
}
\end{document}