Code: Select all
\documentclass{minimal}
\usepackage{expl3}
\ExplSyntaxOn
\begin{document}
\tl_if_novalue:nTF{\c_novalue_tl}{PASS}{FAIL} % prints FAIL
\ExplSyntaxOff
\end{document}
Code: Select all
\documentclass{minimal}
\usepackage{expl3}
\ExplSyntaxOn
\begin{document}
\tl_if_novalue:nTF{\c_novalue_tl}{PASS}{FAIL} % prints FAIL
\ExplSyntaxOff
\end{document}
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
\tl_if_novalue:nTF
tests if the token list is exactly equal to \c_novalue_tl
, meaning equal to the special token list which is stored inside \c_novalue_tl
. This is not the same as {c_novalue_tl}
, the token list consisting of exactly one token, \c_novalue_tl
itself.\c_novalue_tl
, you get the expected behaviour:Code: Select all
\documentclass{minimal}
\usepackage{expl3}
\ExplSyntaxOn
\begin{document}
\cs_generate_variant:Nn \tl_if_novalue:nTF { VTF }
\tl_if_novalue:VTF \c_novalue_tl {PASS}{FAIL} % prints PASS
\ExplSyntaxOff
\end{document}
\tl_if_novalue:nTF{#1}{PASS}{FAIL}
because the argument is not wrapped in a macro/variable.Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis