Why this MWE does never stop compiling generating tons of pdf pages ?


\setbeamersize{text margin left=.4cm}
\setbeamersize{text margin right=.4cm}

            (0,0) -- (2,0) -- (0,1) -- cycle ;
        \filldraw[#1] (0,0) rectangle (.2,.2) ; 





\foreach \i [evaluate=\i as \j using \i+2] in {1,...,2} {%

  • 3
    I'm guessing but try with int(\i+2) in the evaluate of foreach. I don't think \only is that smart.
    – percusse
    Sep 29 '14 at 10:18
  • Bingo ! fill free to write an answer. If not \only, what else ?
    – Tarass
    Sep 29 '14 at 10:41

I didn't check it but it might happen that the argument of \only macro is compared to the framecounter value and since TikZ arithmetic \i+2 returns a decimal point such as 3.0 this comparison never gets satisfied. Hence you need to convert the result to integer to make it 3. So

\foreach \i [evaluate=\i as \j using int(\i+2)] in {1,...,2} {%

does it.

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.