New answers tagged

0 votes

Suppress text output but leave enumerate item labels in place

I came across an article a while ago where someone did a decent job of articulating something similar, using the 'exam' document class and the command '\printanswers'. I'll just link to the article, ...
b3nworthh's user avatar
1 vote
Accepted

Iterating over a list and conditionals in tabular environment not working. Incomplete \ifnum; all text was ignored after line 72

You need to collect the tabular information in a token list, and then output the token list all at once, when the process is complete. To see what I mean, look in my code for instances of \addtotoks, ...
Steven B. Segletes's user avatar
0 votes

Multilingual text with if statement

I have found two ways to deal with the problem. Note: the document always starts with German. First solution, language change contained The first solution - rather trivial and inspired from ...
JustAUser's user avatar
4 votes
Accepted

Weird Question with def, and condition

Your expectations are wrong, sorry. When TeX sees \if\LANG it expands \LANG and gets \ENLANG, which is expandable so at the end we get \if en which returns false. On the other hand, \ifx returns true, ...
egreg's user avatar
  • 1.1m
1 vote

Weird Question with def, and condition

\if\LANG expands \LANG until it gets two non expandable tokens e and n in this case and compares them, so will give false and skip to \else. \ifx\LANG\ENLANG is false as they have different defintions,...
David Carlisle's user avatar
1 vote

Detect if a parameter passed to command is a mathematical formula

You can test for $...$ or \(...\). \documentclass{article} \usepackage{amsmath} \usepackage{varwidth} \ExplSyntaxOn \NewDocumentCommand{\parrafo}{m} { \regex_match:nnTF { \A (\$|\c{\(}) (.*) (\$|\...
egreg's user avatar
  • 1.1m
1 vote

Adding up numbers

As far as the author of the initial release of this answer knows, TeX by means of registers and primitives can do arithmetic in the range -231+1 to +231-1. If you need this only for integers and ...
Ulrich Diez's user avatar
  • 28.8k
1 vote

Test if a package (or package option) is loaded

In newer LaTeX versions, \@ifpackageloaded can also be \IfPackageLoadedTF. Usage is identical. Another option is \ltx@ifpackageloaded from ltxcmds package (the main advantage of ltxcmds package is ...
user202729's user avatar
  • 7,163

Top 50 recent answers are included