diff --git a/badge_kuk.pdf b/badge_kuk.pdf new file mode 100644 index 0000000..990ad3e Binary files /dev/null and b/badge_kuk.pdf differ diff --git a/badge_kuk.tex b/badge_kuk.tex new file mode 100644 index 0000000..3d7e9e1 --- /dev/null +++ b/badge_kuk.tex @@ -0,0 +1,256 @@ +% !TEX program = xelatex +\documentclass{scrartcl} + +\usepackage[paperwidth=9cm, + paperheight=13cm, + left=5.5mm, + right=13.0mm, + top=0cm, + bottom=0cm]{geometry} +\pagestyle{empty} +\usepackage{background} +\backgroundsetup{scale = 1.0, angle = 0, opacity = 1.0,% + contents = {\includegraphics[width = \paperwidth, height = \paperheight, + keepaspectratio] {templates/Badge_Kukkel.pdf}}}% + +\usepackage{qrcode} +\usepackage{ifthen} +\usepackage{lastpage} + +\usepackage{xcolor} +\definecolor{helfer} {rgb}{0.69, 0.88, 0.11} % #B1E11C (grĂ¼n) +\definecolor{kiffel} {rgb}{0.09, 0.45, 0.56} % #16738F (petrol) +\definecolor{orga} {rgb}{0.69, 0.11, 0.20} % #B11D33 (rot) +\definecolor{sponsor}{rgb}{0.35, 0.00, 0.50} % #5A0080 (lila) +\definecolor{kukkel} {rgb}{0.96, 0.56, 0.07} % #F48E12 (orange) + +\usepackage{fontspec} +\usepackage{montserrat} +\usepackage{microtype} +\setmainfont{Montserrat} + +% fitbox stuff +\usepackage{environ}% http://ctan.org/pkg/environ +\newdimen\fontdim% +\newdimen\upperfontdim% +\newdimen\lowerfontdim% +\newif\ifmoreiterations% +\fontdim12pt + +\newbox\trialbox% +\newbox\linebox% +\global\newcount\maxbad% +\newcount\linebad% +\newcount\currenthbadness% + + +\makeatletter +\NewEnviron{fitbox}[2]{% \begin{fitbox}{}{} stuff \end{fitbox} + % Store environment body + \def\stuff{% + \BODY% + }% + % prepare badness box + \def\badnessbox{% + \global\maxbad=0\relax% + \currenthbadness=\hbadness% save old \hbadness + \hbadness=10000000\relax% make sure, TeX reports overfull boxes + \message{Starting measureline recursion with width #1^^J}% + \setbox\trialbox=\vbox{% + \hsize#1\relax% + \fontsize{\fontdim}{1.2\fontdim}% + \selectfont% + \stuff\par% + \measurelines% start recursion + }% +% \noindent\usebox\trialbox\par + \hbadness=\currenthbadness% restore old \hbadness + } + % prepare recursion to measure line badness + \def\measurelines{% + \message{Iteration of measurelines^^J}% + \begingroup% + \setbox\linebox=\lastbox% get the last line + \setbox0=\hbox% + to \hsize{\unhcopy\linebox}% put the last line into box0 to provoke badness calculation + \linebad=\the\badness\relax% \badness now reflects the last typeset box, i.e. box0 + \message{Badness: \the\badness\space\the\linebad\space with max \the\maxbad\space at Fontsize: \the\fontdim\space^^J}% + \ifnum\linebad>\maxbad% store the maximum badness + \global\maxbad=\linebad% Uncomment this line to ignore overfull hboxes! + \fi% + \ifvoid% end of recursion + \linebox% + \else% + \unskip\unpenalty\measurelines% do the recursion + \ifhmode% + \newline% + \fi% + \noindent\box\linebox% do the output + \fi% + \endgroup% + }% + % Prepare measurement box + \def\buildbox{% + \badnessbox% measure badness + \setbox0\vbox{% measure height + \hbox{% + \fontsize{\fontdim}{1.2\fontdim}% + \selectfont% + \minipage{#1}% + \vbox{% + \stuff\par% + }% + \endminipage% + }% + }% + \message{Measured badness: \the\maxbad\space at Fontsize: \the\fontdim\space^^J}% + \dimen@\ht0 + \advance\dimen@\dp0 + \message{Measured box height: \the\dimen@\space^^J}% + }% + \def\shrinkheight{% + \loop% + \fontdim.5\fontdim% Reduce font size by half + \buildbox% + \message{Shrinking, new box height: \the\dimen@\space at Fontsize: \the\fontdim\space^^J}% + \ifdim\dimen@>#2 \repeat% + \lowerfontdim\fontdim% + \upperfontdim2\fontdim% + \fontdim1.5\fontdim% + }% + \def\shrinkwidth{% + \loop% + \fontdim.5\fontdim% Reduce font size by half + \buildbox% + \ifnum\maxbad>10000 \repeat% + \lowerfontdim\fontdim% + \upperfontdim2\fontdim% + \fontdim1.5\fontdim% + }% + \def\growheight{% + \loop% + \fontdim2\fontdim% Double font size + \buildbox% + \message{Growing, new box height: \the\dimen@\space at Fontsize: \the\fontdim\space^^J}% + \ifdim\dimen@<#2 \repeat% + \upperfontdim\fontdim% + \lowerfontdim.5\fontdim% + \fontdim.75\fontdim% + }% + \buildbox% + % Compute upper and lower bounds + \ifdim\dimen@>#2 + \message{Need to shrink box height: \the\dimen@\space^^J}% + \shrinkheight% + \else + \message{Need to grow box height: \the\dimen@\space to target: #2^^J}% + \growheight% + \fi + \message{Max font: \the\upperfontdim\space^^J}% + \message{Min font: \the\lowerfontdim\space^^J}% + % Potentially further reduce bounds for overfull box + \ifnum\maxbad>10000 + \shrinkwidth% + \fi + \message{Max font adjusted: \the\upperfontdim\space^^J}% + \message{Min font adjusted: \the\lowerfontdim\space^^J}% + % Now try to find the optimum height and width + \loop% + \buildbox% + \message{Height: \the\dimen@\space^^J}% + \ifdim\dimen@>#2 + \moreiterationstrue% + \upperfontdim\fontdim% + \advance\fontdim\lowerfontdim% + \fontdim.5\fontdim% + \else + \ifnum\maxbad>10000 + \moreiterationstrue% + \upperfontdim\fontdim% + \advance\fontdim\lowerfontdim% + \fontdim.5\fontdim% + \else + \advance\dimen@-#2 + \ifdim\dimen@<10pt + \lowerfontdim\fontdim% + \advance\fontdim\upperfontdim% + \fontdim.5\fontdim% + \dimen@\upperfontdim% + \advance\dimen@-\lowerfontdim% + \ifdim\dimen@<.2pt + \moreiterationsfalse% + \else + \moreiterationstrue% + \fi + \else + \moreiterationsfalse% + \fi + \fi + \fi + \ifmoreiterations\repeat% + \message{Selected font: \the\fontdim\space^^J}% + \vbox% + to #2{\box0\hbox{}}% Typeset content +}% +\makeatother + +\def\chopline#1,#2 \\{ + \def\name{#1} + %\def\kdvCode{#2} + \def\uni{#2} +} + +\newif\ifmore{} \moretrue% + +\begin{document} + +\newread\file% +\openin\file=list_kukkel_new.csv + +\loop% + \read\file% + to \line% + \ifeof\file% + \global\morefalse% + \else + \expandafter\chopline\line\\ + +\ifthenelse{\equal{\thepage}{1}} { + \vspace*{11.55mm} + }{ + \vspace*{16mm} + } +\begin{minipage}[t][][c]{\textwidth} + \begin{fitbox}{\textwidth}{.075\textheight} + \centering + \ifthenelse{\equal{\name}{\#\#}}{ + \phantom{\textbf{Matthias Stuhlbein}} + }{ + \textbf{\name}% + } + \end{fitbox} +\end{minipage} + +\vspace*{4mm} +\begin{minipage}[t][][c]{\textwidth} + \begin{fitbox}{\textwidth}{.042\textheight} + \centering + \ifthenelse{\equal{\uni}{\#\#}}{ + \phantom{\textbf{TU Dresden}} + }{ + \uni% + } + \end{fitbox} +\end{minipage} + +\vspace{32mm} +%\qrcode[height=24mm]{\kdvCode} + +\pagebreak + +\fi% +\ifmore\repeat% +% +\closein\file% + +\end{document} diff --git a/druck_kuk.pdf b/druck_kuk.pdf new file mode 100644 index 0000000..e649746 Binary files /dev/null and b/druck_kuk.pdf differ diff --git a/druck_kuk.tex b/druck_kuk.tex new file mode 100644 index 0000000..562fd83 --- /dev/null +++ b/druck_kuk.tex @@ -0,0 +1,50 @@ +\documentclass{scrartcl} +\usepackage[nohead,nofoot,margin=0mm]{geometry} +\usepackage{pdfpages} + +\usepackage{background} +\backgroundsetup{scale = 1.0,angle = 0, opacity = 1.0,% + contents = {\includegraphics[width = \paperwidth, height = \paperheight, + keepaspectratio]{foldmarks.pdf}}}% + +% % for foldmarks +% \usepackage{tikz} +% \usetikzlibrary{calc, backgrounds} +% \hoffset=-3.9mm + +\begin{document} +\includepdf[height=13cm, + width=9cm, + pages=-, + nup=2x2, + delta=10mm 10mm, + noautoscale=false, + frame=false]{badge_kuk.pdf} + +% % foldmarks +% \begin{tikzpicture} +% \begin{scope}[on background layer] +% \draw ( 0mm, 0mm)--++(0mm, 0mm); + +% \draw ( 10mm, 0mm)--++( 0mm, -10.5mm); +% \draw (100mm, 0mm)--++( 0mm, -10.5mm); +% \draw (110mm, 0mm)--++( 0mm, -10.5mm); +% \draw (200mm, 0mm)--++( 0mm, -10.5mm); + +% \draw (210mm, - 13.5mm)--++(-7mm, 0mm); +% \draw (210mm, -143.5mm)--++(-7mm, 0mm); +% \draw (210mm, -153.5mm)--++(-7mm, 0mm); +% \draw (210mm, -283.5mm)--++(-7mm, 0mm); + +% \draw (200mm, -297.0mm)--++( 0mm, 10.5mm); +% \draw (110mm, -297.0mm)--++( 0mm, 10.5mm); +% \draw (100mm, -297.0mm)--++( 0mm, 10.5mm); +% \draw ( 10mm, -297.0mm)--++( 0mm, 10.5mm); + +% \draw ( 0mm, -283.5mm)--++( 7mm, 0mm); +% \draw ( 0mm, -153.5mm)--++( 7mm, 0mm); +% \draw ( 0mm, -143.5mm)--++( 7mm, 0mm); +% \draw ( 0mm, - 13.5mm)--++( 7mm, 0mm); +% \end{scope} +% \end{tikzpicture} +\end{document} diff --git a/printready/kukkel.pdf b/printready/kukkel.pdf new file mode 100644 index 0000000..e649746 Binary files /dev/null and b/printready/kukkel.pdf differ