Debian Codegraph @

texmf-dist/tex/latex/textcase/textcase.sty

raw
1 %%
2 %% This is file `textcase.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% textcase.dtx (with options: `package')
8 %%
9 %% Source File: textcase.dtx
10 %% Copyright 1997 1998 2019 2022 2023 2025 David Carlisle
11 %%
12 %% This file may be distributed under the terms of the LPPL.
13 %% See 00readme.txt for details.
14 \NeedsTeXFormat{LaTeX2e}
15 \ProvidesPackage{textcase}
16 [2025/02/16 v1.05 Text only upper/lower case changing (DPC)]
17 \ifx\AddToNoCaseChangeList\@undefined\else
18 \DeclareOption{overload}{}
19 \ProcessOptions
20 \PackageInfo{textcase}{Defining Legacy names}
21 \ExplSyntaxOn
22 \cs_set_protected:Npn \reserved@a #1
23 {
24 \cs_generate_variant:cn { text_ \str_lowercase:n {#1} case:nn } { V }
25 \ExpandArgs { cnx } \NewExpandableDocumentCommand
26 { MakeText#1case }
27 { O{} +m }
28 { \exp_not:c { MakeText#1case \c_space_tl \c_space_tl \c_space_tl }
29 [####1] {####2} }
30 }
31 \reserved@a { Upper }
32 \reserved@a { Lower }
33 \IfFormatAtLeastTF{2024-11-12}{\def\textcase@case{case}}{\def\textcase@case{}}
34 \cs_new_protected:cpn {
35 MakeTextLowercase \c_space_tl \c_space_tl \c_space_tl } [#1] #2
36 {%{
37 \let \OE \oe
38 \@@text@case@aux { lower \textcase@case } {#1} {#2}
39 }%}
40 \cs_new_protected:cpn {
41 MakeTextUppercase \c_space_tl \c_space_tl \c_space_tl } [#1] #2
42 {%{
43 \let \oe \OE
44 \@@text@case@aux { upper \textcase@case } {#1} {#2}
45 }%}
46 \ExplSyntaxOff
47 \expandafter\endinput
48 \fi
49 \def\@uclcnotmath#1#2#3#4{\begingroup
50 #1%
51 \def\({$}\let\)\(%
52 \let\UTF@two@octets@noexpand\@empty
53 \let\UTF@three@octets@noexpand\@empty
54 \let\UTF@four@octets@noexpand\@empty
55 \def\NoCaseChange##1{\noexpand\NoCaseChange{\noexpand##1}}%
56 \@nonchangecase\label
57 \@nonchangecase\ref
58 \@nonchangecase\ensuremath
59 \def\cite##1##{\toks@{\noexpand\cite##1}\@citex}%
60 \def\@citex##1{\NoCaseChange{\the\toks@{##1}}}%
61 \def\reserved@a##1##2{\let#2\reserved@a}%
62 \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
63 \protected@edef\reserved@a{\endgroup
64 \noexpand\@skipmath#3#4$\valign$}%
65 \reserved@a}
66 \def\@nonchangecase#1{\def#1##1{\NoCaseChange{#1{##1}}}}
67 \let\NoCaseChange\@firstofone
68 \def\@skipmath#1#2$#3${%
69 \@skip@nonchangecase#1#2\NoCaseChange\valign
70 \ifx\valign#3%
71 \else
72 $#3$%
73 \expandafter\@skipmath\expandafter#1%
74 \fi}
75 \def\@skip@nonchangecase#1#2\NoCaseChange#3{%
76 #1{#2}%
77 \ifx\valign#3%
78 \else
79 #3%
80 \expandafter\@skip@nonchangecase\expandafter#1%
81 \fi}
82 \DeclareRobustCommand\MakeTextUppercase{%
83 \@uclcnotmath{\def\i{I}\def\j{J}}{##1##2}\uppercase}
84 \protected@edef\MakeTextUppercase#1{\MakeTextUppercase{#1}}
85 \DeclareRobustCommand\MakeTextLowercase{%
86 \@uclcnotmath{}{##2##1}\lowercase}
87 \protected@edef\MakeTextLowercase#1{\MakeTextLowercase{#1}}
88 \DeclareOption{overload}{%
89 \expandafter\let\csname MakeUppercase \expandafter\endcsname
90 \csname MakeTextUppercase \endcsname
91 \expandafter\let\csname MakeLowercase \expandafter\endcsname
92 \csname MakeTextLowercase \endcsname}
93 \ProcessOptions
94 \endinput
95 %%
96 %% End of file `textcase.sty'.