A demonstration of the problem by way of a minimal working example
I saved the following LaTeX code in the file ~/Test.tex
.
\documentclass{article}
\usepackage{ifthen}
\begin{document}
\the\textdir =%
\ifthenelse{\equal{\the\textdir}{TLT}}{TLT}{TRT}
\end{document}
The code prints out the content of the LuaTeX primitive \textdir
register, an equality symbol, and then the string TLT
if the contents of said register is TLT
, and TRT
otherwise.
I then executed the following commands in the Terminal.
> cd ~
> lualatex Test
As a consequence the file ~/Test.pdf
was created. When opened in a PDF viewer, it showed "TLT=TRT".
Questions
If
\the\textdir
expands to the string "TLT", why, then, does the conditional evaluate to the else case "TRT"?How can I query the value of the
\textdir
register?
\jobname
and\string
it returns catcode 12 characters not catcode 11\xifthenelse{\streqtest{\the\textdir}{TLT}}{True}{False}
will work (and, as a bonus, is fully expandable).\xifthenelse
causes a compilation failure, whereas\ifthenelse
works smoothely.