Inline-Textfeld
This commit is contained in:
parent
24f42ab403
commit
2f71b5589d
23
cccbform.cls
23
cccbform.cls
|
@ -359,6 +359,26 @@
|
||||||
\par\addvspace{\formskip}%
|
\par\addvspace{\formskip}%
|
||||||
}
|
}
|
||||||
|
|
||||||
|
% InlineTextField[width]{label}
|
||||||
|
\NewDocumentCommand{\InlineTextField}{o m}{%
|
||||||
|
\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=base west] at (0,0) { \full@TextField[\@tlen] };
|
||||||
|
\IfBlankTF{#2}{}{
|
||||||
|
\node[anchor=base west, rotate=\labelangle] at (-1em,0.6\formfieldheight) {
|
||||||
|
\ttfamily\footnotesize #2\strut
|
||||||
|
};
|
||||||
|
}
|
||||||
|
\end{tikzpicture}
|
||||||
|
}
|
||||||
|
|
||||||
% Checkbox{label} - a checkbox; label can be long and will linebreak reasonably pretty
|
% Checkbox{label} - a checkbox; label can be long and will linebreak reasonably pretty
|
||||||
\NewDocumentCommand{\Checkbox}{m}{%
|
\NewDocumentCommand{\Checkbox}{m}{%
|
||||||
\par%
|
\par%
|
||||||
|
@ -512,6 +532,9 @@
|
||||||
}%
|
}%
|
||||||
}
|
}
|
||||||
|
|
||||||
|
% ensure line height is enough to fit a form field
|
||||||
|
\NewDocumentCommand{\formstrut}{}{\rule{0pt}{\formfieldheight}\strut}
|
||||||
|
|
||||||
% % % common title patterns
|
% % % common title patterns
|
||||||
|
|
||||||
% put the logo in the top right corner
|
% put the logo in the top right corner
|
||||||
|
|
70
doku.tex
70
doku.tex
|
@ -5,10 +5,10 @@
|
||||||
\setcounter{secnumdepth}{\subsubsectionnumdepth}
|
\setcounter{secnumdepth}{\subsubsectionnumdepth}
|
||||||
\setcounter{tocdepth}{\subsubsectiontocdepth}
|
\setcounter{tocdepth}{\subsubsectiontocdepth}
|
||||||
\KOMAoptions{BCOR=1cm,DIV=10,open=any}
|
\KOMAoptions{BCOR=1cm,DIV=10,open=any}
|
||||||
\usepackage{calc,tikz,minted,unicode-math,fontspec,luacode,babel,csquotes,hyperref}
|
\usepackage{calc,tikz,minted,fontspec,luacode,babel,csquotes,hyperref}
|
||||||
\usetikzlibrary{calc}
|
\usetikzlibrary{calc}
|
||||||
\hypersetup{colorlinks,urlcolor={magenta!75!black},linkcolor={green!50!black}}
|
\hypersetup{colorlinks,urlcolor={magenta!75!black},linkcolor={green!50!black}}
|
||||||
\linespread{1.05}
|
\linespread{1.10}
|
||||||
% font definition (same as cccbform.cls)
|
% font definition (same as cccbform.cls)
|
||||||
%% FIXME: RawFeature +case x microtype fixes
|
%% FIXME: RawFeature +case x microtype fixes
|
||||||
%% see https://github.com/schlcht/microtype/issues/33 for fix notes
|
%% see https://github.com/schlcht/microtype/issues/33 for fix notes
|
||||||
|
@ -26,19 +26,6 @@
|
||||||
BoldItalicFeatures={RawFeature={+axis={MONO=0.0,CASL=0.2,slnt=-15,CRSV=1,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}}}
|
ItalicFeatures={RawFeature={+axis={MONO=0.0,CASL=0.2,slnt=-15,CRSV=1,wght=400}}}
|
||||||
]{Recursive}
|
]{Recursive}
|
||||||
\setmathfont[
|
|
||||||
Renderer=HarfBuzz,
|
|
||||||
ItalicFont=Recursive,
|
|
||||||
BoldFont=Recursive,
|
|
||||||
BoldItalicFont=Recursive,
|
|
||||||
UprightFeatures={
|
|
||||||
RawFeature={+ss01,+ss02,+ss08},
|
|
||||||
RawFeature={+axis={MONO=0.0,CASL=0.2,slnt=0,CRSV=0,wght=400}}
|
|
||||||
},
|
|
||||||
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}}}
|
|
||||||
]{Recursive}
|
|
||||||
\setmonofont[
|
\setmonofont[
|
||||||
Renderer=HarfBuzz,
|
Renderer=HarfBuzz,
|
||||||
ItalicFont=Recursive,
|
ItalicFont=Recursive,
|
||||||
|
@ -85,7 +72,7 @@ FOOTER = [[
|
||||||
|
|
||||||
\begin{luacode*}
|
\begin{luacode*}
|
||||||
-- PARAM: number of layers, resulting in 2^LAYERS points
|
-- PARAM: number of layers, resulting in 2^LAYERS points
|
||||||
local LAYERS = 8
|
local LAYERS = 7
|
||||||
-- PARAM: per layer, multiply component by (1/(2^K))^weight
|
-- PARAM: per layer, multiply component by (1/(2^K))^weight
|
||||||
-- (1 = default, larger = smoother, smaller = rougher)
|
-- (1 = default, larger = smoother, smaller = rougher)
|
||||||
local weight = 1.00
|
local weight = 1.00
|
||||||
|
@ -295,7 +282,6 @@ end
|
||||||
\chapter{TODO}
|
\chapter{TODO}
|
||||||
|
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item Inline-Textfeld
|
|
||||||
\item Grundsätze des aktuellen Designs
|
\item Grundsätze des aktuellen Designs
|
||||||
\item \TeX-Intro zum Ende, +build info
|
\item \TeX-Intro zum Ende, +build info
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
@ -592,6 +578,56 @@ Auch hier kann optional das Label geändert werden.
|
||||||
\Notes[Stirnabdruck]
|
\Notes[Stirnabdruck]
|
||||||
\end{ShortExample}
|
\end{ShortExample}
|
||||||
|
|
||||||
|
Letztlich gibt es für Sonderfälle noch Inline-Textfelder.
|
||||||
|
|
||||||
|
\begin{ShortExample}{inlinetextfield}{Sonderfall -- Inline}
|
||||||
|
\Text{Zur Fehlersuche wurden etwa
|
||||||
|
\InlineTextField[0.1]{} Stunden aufgewendet,
|
||||||
|
\InlineTextField[0.1]{} Gramm Koffein sowie
|
||||||
|
\InlineTextField{} konsumiert.
|
||||||
|
\formstrut % normierte Zeilenhöhe forcieren
|
||||||
|
}
|
||||||
|
\end{ShortExample}
|
||||||
|
|
||||||
|
Hierbei ist zu beachten, dass Textfelder höher sind als der umliegende Text.
|
||||||
|
Ohne das \texcode{\formstrut} würde die letzte Zeile \emph{deutlich} dichter an
|
||||||
|
der darüberliegenden kleben, was -- insbesondere wenn es stattdessen eine Zeile in der Mitte betrifft -- komisch aussehen würde. Das muss also ggf. in ≈jede Zeile eingestreut werden. Vergleiche auch nochmal:
|
||||||
|
|
||||||
|
\begin{ShortExample}{formstrutbad}{Wackeliger Text}
|
||||||
|
\Text{Zeile mit Feld \InlineTextField{} und
|
||||||
|
dann ganz viel Text, so dass dazwischen
|
||||||
|
mehrere Zeilen ohne Textfelder entstehen,
|
||||||
|
ein weiteres Feld \InlineTextField{}, mehr
|
||||||
|
Text der wieder etwas dichter beieinander
|
||||||
|
liegt, und dann irgendwann abschließend
|
||||||
|
nochmal eine Zeile mit noch einem Feld
|
||||||
|
\InlineTextField{} um den Unterschied zu
|
||||||
|
sehen.
|
||||||
|
}
|
||||||
|
\end{ShortExample}
|
||||||
|
|
||||||
|
\begin{ShortExample}{formstrutgood}{Gleichmäßiger Text}
|
||||||
|
\Text{Zeile mit Feld \InlineTextField{} und
|
||||||
|
dann ganz viel Text, so dass dazwischen
|
||||||
|
\formstrut
|
||||||
|
mehrere Zeilen ohne Textfelder entstehen,
|
||||||
|
ein weiteres Feld \InlineTextField{}, mehr
|
||||||
|
Text der wieder etwas dichter beieinander
|
||||||
|
\formstrut
|
||||||
|
liegt, und dann irgendwann abschließend
|
||||||
|
\formstrut
|
||||||
|
nochmal eine Zeile mit noch einem Feld
|
||||||
|
\InlineTextField{} um den Unterschied zu
|
||||||
|
sehen.\formstrut
|
||||||
|
}
|
||||||
|
\end{ShortExample}
|
||||||
|
|
||||||
|
Es wird hoffentlich deutlich, dass beide Varianten nicht ideal sind und
|
||||||
|
Inline-Felder nur in Ausnahmefällen die richtige Wahl sind. Dabei sollte aber
|
||||||
|
nochmal darauf hingewiesen werden, dass dieses Problem bei nur einer Zeile
|
||||||
|
Text nicht relevant ist, da dann die Abstände um die Block-Elemente herum
|
||||||
|
sowieso für ein einheitliches Aussehen sorgen.
|
||||||
|
|
||||||
\subsection{Checkboxen}
|
\subsection{Checkboxen}
|
||||||
|
|
||||||
\paragraph{Normale Verwendung} Gibt es eigentlich nicht viel dazu zu sagen --
|
\paragraph{Normale Verwendung} Gibt es eigentlich nicht viel dazu zu sagen --
|
||||||
|
|
15
testdoc.tex
Normal file
15
testdoc.tex
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
\documentclass[]{cccbform}
|
||||||
|
\begin{document}
|
||||||
|
\LogoTitle{Test-Dokument}
|
||||||
|
\TextField{Feld 1}
|
||||||
|
\TextField{Feld 2}
|
||||||
|
\ShortTextField{Feld 3}
|
||||||
|
\TextField{Feld 4}
|
||||||
|
\begin{Indented}
|
||||||
|
\TextField{Feld 5}
|
||||||
|
\TextField{Feld 6}
|
||||||
|
\end{Indented}
|
||||||
|
\TextField{Feld 7}
|
||||||
|
\Text{Abcd \InlineTextField{} efgh ijkl \InlineTextField{Feld 9} mnop qrst.}
|
||||||
|
\TextField{Feld 10}
|
||||||
|
\end{document}
|
Loading…
Reference in a new issue