-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle hash symbols properly in \eappto #38
base: main
Are you sure you want to change the base?
Conversation
I'm afraid we can't use I'm also not really sure that hash symbols are intended to be supported anyway - |
Well, that's very unfortunate, as So after hours of googling, I just came across this SE answer which sadly and ironically comes up with The second answer in that same post suggests an alternative "for less recent TeX engines where [...] \newrobustcmd{\eappto}[2]{%
\ifundef{#1}
{\edef#1{\scantokens{#2\noexpand}}}
{\edef#1{\expandonce#1\scantokens{#2\noexpand}}}} Now, Ulrich Diez mentions in that answer the side effect of |
Sorry, I missed this part. While most of the usage would be for simple tokens, still the current implementation does support hash symbols for |
Well on a second look, the above method doesn't work when From the documentations, The \edef#1{\expandonce#1\expandonce{\romannumeral\__exp_e:nn{#2}{}}} is exactly the behaviour we want, but I'm not sure about your opinion on using expl3 (or reimplementing |
Currently,
\eappto
(and\epreto
,\xappto
, etc.) requires hash symbols#
to be doubled, which is definitely an unintended behaviour since the command to expand cannot have arguments in the first place.Consider the following examples.
Handling of hash symbols in
\appto
works as it should:However, to achieve the same thing with
\eappto
, you need to double the hash symbols:That would only make sense if
#1
had a meaning within the second argument of\eappto
.Obviously, it cannot have any meaning, since
testD
cannot have any arguments to be used with\eappto
in the first place.