Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 :

    \documentclass{flacards}
    \usepackage[frenchb]{babel}
    \usepackage{tikz} 
    \begin{document}

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

    \end{document}

but the \forloop version is working :

    \documentclass{flacards}
    \usepackage[frenchb]{babel}
    \usepackage{forloop} 
    \begin{document}

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

    \end{document}

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

share|improve this question
add comment

1 Answer

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:

\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\foreach \x in {1}{\def\pippo{X}}
\show\pippo
\stop

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
add comment

Your Answer

 
discard

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.