6
votes
4answers
207 views

Is there a better way to check divisibility in LaTeX?

I want to draw a trimmed ruler, for example, from 2.3cm to 3.9cm where the distance between two consecutive marks is 1mm. I have difficulty to efficiently check whether or not the counter is a ...
17
votes
1answer
213 views

Is there a right way to do combined conditionals in LaTeX3?

I have some LaTeX3 code and I want to add a new feature. This will involve choosing between various actions at a particular point. There are two choices to be made, and these choices are ...
9
votes
1answer
831 views

Best practice for getting “If not foo” conditionals

So, here are two ways you might set things up such that \dostuff is done when foo is false. The "new conditional" method If you know when foo is going to be set, then after that do: \newif\ifnotfoo ...
12
votes
2answers
600 views

Best practice to implement a boolean macro argument?

Sometimes I'd like a macro to depend on a boolean argument but I don't know about the best way to implement this. So far, I end up introducing a global (say) \newif\ifextra that is used inside the ...
17
votes
6answers
872 views

Placing many conditionals in a series

I frequently need to do something like this: IF x < 1, DO a ELSE IF x < 2, DO b ELSE IF x < 3, DO c ELSE, DO d Using etoolbox, I end up nesting a lot of ifnumless, like this: ...