6
votes
1answer
175 views

How do I implement a string buffer in TeX?

I've recently learned how to create a macro to iterate over a token sequence using \afterassignment and \let in TeX. Currently, I'm trying to apply this to a tokenization macro (where "tokenization" ...
4
votes
3answers
163 views

Creating commands with a TeX `for` loop

I am trying to create many different commands based on a single command (essentially a custom header) in a predictable way. Is there a way to do this in TeX/LaTeX? My specific example: I'm writing a ...
3
votes
1answer
295 views

how to use \loop … \repeat to generate an arbitrary number of rows in a table [duplicate]

Possible Duplicate: Copy table row n times The code below is intended to produce a table with 3 columns and 3 rows (one heading and two empty rows) but it can be seen that it doesn't work. ...
11
votes
5answers
956 views

Teach me how to use \loop…\repeat constructs, etc

The following code snippet is a part of the solution given here: \def\IncludeOutput#1{ \parskip=2mm \def\examplename{#1} \pdfximage{\Directory/\examplename.pdf}% ...
5
votes
3answers
866 views

Tex Nested Loops

I am trying to write a simple nested loop in LaTex, without using any special packages, using only the \loop...\if... \repeat syntax. I think I may be lacking a basic understanding of the rules for ...
16
votes
7answers
2k views

What is the canonical way to write a for-loop macro?

At a basic level TeX does not provide a for-loop construct, but allows tail-end recursion, however Knuth defined \loop in the plain macros. Coders have been coming with variations of their own ever ...