| 1 |
%% |
| 2 |
%% This is file `gettitlestring.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% gettitlestring.dtx (with options: `package') |
| 8 |
%% |
| 9 |
%% This is a generated file. |
| 10 |
%% |
| 11 |
%% Project: gettitlestring |
| 12 |
%% Version: 2019/12/15 v1.6 |
| 13 |
%% |
| 14 |
%% Copyright (C) |
| 15 |
%% 2009, 2010 Heiko Oberdiek |
| 16 |
%% 2016-2019 Oberdiek Package Support Group |
| 17 |
%% |
| 18 |
%% This work may be distributed and/or modified under the |
| 19 |
%% conditions of the LaTeX Project Public License, either |
| 20 |
%% version 1.3c of this license or (at your option) any later |
| 21 |
%% version. This version of this license is in |
| 22 |
%% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 23 |
%% and the latest version of this license is in |
| 24 |
%% https://www.latex-project.org/lppl.txt |
| 25 |
%% and version 1.3 or later is part of all distributions of |
| 26 |
%% LaTeX version 2005/12/01 or later. |
| 27 |
%% |
| 28 |
%% This work has the LPPL maintenance status "maintained". |
| 29 |
%% |
| 30 |
%% The Current Maintainers of this work are |
| 31 |
%% Heiko Oberdiek and the Oberdiek Package Support Group |
| 32 |
%% https://github.com/ho-tex/gettitlestring/issues |
| 33 |
%% |
| 34 |
%% |
| 35 |
%% The Base Interpreter refers to any `TeX-Format', |
| 36 |
%% because some files are installed in TDS:tex/generic//. |
| 37 |
%% |
| 38 |
%% This work consists of the main source file gettitlestring.dtx |
| 39 |
%% and the derived files |
| 40 |
%% gettitlestring.sty, gettitlestring.pdf, gettitlestring.ins, |
| 41 |
%% gettitlestring.drv, gettitlestring-test1.tex, |
| 42 |
%% gettitlestring-test2.tex. |
| 43 |
%% |
| 44 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 45 |
\catcode13=5 % ^^M |
| 46 |
\endlinechar=13 % |
| 47 |
\catcode35=6 % # |
| 48 |
\catcode39=12 % ' |
| 49 |
\catcode44=12 % , |
| 50 |
\catcode45=12 % - |
| 51 |
\catcode46=12 % . |
| 52 |
\catcode58=12 % : |
| 53 |
\catcode64=11 % @ |
| 54 |
\catcode123=1 % { |
| 55 |
\catcode125=2 % } |
| 56 |
\expandafter\let\expandafter\x\csname [email protected]\endcsname |
| 57 |
\ifx\x\relax % plain-TeX, first loading |
| 58 |
\else |
| 59 |
\def\empty{}% |
| 60 |
\ifx\x\empty % LaTeX, first loading, |
| 61 |
% variable is initialized, but \ProvidesPackage not yet seen |
| 62 |
\else |
| 63 |
\expandafter\ifx\csname PackageInfo\endcsname\relax |
| 64 |
\def\x#1#2{% |
| 65 |
\immediate\write-1{Package #1 Info: #2.}% |
| 66 |
}% |
| 67 |
\else |
| 68 |
\def\x#1#2{\PackageInfo{#1}{#2, stopped}}% |
| 69 |
\fi |
| 70 |
\x{gettitlestring}{The package is already loaded}% |
| 71 |
\aftergroup\endinput |
| 72 |
\fi |
| 73 |
\fi |
| 74 |
\endgroup% |
| 75 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 76 |
\catcode13=5 % ^^M |
| 77 |
\endlinechar=13 % |
| 78 |
\catcode35=6 % # |
| 79 |
\catcode39=12 % ' |
| 80 |
\catcode40=12 % ( |
| 81 |
\catcode41=12 % ) |
| 82 |
\catcode44=12 % , |
| 83 |
\catcode45=12 % - |
| 84 |
\catcode46=12 % . |
| 85 |
\catcode47=12 % / |
| 86 |
\catcode58=12 % : |
| 87 |
\catcode64=11 % @ |
| 88 |
\catcode91=12 % [ |
| 89 |
\catcode93=12 % ] |
| 90 |
\catcode123=1 % { |
| 91 |
\catcode125=2 % } |
| 92 |
\expandafter\ifx\csname ProvidesPackage\endcsname\relax |
| 93 |
\def\x#1#2#3[#4]{\endgroup |
| 94 |
\immediate\write-1{Package: #3 #4}% |
| 95 |
\xdef#1{#4}% |
| 96 |
}% |
| 97 |
\else |
| 98 |
\def\x#1#2[#3]{\endgroup |
| 99 |
#2[{#3}]% |
| 100 |
\ifx#1\@undefined |
| 101 |
\xdef#1{#3}% |
| 102 |
\fi |
| 103 |
\ifx#1\relax |
| 104 |
\xdef#1{#3}% |
| 105 |
\fi |
| 106 |
}% |
| 107 |
\fi |
| 108 |
\expandafter\x\csname [email protected]\endcsname |
| 109 |
\ProvidesPackage{gettitlestring}% |
| 110 |
[2019/12/15 v1.6 Cleanup title references (HO)]% |
| 111 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 112 |
\catcode13=5 % ^^M |
| 113 |
\endlinechar=13 % |
| 114 |
\catcode123=1 % { |
| 115 |
\catcode125=2 % } |
| 116 |
\catcode64=11 % @ |
| 117 |
\def\x{\endgroup |
| 118 |
\expandafter\edef\csname GTS@AtEnd\endcsname{% |
| 119 |
\endlinechar=\the\endlinechar\relax |
| 120 |
\catcode13=\the\catcode13\relax |
| 121 |
\catcode32=\the\catcode32\relax |
| 122 |
\catcode35=\the\catcode35\relax |
| 123 |
\catcode61=\the\catcode61\relax |
| 124 |
\catcode64=\the\catcode64\relax |
| 125 |
\catcode123=\the\catcode123\relax |
| 126 |
\catcode125=\the\catcode125\relax |
| 127 |
}% |
| 128 |
}% |
| 129 |
\x\catcode61\catcode48\catcode32=10\relax% |
| 130 |
\catcode13=5 % ^^M |
| 131 |
\endlinechar=13 % |
| 132 |
\catcode35=6 % # |
| 133 |
\catcode64=11 % @ |
| 134 |
\catcode123=1 % { |
| 135 |
\catcode125=2 % } |
| 136 |
\def\TMP@EnsureCode#1#2{% |
| 137 |
\edef\GTS@AtEnd{% |
| 138 |
\GTS@AtEnd |
| 139 |
\catcode#1=\the\catcode#1\relax |
| 140 |
}% |
| 141 |
\catcode#1=#2\relax |
| 142 |
} |
| 143 |
\TMP@EnsureCode{42}{12}% * |
| 144 |
\TMP@EnsureCode{44}{12}% , |
| 145 |
\TMP@EnsureCode{45}{12}% - |
| 146 |
\TMP@EnsureCode{46}{12}% . |
| 147 |
\TMP@EnsureCode{47}{12}% / |
| 148 |
\TMP@EnsureCode{91}{12}% [ |
| 149 |
\TMP@EnsureCode{93}{12}% ] |
| 150 |
\edef\GTS@AtEnd{\GTS@AtEnd\noexpand\endinput} |
| 151 |
\RequirePackage{kvoptions}[2009/07/17] |
| 152 |
\SetupKeyvalOptions{% |
| 153 |
family=gettitlestring,% |
| 154 |
prefix=GTS@% |
| 155 |
} |
| 156 |
\newcommand*{\GetTitleStringSetup}{% |
| 157 |
\setkeys{gettitlestring}% |
| 158 |
} |
| 159 |
\DeclareBoolOption{expand} |
| 160 |
\InputIfFileExists{gettitlestring.cfg}{}{} |
| 161 |
\ProcessKeyvalOptions*\relax |
| 162 |
\newcommand*{\GetTitleString}{% |
| 163 |
\ifGTS@expand |
| 164 |
\expandafter\GetTitleStringExpand |
| 165 |
\else |
| 166 |
\expandafter\GetTitleStringNonExpand |
| 167 |
\fi |
| 168 |
} |
| 169 |
\newcommand{\GetTitleStringExpand}[1]{% |
| 170 |
\def\GetTitleStringResult{#1}% |
| 171 |
\begingroup |
| 172 |
\GTS@DisablePredefinedCmds |
| 173 |
\GTS@DisableHook |
| 174 |
\edef\x{\endgroup |
| 175 |
\noexpand\def\noexpand\GetTitleStringResult{% |
| 176 |
\GetTitleStringResult |
| 177 |
}% |
| 178 |
}% |
| 179 |
\x |
| 180 |
} |
| 181 |
\newcommand{\GetTitleStringNonExpand}[1]{% |
| 182 |
\def\GetTitleStringResult{#1}% |
| 183 |
\global\let\GTS@GlobalString\GetTitleStringResult |
| 184 |
\begingroup |
| 185 |
\GTS@RemoveLeft |
| 186 |
\GTS@RemoveRight |
| 187 |
\endgroup |
| 188 |
\let\GetTitleStringResult\GTS@GlobalString |
| 189 |
} |
| 190 |
\def\GTS@DisablePredefinedCmds{% |
| 191 |
\let\label\@gobble |
| 192 |
\let\zlabel\@gobble |
| 193 |
\let\zref@label\@gobble |
| 194 |
\let\zref@labelbylist\@gobbletwo |
| 195 |
\let\zref@labelbyprops\@gobbletwo |
| 196 |
\let\index\@gobble |
| 197 |
\let\glossary\@gobble |
| 198 |
\let\markboth\@gobbletwo |
| 199 |
\let\@mkboth\@gobbletwo |
| 200 |
\let\markright\@gobble |
| 201 |
\let\phantomsection\@empty |
| 202 |
\def\addcontentsline{\expandafter\@gobble\@gobbletwo}% |
| 203 |
\let\raggedright\@empty |
| 204 |
\let\raggedleft\@empty |
| 205 |
\let\centering\@empty |
| 206 |
\let\protect\@unexpandable@protect |
| 207 |
\let\enit@format\@empty % package enumitem |
| 208 |
} |
| 209 |
\providecommand*{\GTS@DisableHook}{} |
| 210 |
\def\GetTitleStringDisableCommands{% |
| 211 |
\begingroup |
| 212 |
\makeatletter |
| 213 |
\GTS@DisableCommands |
| 214 |
} |
| 215 |
\long\def\GTS@DisableCommands#1{% |
| 216 |
\toks0=\expandafter{\GTS@DisableHook}% |
| 217 |
\toks2={#1}% |
| 218 |
\xdef\GTS@GlobalString{\the\toks0 \the\toks2}% |
| 219 |
\endgroup |
| 220 |
\let\GTS@DisableHook\GTS@GlobalString |
| 221 |
} |
| 222 |
\def\GTS@RemoveLeft{% |
| 223 |
\toks@\expandafter\expandafter\expandafter{% |
| 224 |
\expandafter\GTS@Car\GTS@GlobalString{}{}{}{}\GTS@Nil |
| 225 |
}% |
| 226 |
\edef\GTS@Token{\the\toks@}% |
| 227 |
\GTS@PredefinedLeftCmds |
| 228 |
\expandafter\futurelet\expandafter\GTS@Token |
| 229 |
\expandafter\GTS@TestLeftSpace\GTS@GlobalString\GTS@Nil |
| 230 |
\GTS@End |
| 231 |
} |
| 232 |
\def\GTS@End{} |
| 233 |
\long\def\GTS@TestLeft#1#2{% |
| 234 |
\def\GTS@temp{#1}% |
| 235 |
\ifx\GTS@temp\GTS@Token |
| 236 |
\toks@\expandafter\expandafter\expandafter{% |
| 237 |
\expandafter#2\GTS@GlobalString\GTS@Nil |
| 238 |
}% |
| 239 |
\expandafter\GTS@TestLeftEnd |
| 240 |
\fi |
| 241 |
} |
| 242 |
\long\def\GTS@TestLeftEnd#1\GTS@End{% |
| 243 |
\xdef\GTS@GlobalString{\the\toks@}% |
| 244 |
\GTS@RemoveLeft |
| 245 |
} |
| 246 |
\long\def\GTS@Car#1#2\GTS@Nil{#1} |
| 247 |
\long\def\GTS@Cdr#1#2\GTS@Nil{#2} |
| 248 |
\long\def\GTS@CdrTwo#1#2#3\GTS@Nil{#3} |
| 249 |
\long\def\GTS@CdrThree#1#2#3#4\GTS@Nil{#4} |
| 250 |
\long\def\GTS@CdrFour#1#2#3#4#5\GTS@Nil{#5} |
| 251 |
\long\def\GTS@TestLeftSpace#1\GTS@Nil{% |
| 252 |
\ifx\GTS@Token\@sptoken |
| 253 |
\toks@\expandafter{% |
| 254 |
\romannumeral-0\GTS@GlobalString |
| 255 |
}% |
| 256 |
\expandafter\GTS@TestLeftEnd |
| 257 |
\fi |
| 258 |
} |
| 259 |
\def\GTS@PredefinedLeftCmds{% |
| 260 |
\GTS@TestLeft\Hy@phantomsection\GTS@Cdr |
| 261 |
\GTS@TestLeft\Hy@SectionAnchor\GTS@Cdr |
| 262 |
\GTS@TestLeft\Hy@SectionAnchorHref\GTS@CdrTwo |
| 263 |
\GTS@TestLeft\label\GTS@CdrTwo |
| 264 |
\GTS@TestLeft\zlabel\GTS@CdrTwo |
| 265 |
\GTS@TestLeft\index\GTS@CdrTwo |
| 266 |
\GTS@TestLeft\glossary\GTS@CdrTwo |
| 267 |
\GTS@TestLeft\markboth\GTS@CdrThree |
| 268 |
\GTS@TestLeft\@mkboth\GTS@CdrThree |
| 269 |
\GTS@TestLeft\addcontentsline\GTS@CdrFour |
| 270 |
\GTS@TestLeft\enit@format\GTS@Cdr % package enumitem |
| 271 |
} |
| 272 |
\def\GTS@RemoveRight{% |
| 273 |
\toks@{}% |
| 274 |
\expandafter\GTS@TestRightLabel\GTS@GlobalString |
| 275 |
\label{}\GTS@Nil\@nil |
| 276 |
\GTS@RemoveRightSpace |
| 277 |
} |
| 278 |
\begingroup |
| 279 |
\def\GTS@temp#1{\endgroup |
| 280 |
\def\GTS@RemoveRightSpace{% |
| 281 |
\expandafter\GTS@TestRightSpace\GTS@GlobalString |
| 282 |
\GTS@Nil#1\GTS@Nil\@nil |
| 283 |
}% |
| 284 |
}% |
| 285 |
\GTS@temp{ } |
| 286 |
\def\GTS@TestRightSpace#1 \GTS@Nil#2\@nil{% |
| 287 |
\ifx\relax#2\relax |
| 288 |
\else |
| 289 |
\gdef\GTS@GlobalString{#1}% |
| 290 |
\expandafter\GTS@RemoveRightSpace |
| 291 |
\fi |
| 292 |
} |
| 293 |
\def\GTS@TestRightLabel#1\label#2#3\GTS@Nil#4\@nil{% |
| 294 |
\def\GTS@temp{#3}% |
| 295 |
\ifx\GTS@temp\@empty |
| 296 |
\expandafter\gdef\expandafter\GTS@GlobalString\expandafter{% |
| 297 |
\the\toks@ |
| 298 |
#1% |
| 299 |
}% |
| 300 |
\expandafter\@gobble |
| 301 |
\else |
| 302 |
\expandafter\@firstofone |
| 303 |
\fi |
| 304 |
{% |
| 305 |
\toks@\expandafter{\the\toks@#1}% |
| 306 |
\GTS@TestRightLabel#3\GTS@Nil\@nil |
| 307 |
}% |
| 308 |
} |
| 309 |
\GTS@AtEnd% |
| 310 |
%% \section{Installation} |
| 311 |
\endinput |
| 312 |
%% |
| 313 |
%% End of file `gettitlestring.sty'. |