cccb-formulare/cccbform.cls

550 lines
16 KiB
OpenEdge ABL
Raw Normal View History

2024-12-07 07:13:08 +01:00
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\ProvidesClass{cccbform}[2024/12/08 In the Beginning, There Was Chaos]
2024-11-11 03:46:08 +01:00
\LoadClass{scrartcl}
2024-12-07 07:13:08 +01:00
\RequirePackage{geometry, calc, fontspec, tikz, hyperref, changepage, letltxmacro}
\RequirePackage[ngerman]{babel}
2024-12-01 00:59:56 +01:00
\usetikzlibrary{calc}
2024-11-11 03:46:08 +01:00
2024-12-07 07:13:08 +01:00
\geometry{a4paper, margin=1.5cm, inner=2.5cm}
\pagestyle{empty}
% allow disabling PDF forms in case they cause printing problems
% (*most* viewers don't print them, so we need "fake" fields below them anyways
% but some do, and always put the form field on top (even if explicitly placed
% below other elements), which then obscures the label text)
2024-12-04 00:16:47 +01:00
\newif\if@DoPdfForm
\@DoPdfFormtrue
\DeclareOption{noform}{\@DoPdfFormfalse}
2024-12-07 07:13:08 +01:00
\newif\if@Example
\@Examplefalse
\DeclareOption{example}{ % for embedded examples in the documentation
\geometry{a6paper, margin=1ex}
\@Exampletrue
}
\DeclareOption{shortexample}{
\geometry{paperwidth=105mm, paperheight=74mm, margin=1ex}
\@Exampletrue
\AtEndDocument{%
\pageheight=\pagetotal
\advance\pageheight by 2ex
}
}
2024-12-04 00:16:47 +01:00
\ProcessOptions\relax
2024-11-11 03:46:08 +01:00
% address
\newcommand{\address}{%
2024-12-04 00:16:47 +01:00
Chaos Computer Club Berlin~/ CCC~(B)~e.~V.\\
2024-11-11 03:46:08 +01:00
Marienstr.~11\\
10117~Berlin
}
2024-11-16 05:45:38 +01:00
\setmainfont[
Renderer=HarfBuzz,
ItalicFont=Recursive,
BoldFont=Recursive,
BoldItalicFont=Recursive,
Scale=0.9,
UprightFeatures={
RawFeature={+ss01,+ss02,+ss08,+case},
2024-11-18 04:42:30 +01:00
RawFeature={+axis={MONO=0.0,CASL=0.2,slnt=0,CRSV=0,wght=400}}
2024-11-16 05:45:38 +01:00
},
2024-11-18 04:42:30 +01:00
BoldFeatures={RawFeature={+axis={MONO=0.0,CASL=0.2,slnt=0,CRSV=0,wght=700}}},
BoldItalicFeatures={RawFeature={+axis={MONO=0.0,CASL=0.2,slnt=-15,CRSV=1,wght=700}}},
ItalicFeatures={RawFeature={+axis={MONO=0.0,CASL=0.2,slnt=-15,CRSV=1,wght=400}}}
2024-11-16 05:45:38 +01:00
]{Recursive}
\setmonofont[
Renderer=HarfBuzz,
ItalicFont=Recursive,
BoldFont=Recursive,
BoldItalicFont=Recursive,
Scale=0.9,
UprightFeatures={
RawFeature={+ss01,+ss02,+ss08,+case},
RawFeature={+axis={MONO=1.0,CASL=0.2,slnt=0,CRSV=0,wght=400}}
},
BoldFeatures={RawFeature={+axis={MONO=1.0,CASL=0.2,slnt=0,CRSV=0,wght=700}}},
BoldItalicFeatures={RawFeature={+axis={MONO=1.0,CASL=0.2,slnt=-15,CRSV=1,wght=700}}},
ItalicFeatures={RawFeature={+axis={MONO=1.0,CASL=0.2,slnt=-15,CRSV=1,wght=400}}}
]{Recursive}
\renewfontfamily\titlefont[
Renderer=HarfBuzz,
ItalicFont=Recursive,
BoldFont=Recursive,
BoldItalicFont=Recursive,
Scale=0.9,
UprightFeatures={
RawFeature={+ss01,+ss02,+ss08,+case},
2024-11-18 04:42:30 +01:00
RawFeature={+axis={MONO=0.0,CASL=0.4,slnt=0,CRSV=1,wght=500}}
2024-11-16 05:45:38 +01:00
},
2024-11-18 04:42:30 +01:00
BoldFeatures={RawFeature={+axis={MONO=0.0,CASL=0.4,slnt=0,CRSV=1,wght=800}}},
BoldItalicFeatures={RawFeature={+axis={MONO=0.0,CASL=0.4,slnt=-15,CRSV=1,wght=800}}},
ItalicFeatures={RawFeature={+axis={MONO=0.0,CASL=0.4,slnt=-15,CRSV=1,wght=500}}}
2024-11-16 05:45:38 +01:00
]{Recursive}
2024-11-11 03:46:08 +01:00
% colors
2024-11-18 04:42:30 +01:00
\definecolor{fieldcolor}{gray}{0.85}
2024-11-21 22:48:52 +01:00
\definecolor{bordercolor}{gray}{0.1}
2024-11-11 03:46:08 +01:00
% lengths
\def\deflength#1#2{\newlength{#1}\setlength{#1}{#2}}
\setlength{\parindent}{0pt}
\setlength{\fboxsep}{0pt}
2024-12-04 00:16:47 +01:00
\deflength{\normaltextheight}{\dimexpr \ht\strutbox + \dp\strutbox \relax}
% XXX design-relevant lengths
\deflength{\formfieldheight}{1.25\normaltextheight}
2024-12-01 00:59:56 +01:00
\deflength{\formskip}{0.75em}
2024-11-12 17:25:27 +01:00
\deflength{\colsep}{1.0em}
2024-11-11 03:46:08 +01:00
\deflength{\indentstep}{1cm}
\deflength{\borderwidth}{0.5pt}
2024-12-04 00:16:47 +01:00
% YYY these might need adjustments after changes
\deflength{\formshrink}{4pt}
2024-11-12 17:25:27 +01:00
\def\checkboxtextshrink{\dimexpr
\formfieldheight % width of checkbox
+1em % the \quad separator's width
+\formshrink % wild guess, -2\borderwidth leaves 1pt overfull
\relax}
\deflength{\htweak}{0.5pt} % manual adjustment of horizontal alignment of form elements
\deflength{\hadj}{\dimexpr -0.5\formshrink - 0.5\fontdimen2\font + \htweak \relax}
2024-12-04 00:16:47 +01:00
% XXX length factors (as percentage of \linewidth)
2024-12-01 00:59:56 +01:00
\def\normalfieldwidth{0.65}
\def\shortfieldwidth{0.35}
2024-12-04 00:16:47 +01:00
% XXX rotation angle
2024-12-01 00:59:56 +01:00
\def\labelangle{4.20}
2024-11-11 03:46:08 +01:00
% counters
\newcounter{fieldnum}
\def\@autofieldname{field\thefieldnum}
2024-12-01 00:59:56 +01:00
% conditional flags
\newif\ifMultiColumn
2024-11-11 03:46:08 +01:00
% abbreviations
\def\@formdefaults{%
backgroundcolor=fieldcolor,bordercolor=fieldcolor,%
borderwidth=0pt,charsize=\formfieldheight%
}
% address placement helper
\newcommand{\@dinaddress}{%
\begin{tikzpicture}[remember picture, overlay]
\node[anchor=north west] at (current page.north west) [xshift=2.35cm, yshift=-5cm] {%
\begin{minipage}{10cm}
\emph{an den} \par
2024-12-04 22:42:03 +01:00
\addvspace{\formskip}
2024-11-11 03:46:08 +01:00
\noindent\address
\end{minipage}
};
\end{tikzpicture}
}
% % % form@, fake@, and full@ variants of the form elements:
%
% (raw@: renamed / prefixed hyperref command)
% form@: PDF form element (some viewers don't print it)
% fake@: A colored box, non-interactive (but will be printed!)
% full@: a stack of fake@ and form@ on top of each other
%
% The general parameter convention here is: height, width multiplier
% - height is optional and defaults to \formfieldheight, giving the right size
% for a single-line text field
% - width is "mandatory" but always used followed by \linewidth, so passing an
% empty argument works and is effectively equivalent to passing 1
% rename commands to make nice names available
\LetLtxMacro\raw@TextField\TextField
\LetLtxMacro\raw@CheckBox\CheckBox
\let\CheckBox\relax
% wrapped form fields with defaults filled in
2024-11-18 04:42:30 +01:00
\NewDocumentCommand{\form@TextField}{D<>{\formfieldheight} O{1.0}}{%
2024-11-11 03:46:08 +01:00
\stepcounter{fieldnum}
\expandafter\raw@TextField\expandafter[\@formdefaults,
name=\@autofieldname,
2024-11-12 17:25:27 +01:00
width=\dimexpr #2\linewidth - \formshrink \relax,
height=\dimexpr #1 - \formshrink \relax
2024-11-11 03:46:08 +01:00
]{}%
}
2024-11-18 04:42:30 +01:00
\NewDocumentCommand{\form@MultilineTextField}{D<>{\formfieldheight} O{1.0}}{%
2024-11-11 03:46:08 +01:00
\stepcounter{fieldnum}
\expandafter\raw@TextField\expandafter[\@formdefaults,
name=\@autofieldname,
multiline=true,
2024-11-12 17:25:27 +01:00
width=\dimexpr #2\linewidth - \formshrink \relax,
height=\dimexpr #1 - \formshrink \relax
2024-11-11 03:46:08 +01:00
]{}%
}
\NewDocumentCommand{\form@CheckBox}{}{%
\stepcounter{fieldnum}
\expandafter\raw@CheckBox\expandafter[\@formdefaults,
name=\@autofieldname,
2024-12-04 00:16:47 +01:00
width=\dimexpr \normaltextheight - \formshrink \relax,
height=\dimexpr \normaltextheight - \formshrink \relax
2024-11-11 03:46:08 +01:00
]{}%
}
% fake form fields to put *under* the PDF form fields
2024-11-18 04:42:30 +01:00
\NewDocumentCommand{\fake@TextField}{D<>{\formfieldheight} O{1.0}}{%
2024-11-11 03:46:08 +01:00
\begin{tikzpicture}[baseline=0.6ex]
\fill[fieldcolor]
(0,0) rectangle (#2\linewidth - 2\borderwidth,#1);
\draw[dash pattern=on 0.5\borderwidth off 5\borderwidth,bordercolor,
line width=\borderwidth, line cap=round]
(0,0) -- (#2\linewidth - 2\borderwidth,0);
2024-11-12 17:25:27 +01:00
\end{tikzpicture}%
2024-11-11 03:46:08 +01:00
}
\LetLtxMacro\fake@MultilineTextField\fake@TextField
\NewDocumentCommand{\fake@CheckBox}{}{%
\begin{tikzpicture}[baseline=0.6ex]
\fill[fieldcolor]
2024-12-04 00:16:47 +01:00
(0,0) rectangle (\normaltextheight,\normaltextheight);
2024-11-11 03:46:08 +01:00
\draw[bordercolor,line width=\borderwidth]
2024-12-04 00:16:47 +01:00
(0,0) rectangle (\normaltextheight,\normaltextheight);
2024-11-12 17:25:27 +01:00
\end{tikzpicture}%
2024-11-11 03:46:08 +01:00
}
% "full" stacked version of fake + actual form field
2024-11-18 04:42:30 +01:00
\NewDocumentCommand{\full@TextField}{D<>{\formfieldheight} O{1.0}}{%
2024-11-12 17:25:27 +01:00
\begin{tikzpicture}[baseline]
\node (background) [anchor=base west, inner sep=0pt, outer sep=0pt] at (0,0) {
2024-11-18 04:42:30 +01:00
\fake@TextField<#1>[#2]
2024-11-12 17:25:27 +01:00
};
2024-12-04 00:16:47 +01:00
\if@DoPdfForm
\node[anchor=center, inner sep=0pt, outer sep=0pt] at (background.center) {
\kern\hadj\form@TextField<#1>[#2]
};
\fi
2024-11-12 17:25:27 +01:00
\end{tikzpicture}
2024-11-11 03:46:08 +01:00
}
2024-11-18 04:42:30 +01:00
\NewDocumentCommand{\full@MultilineTextField}{D<>{\formfieldheight} O{1.0}}{%
2024-11-12 17:25:27 +01:00
\begin{tikzpicture}[baseline]
\node (background) [anchor=base west, inner sep=0pt, outer sep=0pt] at (0,0) {
2024-11-18 04:42:30 +01:00
\fake@MultilineTextField<#1>[#2]
2024-11-12 17:25:27 +01:00
};
2024-12-04 00:16:47 +01:00
\if@DoPdfForm
\node[anchor=center, inner sep=0pt, outer sep=0pt] at (background.center) {
\kern\hadj\form@MultilineTextField<#1>[#2]
};
\fi
2024-11-12 17:25:27 +01:00
\end{tikzpicture}
2024-11-11 03:46:08 +01:00
}
\NewDocumentCommand{\full@CheckBox}{}{%
2024-11-12 17:25:27 +01:00
\begin{tikzpicture}[baseline]
\node (background) [anchor=base west, inner sep=0pt, outer sep=0pt] at (0,0) {
\fake@CheckBox
};
2024-12-04 00:16:47 +01:00
\if@DoPdfForm
\node [anchor=center, inner sep=0pt] at (background.center) {
\kern\hadj\form@CheckBox
};
\fi
2024-11-12 17:25:27 +01:00
\end{tikzpicture}
2024-11-11 03:46:08 +01:00
}
% % % exposed form elements
% Text{text} - just text, with proper spacing
2024-12-04 00:16:47 +01:00
\NewDocumentCommand{\Text}{+m}{%
2024-12-04 22:42:03 +01:00
\par\addvspace{2\formskip}#1\par\addvspace{\formskip}
2024-11-11 03:46:08 +01:00
}
2024-12-01 00:59:56 +01:00
% TextField*{label} - a single-line input (starred version uses all available space)
2024-11-18 04:42:30 +01:00
\RenewDocumentCommand{\TextField}{s m}{%
2024-11-11 03:46:08 +01:00
\par%
2024-12-01 00:59:56 +01:00
\ifMultiColumn%
\pgfmathsetmacro{\@tlen}{1.0}%
\else%
\IfBooleanTF{#1}{\pgfmathsetmacro{\@tlen}{1.0}}{\pgfmathsetmacro{\@tlen}{\normalfieldwidth}}%
\fi%
\begin{tikzpicture}[baseline]
\useasboundingbox (0,0) rectangle (\@tlen\textwidth,\formfieldheight);
\node[anchor=west] at (0, 0) {
\full@TextField[\@tlen]
};
\node[anchor=west,rotate=\labelangle] at (-1em,0.4\formfieldheight) {
\ttfamily\footnotesize #2\strut
};
\end{tikzpicture}%
2024-12-04 22:42:03 +01:00
\par\addvspace{1.5\formskip}%
2024-11-11 03:46:08 +01:00
}
2024-12-01 00:59:56 +01:00
% ShortTextField[width]{label} - a single-line input with reduced width
\NewDocumentCommand{\ShortTextField}{o m}{%
2024-11-11 03:46:08 +01:00
\par%
2024-12-01 00:59:56 +01:00
\IfValueTF{#1}{\pgfmathsetmacro{\@tlen}{#1}}{%
\ifMultiColumn%
\pgfmathsetmacro{\@tlen}{\normalfieldwidth}%
\else%
\pgfmathsetmacro{\@tlen}{\shortfieldwidth}%
\fi%
}%
\begin{tikzpicture}[baseline]
\useasboundingbox (0,0) rectangle (\@tlen\textwidth,\formfieldheight);
\node[anchor=west] at (0,0) {
\full@TextField[\@tlen]
};
\node[anchor=west,rotate=\labelangle] at (-1em,0.4\formfieldheight) {
\ttfamily\footnotesize #2\strut
};
\end{tikzpicture}%
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-11-11 03:46:08 +01:00
}
2024-12-01 00:59:56 +01:00
% MultilineTextField*[height]{label} - a multi-line input, starred version uses all available width
2024-11-18 04:42:30 +01:00
\NewDocumentCommand{\MultilineTextField}{s O{} m}{%
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-12-01 00:59:56 +01:00
\ifMultiColumn%
\pgfmathsetmacro{\@tlen}{1.0}%
\else%
\IfBooleanTF{#1}{\pgfmathsetmacro{\@tlen}{1.0}}{\pgfmathsetmacro{\@tlen}{\normalfieldwidth}}%
\fi%
\begin{tikzpicture}[baseline]
\useasboundingbox (0,0) rectangle (\@tlen\textwidth,\formfieldheight);
\node[anchor=west] at (0,0) {
\full@MultilineTextField<#2>[\@tlen]
};
\node[anchor=west,rotate=\labelangle] at (-1em,0.4\formfieldheight) {
\ttfamily\footnotesize #3\strut
};
\end{tikzpicture}
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-11-11 03:46:08 +01:00
}
% Signature[label] - a field not fillable on the computer, big enough for a signature
\NewDocumentCommand{\Signature}{O{Datum, Unterschrift}}{%
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-12-01 00:59:56 +01:00
\ifMultiColumn%
\pgfmathsetmacro{\@tlen}{\normalfieldwidth}%
\else%
\pgfmathsetmacro{\@tlen}{\shortfieldwidth}%
\fi%
\begin{tikzpicture}[baseline]
2024-12-04 22:42:03 +01:00
\useasboundingbox (0,0) rectangle (\@tlen\textwidth,1.0cm);
2024-12-01 00:59:56 +01:00
\node[anchor=west] at (0,0) {
2024-12-05 03:33:33 +01:00
\fake@MultilineTextField<1.0cm>[\@tlen]
2024-12-01 00:59:56 +01:00
};
\node[anchor=north west,rotate=\labelangle] at (-1em,1cm -0.4\formfieldheight) {
\ttfamily\footnotesize #1\strut
};
\end{tikzpicture}
2024-12-04 22:42:03 +01:00
\par\addvspace{2\formskip}%
2024-11-11 03:46:08 +01:00
}
% Notes[label] - a slightly taller fake field that fills the whole width
\NewDocumentCommand{\Notes}{O{Vermerke}}{%
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-12-01 00:59:56 +01:00
\pgfmathsetmacro{\@tlen}{1.0}
\begin{tikzpicture}[baseline]
2024-12-04 22:42:03 +01:00
\useasboundingbox (0,0) rectangle (\@tlen\textwidth,1.5cm);
2024-12-01 00:59:56 +01:00
\node[anchor=west] at (0,0) {
2024-12-05 03:33:33 +01:00
\fake@MultilineTextField<1.5cm>[\@tlen]
2024-12-01 00:59:56 +01:00
};
\node[anchor=north west,rotate=\labelangle] at (-1em,1.5cm -0.9\formfieldheight) {
\ttfamily\footnotesize #1\strut
};
\end{tikzpicture}
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-11-11 03:46:08 +01:00
}
% Checkbox{label} - a checkbox; label can be long and will linebreak reasonably pretty
\NewDocumentCommand{\Checkbox}{m}{%
\par%
\full@CheckBox\quad%
2024-11-12 17:25:27 +01:00
\begin{minipage}[t]{\dimexpr \linewidth - \checkboxtextshrink \relax}%
2024-11-11 03:46:08 +01:00
#1%
\end{minipage}%
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-11-11 03:46:08 +01:00
}
2024-11-12 17:25:27 +01:00
% InlineCheckbox - just the box
2024-11-16 05:45:38 +01:00
\NewDocumentCommand{\InlineCheckbox}{}{\full@CheckBox}
2024-11-12 17:25:27 +01:00
2024-11-11 03:46:08 +01:00
% CheckboxOther[width]{label} - a checkbox for a write-in option
2024-12-01 00:59:56 +01:00
\NewDocumentCommand{\CheckboxOther}{O{\shortfieldwidth} m}{%
2024-11-11 03:46:08 +01:00
\par%
2024-12-04 00:16:47 +01:00
\full@CheckBox\quad#2\quad\smash{\full@TextField[#1]}%
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-11-11 03:46:08 +01:00
}
% high-level structure
% Section{title} - a form section
\NewDocumentCommand{\Section}{m}{%
2024-12-04 22:42:03 +01:00
\addvspace{1.5cm}%
2024-11-11 03:46:08 +01:00
{\Large\bfseries #1}%
2024-12-04 22:42:03 +01:00
\par\addvspace{2\formskip}%
2024-11-11 03:46:08 +01:00
}
% Subsection{title} - slightly smaller than section
\NewDocumentCommand{\Subsection}{m}{%
2024-12-04 22:42:03 +01:00
\addvspace{1.0cm}%
2024-11-11 03:46:08 +01:00
{\large\bfseries #1}%
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-11-11 03:46:08 +01:00
}
2024-12-04 00:16:47 +01:00
\NewDocumentCommand{\full@rule}{}{%
\noindent\makebox[\linewidth]{\rule{\maxdimen}{\borderwidth}}%
}
\NewDocumentCommand{\text@rule}{}{%
\hfill\rule{0.75\textwidth}{\borderwidth}\hfill\hfill\null%
}
2024-11-11 03:46:08 +01:00
% Rule - a horizontal rule, with correct spacing
\NewDocumentCommand{\Rule}{}{%
2024-12-04 00:16:47 +01:00
\par%
\text@rule%
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-11-11 03:46:08 +01:00
}
% RuleSection - rule followed by a small note *immediately* below, before the spacing
% (e.g. to separate public / internal sections of a form)
\NewDocumentCommand{\RuleSection}{m}{%
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-12-04 00:16:47 +01:00
\leavevmode\full@rule\\[-1ex]%
{\details{(#1)}}%
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}
2024-11-11 03:46:08 +01:00
}
% \begin{Indented}[factor] ... \end{Indented} - indent a section
\NewDocumentEnvironment{Indented}{O{}}{%
2024-12-01 00:59:56 +01:00
\vspace{-1\formskip}
2024-11-11 03:46:08 +01:00
\begin{adjustwidth}{#1\indentstep}{0pt}%
}{%
\end{adjustwidth}%
2024-12-04 22:42:03 +01:00
\addvspace{2\formskip}
2024-11-11 03:46:08 +01:00
}
% TwoColumns{left}{right} - put two sections side-by-side
2024-12-04 00:16:47 +01:00
\NewDocumentCommand{\TwoColumns}{+m +m}{%
2024-12-01 00:59:56 +01:00
\MultiColumntrue
2024-11-12 17:25:27 +01:00
\begin{minipage}[t]{0.5\linewidth - 0.5\colsep}%
#1%
\end{minipage}%
\hfill
\begin{minipage}[t]{0.5\linewidth - 0.5\colsep}%
#2%
\end{minipage}%
2024-12-01 00:59:56 +01:00
\MultiColumnfalse
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-11-12 17:25:27 +01:00
}
2024-12-04 00:16:47 +01:00
\NewDocumentCommand{\ThreeColumns}{+m +m +m}{%
2024-12-01 00:59:56 +01:00
\MultiColumntrue
2024-11-12 17:25:27 +01:00
\begin{minipage}[t]{0.333\linewidth - 0.66\colsep}%
2024-11-11 03:46:08 +01:00
#1%
\end{minipage}%
\hfill
2024-11-12 17:25:27 +01:00
\begin{minipage}[t]{0.333\linewidth - 0.66\colsep}%
2024-11-11 03:46:08 +01:00
#2%
\end{minipage}%
2024-11-12 17:25:27 +01:00
\hfill
\begin{minipage}[t]{0.333\linewidth - 0.66\colsep}%
#3%
\end{minipage}%
2024-12-01 00:59:56 +01:00
\MultiColumnfalse
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-11-12 17:25:27 +01:00
}
2024-12-04 00:16:47 +01:00
\NewDocumentCommand{\FiveColumns}{+m +m +m +m +m}{%
2024-12-01 00:59:56 +01:00
\MultiColumntrue
2024-11-12 17:25:27 +01:00
\begin{minipage}[t]{0.2\linewidth - 0.8\colsep}%
#1%
\end{minipage}%
\hfill
\begin{minipage}[t]{0.2\linewidth - 0.8\colsep}%
#2%
\end{minipage}%
\hfill
\begin{minipage}[t]{0.2\linewidth - 0.8\colsep}%
#3%
\end{minipage}%
\hfill
\begin{minipage}[t]{0.2\linewidth - 0.8\colsep}%
#4%
\end{minipage}%
\hfill
\begin{minipage}[t]{0.2\linewidth - 0.8\colsep}%
#5%
\end{minipage}%
2024-12-01 00:59:56 +01:00
\MultiColumnfalse
2024-12-04 22:42:03 +01:00
\par\addvspace{\formskip}%
2024-11-11 03:46:08 +01:00
}
% details{text} - (use instead of font sizes, small text)
\NewDocumentCommand{\details}{m}{%
{\scriptsize #1}%
}
% % % common title patterns
2024-11-18 04:42:30 +01:00
% put the logo in the top right corner
\NewDocumentCommand{\@logo}{}{
2024-12-07 07:13:08 +01:00
\if@Example
\begin{tikzpicture}[remember picture, overlay]
\node[anchor=north east] at (current page.north east) [xshift=-0.5cm, yshift=-0.5cm] {%
\includegraphics[width=1.5cm]{logo.pdf}%
};
\end{tikzpicture}%
\else
\begin{tikzpicture}[remember picture, overlay]
\node[anchor=north east] at (current page.north east) [xshift=-1.5cm, yshift=-1.5cm] {%
\includegraphics[width=3cm]{logo.pdf}%
};
\end{tikzpicture}%
\fi
2024-11-18 04:42:30 +01:00
}
% LogoTitle{title} - logo on the right, title on the left
\NewDocumentCommand{\LogoTitle}{m}{
\@logo
2024-12-07 07:13:08 +01:00
\if@Example
\\[0.5cm]{\titlefont\huge\bfseries #1}\\[1cm]
\else
\\[1cm]{\titlefont\huge\bfseries #1}\\[1.5cm]
\fi
2024-11-11 03:46:08 +01:00
}
% AddressTitle{title} - title at the top, address, then the form below
2024-11-18 04:42:30 +01:00
% AddressTitle*{title} - same, plus logo
\NewDocumentCommand{\AddressTitle}{s m}{
\IfBooleanT{#1}{\@logo}
2024-11-11 03:46:08 +01:00
\@dinaddress
2024-12-04 00:16:47 +01:00
\\[1cm]\smash{{\titlefont\huge\bfseries #2}}\\[4.5cm]
2024-11-11 03:46:08 +01:00
}
% need to emit \Form ; hyperref generates incomplete CheckBox appearance data,
% which causes problems with some viewers - so it's currently better not to
% generate any at all
\AtBeginDocument{
\Form[NeedAppearances=false]
2024-12-01 00:59:56 +01:00
\PageFoldMarks
2024-11-11 03:46:08 +01:00
}
2024-12-01 00:59:56 +01:00
\NewDocumentCommand{\PageFoldMarks}{}{
2024-12-07 07:13:08 +01:00
\if@Example
\else
2024-12-01 00:59:56 +01:00
\begin{tikzpicture}[remember picture,overlay]
2024-12-05 22:04:31 +01:00
\draw ($(current page.north west)!0.33!(current page.south west)$) -- ++(7.5mm,0cm);
\draw ($(current page.north west)!0.50!(current page.south west)$) -- ++(1.25cm,0cm);
\draw ($(current page.north west)!0.66!(current page.south west)$) -- ++(7.5mm,0cm);
2024-12-01 00:59:56 +01:00
\end{tikzpicture}
2024-12-07 07:13:08 +01:00
\fi
2024-12-01 00:59:56 +01:00
}
% fold markers
\AddToHook{shipout/background}{%
\PageFoldMarks
}