[texhax] "Programming" in LaTeX

Malte Thoma Malte.Thoma at awi.de
Thu Feb 22 15:48:46 CET 2018


Hi, I hope this question is sent to the correct list. I would like to get the following running:

--------------------------------------------
\documentclass{article}
\usepackage{xstring,ifthen}
\newcommand{\mytest}[1]{%
    \newcommand{\s}{\StrChar{#1}{3}}
    \newcommand{\x}{c}
    3rd charactor of input is: \s ~equal to \x \\
    1st test: \IfStrEq{\x}{c}{true}{false} \\
    2nd test: \IfStrEq{\s}{c}{true}{false}
}
\begin{document}
    \mytest{abcd}
\end{document}
------------------------------------------

The first test works as expected :-)
but the second test failed with

! Argument of \@secondoftwo has an extra }.

What do I miss?
Many thanks,
Malte


More information about the texhax mailing list