Kapitel 6

Tabellen mit LaTeX

Loop for tabular lines

\documentclass{article}
\usepackage{longtable}
\newcounter{xyz}\newcounter{uvw}
\makeatletter
\newtoks\@tabtoks
\newcommand\addtabtoks[1]{\@tabtoks\expandafter{\the\@tabtoks#1}}
\newcommand*\resettabtoks{\@tabtoks{}\setcounter{xyz}{1}}
\newcommand*\printtabtoks{\the\@tabtoks}
\makeatother
\begin{document}
\resettabtoks
\loop\ifnum\theuvw<10\relax
  \stepcounter{uvw}
  \addtabtoks{\thexyz\stepcounter{xyz}& & & & \\\hline}%
\repeat
\begin{longtable}{|*5{c|}}\hline
\textbf{Nr.} & \textbf{Vorname} & \textbf{Nachname} & 
   \textbf{Anschrift} & \textbf{Unterschrift}\\\hline
\printtabtoks
\end{longtable}
\end{document}

Zurück zur Hauptseite/Back to main page
Copyright $Id: chapter06.html 28 2022-12-31 07:33:58Z voss $