I'd like to define a command that functions like:
\def\foo#1{...} % function over single letters (e.g. making upper cases)
\def\bar#1{...} % function over a paragraph by replacing each single letter with \foo
How can I reach this purpose?
It seems that the following codes work:
\def\bar<#1#2>{\foo{#1}\if&\else\bar<#2>\fi}
And \bar<Hello> will obtain HELLO if we define \def\foo\uppercase.
However, this cannot read spaces. \bar<Hello World> will obtain HELLOWORLD.
\bar, but I don't know how. – OrthoPole Apr 04 '23 at 07:44\letterAafter\let\letterA=A? How to handle expandable tokens where expansion at some point might deliver letters? Might multibyte-utf-8-characters on a traditional 8-bit-TeX-engine be an issue? || You might be interested in l3regex. – Ulrich Diez Apr 04 '23 at 08:37\everypar, which runs at the begining of the next paragraph. – John Kormylo Apr 04 '23 at 12:09