4
votes
1answer
102 views

How to check if it is the first time or last time a macro has been used in ConTeXt?

I have some text in my document which appears repeatedly many times throughout the document, so I have defined a custom macro, e.g.: \define\mymacro{ \section{A} There is some text. ...
7
votes
2answers
672 views

How to check if a value is not equal using TeX conditionals?

I have a value defined in a macro, e.g.: \mymacro{apple} I need to check if a value does not equal a string, e.g.: IF #1 NOT EQUAL TO "apple" THEN PRINT "It is not a apple, it is #1." FI I ...
2
votes
1answer
299 views

How to compare two counters using TeX conditionals in ConTeXt?

I have two counters, \definenumber[words] and \definenumber[items]. I have tried to use TeX conditionals to compare them, e.g.: \ifnum\getnumber[words]=\getnumber[items] This will print some text ...
7
votes
1answer
296 views

Different content if command returns empty text (ConTeXt)

I have the following code in my ConTeXt environment: \startsetups[sectioninfo] \ss \rlap{\userpagenumber} \hfill ยง \getmarking[sectionnumber][current] \emspace \bf ...