How do I use to insert ifthenelse crop marks in Tikz. I want

ifthenelse{\printcrop=true}{\draw(0,0) -- ++(0,1);}{}

That is, if yes, make a drawing, else but do nothing.

And yet, where I can choose the option true or false?

1 Answer 1


You can define your own if-switch using \newif\ifyourname and then use \yournametrue and \yournamefalse to set it to true or false, respectively. To use the if simply use \ifyourname <true clause> \else <false clause> \fi where the \else clause is optional.

You code example would be written this way:



% other drawing commands
  \draw(0,0) -- ++(0,1);
% other drawing commands

Note that this if-switches are expandable. You shouldn't use \newif inside another \if... clause because this might cause trouble.


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.