{foreach} is for questions regarding the TikZ/PGF module of the same name which can also be used as a standalone package pgffor.
13
votes
4answers
1k views
pgffor: Special treatment for last item in \foreach-list
Is there a way for handling the last item in a \foreach-list in a special way. An example might illustrate an application for that:
\documentclass{minimal}
\usepackage{pgffor}
\begin{document}
...
6
votes
1answer
548 views
Generating tables with \@for command
I'm making a report template that requires the list of authors to be presented in several different ways, one of which is a table that lists each author and provides a space for them to sign the ...
14
votes
3answers
302 views
How keep a running list of strings and then process them one at a time
I would like to keep track of all the \AddRef commands in a document and then process them one at a time, for instance print them in the document on one line per value. It seems that this should be ...
10
votes
1answer
2k views
TikZ \foreach loop with macro-defined list
I have a small problem with the TikZ \foreach loop whenever the list, over which we loop, is defined my a macro. The following code example will show my problem:
\documentclass{scrartcl}
...
6
votes
2answers
787 views
Iterate over space-separated list
I’ll briefly explain the background in case this can be solved simpler but I’d still be interested in an answer to the actual question, too.
My chapter titles are very narrow and use a large font so ...
6
votes
2answers
2k views
How to use parameter numbers and \foreach
Is there a way to use the TikZ \foreach command to do operations with parameters?
E.g. I would like to be able to write (just a silly example):
\newcommand{\foo}[9]{
\foreach \x in{1,2,...,9}{
...
3
votes
1answer
847 views
Drawing a Markov chain - How do I update the value of a variable in TikZ?
I would like to plot a simulation of a Markov process in R^2. Basically, I want to draw a line that starts at (x_0,y_0)=(0,2) and then follow this rule:
For each i=1,...,10, the line will go through ...
3
votes
1answer
307 views
Are there list building macros in PGF/Tikz?
In Mathematica, C# linq, or other languages, we can use auxiliary functions to produce list of certain pattern.
For example:
In Mathematica, we can use Table[] or Range[] to produce a list of ...
3
votes
2answers
400 views
Unexpected tikz/counter behaviour
What I've been trying to do, futilely, is to use the foreach[counter=\xi] x in {1,2,3} statement in tikz/pgf with LaTeX. This fails, every time. Whatever. So I moved on to trying to use a counter, ...