8
votes
1answer
156 views

Problems understanding definition of \newif

Reading http://profs.sci.univr.it/~gregorio/introtex.pdf, I have come across the definition of \newif on page 75: \def\newif#1{\@ifdefinable{#1}{\@newif#1}} \def\@newif#1{\count@\escapechar ...
18
votes
1answer
361 views

How to check if a variable contains a word in plain TeX?

I have a variable that contains a long list of keywords, e.g.: \keywords{computers, business, biology, fine art, literature, zoology} I need to make an if-then statement that checks for the ...
23
votes
1answer
642 views

Use of \relax after \ifnum … \fi construction

I'm reading Malcolm Clark's A Plain TeX Primer. On page 111 there's an exercise to define a macro that prints the current time. I've reproduced Clark's answer below: \newcount\minleft ...
6
votes
1answer
79 views

How to create a conditional which checks the value of written text in plain TeX?

I need to create a conditional in plain TeX like this: IF #1 = "N" THEN PRINT "TRUE" ELSE PRINT "#1" I tried various ways in TeX. The solution must be simple, but none of the ways I tried ...
8
votes
4answers
773 views

How to create a conditional which checks if one or another condition is true in plain TeX?

I need to make a conditional like this: IF #1 > \variable OR #1 = 0 THEN PRINT "True" ELSE PRINT "False" If #1 is greater than \variable or is equal to 0, then it it true. The value only ...
1
vote
1answer
277 views

Unexpected conditional branch with \ifdim

I have a problem with the following code: \newtoks\sectoks \sectoks={\noindent} \newtoks\subsubjectstyle \subsubjectstyle={\emitsectglue 1\the\sectoks} \newtoks\postsectoks ...