TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My flashcard with \forloop is working after your help. I try it with \foreach (tikz) but it's not working. The pdf files contain only one flash card in the bottom right corner, the 24th card and the 48th,...

The minimal non-working example is :


    \foreach \x in {1,2,...,50}{\card{a}{b}}


but the \forloop version is working :


    \forloop{compteura}{1}{\value{compteura} < 11}{\card{a}{b}}


I prefer use tikz for the math possibility. Until such time I use package calc for doing math on counter.

share|improve this question
up vote 1 down vote accepted

I believe that the problem is in the fact that \foreach does everything inside a group and this, for some reason, conflicts with the card production of flacards; indeed just the last card in each page is actually printed.

In order to see if my assertion is right, I ran the following test:

\foreach \x in {1}{\def\pippo{X}}

and TeX prompted

> \pippo=undefined.
l.5 \show\pippo

Unfortunately, also removing the group started by \foreach seems to do nothing (it's quite possible that other groups are used).

If you need the \foreach function only in cases such as {1,2,...,50} it's easy to replace it with other loops, as you already know. If the "list" processing is needed, please update your question. With etoolbox it's quite handy to process lists of values.

share|improve this answer
thank, I understand the point. Your explications are very clear.I will try to use the other package flashcards.cls, or forloop with flacard.cls. – La Raison Sep 25 '11 at 0:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.