| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% TUDa-CI -- Corporate Design for TU Darmstadt |
| 4 |
% ---------------------------------------------------------------------------- |
| 5 |
% |
| 6 |
% Copyright (C) 2018--2025 by Marei Peischl <[email protected]> |
| 7 |
% |
| 8 |
% ============================================================================ |
| 9 |
% This work may be distributed and/or modified under the |
| 10 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 11 |
% of this license or (at your option) any later version. |
| 12 |
% The latest version of this license is in |
| 13 |
% http://www.latex-project.org/lppl.txt |
| 14 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 15 |
% version 2008/05/04 or later. |
| 16 |
% |
| 17 |
% This work has the LPPL maintenance status `maintained'. |
| 18 |
% |
| 19 |
% The Current Maintainer of this work is |
| 20 |
% Marei Peischl <[email protected]> |
| 21 |
% |
| 22 |
% The development repository can be found at |
| 23 |
% https://github.com/tudace/tuda_latex_templates |
| 24 |
% Please use the issue tracker for feedback! |
| 25 |
% |
| 26 |
% ============================================================================ |
| 27 |
% |
| 28 |
% \fi |
| 29 |
% |
| 30 |
% \iffalse% no documentation on this |
| 31 |
% \iffalse^^A Preparation for real docstrip documentation |
| 32 |
%<*driver> |
| 33 |
\ProvidesFile{tudaletter.dtx}[2025-11-13 v4.05 Letters for TUDa-CI, Corporate Design of TU Darmstadt] |
| 34 |
\typeout{***********************************************************} |
| 35 |
\typeout{No documentation included in this file! Please see tuda-ci.pdf for more information and DEMO-TUDaLetter.tex/.pdf for an example of use.} |
| 36 |
\typeout{***********************************************************} |
| 37 |
\stop |
| 38 |
%</driver> |
| 39 |
%<*class&initialization> |
| 40 |
%<@@=ptxcd> |
| 41 |
\NeedsTeXFormat{LaTeX2e}[2020/10/01] |
| 42 |
\ProvidesExplClass{tudaletter}{2025-11-13}{4.05}{Letters for TUDa-CI, Corporate Design of TU Darmstadt} |
| 43 |
%</class&initialization> |
| 44 |
%<*driver>^^A Preparation for real docstrip documentation |
| 45 |
\providecommand*{\TUDaDocDTXfiles}{tudaletter.dtx} |
| 46 |
\input{tuda-ci.dtx} |
| 47 |
%</driver> |
| 48 |
% \fi |
| 49 |
% |
| 50 |
% \changes{v4.00}{2025-01-26}{Converted to DTX file} |
| 51 |
% |
| 52 |
% \DoNotIndex{\newcommand,\newenvironment} |
| 53 |
% |
| 54 |
% \GetFileInfo{tudaletter.dtx} |
| 55 |
% \title{The \textsf{tudaletter} package} |
| 56 |
% \author{<+author+>\thanks{Email: \href{mailto:<+email+>}{<+email+>}}} |
| 57 |
% \date{\fileversion~from \filedate} |
| 58 |
% |
| 59 |
% \maketitle |
| 60 |
% |
| 61 |
% |
| 62 |
% \DescribeMacro{\fileversion} |
| 63 |
% |
| 64 |
% |
| 65 |
% \DescribeMacro{\filedate} |
| 66 |
% |
| 67 |
% |
| 68 |
% \DescribeMacro{\opening} |
| 69 |
% |
| 70 |
% |
| 71 |
% \DescribeMacro{\letterpagestyle} |
| 72 |
% |
| 73 |
% |
| 74 |
% \MaybeStop{} |
| 75 |
% |
| 76 |
% \section{Implementation} |
| 77 |
% |
| 78 |
% \iffalse |
| 79 |
%<*class> |
| 80 |
%<*initialization> |
| 81 |
% \fi |
| 82 |
% |
| 83 |
% |
| 84 |
% \begin{macrocode} |
| 85 |
\str_const:Nn \c_@@_base_str {letter} |
| 86 |
\str_new:N \g_ptxcd_department_str |
| 87 |
\bool_new:N \g_@@_adjust_textwidth_bool |
| 88 |
\keys_define:nn {ptxcd/letter} { |
| 89 |
logo .bool_gset:N = \g_@@_letter_logo_bool, |
| 90 |
logo .default:n = true, |
| 91 |
logo .initial:n = true, |
| 92 |
premium .bool_gset:N = \g_@@_letter_premium_bool, |
| 93 |
premium .default:n = true, |
| 94 |
firstpagenumber .bool_gset:N = \g_@@_firstpagenumber_bool, |
| 95 |
firstpagenumber .initial:n = true, |
| 96 |
raggedright .bool_gset:N = \g_@@_letter_raggedright_bool, |
| 97 |
headrule .bool_gset:N = \g_@@_letter_headrule_bool, |
| 98 |
headrule .initial:n = true, |
| 99 |
headrule .default:n = true, |
| 100 |
textwidth .choice:, |
| 101 |
textwidth / wide .code:n = \bool_gset_true:N \g_@@_adjust_textwidth_bool, |
| 102 |
textwidth / narrow .code:n = \bool_gset_false:N \g_@@_adjust_textwidth_bool, |
| 103 |
textwidth .initial:n = wide, |
| 104 |
%</initialization> |
| 105 |
%<gobble>} |
| 106 |
% \end{macrocode} |
| 107 |
% \iffalse |
| 108 |
%<*packages> |
| 109 |
% \fi |
| 110 |
% \begin{macrocode} |
| 111 |
% \begin{documentation} |
| 112 |
% \DescribeMacro{\@fontsizefilebase} |
| 113 |
% |
| 114 |
% \end{documentation} |
| 115 |
% \begin{implementation} |
| 116 |
% \begin{macro}{\@fontsizefilebase} |
| 117 |
% \begin{macrocode} |
| 118 |
\newcommand*{\@fontsizefilebase}{tudalettersize} |
| 119 |
% \end{macrocode} |
| 120 |
% \end{macro} |
| 121 |
% \end{implementation} |
| 122 |
% |
| 123 |
% \begin{macrocode} |
| 124 |
\PassOptionsToClass{fontsize=10pt,parskip=full-}{scrletter} |
| 125 |
\PassOptionsToPackage{refline=nodate,addrfield=topaligned,firstfoot=false,pagenumber=botright}{scrletter} |
| 126 |
\LoadClass{scrletter} |
| 127 |
% \end{macrocode} |
| 128 |
% Load the TUDa-colorscheme |
| 129 |
% \begin{macrocode} |
| 130 |
\RequirePackage{tudacolors} |
| 131 |
\RequirePackage{tudafonts} |
| 132 |
\RequirePackage{graphicx} |
| 133 |
\RequirePackage{afterpage} |
| 134 |
\RequirePackage{ragged2e} |
| 135 |
\bool_if:NTF \g_@@_letter_premium_bool { |
| 136 |
\cs_new:Nn \ptxcd_premiumcolor: {accentcolor} |
| 137 |
\cs_new:Nn \ptxcd_use_premiumcolor: {\color{accentcolor}} |
| 138 |
\cs_set:Nn \ptxcd_use_premiumcolor_text: {\color{textaccentcolor}} |
| 139 |
}{ |
| 140 |
\cs_new:Nn \ptxcd_premiumcolor: {black} |
| 141 |
\let\ptxcd_use_premiumcolor:\relax |
| 142 |
\let\ptxcd_use_premiumcolor_text:\relax |
| 143 |
} |
| 144 |
% \end{macrocode} |
| 145 |
% %%%%Briefbogen |
| 146 |
% % Spacing: |
| 147 |
% \begin{macrocode} |
| 148 |
\dim_const:Nn \c_ptxcd_HeadMargin_dim {12.5mm} |
| 149 |
\dim_const:Nn \c_ptxcd_LeftMargin_dim {24.0mm} |
| 150 |
\dim_const:Nn \c_@@_firstpage_extraindent_dim {-\paperwidth+120mm +\c_ptxcd_LeftMargin_dim +\c_ptxcd_HeadMargin_dim} |
| 151 |
\bool_if:NTF \g_@@_adjust_textwidth_bool |
| 152 |
{ |
| 153 |
\dim_const:Nn \c_ptxcd_RightMargin_dim {\c_ptxcd_HeadMargin_dim} |
| 154 |
}{ |
| 155 |
\dim_const:Nn \c_ptxcd_RightMargin_dim {\c_ptxcd_HeadMargin_dim-\c_@@_firstpage_extraindent_dim} |
| 156 |
} |
| 157 |
\dim_const:Nn \c_ptxcd_BottomMargin_dim {20mm} |
| 158 |
\dim_const:Nn \c_ptxcd_Linewidth_dim {\paperwidth-\c_ptxcd_LeftMargin_dim-\c_ptxcd_RightMargin_dim} |
| 159 |
\RequirePackage{geometry} |
| 160 |
\geometry{ |
| 161 |
twoside=false, |
| 162 |
left=\c_ptxcd_LeftMargin_dim, |
| 163 |
right=\c_ptxcd_RightMargin_dim, |
| 164 |
bottom=\c_ptxcd_BottomMargin_dim, |
| 165 |
footskip=7mm, |
| 166 |
} |
| 167 |
\dim_const:Nn \c_ptxcd_textwidth_dim {\textwidth} |
| 168 |
\bool_if:NTF \g_@@_letter_logo_bool { |
| 169 |
\geometry{top=64mm} |
| 170 |
} { |
| 171 |
\geometry{top=30mm} |
| 172 |
} |
| 173 |
% \end{macrocode} |
| 174 |
% \iffalse |
| 175 |
%</packages> |
| 176 |
%<*pdfx> |
| 177 |
% \fi |
| 178 |
% \changes{v4.00}{2025-01-26}{Unify pdfx/pdfa mechanism structure over all document types} |
| 179 |
% \begin{macrocode} |
| 180 |
\if_bool:N \g_ptxcd_pdfx_bool |
| 181 |
\PassOptionsToPackage{a-2b}{pdfx} |
| 182 |
% \end{macrocode} |
| 183 |
% Workaround posted by David Carlisle on tex.stackexchange |
| 184 |
% Thanks to Ulrike Fischer for mentioning it in #472 |
| 185 |
% \begin{macrocode} |
| 186 |
\let \_@@_grouplevel_before_pdfx: \currentgrouplevel |
| 187 |
\chardef\currentgrouplevel0 |
| 188 |
\ExplSyntaxOff |
| 189 |
\RequirePackage{pdfx} |
| 190 |
\ExplSyntaxOn |
| 191 |
\let \currentgrouplevel \_@@_grouplevel_before_pdfx: |
| 192 |
\cs_undefine:N \_@@_grouplevel_before_pdfx: |
| 193 |
% \end{macrocode} |
| 194 |
% end of the workaround |
| 195 |
% \begin{macrocode} |
| 196 |
\else: |
| 197 |
\PassOptionsToPackage{hidelinks, unicode}{hyperref} |
| 198 |
\RequirePackage{hyperref} |
| 199 |
\fi: |
| 200 |
% \end{macrocode} |
| 201 |
% \iffalse |
| 202 |
%</pdfx> |
| 203 |
%<*body> |
| 204 |
% \fi |
| 205 |
% \changes{v4.00}{2025-01-26}{Unify pdfx/pdfa mechanism structure over all document types} |
| 206 |
% \begin{macrocode} |
| 207 |
\RequirePackage[paper=a4]{tudarules}% might load pgfcore, so it has to be loaded after pdfx |
| 208 |
\setplength{firstheadhpos}{\c_ptxcd_HeadMargin_dim} |
| 209 |
\setplength{firstheadvpos}{\c_ptxcd_HeadMargin_dim} |
| 210 |
\setplength{firstheadwidth}{\dim_eval:n {\paperwidth - 2\c_ptxcd_HeadMargin_dim}} |
| 211 |
\setplength{firstfootvpos}{\dim_eval:n {\paperheight -17mm}} |
| 212 |
\setplength{firstfoothpos}{\useplength{firstheadhpos}} |
| 213 |
\setplength{firstfootwidth}{\useplength{firstheadwidth}} |
| 214 |
\setplength{toaddrhpos}{\c_ptxcd_LeftMargin_dim} |
| 215 |
\setplength{toaddrvpos}{50mm} |
| 216 |
\setplength{backaddrheight}{4mm} |
| 217 |
\setplength{toaddrindent}{0mm} |
| 218 |
\setplength{refhpos}{\c_ptxcd_LeftMargin_dim} |
| 219 |
\setplength{refvpos}{106mm} |
| 220 |
\setplength{subjectaftervskip}{2\baselineskip} |
| 221 |
\setplength{lochpos}{\c_ptxcd_HeadMargin_dim} |
| 222 |
\setplength{locvpos}{\dimexpr\useplength{refvpos}+\useplength{subjectaftervskip}+1.4\baselineskip\relax} |
| 223 |
\setplength{refaftervskip}{0pt} |
| 224 |
\setplength{subjectbeforevskip}{0pt} |
| 225 |
\setplength{locwidth}{\dimexpr\paperwidth-154,5mm -\c_ptxcd_HeadMargin_dim\relax} |
| 226 |
\setplength{locheight}{\dimexpr\paperheight-\useplength{locvpos}-\c_ptxcd_BottomMargin_dim\relax} |
| 227 |
\bool_if:NTF \g_@@_letter_headrule_bool { |
| 228 |
\ptxcd_makeheadrule[width=\useplength{firstheadwidth},color=identbarcolor]{ptxcd_LetterheadRule} |
| 229 |
} { |
| 230 |
\box_new:N \ptxcd_LetterheadRule_box |
| 231 |
\def\ptxcd_LetterheadRule{} |
| 232 |
} |
| 233 |
\ptxcd_makefootrule[width=\useplength{firstheadwidth}]{ptxcd_LetterfootRule} |
| 234 |
\box_new:N \g_TUDaLetter_firsthead_box |
| 235 |
\hbox_gset:Nn \g_TUDaLetter_firsthead_box { |
| 236 |
\parbox[t]{\useplength{firstheadwidth}}{ |
| 237 |
\raggedleft |
| 238 |
\smash{\ptxcd_LetterheadRule} |
| 239 |
\par |
| 240 |
\vspace{.5\c_ptxcd_logoheight_dim} |
| 241 |
\makebox[\_@@_logowidth:][l]{\_@@_insert_logo:} |
| 242 |
} |
| 243 |
} |
| 244 |
\box_gset_dp:Nn \g_TUDaLetter_firsthead_box {\c_zero_dim} |
| 245 |
\setkomavar{firsthead}{ |
| 246 |
\box_use:N \g_TUDaLetter_firsthead_box |
| 247 |
} |
| 248 |
\KOMAoptions{backaddress=plain} |
| 249 |
\setkomavar{backaddressseparator}{\,$\vert$\,} |
| 250 |
% \end{macrocode} |
| 251 |
% \begin{documentation} |
| 252 |
% \subsection{Additional KOMA Variables defined for TUDa-CI} |
| 253 |
% The letter template requires some additional variables: |
| 254 |
% \begin{description} |
| 255 |
% \item[frominstitution] institute/department/… in German |
| 256 |
% \item[frominstitution-en] institute/department/… in English |
| 257 |
% \item[fromfunction] position or job title of the sender |
| 258 |
% \end{description} |
| 259 |
% \end{documentation} |
| 260 |
% \begin{implementation} |
| 261 |
% \begin{macrocode} |
| 262 |
\newkomavar{frominstitution} |
| 263 |
\newkomavar{frominstitution-en} |
| 264 |
\newkomavar{fromfunction} |
| 265 |
% \end{macrocode} |
| 266 |
% \begin{macrocode} |
| 267 |
\newkomafont{ptxcd_location}{\accentfont\normalcolor} |
| 268 |
\setkomafont{fromname}{\small} |
| 269 |
\newkomafont{ptxcd_frominst}{\small\ptxcd_use_premiumcolor_text: } |
| 270 |
\setkomafont{fromaddress}{\footnotesize} |
| 271 |
\setkomafont{refname}{} |
| 272 |
\setkomafont{refvalue}{} |
| 273 |
\setkomafont{pageheadfoot}{\footnotesize} |
| 274 |
% \end{macrocode} |
| 275 |
% \end{implementation} |
| 276 |
% \begin{documentation} |
| 277 |
% \DescribeMacro{\TUD@locfield} |
| 278 |
% |
| 279 |
% \end{documentation} |
| 280 |
% \begin{implementation} |
| 281 |
% \begin{macro}{\TUD@locfield} |
| 282 |
% \begin{macrocode} |
| 283 |
\newcommand{\TUD@locfield}{% |
| 284 |
\usekomafont{ptxcd_location}\usekomafont{fromaddress} |
| 285 |
\setparsizes{\z@}{\z@}{\z@ plus 1fil} |
| 286 |
\par@updaterelative |
| 287 |
\begingroup |
| 288 |
\int_compare:nT {0 < \@pageat <3} { |
| 289 |
\ptxcd_letterpagemark:\\[\baselineskip] |
| 290 |
} |
| 291 |
\usekomafont{ptxcd_frominst} |
| 292 |
\Ifkomavarempty{frominstitution}{}{% |
| 293 |
{\usekomavar[\raggedright]{frominstitution}} |
| 294 |
\\[\baselineskip]}% |
| 295 |
\Ifkomavarempty{frominstitution-en}{}{% |
| 296 |
\usekomavar[\raggedright]{frominstitution-en} |
| 297 |
\\[\baselineskip]}% |
| 298 |
\endgroup |
| 299 |
\Ifkomavarempty{fromlogo}{}{\usekomavar{fromlogo}\\[\baselineskip]}% |
| 300 |
\Ifkomavarempty{fromname}{} |
| 301 |
{{\usekomafont{fromname}\usekomavar{fromname}} |
| 302 |
\Ifkomavarempty{fromfunction}{}{\\\usekomavar{fromfunction}} |
| 303 |
\\[\baselineskip]}% |
| 304 |
\Ifkomavarempty{fromaddress}{}{\usekomavar{fromaddress}\\[\baselineskip]}% |
| 305 |
\@tempswafalse |
| 306 |
\clist_map_inline:nn {fromphone, fromfax, fromemail, fromurl}{ |
| 307 |
\@tempswatrue |
| 308 |
\Ifkomavarempty{##1}{}{ |
| 309 |
\Ifkomavarempty*{##1}{}{\makebox[1cm][l]{\usekomavar*{##1}}}\usekomavar{##1}\par |
| 310 |
} |
| 311 |
} |
| 312 |
\if@tempswa |
| 313 |
\vspace{2\baselineskip} |
| 314 |
\fi |
| 315 |
\Ifkomavarempty*{date}{}{\usekomavar*{date}\\\usekomavar{date}} |
| 316 |
\seq_use:Nn \g_@@_reffields_seq {} |
| 317 |
\Ifkomavarempty{frombank}{}{\vfill% |
| 318 |
\Ifkomavarempty*{frombank}{Bankverbindung}{\usekomavar*{frombank}}\\\usekomavar{frombank} |
| 319 |
} |
| 320 |
} |
| 321 |
% \end{macrocode} |
| 322 |
% \end{macro} |
| 323 |
% \end{implementation} |
| 324 |
% |
| 325 |
% \begin{macrocode} |
| 326 |
\setkomavar{location}{\parbox[t][.45\paperheight][t]{\useplength{locwidth}}{\TUD@locfield}} |
| 327 |
\tl_const:Nn \ptxcd_reffield_separator_tl {\\} |
| 328 |
\cs_new:Nn \ptxcd_set_reffield:n { |
| 329 |
\Ifkomavarempty{#1}{}{% |
| 330 |
\if@tempswa\\[\baselineskip]\fi |
| 331 |
\parbox[t]{\linewidth}{\noindent\raggedright |
| 332 |
\usekomafont{refname} |
| 333 |
\usekomavar*{#1}\ptxcd_reffield_separator_tl |
| 334 |
\usekomafont{refvalue} |
| 335 |
\usekomavar{#1} |
| 336 |
}% |
| 337 |
\@tempswatrue |
| 338 |
}% |
| 339 |
} |
| 340 |
\seq_new:N \g_@@_reffields_seq |
| 341 |
\newlength{\TUD@page@free} |
| 342 |
\newcounter{TUD@page@free@lines} |
| 343 |
\dim_new:N \g_@@_page_free_dim |
| 344 |
\int_new:N \g_@@_free_lines_int |
| 345 |
% \end{macrocode} |
| 346 |
% \begin{documentation} |
| 347 |
% \DescribeMacro{\opening} |
| 348 |
% |
| 349 |
% \end{documentation} |
| 350 |
% \begin{implementation} |
| 351 |
% \begin{macro}{\opening} |
| 352 |
% \begin{macrocode} |
| 353 |
\renewcommand{\opening}[1]{% |
| 354 |
\widowpenalty=100 |
| 355 |
\@PapersizeWarning |
| 356 |
\seq_gclear:N \g_@@_reffields_seq |
| 357 |
\renewcommand*{\@set@reffield}[1]{ |
| 358 |
\typeout{Field: ##1}% |
| 359 |
\str_if_eq:nnT {##1}{datemarkerfield}{% |
| 360 |
\let\scr@datemarkerfield@var=\scr@date@var |
| 361 |
\let\scr@datemarkerfield@name=\scr@date@name |
| 362 |
\setkomavar{date}{}% |
| 363 |
} |
| 364 |
\Ifkomavarempty{##1}{}{% |
| 365 |
\seq_gput_right:Nn \g_@@_reffields_seq {% |
| 366 |
\ptxcd_set_reffield:n {##1} |
| 367 |
}% |
| 368 |
}% |
| 369 |
} |
| 370 |
\let\do@set@reffield\@set@reffield |
| 371 |
\@set@reffields |
| 372 |
\removereffields |
| 373 |
\@gen@firsthead |
| 374 |
\@mkboth{\scr@fromname@var}{\scr@subject@var}% |
| 375 |
\thispagestyle{letter.first}\noindent |
| 376 |
\Ifkomavarempty{toname}{\setkomavar{toname}{\mbox{}}}{} |
| 377 |
\@foldmarks\@firstheadfootfield\@addrfield\@locfield |
| 378 |
\ifdim\useplength{subjectvpos}=\z@\else\@subjfield\fi |
| 379 |
\@datefield |
| 380 |
\@makelettertitle |
| 381 |
\ifdim\useplength{subjectvpos}=\z@\if@subjafter\else\@subjfield\fi\fi |
| 382 |
{\setparsizes{\z@}{\z@}{\z@ plus 1fil}\par@updaterelative#1\par}% |
| 383 |
{\setlength{\@tempdima}{\baselineskip}% |
| 384 |
\addtolength{\@tempdima}{-\parskip}% |
| 385 |
\ifdim \@tempdima>\z@\vskip\@tempdima\fi}% |
| 386 |
\ifdim\useplength{subjectvpos}=\z@\if@subjafter\@subjfield\fi\fi |
| 387 |
\setcounter{equation}{0}% |
| 388 |
\@afterheading% |
| 389 |
\@nobreaktrue |
| 390 |
\@afterindentfalse |
| 391 |
\bool_if:NT \g_@@_adjust_textwidth_bool { |
| 392 |
\everypar{% |
| 393 |
\if@nobreak |
| 394 |
\@nobreakfalse\clubpenalty\@M |
| 395 |
\if@afterindent |
| 396 |
\else{\setbox\z@\lastbox} |
| 397 |
\fi |
| 398 |
\else |
| 399 |
\clubpenalty\@clubpenalty |
| 400 |
\fi |
| 401 |
\ifnum\thepage=1% |
| 402 |
\dim_gset:Nn \g_@@_page_free_dim {-\pagegoal + \pagetotal} |
| 403 |
\dim_compare:nTF {-\g_@@_page_free_dim>2\baselineskip} |
| 404 |
{ |
| 405 |
\int_gset:Nn \g_@@_free_lines_int {\fp_eval:n {ceil(\g_@@_page_free_dim/\baselineskip)}} |
| 406 |
\int_compare:nT {\g_@@_free_lines_int<0} { |
| 407 |
\hangafter=\g_@@_free_lines_int\hangindent=\c_@@_firstpage_extraindent_dim% |
| 408 |
} |
| 409 |
} { |
| 410 |
\dim_compare:nT {-\TUD@page@free>\baselineskip} { |
| 411 |
\hangafter=-2\hangindent=\c_@@_firstpage_extraindent_dim% |
| 412 |
} |
| 413 |
} |
| 414 |
\fi% |
| 415 |
}% |
| 416 |
\global\setlength{\linewidth}{\dim_eval:n {\c_ptxcd_Linewidth_dim + \c_@@_firstpage_extraindent_dim}} |
| 417 |
\afterpage{ |
| 418 |
\global\setlength{\linewidth}{\c_ptxcd_Linewidth_dim} |
| 419 |
\widowpenalty=10000 |
| 420 |
} |
| 421 |
} |
| 422 |
} |
| 423 |
% \end{macrocode} |
| 424 |
% \end{macro} |
| 425 |
% \end{implementation} |
| 426 |
% |
| 427 |
% \begin{macrocode} |
| 428 |
\AtBeginDocument{% |
| 429 |
\raggedbottom% |
| 430 |
} |
| 431 |
\setkomafont{backaddress}{\accentfont\tiny\ptxcd_use_premiumcolor_text:\raisebox{\dimexpr-\totalheight+\ht\strutbox\relax}{\rule{\z@}{4mm}}} |
| 432 |
\raggedbottom |
| 433 |
\int_new:N \l_ptxcd_letter_lastpage_int |
| 434 |
\cs_new:Nn \ptxcd_letterpagemark: { |
| 435 |
%get lastpage for this letter if not already done |
| 436 |
\int_compare:nNnTF {\value{page}} = {1} { |
| 437 |
\bool_if:NTF \g_@@_firstpagenumber_bool |
| 438 |
{\bool_set_true:N \l_tmpa_bool} |
| 439 |
{\bool_set_false:N \l_tmpa_bool} |
| 440 |
} |
| 441 |
{\bool_set_true:N \l_tmpa_bool} |
| 442 |
\bool_if:NT \l_tmpa_bool { |
| 443 |
\int_if_exist:cF {c_ptxcd_letter\thisletter _lastpage_int} { |
| 444 |
\cs_if_exist:cTF {r@\thisletter.lastpage} { |
| 445 |
\int_const:cn {c_ptxcd_letter\thisletter _lastpage_int} { |
| 446 |
\exp_args:NNc \expandafter \@secondoffive { r@\thisletter.lastpage} |
| 447 |
} |
| 448 |
} { |
| 449 |
%warning -> rerun latex |
| 450 |
\int_const:cn {c_ptxcd_letter\thisletter _lastpage_int} {0} |
| 451 |
} |
| 452 |
} |
| 453 |
\usekomafont{pagenumber}\pagename\nobreakspace\thepage |
| 454 |
\int_compare:nT { |
| 455 |
\int_use:c {c_ptxcd_letter\thisletter _lastpage_int} |
| 456 |
> 1 |
| 457 |
} {/\int_to_arabic:n{\int_use:c {c_ptxcd_letter\thisletter _lastpage_int}}} |
| 458 |
} |
| 459 |
} |
| 460 |
\setkomavar{firstfoot}{\usekomavar{nextfoot}} |
| 461 |
\setkomavar{nextfoot}{% |
| 462 |
\ifnum\@pageat>2 |
| 463 |
\parbox[c]{\layerwidth}{% |
| 464 |
\ifcase\@pageat\or\or\or\raggedright\or\centering\or\raggedleft\fi |
| 465 |
\strut\pagemark% |
| 466 |
}% |
| 467 |
\fi |
| 468 |
} |
| 469 |
\cs_set_eq:NN \letterpagemark \ptxcd_letterpagemark: |
| 470 |
\bool_if:NT \g_@@_letter_headrule_bool { |
| 471 |
\bool_if:NTF \g_@@_letter_logo_bool { |
| 472 |
\setkomavar{nexthead}{\raisebox{\topskip}{\box_use:N \g_TUDaLetter_firsthead_box}} |
| 473 |
}{ |
| 474 |
\setkomavar{nexthead}{\raisebox{\depth}{\ptxcd_LetterheadRule}} |
| 475 |
} |
| 476 |
} |
| 477 |
\newpairofpagestyles[letter]{TUDaLetter}{ |
| 478 |
\exp_args:Nx \KOMAoptions{ |
| 479 |
footwidth=\dimexpr\paperwidth-2\c_ptxcd_HeadMargin_dim \c_colon_str-\dim_eval:n {\c_ptxcd_HeadMargin_dim -1mm}, |
| 480 |
headwidth=\dimexpr\paperwidth-2\c_ptxcd_HeadMargin_dim \c_colon_str-\dim_eval:n {\c_ptxcd_HeadMargin_dim -1mm}, |
| 481 |
footsepline=.5\c_ptxcd_smallrule_dim,plainfootsepline |
| 482 |
} |
| 483 |
\ModifyLayer[voffset=\c_ptxcd_HeadMargin_dim,align=tl]{TUDaLetter.head.even} |
| 484 |
\ModifyLayer[voffset=\c_ptxcd_HeadMargin_dim,align=tl]{TUDaLetter.head.odd} |
| 485 |
\ModifyLayer[voffset=\c_ptxcd_HeadMargin_dim,align=tl]{TUDaLetter.head.oneside} |
| 486 |
\ModifyLayer[voffset=\c_ptxcd_HeadMargin_dim,align=tl]{plain.TUDaLetter.head.even} |
| 487 |
\ModifyLayer[voffset=\c_ptxcd_HeadMargin_dim,align=tl]{plain.TUDaLetter.head.odd} |
| 488 |
\ModifyLayer[voffset=\c_ptxcd_HeadMargin_dim,align=tl]{plain.TUDaLetter.head.oneside} |
| 489 |
\lehead{\usekomavar{nexthead}}% |
| 490 |
\lohead{\usekomavar{nexthead}}% |
| 491 |
\lefoot{\usekomavar{nextfoot}}% |
| 492 |
\lofoot{\usekomavar{nextfoot}}% |
| 493 |
} |
| 494 |
\DeclarePageStyleByLayers{TUDaLetter.first}{TUDaLetter.foot.even,TUDaLetter.foot.odd,TUDaLetter.foot.oneside,TUDaLetter.foot.above.line} |
| 495 |
\pagestyle{TUDaLetter} |
| 496 |
\DeclarePageStyleAlias{letter.first}{TUDaLetter.first} |
| 497 |
% \end{macrocode} |
| 498 |
% \begin{documentation} |
| 499 |
% \DescribeMacro{\letterpagestyle} |
| 500 |
% |
| 501 |
% \end{documentation} |
| 502 |
% \begin{implementation} |
| 503 |
% \begin{macro}{\letterpagestyle} |
| 504 |
% \begin{macrocode} |
| 505 |
\def\letterpagestyle{TUDaLetter} |
| 506 |
% \end{macrocode} |
| 507 |
% \end{macro} |
| 508 |
% \end{implementation} |
| 509 |
% |
| 510 |
% Widows and clubs |
| 511 |
% \begin{macrocode} |
| 512 |
\widowpenalty=10000 |
| 513 |
\clubpenalty=10000 |
| 514 |
% \end{macrocode} |
| 515 |
% default values |
| 516 |
% \begin{macrocode} |
| 517 |
\setkomavar*{fromemail}{} |
| 518 |
\setkomavar*{fromurl}{} |
| 519 |
\setkomavar{backaddress}{Technische~ Universität~ Darmstadt\\Karolinenplatz~ 5\\64289~ Darmstadt} |
| 520 |
% \end{macrocode} |
| 521 |
% renewcaptions |
| 522 |
% \begin{macrocode} |
| 523 |
\defcaptionname{german,ngerman,austrian,naustrian,% |
| 524 |
swissgerman,nswissgerman}\yourmailname{Ihre~ Nachricht}% |
| 525 |
\defcaptionname{german, ngerman,austrian,naustrian,% |
| 526 |
swissgerman,nswissgerman}\phonename{Tel.}% |
| 527 |
% \end{macrocode} |
| 528 |
% signature raggedright |
| 529 |
% \begin{macrocode} |
| 530 |
\let\raggedsignature\raggedright |
| 531 |
\bool_if:NT \g_@@_letter_raggedright_bool {\AtBeginLetter{\RaggedRight}} |
| 532 |
% \end{macrocode} |
| 533 |
% backwards compatibility for KOMA-Script |
| 534 |
% \begin{macrocode} |
| 535 |
\cs_if_exist:NF \Ifkomavarempty{ |
| 536 |
\let\Ifkomavarempty\ifkomavarempty |
| 537 |
} |
| 538 |
\file_if_exist_input:n {\g_@@_config_prefix_tl\g_ptxcd_department_str.cfg} |
| 539 |
% \end{macrocode} |
| 540 |
|
| 541 |
% |
| 542 |
% \iffalse |
| 543 |
%</body> |
| 544 |
%</class> |
| 545 |
% \fi |
| 546 |
% \Finale |
| 547 |
% \fi^^A No documentation on this |
| 548 |
\endinput |