Is there a way to add arithmetic operations to \ifthenelse statements? Here is a minimal (non)example:
\documentclass{amsart} \usepackage{tikz, ifthen} \begin{document} \begin{tikzpicture} \foreach \a in {-6,...,6} { \foreach \b in {-6,...,6} { \ifthenelse{ (\a + \b) < 4 } { \node at ( (\a, \b ) {(\a, \b)}; } {} } } \end{tikzpicture} \end{document} It is not working because \ifthenelse does not allow \a+\b.
Bonus question: Is there a way to e.g. define \c = \a + \b in advance so I can use \c elsewhere, in \ifthenelse and subsequence \draw commands?
Bonus questionEDIT: Is there a way to e.g. define \c = \a
Actually what I needed is \a + 1.414*\b < 4 AND \a \b in advance so- 1.414*\b > 0. I thought I can use \c elsewherecould handle the rest once I know how to insert arithmetic operations into \ifthenelse, in \ifthenelsebut apparently it's more complicated than that. Apologies for the mixup and subsequence \draw commands?thanks for your help.