next version

This commit is contained in:
nobody 2024-12-01 00:59:56 +01:00
parent 1edec96c28
commit 88210546c4
3 changed files with 114 additions and 20 deletions

View file

@ -2,8 +2,9 @@
\ProvidesClass{cccbform}[2024-11-08 In the Beginning, There Was Chaos] \ProvidesClass{cccbform}[2024-11-08 In the Beginning, There Was Chaos]
\LoadClass{scrartcl} \LoadClass{scrartcl}
\RequirePackage{geometry, calc, xparse, xcolor, hyperref, tikz, \RequirePackage{geometry, calc, xparse, xcolor, hyperref, tikz, tikzpagenodes,
fontspec, changepage, letltxmacro, textpos} fontspec, changepage, letltxmacro, textpos}
\usetikzlibrary{calc}
% address % address
\newcommand{\address}{% \newcommand{\address}{%
@ -83,9 +84,9 @@
\def\deflength#1#2{\newlength{#1}\setlength{#1}{#2}} \def\deflength#1#2{\newlength{#1}\setlength{#1}{#2}}
\setlength{\parindent}{0pt} \setlength{\parindent}{0pt}
\setlength{\fboxsep}{0pt} \setlength{\fboxsep}{0pt}
\deflength{\formfieldheight}{14pt} \deflength{\formfieldheight}{16pt}
\deflength{\formshrink}{4pt} \deflength{\formshrink}{4pt}
\deflength{\formskip}{0.5em} \deflength{\formskip}{0.75em}
\deflength{\colsep}{1.0em} \deflength{\colsep}{1.0em}
\deflength{\indentstep}{1cm} \deflength{\indentstep}{1cm}
\deflength{\borderwidth}{0.5pt} \deflength{\borderwidth}{0.5pt}
@ -96,11 +97,19 @@
\relax} \relax}
\deflength{\htweak}{0.5pt} % manual adjustment of horizontal alignment of form elements \deflength{\htweak}{0.5pt} % manual adjustment of horizontal alignment of form elements
\deflength{\hadj}{\dimexpr -0.5\formshrink - 0.5\fontdimen2\font + \htweak \relax} \deflength{\hadj}{\dimexpr -0.5\formshrink - 0.5\fontdimen2\font + \htweak \relax}
% length factors (as percentage of \linewidth)
\def\normalfieldwidth{0.65}
\def\shortfieldwidth{0.35}
% rotation angle
\def\labelangle{4.20}
% counters % counters
\newcounter{fieldnum} \newcounter{fieldnum}
\def\@autofieldname{field\thefieldnum} \def\@autofieldname{field\thefieldnum}
% conditional flags
\newif\ifMultiColumn
% abbreviations % abbreviations
\def\@formdefaults{% \def\@formdefaults{%
backgroundcolor=fieldcolor,bordercolor=fieldcolor,% backgroundcolor=fieldcolor,bordercolor=fieldcolor,%
@ -230,44 +239,101 @@
\par#1\par\vspace{\formskip} \par#1\par\vspace{\formskip}
} }
% TextField{label} - a single-line input % TextField*{label} - a single-line input (starred version uses all available space)
\RenewDocumentCommand{\TextField}{s m}{% \RenewDocumentCommand{\TextField}{s m}{%
\par% \par%
{\ttfamily\footnotesize #2\strut}\\% \ifMultiColumn%
\IfBooleanTF{#1}{\full@TextField}{\full@TextField[0.7]}% \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}%
\par\vspace{\formskip}% \par\vspace{\formskip}%
} }
% ShortTextField[width]{label} - a single-line input that doesn't have full width % ShortTextField[width]{label} - a single-line input with reduced width
% (50% by default) \NewDocumentCommand{\ShortTextField}{o m}{%
\NewDocumentCommand{\ShortTextField}{O{0.35} m}{%
\par% \par%
{\ttfamily\footnotesize #2\strut}\\% \IfValueTF{#1}{\pgfmathsetmacro{\@tlen}{#1}}{%
\full@TextField[#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}%
\par\vspace{\formskip}% \par\vspace{\formskip}%
} }
% MultilineTextField[height]{label} - a multi-line input % MultilineTextField*[height]{label} - a multi-line input, starred version uses all available width
\NewDocumentCommand{\MultilineTextField}{s O{} m}{% \NewDocumentCommand{\MultilineTextField}{s O{} m}{%
\par% \par%
{\ttfamily\footnotesize #3\strut}\\% \ifMultiColumn%
\IfBooleanTF{#1}{\full@MultilineTextField<#2>}{\full@MultilineTextField<#2>[0.7]}% \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}
\par\vspace{\formskip}% \par\vspace{\formskip}%
} }
% Signature[label] - a field not fillable on the computer, big enough for a signature % Signature[label] - a field not fillable on the computer, big enough for a signature
\NewDocumentCommand{\Signature}{O{Datum, Unterschrift}}{% \NewDocumentCommand{\Signature}{O{Datum, Unterschrift}}{%
\par% \par%
{\ttfamily\footnotesize #1\strut}\\% \ifMultiColumn%
\fake@MultilineTextField<1.0cm>[0.35]% \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@MultilineTextField<1.0cm>[\@tlen]
};
\node[anchor=north west,rotate=\labelangle] at (-1em,1cm -0.4\formfieldheight) {
\ttfamily\footnotesize #1\strut
};
\end{tikzpicture}
\par\vspace{\formskip}% \par\vspace{\formskip}%
} }
% Notes[label] - a slightly taller fake field that fills the whole width % Notes[label] - a slightly taller fake field that fills the whole width
\NewDocumentCommand{\Notes}{O{Vermerke}}{% \NewDocumentCommand{\Notes}{O{Vermerke}}{%
\par% \par%
{\ttfamily\footnotesize #1\strut}\\% \pgfmathsetmacro{\@tlen}{1.0}
\fake@MultilineTextField<1.5cm>% \begin{tikzpicture}[baseline]
\useasboundingbox (0,0) rectangle (\@tlen\textwidth,\formfieldheight);
\node[anchor=west] at (0,0) {
\full@MultilineTextField<1.5cm>[\@tlen]
};
\node[anchor=north west,rotate=\labelangle] at (-1em,1.5cm -0.9\formfieldheight) {
\ttfamily\footnotesize #1\strut
};
\end{tikzpicture}
\par\vspace{\formskip}% \par\vspace{\formskip}%
} }
@ -285,7 +351,7 @@
\NewDocumentCommand{\InlineCheckbox}{}{\full@CheckBox} \NewDocumentCommand{\InlineCheckbox}{}{\full@CheckBox}
% CheckboxOther[width]{label} - a checkbox for a write-in option % CheckboxOther[width]{label} - a checkbox for a write-in option
\NewDocumentCommand{\CheckboxOther}{O{0.35} m}{% \NewDocumentCommand{\CheckboxOther}{O{\shortfieldwidth} m}{%
\par% \par%
\full@CheckBox\quad#2\quad\full@TextField[#1]% \full@CheckBox\quad#2\quad\full@TextField[#1]%
\par\vspace{\formskip}% \par\vspace{\formskip}%
@ -325,13 +391,16 @@
% \begin{Indented}[factor] ... \end{Indented} - indent a section % \begin{Indented}[factor] ... \end{Indented} - indent a section
\NewDocumentEnvironment{Indented}{O{}}{% \NewDocumentEnvironment{Indented}{O{}}{%
\vspace{-1\formskip}
\begin{adjustwidth}{#1\indentstep}{0pt}% \begin{adjustwidth}{#1\indentstep}{0pt}%
}{% }{%
\end{adjustwidth}% \end{adjustwidth}%
\vspace{\formskip}
} }
% TwoColumns{left}{right} - put two sections side-by-side % TwoColumns{left}{right} - put two sections side-by-side
\NewDocumentCommand{\TwoColumns}{m m}{% \NewDocumentCommand{\TwoColumns}{m m}{%
\MultiColumntrue
\begin{minipage}[t]{0.5\linewidth - 0.5\colsep}% \begin{minipage}[t]{0.5\linewidth - 0.5\colsep}%
#1% #1%
\end{minipage}% \end{minipage}%
@ -339,10 +408,12 @@
\begin{minipage}[t]{0.5\linewidth - 0.5\colsep}% \begin{minipage}[t]{0.5\linewidth - 0.5\colsep}%
#2% #2%
\end{minipage}% \end{minipage}%
\MultiColumnfalse
\par\vspace{\formskip}% \par\vspace{\formskip}%
} }
\NewDocumentCommand{\ThreeColumns}{m m m}{% \NewDocumentCommand{\ThreeColumns}{m m m}{%
\MultiColumntrue
\begin{minipage}[t]{0.333\linewidth - 0.66\colsep}% \begin{minipage}[t]{0.333\linewidth - 0.66\colsep}%
#1% #1%
\end{minipage}% \end{minipage}%
@ -354,10 +425,12 @@
\begin{minipage}[t]{0.333\linewidth - 0.66\colsep}% \begin{minipage}[t]{0.333\linewidth - 0.66\colsep}%
#3% #3%
\end{minipage}% \end{minipage}%
\MultiColumnfalse
\par\vspace{\formskip}% \par\vspace{\formskip}%
} }
\NewDocumentCommand{\FiveColumns}{m m m m m}{% \NewDocumentCommand{\FiveColumns}{m m m m m}{%
\MultiColumntrue
\begin{minipage}[t]{0.2\linewidth - 0.8\colsep}% \begin{minipage}[t]{0.2\linewidth - 0.8\colsep}%
#1% #1%
\end{minipage}% \end{minipage}%
@ -377,6 +450,7 @@
\begin{minipage}[t]{0.2\linewidth - 0.8\colsep}% \begin{minipage}[t]{0.2\linewidth - 0.8\colsep}%
#5% #5%
\end{minipage}% \end{minipage}%
\MultiColumnfalse
\par\vspace{\formskip}% \par\vspace{\formskip}%
} }
@ -415,5 +489,20 @@
% generate any at all % generate any at all
\AtBeginDocument{ \AtBeginDocument{
\Form[NeedAppearances=false] \Form[NeedAppearances=false]
\PageFoldMarks
} }
\NewDocumentCommand{\PageFoldMarks}{}{
\begin{tikzpicture}[remember picture,overlay]
\draw ($(current page.north west)!0.33!(current page.south west)$) -- ++(5mm,0cm);
\draw ($(current page.north west)!0.50!(current page.south west)$) -- ++(1cm,0cm);
\draw ($(current page.north west)!0.66!(current page.south west)$) -- ++(5mm,0cm);
\end{tikzpicture}
}
% fold markers
\AddToHook{shipout/background}{%
\PageFoldMarks
}

View file

@ -1,9 +1,11 @@
\documentclass{cccbform} \documentclass{cccbform}
\begin{document} \begin{document}
\AddressTitle*{Antrag auf Erstattung von Auslagen} \AddressTitle*{Antrag auf Erstattung von Auslagen}
\vspace{0.5cm}
\TextField{Name} \TextField{Name}
\TextField{Verwendungszweck} \TextField{Verwendungszweck}
\TextField{Erstattungsbetrag} \TextField{Erstattungsbetrag}
\medskip
\Text{Ich bitte um Erstattung} \Text{Ich bitte um Erstattung}
\Checkbox{in bar} \Checkbox{in bar}
\Checkbox{auf mein Konto:} \Checkbox{auf mein Konto:}

View file

@ -3,16 +3,18 @@
\LogoTitle{Antrag auf Mitgliedschaft im\\\strut{\LARGE Chaos Computer Club Berlin / CCC~(B)~e.~V.}} \LogoTitle{Antrag auf Mitgliedschaft im\\\strut{\LARGE Chaos Computer Club Berlin / CCC~(B)~e.~V.}}
\Checkbox{Ja, ich habe die Satzung des Chaos Computer Club Berlin e.~V., die Beitragsordnung in der aktuellen Fassung und die Hinweise zur Mitgliedschaft gelesen und möchte Mitglied im CCCB~e.~V. werden.} \Checkbox{Ja, ich habe die Satzung des Chaos Computer Club Berlin e.~V., die Beitragsordnung in der aktuellen Fassung und die Hinweise zur Mitgliedschaft gelesen und möchte Mitglied im CCCB~e.~V. werden.}
\begin{Indented} \begin{Indented}
\TextField{Vor- und Zuame} \TextField{Vor- und Zuname}
\TextField{Pseudonym} \TextField{Pseudonym}
\TextField{E-Mail} \TextField{E-Mail}
\end{Indented} \end{Indented}
\medskip
\Text{Ich beantrage folgende Mitgliedschaft:} \Text{Ich beantrage folgende Mitgliedschaft:}
\begin{Indented} \begin{Indented}
\Checkbox{Reguläre Mitgliedschaft (20€ pro Monat)} \Checkbox{Reguläre Mitgliedschaft (20€ pro Monat)}
\Checkbox{Ermäßigte Mitgliedschaft (10€ pro Monat) -- bitte Beleg beilegen!} \Checkbox{Ermäßigte Mitgliedschaft (10€ pro Monat) -- bitte Beleg beilegen!}
\CheckboxOther[0.17]{Mitgliedschaft mit Sonderbeitrag nach Art.~6 Abs.~2 der Satzung:} \CheckboxOther[0.17]{Mitgliedschaft mit Sonderbeitrag nach Art.~6 Abs.~2 der Satzung:}
\end{Indented} \end{Indented}
\medskip
\Text{Ich werde den Mitgliedsbeitrag auf das folgende Konto überweisen:} \Text{Ich werde den Mitgliedsbeitrag auf das folgende Konto überweisen:}
\begin{Indented} \begin{Indented}
\Text{% \Text{%
@ -24,6 +26,7 @@
\end{Indented} \end{Indented}
\Text{Hinweis: Die Rechtsgrundlage dieser Datenverarbeitung ist Art.~6 Abs.~1 lit.~b) DSGVO.} \Text{Hinweis: Die Rechtsgrundlage dieser Datenverarbeitung ist Art.~6 Abs.~1 lit.~b) DSGVO.}
\ShortTextField{Ort, Datum} \ShortTextField{Ort, Datum}
\medskip
\Signature[Unterschrift] \Signature[Unterschrift]
\RuleSection{Miss- oder Vertrauenspersonen} \RuleSection{Miss- oder Vertrauenspersonen}
\Text{Die folgenden Aktiven sind für eine Aufnahme:} \Text{Die folgenden Aktiven sind für eine Aufnahme:}