Skip to content

Commit

Permalink
Support \noexpand in \MakeUpper/Lowercase
Browse files Browse the repository at this point in the history
We need to ensure these survive the expander inside
the expl3 code, which is done most readily by suppressing
that code entirely using \unexpanded.
  • Loading branch information
josephwright committed Apr 21, 2022
1 parent 9b515d6 commit 4d5db49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
================================================================================

2022-04-21 Joseph Wright <Joseph.Wright@latex-project.org>

* ltfinal.dtx (subsection{Lccodes and uccodes}):
Support \noexpand in arg. to \MakeUppercase and
\MakeLowercase

2022-04-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org>

* ltmath.dtx (subsubsection{The UNSORTED Rest}):
Expand Down
7 changes: 4 additions & 3 deletions base/ltfinal.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltfinal.dtx}
[2022/04/03 v2.2s LaTeX Kernel (Final Settings)]
[2022/04/21 v2.2t LaTeX Kernel (Final Settings)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltfinal.dtx}
Expand Down Expand Up @@ -1104,14 +1104,15 @@
% \changes{v2.1h}{2019/09/14}{Expand UTF8 chars when case changing (github/177)}
% \changes{v2.2r}{2022/02/20}
% {Use \cs{@expl@text@uppercase@@n}, removing local redefinition of \cs{UTF@two@octets@noexpand}}%
% \changes{v2.2t}{2022/04/21}{Support \cs{noexpand} in argument of \cs{@expl@text@uppercase@@n}}
% \begin{macrocode}
\protected@edef\reserved@a{\@expl@text@uppercase@@n{#1}}%
\protected@edef\reserved@a{\@expl@text@uppercase@@n{\noexpand\unexpanded{#1}}}%
\reserved@a
}}
\DeclareRobustCommand{\MakeLowercase}[1]{{%
\def\reserved@a##1##2{\let##2##1\reserved@a}%
\expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
\protected@edef\reserved@a{\@expl@text@lowercase@@n{#1}}%
\protected@edef\reserved@a{\@expl@text@lowercase@@n{\noexpand\unexpanded{#1}}}%
\reserved@a
}}
% \end{macrocode}
Expand Down

0 comments on commit 4d5db49

Please sign in to comment.