Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!dayton.saic.com!fac2 From: fac2@dayton.saic.com (Earle Ake) Newsgroups: comp.text Subject: Help with repeating commands in LaTeX Message-ID: <907.25b046af@dayton.saic.com> Date: 14 Jan 90 14:30:23 GMT Organization: Science Applications Intl. Corp., Dayton, Ohio Lines: 60 I am trying to come up with a way of not putting in 50 or so of the same thing when I want to make up a checklist in a tabular environment of LaTeX. I tried to use the \loop...\repeat construct but to no avail. Has anyone else done this and if so how? Any help would be appreciated. Thanks in advance. Example of what I would like to do is below: % % % Some sort of macro to do a \duplicate{command}{number-of-times} % % \newcount\n \def\duplicate#1#2{\n=0 \loop\ifnum\n<#2 \advance\n by1 {#1} % \endgraf \repeat} \documentstyle{article} \pagestyle{empty} \begin{document} % % % Just a little tabular environment here % % \begin{tabular}{p{1.5in}p{1.0in}p{1.0in}p{1.8in}} \multicolumn{1}{c}{\rule{1.3in}{0pt}} & \multicolumn{1}{c}{\rule{0.8in}{0pt}} & \multicolumn{1}{c}{\rule{0.8in}{0pt}} & \multicolumn{1}{c}{\rule{1.6in}{0pt}} \\ \hline % % % I don't want to put 50 or so of the following line in the TeX file. Would % some form of repeat work here? % % \duplicate{ \multicolumn{1}{c}{\rule{1.3in}{1pt}} & \multicolumn{1}{c}{\rule{0.8in}{1pt}} & \multicolumn{1}{c}{System\rule{0.2in}{0pt}User} & \multicolumn{1}{c}{Readonly\rule{0.2in}{0pt}Read/Write}\\ }{5} \end{tabular} \end{document} -- _____________________________________________________________________________ ____ ____ ___ Earle Ake /___ /___/ / / Science Applications International Corporation ____// / / /__ Dayton, Ohio ----------------------------------------------------------------------------- Internet: fac2%dayton.saic.com@uunet.uu.net uucp: uunet!dayvb!fac2