I'm trying to get to grips with how to do basic string manipulation using expl3
. Here's what I have so far:
\documentclass{article}
\begin{document}
\ExplSyntaxOn
\str_set_eq:NN \l_tmpa_str \str_uppercase:n{hello}
\l_tmpa_str
\ExplSyntaxOff
\end{document}
I don't get an error when I compile with latexmk -jobname=test -lualatex .\uppercasing_strings.tex
, but the content of the resulting pdf is not what I expect:
Furthermore, if I try str_show:N \l_tmpa_str
I get an error:
LaTeX3 Error: Variable '\l_tmpa_str' is not a valid str.
What am I doing wrong? How can I output the value of \l_tmpa_str
to both the terminal and my pdf?
Edit
Code
MWE bracing argument as per comments
\documentclass{article}
\begin{document}
\ExplSyntaxOn
\str_set:Nx {\l_tmpa_str} {\str_uppercase:n {hello}}
\str_show:N \l_tmpa_str
\ExplSyntaxOff
\end{document}
Error message
------------
Running 'lualatex -recorder --jobname="test" "./uppercasing_strings.tex"'
------------
This is LuaHBTeX, Version 1.15.0 (TeX Live 2022)
restricted system commands enabled.
(./uppercasing_strings.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-04-10>
(c:/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(c:/texlive/2022/texmf-dist/tex/latex/base/size10.clo))
(c:/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-luatex.def)
(./test.aux) (c:/texlive/2022/texmf-dist/tex/latex/base/ts1cmr.fd)
> \l_tmpa_str=HELLO.
<recently read> }
l.9 \str_show:N \l_tmpa_str
?