Posts tagged ‘PGF’

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}

dann

Uwe

Uwe Ziegenhagen has been working with LaTeX for more than a decade. Besides TeX/LaTeX he likes to work with Python, Rasberry/Arduino and his digital camera.

More Posts - Website

Simple looping with LaTeX

Here’s a fairly easy example how to loop through a LaTeX collection/list with the help of the pgffor package

\documentclass[12pt,ngerman]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{pgffor}
\begin{document}

\begin{itemize}
\foreach \x in {Donald,Dagobert,Gustav,Goofy} {\item \x}
\end{itemize}

\end{document}

googy

Uwe

Uwe Ziegenhagen has been working with LaTeX for more than a decade. Besides TeX/LaTeX he likes to work with Python, Rasberry/Arduino and his digital camera.

More Posts - Website

PGFplots und Beamer

Marc van Dongen hat heute bei stackexchange ein schönes Minimal-Beispiel zu PGFplots veröffentlicht (http://tex.stackexchange.com/questions/44923/create-slide-with-graph-in-beamer).

\documentclass{beamer}
\usepackage{pgfplots}
\begin{document}
\begin{frame}[fragile]
   \frametitle{Bar Graphs}
\begin{tikzpicture}[scale=0.85]
\begin{axis}[xbar,tick align=outside,
             width=11cm,
             height=8cm,
             bar width={10pt},
             enlargelimits=0.13,
             nodes near coords,
             nodes near coords align=horizontal,
             point meta=x * 1, % The displayed number.
             xlabel=\textbf{Frequency of Winning the Final},
             xtick={0,5,...,35},
             ytick={1,...,13},
             yticklabels={Kerry,Laois,London,Waterford,Clare,Offaly,
                      Galway,Wexford,Dublin,Limerick,Tipperary,Cork,Kilkenny}
            ]
\addplot
[draw=blue,fill=blue!15]
coordinates
{(1,1) (1,2) (1,3) (2,4) (3,5) (4,6) (4,7) (6,8) (6,9) (7,10) (26,11) (30,12) (33,13)};
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}

Uwe

Uwe Ziegenhagen has been working with LaTeX for more than a decade. Besides TeX/LaTeX he likes to work with Python, Rasberry/Arduino and his digital camera.

More Posts - Website