I have a nested foreach
, where each loop is over the same number range.
I want to apply a style dependent on the relation between the numbers (\m
and \x
in the example code), i.e., whether they are equal, the first is lower than the second, or the second is lower than the first one.
I prefer a solution with tikz styles as long as its not extremely complicated, other solutions are acceptable, too (like using macros).
Example Code
The code could look like this (with the stye conditional style
not implemented).
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\foreach \m in {1,...,3} {%
\noindent
\begin{tikzpicture}
\foreach \x in {1,...,3} {%
\node[conditional style=\x wrt \m] at (\x,0) {\x};
}
\end{tikzpicture}
\par
}
\end{document}
Expected Result
In the following output, strike through, bold and plain are used as exemplary styles, because SO doesn't allow colored text afaik.
1 2 3
12 3
123