Looping with LaTeX — Generating Name Cards
Today I had to generate a few name cards, LaTeX and the pgffor command came very handy doing that. I am not entirely satisfied with this solution, since the margins are hardwired, so if you have a better way just tell me.
\documentclass[45pt,ngerman]{scrartcl} \usepackage[left=1cm,right=1cm,top=1.5cm,bottom=0.5cm,a4paper]{geometry} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{babel} \usepackage{pgffor} \usepackage{tikz} \usepackage{xcolor} \usepackage{lmodern} \usetikzlibrary{positioning} \pagestyle{empty} \setlength{\parskip}{0pt} \begin{document} \centering \foreach \x in {Manfred Mustermann, Gabi Mustermann, Manuela Mustermann}{ \begin{tikzpicture} [mybox/.style={rectangle,black,xshift=0cm,yshift=0cm,minimum width=0.975\textwidth,font=\bfseries,draw=black,very thick,align=center, minimum height=0.475\textheight}] \node at (0,0) [mybox] {\x}; \node at (0,0.475\textheight) [mybox] {}; \end{tikzpicture}\clearpage} \end{document}