In my code some pictures should be displayed if any condition is satisfied.
The conditional must necessarily be placed within the picture environment.
The question is how to insert a line break in the text ONLY if the picture actually took place.
A MWE:
\documentclass{article}
\usepackage{tikz}
\newcommand{\picturexample}[1]{%
\begin{tikzpicture}
\ifodd#1 % In practice, a PGF/TikZ's check command
\draw (0,0) circle (1);
\fi
\end{tikzpicture}}
\newcount\n
\begin{document}
\loop
\picturexample{\n}%
\\ % this should happen only when the picture "exists"
\advance\n1
\ifnum\n<10\repeat
\end{document}
\if
that is set to true if the picture is drawn?