Skip to content

Commit

Permalink
NoCaseChange
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcarlisle committed Jun 2, 2022
1 parent 7658700 commit 82bf87a
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 6 deletions.
5 changes: 5 additions & 0 deletions base/changes.txt
Expand Up @@ -6,6 +6,11 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
================================================================================

2022-06-02 David Carlisle <David.Carlisle@latex-project.org>

* ltfinal.dtx: add \NoCaseChange (previously available in the
textcase package)

2022-05-27 David Carlisle <David.Carlisle@latex-project.org>

* ltfiles.dtx, ltoutenc.dtx:
Expand Down
2 changes: 1 addition & 1 deletion base/doc/ltnews35.tex
Expand Up @@ -519,7 +519,7 @@ \subsection{\cs{protected} UTF-8 character definitions}
Related to this change \cs{MakeUppercase} and \cs{MakeLowercase} have
been updated to use the Unicode-aware case changing functions
\cs{text\string_lowercase:n} in place of the \TeX\ primitive \cs{lowercase}.
A similar change will be made in the \pkg{textcase} package.
The \cs{NoCaseChange} command from the \pkg{textcase} package has also been added.

Note: for technical reasons these low-level character handling changes
will not be rolled back if the format version is rolled back using the
Expand Down
19 changes: 14 additions & 5 deletions base/ltfinal.dtx
Expand Up @@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltfinal.dtx}
[2022/04/21 v2.2t LaTeX Kernel (Final Settings)]
[2022/06/02 v2.2u LaTeX Kernel (Final Settings)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltfinal.dtx}
Expand Down Expand Up @@ -273,9 +273,9 @@
% \end{macro}
% \end{macro}
%
% \begin{macro}{trace_stack_levels}
% \begin{macro}{trace\string_stack\string_levels}
% Now define the Lua function to emulate \cs{tracingstacklevels} and
% install it in the \texttt{input_level_string} callback.
% install it in the |input_level_string| callback.
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
Expand Down Expand Up @@ -1064,6 +1064,7 @@
%
% \begin{macro}{\MakeUppercase}
% \begin{macro}{\MakeUppercase}
% \begin{macro}{\NoCaseChange}
% \begin{macro}{\@uclclist}
% \begin{macro}{\@expl@text@lowercase@@n}
% \begin{macro}{\@expl@text@uppercase@@n}
Expand Down Expand Up @@ -1091,10 +1092,17 @@
\ExplSyntaxOn
\protected\def\@expl@text@lowercase@@n{\text_lowercase:n}
\protected\def\@expl@text@uppercase@@n{\text_uppercase:n}
% \end{macrocode}
%
% \changes{v2.2u}{2022/06/02}{Add \cs{NoCaseChange}}
% |\NoCaseChange| protects its argument from the case change functions.
% \begin{macrocode}
\tl_put_right:Nn \l_text_case_exclude_arg_tl { \NoCaseChange }
\cs_new_protected:Npn \NoCaseChange #1 {#1}
\ExplSyntaxOff
% \end{macrocode}
%% \begin{macrocode}
%
% \begin{macrocode}
\DeclareRobustCommand{\MakeUppercase}[1]{{%
\def\i{I}\def\j{J}%
\def\reserved@a##1##2{\let##1##2\reserved@a}%
Expand Down Expand Up @@ -1151,6 +1159,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \changes{v1.0h}{1994/05/13}{Added output enc stuff}
% \changes{v1.0i}{1994/05/16}{moved output enc stuff to lfonts}
Expand Down
12 changes: 12 additions & 0 deletions base/testfiles/github-0838.lvt
@@ -0,0 +1,12 @@
\documentclass{article}

\input{test2e}
% adding \NoCaseChange

\begin{document}

\sbox0{\MakeUppercase{abc \NoCaseChange{lll}xyz}}

\START
\showbox0
\END
16 changes: 16 additions & 0 deletions base/testfiles/github-0838.tlg
@@ -0,0 +1,16 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
> \box...=
\hbox(6.94444+0.0)x54.58344
.\OT1/cmr/m/n/10 A
.\OT1/cmr/m/n/10 B
.\OT1/cmr/m/n/10 C
.\glue 3.33333 plus 1.66498 minus 1.11221
.\OT1/cmr/m/n/10 l
.\OT1/cmr/m/n/10 l
.\OT1/cmr/m/n/10 l
.\OT1/cmr/m/n/10 X
.\OT1/cmr/m/n/10 Y
.\OT1/cmr/m/n/10 Z
! OK.
l. ...\showbox0

0 comments on commit 82bf87a

Please sign in to comment.