2

I try to automatise the construction of my flashcards. I try with \foreach (tikz) and \forloop (forloop package), it's not working. The error is in the two case:

! LaTeX Error: There's no line here to end.
See the LaTeX manual or LaTeX Companion for explanation.

The code :

\documentclass{flacards}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}

\usepackage[frenchb]{babel}

\usepackage{forloop} 

\begin{document}
\newcounter{ct}
\forloop{ct}{1}{\value{ct} < 11}{ 
  \card{\arabic{ct}}{}
}
\end{document}
3

You have to specify some text also in the second argument. (La)TeX needs to go into horizontal mode, otherwise the error will show.

Since \null doesn't activate horizontal mode, it's useless. So

\card{\arabic{ct}}{~}

or \card{\arabic{ct}}{\ } will work.

  • Ha, now that is obvious now! And probably the cleanest way is to use \leavevmode in the second argument. – mbork Sep 19 '11 at 20:34
  • I understand my error.I tried to do short loop test just to see the result whitout the second argument. – La Raison Sep 19 '11 at 23:51
1

I have no idea what's going on in the \card macro (and unfortunately I don't have time to investigate it), but it seems that the empty second argument is the culprit. Interestingly enough, \card{\arabic{ct}}{\null} does not help (anyone has any idea why?), but \card{\arabic{ct}}{\ } does.

(And obviously the loop has nothing to do with that.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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