| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% File: selinput.dtx |
| 4 |
% Version: 2019-12-10 v1.6 |
| 5 |
% Info: Semi-automatic input encoding detection |
| 6 |
% |
| 7 |
% Copyright (C) |
| 8 |
% 2007 Heiko Oberdiek |
| 9 |
% 2016-2019 Oberdiek Package Support Group |
| 10 |
% https://github.com/ho-tex/selinput/issues |
| 11 |
% |
| 12 |
% This work may be distributed and/or modified under the |
| 13 |
% conditions of the LaTeX Project Public License, either |
| 14 |
% version 1.3c of this license or (at your option) any later |
| 15 |
% version. This version of this license is in |
| 16 |
% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 17 |
% and the latest version of this license is in |
| 18 |
% https://www.latex-project.org/lppl.txt |
| 19 |
% and version 1.3 or later is part of all distributions of |
| 20 |
% LaTeX version 2005/12/01 or later. |
| 21 |
% |
| 22 |
% This work has the LPPL maintenance status "maintained". |
| 23 |
% |
| 24 |
% The Current Maintainers of this work are |
| 25 |
% Heiko Oberdiek and the Oberdiek Package Support Group |
| 26 |
% https://github.com/ho-tex/selinput/issues |
| 27 |
% |
| 28 |
% This work consists of the main source file selinput.dtx |
| 29 |
% and the derived files |
| 30 |
% selinput.sty, selinput.pdf, selinput.ins, selinput.drv, |
| 31 |
% selinput-test1.tex, selinput-test2.tex, selinput-test3.tex, |
| 32 |
% selinput-test4.tex, selinput-test5.tex. |
| 33 |
% |
| 34 |
% Distribution: |
| 35 |
% CTAN:macros/latex/contrib/selinput/selinput.dtx |
| 36 |
% CTAN:macros/latex/contrib/selinput/selinput.pdf |
| 37 |
% |
| 38 |
% Unpacking: |
| 39 |
% (a) If selinput.ins is present: |
| 40 |
% tex selinput.ins |
| 41 |
% (b) Without selinput.ins: |
| 42 |
% tex selinput.dtx |
| 43 |
% (c) If you insist on using LaTeX |
| 44 |
% latex \let\install=y\input{selinput.dtx} |
| 45 |
% (quote the arguments according to the demands of your shell) |
| 46 |
% |
| 47 |
% Documentation: |
| 48 |
% (a) If selinput.drv is present: |
| 49 |
% latex selinput.drv |
| 50 |
% (b) Without selinput.drv: |
| 51 |
% latex selinput.dtx; ... |
| 52 |
% The class ltxdoc loads the configuration file ltxdoc.cfg |
| 53 |
% if available. Here you can specify further options, e.g. |
| 54 |
% use A4 as paper format: |
| 55 |
% \PassOptionsToClass{a4paper}{article} |
| 56 |
% |
| 57 |
% Programm calls to get the documentation (example): |
| 58 |
% pdflatex selinput.dtx |
| 59 |
% makeindex -s gind.ist selinput.idx |
| 60 |
% pdflatex selinput.dtx |
| 61 |
% makeindex -s gind.ist selinput.idx |
| 62 |
% pdflatex selinput.dtx |
| 63 |
% |
| 64 |
% Installation: |
| 65 |
% TDS:tex/latex/selinput/selinput.sty |
| 66 |
% TDS:doc/latex/selinput/selinput.pdf |
| 67 |
% TDS:source/latex/selinput/selinput.dtx |
| 68 |
% |
| 69 |
%<*ignore> |
| 70 |
\begingroup |
| 71 |
\catcode123=1 % |
| 72 |
\catcode125=2 % |
| 73 |
\def\x{LaTeX2e}% |
| 74 |
\expandafter\endgroup |
| 75 |
\ifcase 0\ifx\install y1\fi\expandafter |
| 76 |
\ifx\csname processbatchFile\endcsname\relax\else1\fi |
| 77 |
\ifx\fmtname\x\else 1\fi\relax |
| 78 |
\else\csname fi\endcsname |
| 79 |
%</ignore> |
| 80 |
%<*install> |
| 81 |
\input docstrip.tex |
| 82 |
\Msg{************************************************************************} |
| 83 |
\Msg{* Installation} |
| 84 |
\Msg{* Package: selinput 2019-12-10 v1.6 Semi-automatic input encoding detection (HO)} |
| 85 |
\Msg{************************************************************************} |
| 86 |
|
| 87 |
\keepsilent |
| 88 |
\askforoverwritefalse |
| 89 |
|
| 90 |
\let\MetaPrefix\relax |
| 91 |
\preamble |
| 92 |
|
| 93 |
This is a generated file. |
| 94 |
|
| 95 |
Project: selinput |
| 96 |
Version: 2019-12-10 v1.6 |
| 97 |
|
| 98 |
Copyright (C) |
| 99 |
2007 Heiko Oberdiek |
| 100 |
2016-2019 Oberdiek Package Support Group |
| 101 |
|
| 102 |
This work may be distributed and/or modified under the |
| 103 |
conditions of the LaTeX Project Public License, either |
| 104 |
version 1.3c of this license or (at your option) any later |
| 105 |
version. This version of this license is in |
| 106 |
https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 107 |
and the latest version of this license is in |
| 108 |
https://www.latex-project.org/lppl.txt |
| 109 |
and version 1.3 or later is part of all distributions of |
| 110 |
LaTeX version 2005/12/01 or later. |
| 111 |
|
| 112 |
This work has the LPPL maintenance status "maintained". |
| 113 |
|
| 114 |
The Current Maintainers of this work are |
| 115 |
Heiko Oberdiek and the Oberdiek Package Support Group |
| 116 |
https://github.com/ho-tex/selinput/issues |
| 117 |
|
| 118 |
|
| 119 |
This work consists of the main source file selinput.dtx |
| 120 |
and the derived files |
| 121 |
selinput.sty, selinput.pdf, selinput.ins, selinput.drv, |
| 122 |
selinput-test1.tex, selinput-test2.tex, selinput-test3.tex, |
| 123 |
selinput-test4.tex, selinput-test5.tex. |
| 124 |
|
| 125 |
\endpreamble |
| 126 |
\let\MetaPrefix\DoubleperCent |
| 127 |
|
| 128 |
\generate{% |
| 129 |
\file{selinput.ins}{\from{selinput.dtx}{install}}% |
| 130 |
\file{selinput.drv}{\from{selinput.dtx}{driver}}% |
| 131 |
\usedir{tex/latex/selinput}% |
| 132 |
\file{selinput.sty}{\from{selinput.dtx}{package}}% |
| 133 |
} |
| 134 |
|
| 135 |
\catcode32=13\relax% active space |
| 136 |
\let =\space% |
| 137 |
\Msg{************************************************************************} |
| 138 |
\Msg{*} |
| 139 |
\Msg{* To finish the installation you have to move the following} |
| 140 |
\Msg{* file into a directory searched by TeX:} |
| 141 |
\Msg{*} |
| 142 |
\Msg{* selinput.sty} |
| 143 |
\Msg{*} |
| 144 |
\Msg{* To produce the documentation run the file `selinput.drv'} |
| 145 |
\Msg{* through LaTeX.} |
| 146 |
\Msg{*} |
| 147 |
\Msg{* Happy TeXing!} |
| 148 |
\Msg{*} |
| 149 |
\Msg{************************************************************************} |
| 150 |
|
| 151 |
\endbatchfile |
| 152 |
%</install> |
| 153 |
%<*ignore> |
| 154 |
\fi |
| 155 |
%</ignore> |
| 156 |
%<*driver> |
| 157 |
\NeedsTeXFormat{LaTeX2e} |
| 158 |
\ProvidesFile{selinput.drv}% |
| 159 |
[2019-12-10 v1.6 Semi-automatic input encoding detection (HO)]% |
| 160 |
\documentclass{ltxdoc} |
| 161 |
\ifx\Umathcode\undefined |
| 162 |
\usepackage[T1]{fontenc} |
| 163 |
\fi |
| 164 |
\usepackage{textcomp} |
| 165 |
\usepackage{lmodern} |
| 166 |
\usepackage{holtxdoc}[2011/11/22] |
| 167 |
\usepackage{color} |
| 168 |
\begin{document} |
| 169 |
\DocInput{selinput.dtx}% |
| 170 |
\end{document} |
| 171 |
%</driver> |
| 172 |
% \fi |
| 173 |
% |
| 174 |
% |
| 175 |
% |
| 176 |
% \GetFileInfo{selinput.drv} |
| 177 |
% |
| 178 |
% \title{The \xpackage{selinput} package} |
| 179 |
% \date{2019-12-10 v1.6} |
| 180 |
% \author{Heiko Oberdiek\thanks |
| 181 |
% {Please report any issues at \url{https://github.com/ho-tex/selinput/issues}}} |
| 182 |
% |
| 183 |
% \maketitle |
| 184 |
% |
| 185 |
% \begin{abstract} |
| 186 |
% This package selects the input encoding by specifying between |
| 187 |
% input characters and their glyph names. |
| 188 |
% \end{abstract} |
| 189 |
% |
| 190 |
% \tableofcontents |
| 191 |
% |
| 192 |
% \newcommand*{\EM}{\textcolor{blue}} |
| 193 |
% \newcommand*{\ExampleText}{^^A |
| 194 |
% Umlauts:\ \EM{\"A\"O\"U\"a\"o\"u\ss}^^A |
| 195 |
% } |
| 196 |
% |
| 197 |
% \section{Documentation} |
| 198 |
% |
| 199 |
% \subsection{Introduction} |
| 200 |
% |
| 201 |
% \LaTeX\ supports the direct use of 8-bit characters by means |
| 202 |
% of package \xpackage{inputenc}. However you must know |
| 203 |
% and specify the encoding, e.g.: |
| 204 |
% \begin{quote} |
| 205 |
% \ttfamily |
| 206 |
% |\documentclass{article}|\\ |
| 207 |
% |\usepackage[|\EM{latin1}|]{inputenc}|\\ |
| 208 |
% |% or \usepackage[|\EM{utf8}|]{inputenc}|\\ |
| 209 |
% |% or \usepackage[|\EM{??}|]{inputenc}|\\ |
| 210 |
% |\begin{document}|\\ |
| 211 |
% | |\ExampleText\\ |
| 212 |
% |\end{document}| |
| 213 |
% \end{quote} |
| 214 |
% |
| 215 |
% If the document is transferred in an environment that |
| 216 |
% uses a different encoding, then there are programs that |
| 217 |
% convert the input characters. Examples for conversion |
| 218 |
% of file \xfile{test.tex} |
| 219 |
% from encoding latin1 (ISO-8859-1) to UTF-8: |
| 220 |
% \begin{quote} |
| 221 |
% \ttfamily |
| 222 |
% |recode ISO-8859-1..UTF-8 test.tex|\\ |
| 223 |
% |recode latin1..utf8 test.tex|\\ |
| 224 |
% |iconv --from-code ISO-8859-1|\\ |
| 225 |
% \hphantom{iconv}| --to-code UTF-8|\\ |
| 226 |
% \hphantom{iconv}| --output testnew.tex|\\ |
| 227 |
% \hphantom{iconv}| test.tex|\\ |
| 228 |
% |iconv -f latin1 -t utf8 -o testnew.tex test.tex| |
| 229 |
% \end{quote} |
| 230 |
% However, the encoding name for package \xpackage{inputenc} |
| 231 |
% must be changed: |
| 232 |
% \begin{quote} |
| 233 |
% |\usepackage[latin1]{inputenc}| $\rightarrow$ |
| 234 |
% |\usepackage[utf8]{inputenc}|\kern-4pt\relax |
| 235 |
% \end{quote} |
| 236 |
% Of course, unless you are using some clever editor |
| 237 |
% that knows package \xpackage{inputenc}, recodes |
| 238 |
% the file and adjusts the option at the same time. |
| 239 |
% But most editors can perhaps recode the file, but |
| 240 |
% they let the option untouched. |
| 241 |
% |
| 242 |
% Therefore package \xpackage{selinput} chooses another way for |
| 243 |
% specifying the input encoding. The encoding name is not needed |
| 244 |
% at all. Some 8-bit characters are identified by their glyph |
| 245 |
% name and the package chooses an appropriate encoding, example: |
| 246 |
% \begin{quote} |
| 247 |
% \ttfamily |
| 248 |
% |\documentclass{article}|\\ |
| 249 |
% |\usepackage{selinput}|\\ |
| 250 |
% |\SelectInputMappings{|\\ |
| 251 |
% | adieresis={|\EM{\"a}|}|,\\ |
| 252 |
% | germandbls={|\EM{\ss}|}|,\\ |
| 253 |
% | Euro={|\EM{\texteuro}|}|,\\ |
| 254 |
% |}|\\ |
| 255 |
% |\begin{document}|\\ |
| 256 |
% | |\ExampleText\\ |
| 257 |
% |\end{document}| |
| 258 |
% \end{quote} |
| 259 |
% |
| 260 |
% \subsection{User interface} |
| 261 |
% |
| 262 |
% \begin{declcs}{SelectInputEncodingList} \M{encoding list} |
| 263 |
% \end{declcs} |
| 264 |
% \cs{SelectInputEncodingList} expects a comma separated list of |
| 265 |
% encoding names. Example: |
| 266 |
% \begin{quote} |
| 267 |
% |\SelectInputEncodingList{utf8,ansinew,mac-roman}| |
| 268 |
% \end{quote} |
| 269 |
% The encodings of package \xpackage{inputenx} are used as default. |
| 270 |
% |
| 271 |
% \begin{declcs}{SelectInputMappings} \M{mapping pairs} |
| 272 |
% \end{declcs} |
| 273 |
% A mapping pair consists of a glyph name and its input |
| 274 |
% character: |
| 275 |
% \begin{quote} |
| 276 |
% |\SelectInputMappings{|\\ |
| 277 |
% | adieresis={|\EM{\"a}|}|,\\ |
| 278 |
% | germandbls={|\EM{\ss}|}|,\\ |
| 279 |
% | Euro={|\EM{\texteuro}|}|,\\ |
| 280 |
% |}| |
| 281 |
% \end{quote} |
| 282 |
% The supported glyph names can be found in file \xfile{ix-name.def} |
| 283 |
% of project \xpackage{inputenx} \cite{inputenx}. The names are |
| 284 |
% basically taken from Adobe's glyphlists \cite{adobe:glyphlist,adobe:aglfn}. |
| 285 |
% As many pairs are needed as necessary to identify the encoding. |
| 286 |
% Example with insufficient pairs: |
| 287 |
% \begin{quote} |
| 288 |
% \ttfamily |
| 289 |
% |\SelectInputEncodingSet{latin1,latin9}|\\ |
| 290 |
% |\SelectInputMappings{|\\ |
| 291 |
% | adieresis={|\EM{\"a}|}|,\\ |
| 292 |
% | germandbls={|\EM{\ss}|}|,\\ |
| 293 |
% |}|\\ |
| 294 |
% \ExampleText| and Euro: |\EM{\textcurrency} (wrong) |
| 295 |
% \end{quote} |
| 296 |
% The first encoding \xoption{latin1} passes the constraints given |
| 297 |
% by the mapping pairs. However the Euro symbol is not part of |
| 298 |
% the encoding. Thus a mapping pair with the Euro symbol |
| 299 |
% solves the problem. In fact the symbol alone already succeeds in selecting |
| 300 |
% between \xoption{latin1} and \xoption{latin9}: |
| 301 |
% \begin{quote} |
| 302 |
% \ttfamily |
| 303 |
% |\SelectInputEncodingSet{latin1,latin9}|\\ |
| 304 |
% |\SelectInputMappings{|\\ |
| 305 |
% | Euro={|\EM{\texteuro}|},|\\ |
| 306 |
% |}|\\ |
| 307 |
% \ExampleText| and Euro: |\EM{\texteuro} |
| 308 |
% \end{quote} |
| 309 |
% |
| 310 |
% \subsection{Options} |
| 311 |
% |
| 312 |
% \begin{description} |
| 313 |
% \item[\xoption{warning}:] |
| 314 |
% The selected encoding is written |
| 315 |
% by \cs{PackageInfo} into the \xfile{.log} file only. |
| 316 |
% Option \xoption{warning} changes it to \cs{PackageWarning}. |
| 317 |
% Then the selected encoding is shown on the terminal as well. |
| 318 |
% \item[\xoption{ucs}:] |
| 319 |
% The encoding file \xfile{utf8x} of package \cs{ucs} requires |
| 320 |
% that the package itself is loaded before. |
| 321 |
% If the package is not loaded, then the option \xoption{ucs} |
| 322 |
% will load package \xpackage{ucs} if the detected encoding is |
| 323 |
% UTF-8 (limited to the preamble, packages cannot be loaded later). |
| 324 |
% \item[\xoption{utf8=\dots}:] |
| 325 |
% The option allows to specify other encoding files |
| 326 |
% for UTF-8 than \LaTeX's \xfile{utf8.def}. For example, |
| 327 |
% |utf8=utf-8| will load \xfile{utf-8.def} instead. |
| 328 |
% \end{description} |
| 329 |
% |
| 330 |
% \subsection{Encodings} |
| 331 |
% |
| 332 |
% Package \xpackage{stringenc} \cite{stringenc} |
| 333 |
% is used for testing the encoding. Thus the encoding |
| 334 |
% name must be known by this package. Then the found |
| 335 |
% encoding is loaded by \cs{inputencoding} by package |
| 336 |
% \xpackage{inputenc} or \cs{InputEncoding} if package |
| 337 |
% \xpackage{inputenx} is loaded. |
| 338 |
% |
| 339 |
% The supported encodings are present in the encoding list, |
| 340 |
% thus usually the encoding names do not matter. |
| 341 |
% If the list is set by \cs{SelectInputEncodingList}, |
| 342 |
% then you can use the names that work for package |
| 343 |
% \xpackage{inputenc} and are known by package \xpackage{stringenc}, |
| 344 |
% for example: \xoption{latin1}, \xoption{x-iso-8859-1}. Encoding |
| 345 |
% file names of package \xpackage{inputenx} are prefixed with \xfile{x-}. |
| 346 |
% The prefix can be dropped, if package \xpackage{inputenx} is loaded. |
| 347 |
% |
| 348 |
% \StopEventually{ |
| 349 |
% } |
| 350 |
% |
| 351 |
% \section{Implementation} |
| 352 |
% |
| 353 |
% \begin{macrocode} |
| 354 |
%<*package> |
| 355 |
\NeedsTeXFormat{LaTeX2e} |
| 356 |
\ProvidesPackage{selinput} |
| 357 |
[2019-12-10 v1.6 Semi-automatic input encoding detection (HO)]% |
| 358 |
% \end{macrocode} |
| 359 |
% |
| 360 |
% \begin{macrocode} |
| 361 |
\RequirePackage{inputenc} |
| 362 |
\RequirePackage{kvsetkeys}[2006/10/19] |
| 363 |
\RequirePackage{stringenc}[2007/06/16] |
| 364 |
\RequirePackage{kvoptions} |
| 365 |
% \end{macrocode} |
| 366 |
% \begin{macro}{\SelectInputEncodingList} |
| 367 |
% \begin{macrocode} |
| 368 |
\newcommand*{\SelectInputEncodingList}{% |
| 369 |
\let\SIE@EncodingList\@empty |
| 370 |
\kvsetkeys{SelInputEnc}% |
| 371 |
} |
| 372 |
% \end{macrocode} |
| 373 |
% \end{macro} |
| 374 |
% \begin{macro}{\SelectInputMappings} |
| 375 |
% \begin{macrocode} |
| 376 |
\newcommand*{\SelectInputMappings}[1]{% |
| 377 |
\SIE@LoadNameDefs |
| 378 |
\let\SIE@StringUnicode\@empty |
| 379 |
\let\SIE@StringDest\@empty |
| 380 |
\kvsetkeys{SelInputMap}{#1}% |
| 381 |
\ifx\\SIE@StringUnicode\SIE@StringDest\\% |
| 382 |
\PackageError{selinput}{% |
| 383 |
No mappings specified% |
| 384 |
}\@ehc |
| 385 |
\else |
| 386 |
\EdefUnescapeHex\SIE@StringUnicode\SIE@StringUnicode |
| 387 |
\let\SIE@Encoding\@empty |
| 388 |
\@for\SIE@EncodingTest:=\SIE@EncodingList\do{% |
| 389 |
\ifx\SIE@Encoding\@empty |
| 390 |
\StringEncodingConvertTest\SIE@temp\SIE@StringUnicode |
| 391 |
{utf16be}\SIE@EncodingTest{% |
| 392 |
\ifx\SIE@temp\SIE@StringDest |
| 393 |
\let\SIE@Encoding\SIE@EncodingTest |
| 394 |
\fi |
| 395 |
}{}% |
| 396 |
\fi |
| 397 |
}% |
| 398 |
\ifx\SIE@Encoding\@empty |
| 399 |
\StringEncodingConvertTest\SIE@temp\SIE@StringDest |
| 400 |
{ascii}{utf16be}{% |
| 401 |
\def\SIE@Encoding{ascii}% |
| 402 |
\SIE@Info{selinput}{% |
| 403 |
Matching encoding not found, but input characters% |
| 404 |
\MessageBreak |
| 405 |
are 7-bit (possibly editor replacements).% |
| 406 |
\MessageBreak |
| 407 |
Hence using ascii encoding% |
| 408 |
}% |
| 409 |
}{}% |
| 410 |
\fi |
| 411 |
\ifx\SIE@Encoding\@empty |
| 412 |
\PackageError{selinput}{% |
| 413 |
Cannot find a matching encoding% |
| 414 |
}\@ehd |
| 415 |
\else |
| 416 |
\ifx\SIE@Encoding\SIE@EncodingUTFviii |
| 417 |
\SIE@LoadUnicodePackage |
| 418 |
\ifx\SIE@UseUTFviii\@empty |
| 419 |
\else |
| 420 |
\let\SIE@Encoding\SIE@UseUTFviii |
| 421 |
\fi |
| 422 |
\fi |
| 423 |
\begingroup\expandafter\expandafter\expandafter\endgroup |
| 424 |
\expandafter\ifx\csname InputEncoding\endcsname\relax |
| 425 |
\inputencoding\SIE@Encoding |
| 426 |
\else |
| 427 |
\InputEncoding\SIE@Encoding |
| 428 |
\fi |
| 429 |
\SIE@Info{selinput}{Encoding `\SIE@Encoding' selected}% |
| 430 |
\fi |
| 431 |
\fi |
| 432 |
} |
| 433 |
% \end{macrocode} |
| 434 |
% \end{macro} |
| 435 |
% \begin{macro}{\SIE@LoadNameDefs} |
| 436 |
% \begin{macrocode} |
| 437 |
\def\SIE@LoadNameDefs{% |
| 438 |
\begingroup |
| 439 |
\endlinechar=\m@ne |
| 440 |
\catcode92=0 % backslash |
| 441 |
\catcode123=1 % left curly brace/beginning of group |
| 442 |
\catcode125=2 % right curly brace/end of group |
| 443 |
\catcode37=14 % percent/comment character |
| 444 |
\@makeother\[% |
| 445 |
\@makeother\]% |
| 446 |
\@makeother\.% |
| 447 |
\@makeother\(% |
| 448 |
\@makeother\)% |
| 449 |
\@makeother\/% |
| 450 |
\@makeother\-% |
| 451 |
\let\InputenxName\SelectInputDefineMapping |
| 452 |
\InputIfFileExists{ix-name.def}{}{% |
| 453 |
\PackageError{selinput}{% |
| 454 |
Missing `ix-name.def' (part of package `inputenx')% |
| 455 |
}\@ehd |
| 456 |
}% |
| 457 |
\global\let\SIE@LoadNameDefs\relax |
| 458 |
\endgroup |
| 459 |
} |
| 460 |
% \end{macrocode} |
| 461 |
% \end{macro} |
| 462 |
% \begin{macro}{\SelectInputDefineMapping} |
| 463 |
% \begin{macrocode} |
| 464 |
\newcommand*{\SelectInputDefineMapping}[1]{% |
| 465 |
\expandafter\gdef\csname SIE@@#1\endcsname |
| 466 |
} |
| 467 |
% \end{macrocode} |
| 468 |
% \end{macro} |
| 469 |
% \begin{macrocode} |
| 470 |
\kv@set@family@handler{SelInputMap}{% |
| 471 |
\@onelevel@sanitize\kv@key |
| 472 |
\ifx\kv@value\relax |
| 473 |
\PackageError{selinput}{% |
| 474 |
Missing input character for `\kv@key'% |
| 475 |
}\@ehc |
| 476 |
\else |
| 477 |
\@onelevel@sanitize\kv@value |
| 478 |
\ifx\kv@value\@empty |
| 479 |
\PackageError{selinput}{% |
| 480 |
Input character got lost?\MessageBreak |
| 481 |
Missing input character for `\kv@key'% |
| 482 |
}\@ehc |
| 483 |
\else |
| 484 |
\@ifundefined{SIE@@\kv@key}{% |
| 485 |
\PackageWarning{selinput}{% |
| 486 |
Missing definition for `\kv@key'% |
| 487 |
}% |
| 488 |
}{% |
| 489 |
\edef\SIE@StringDest{% |
| 490 |
\SIE@StringDest |
| 491 |
\kv@value |
| 492 |
}% |
| 493 |
\edef\SIE@StringUnicode{% |
| 494 |
\SIE@StringUnicode |
| 495 |
\csname SIE@@\kv@key\endcsname |
| 496 |
}% |
| 497 |
}% |
| 498 |
\fi |
| 499 |
\fi |
| 500 |
} |
| 501 |
% \end{macrocode} |
| 502 |
% \begin{macrocode} |
| 503 |
\kv@set@family@handler{SelInputEnc}{% |
| 504 |
\@onelevel@sanitize\kv@key |
| 505 |
\ifx\kv@value\relax |
| 506 |
\ifx\SIE@EncodingList\@empty |
| 507 |
\let\SIE@EncodingList\kv@key |
| 508 |
\else |
| 509 |
\edef\SIE@EncodingList{\SIE@EncodingList,\kv@key}% |
| 510 |
\fi |
| 511 |
\else |
| 512 |
\@onelevel@sanitize\kv@value |
| 513 |
\PackageError{selinput}{% |
| 514 |
Illegal key value pair (\kv@key=\kv@value)\MessagBreak |
| 515 |
in encoding list% |
| 516 |
}\@ehc |
| 517 |
\fi |
| 518 |
} |
| 519 |
% \end{macrocode} |
| 520 |
% |
| 521 |
% \begin{macro}{\SIE@LoadUnicodePackage} |
| 522 |
% \begin{macrocode} |
| 523 |
\def\SIE@LoadUnicodePackage{% |
| 524 |
\@ifpackageloaded\SIE@UnicodePackage{}{% |
| 525 |
\RequirePackage\SIE@UnicodePackage\relax |
| 526 |
}% |
| 527 |
\SIE@PatchUCS |
| 528 |
\global\let\SIE@LoadUnicodePackage\relax |
| 529 |
} |
| 530 |
\let\SIE@show\show |
| 531 |
\def\SIE@PatchUCS{% |
| 532 |
\AtBeginDocument{% |
| 533 |
\expandafter\ifx\csname [email protected]\endcsname\relax |
| 534 |
\else |
| 535 |
\let\show\SIE@show |
| 536 |
\fi |
| 537 |
}% |
| 538 |
} |
| 539 |
\SIE@PatchUCS |
| 540 |
% \end{macrocode} |
| 541 |
% \end{macro} |
| 542 |
% \begin{macrocode} |
| 543 |
\AtBeginDocument{% |
| 544 |
\let\SIE@LoadUnicodePackage\relax |
| 545 |
} |
| 546 |
% \end{macrocode} |
| 547 |
% \begin{macro}{\SIE@EncodingUTFviii} |
| 548 |
% \begin{macrocode} |
| 549 |
\def\SIE@EncodingUTFviii{utf8} |
| 550 |
\@onelevel@sanitize\SIE@EncodingUTFviii |
| 551 |
% \end{macrocode} |
| 552 |
% \end{macro} |
| 553 |
% \begin{macro}{\SIE@EncodingUTFviiix} |
| 554 |
% \begin{macrocode} |
| 555 |
\def\SIE@EncodingUTFviiix{utf8x} |
| 556 |
\@onelevel@sanitize\SIE@EncodingUTFviiix |
| 557 |
% \end{macrocode} |
| 558 |
% \end{macro} |
| 559 |
% |
| 560 |
% \begin{macrocode} |
| 561 |
\let\SIE@UnicodePackage\@empty |
| 562 |
\let\SIE@UseUTFviii\@empty |
| 563 |
\let\SIE@Info\PackageInfo |
| 564 |
% \end{macrocode} |
| 565 |
% \begin{macrocode} |
| 566 |
\SetupKeyvalOptions{% |
| 567 |
family=SelInput,% |
| 568 |
prefix=SelInput@% |
| 569 |
} |
| 570 |
\define@key{SelInput}{utf8}{% |
| 571 |
\def\SIE@UseUTFviii{#1}% |
| 572 |
\@onelevel@sanitize\SIE@UseUTFviii |
| 573 |
} |
| 574 |
\DeclareBoolOption{ucs} |
| 575 |
\DeclareVoidOption{warning}{% |
| 576 |
\let\SIE@Info\PackageWarning |
| 577 |
} |
| 578 |
\ProcessKeyvalOptions{SelInput} |
| 579 |
\ifSelInput@ucs |
| 580 |
\def\SIE@UnicodePackage{ucs}% |
| 581 |
\ifx\SIE@UseUTFviii\@empty |
| 582 |
\let\SIE@UseUTFviii\SIE@EncodingUTFviiix |
| 583 |
\fi |
| 584 |
\else |
| 585 |
\ifx\SIE@UseUTFviii\@empty |
| 586 |
\@ifpackageloaded{ucs}{% |
| 587 |
\let\SIE@UseUTFviii\SIE@EncodingUTFviiix |
| 588 |
}{% |
| 589 |
\let\SIE@UseUTFviii\SIE@EncodingUTFviii |
| 590 |
}% |
| 591 |
\fi |
| 592 |
\fi |
| 593 |
% \end{macrocode} |
| 594 |
% |
| 595 |
% \begin{macro}{\SIE@EncodingList} |
| 596 |
% \begin{macrocode} |
| 597 |
\edef\SIE@EncodingList{% |
| 598 |
utf8,% |
| 599 |
x-iso-8859-1,% |
| 600 |
x-iso-8859-15,% |
| 601 |
x-cp1252,% ansinew |
| 602 |
x-mac-roman,% |
| 603 |
x-iso-8859-2,% |
| 604 |
x-iso-8859-3,% |
| 605 |
x-iso-8859-4,% |
| 606 |
x-iso-8859-5,% |
| 607 |
x-iso-8859-6,% |
| 608 |
x-iso-8859-7,% |
| 609 |
x-iso-8859-8,% |
| 610 |
x-iso-8859-9,% |
| 611 |
x-iso-8859-10,% |
| 612 |
x-iso-8859-11,% |
| 613 |
x-iso-8859-13,% |
| 614 |
x-iso-8859-14,% |
| 615 |
x-iso-8859-15,% |
| 616 |
x-mac-centeuro,% |
| 617 |
x-mac-cyrillic,% |
| 618 |
x-koi8-r,% |
| 619 |
x-cp1250,% |
| 620 |
x-cp1251,% |
| 621 |
x-cp1257,% |
| 622 |
x-cp437,% |
| 623 |
x-cp850,% |
| 624 |
x-cp852,% |
| 625 |
x-cp855,% |
| 626 |
x-cp858,% |
| 627 |
x-cp865,% |
| 628 |
x-cp866,% |
| 629 |
x-nextstep,% |
| 630 |
x-dec-mcs% |
| 631 |
}% |
| 632 |
\@onelevel@sanitize\SIE@EncodingList |
| 633 |
% \end{macrocode} |
| 634 |
% \end{macro} |
| 635 |
% |
| 636 |
% \begin{macrocode} |
| 637 |
%</package> |
| 638 |
% \end{macrocode} |
| 639 |
%% \section{Installation} |
| 640 |
% |
| 641 |
% \subsection{Download} |
| 642 |
% |
| 643 |
% \paragraph{Package.} This package is available on |
| 644 |
% CTAN\footnote{\CTANpkg{selinput}}: |
| 645 |
% \begin{description} |
| 646 |
% \item[\CTAN{macros/latex/contrib/selinput/selinput.dtx}] The source file. |
| 647 |
% \item[\CTAN{macros/latex/contrib/selinput/selinput.pdf}] Documentation. |
| 648 |
% \end{description} |
| 649 |
% |
| 650 |
% |
| 651 |
% \paragraph{Bundle.} All the packages of the bundle `selinput' |
| 652 |
% are also available in a TDS compliant ZIP archive. There |
| 653 |
% the packages are already unpacked and the documentation files |
| 654 |
% are generated. The files and directories obey the TDS standard. |
| 655 |
% \begin{description} |
| 656 |
% \item[\CTANinstall{install/macros/latex/contrib/selinput.tds.zip}] |
| 657 |
% \end{description} |
| 658 |
% \emph{TDS} refers to the standard ``A Directory Structure |
| 659 |
% for \TeX\ Files'' (\CTANpkg{tds}). Directories |
| 660 |
% with \xfile{texmf} in their name are usually organized this way. |
| 661 |
% |
| 662 |
% \subsection{Bundle installation} |
| 663 |
% |
| 664 |
% \paragraph{Unpacking.} Unpack the \xfile{selinput.tds.zip} in the |
| 665 |
% TDS tree (also known as \xfile{texmf} tree) of your choice. |
| 666 |
% Example (linux): |
| 667 |
% \begin{quote} |
| 668 |
% |unzip selinput.tds.zip -d ~/texmf| |
| 669 |
% \end{quote} |
| 670 |
% |
| 671 |
% \subsection{Package installation} |
| 672 |
% |
| 673 |
% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting |
| 674 |
% \docstrip\ archive. The files are extracted by running the |
| 675 |
% \xfile{.dtx} through \plainTeX: |
| 676 |
% \begin{quote} |
| 677 |
% \verb|tex selinput.dtx| |
| 678 |
% \end{quote} |
| 679 |
% |
| 680 |
% \paragraph{TDS.} Now the different files must be moved into |
| 681 |
% the different directories in your installation TDS tree |
| 682 |
% (also known as \xfile{texmf} tree): |
| 683 |
% \begin{quote} |
| 684 |
% \def\t{^^A |
| 685 |
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} |
| 686 |
% selinput.sty & tex/latex/selinput/selinput.sty\\ |
| 687 |
% selinput.pdf & doc/latex/selinput/selinput.pdf\\ |
| 688 |
% selinput.dtx & source/latex/selinput/selinput.dtx\\ |
| 689 |
% \end{tabular}^^A |
| 690 |
% }^^A |
| 691 |
% \sbox0{\t}^^A |
| 692 |
% \ifdim\wd0>\linewidth |
| 693 |
% \begingroup |
| 694 |
% \advance\linewidth by\leftmargin |
| 695 |
% \advance\linewidth by\rightmargin |
| 696 |
% \edef\x{\endgroup |
| 697 |
% \def\noexpand\lw{\the\linewidth}^^A |
| 698 |
% }\x |
| 699 |
% \def\lwbox{^^A |
| 700 |
% \leavevmode |
| 701 |
% \hbox to \linewidth{^^A |
| 702 |
% \kern-\leftmargin\relax |
| 703 |
% \hss |
| 704 |
% \usebox0 |
| 705 |
% \hss |
| 706 |
% \kern-\rightmargin\relax |
| 707 |
% }^^A |
| 708 |
% }^^A |
| 709 |
% \ifdim\wd0>\lw |
| 710 |
% \sbox0{\small\t}^^A |
| 711 |
% \ifdim\wd0>\linewidth |
| 712 |
% \ifdim\wd0>\lw |
| 713 |
% \sbox0{\footnotesize\t}^^A |
| 714 |
% \ifdim\wd0>\linewidth |
| 715 |
% \ifdim\wd0>\lw |
| 716 |
% \sbox0{\scriptsize\t}^^A |
| 717 |
% \ifdim\wd0>\linewidth |
| 718 |
% \ifdim\wd0>\lw |
| 719 |
% \sbox0{\tiny\t}^^A |
| 720 |
% \ifdim\wd0>\linewidth |
| 721 |
% \lwbox |
| 722 |
% \else |
| 723 |
% \usebox0 |
| 724 |
% \fi |
| 725 |
% \else |
| 726 |
% \lwbox |
| 727 |
% \fi |
| 728 |
% \else |
| 729 |
% \usebox0 |
| 730 |
% \fi |
| 731 |
% \else |
| 732 |
% \lwbox |
| 733 |
% \fi |
| 734 |
% \else |
| 735 |
% \usebox0 |
| 736 |
% \fi |
| 737 |
% \else |
| 738 |
% \lwbox |
| 739 |
% \fi |
| 740 |
% \else |
| 741 |
% \usebox0 |
| 742 |
% \fi |
| 743 |
% \else |
| 744 |
% \lwbox |
| 745 |
% \fi |
| 746 |
% \else |
| 747 |
% \usebox0 |
| 748 |
% \fi |
| 749 |
% \end{quote} |
| 750 |
% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's |
| 751 |
% TDS installing feature, then some files can already be in the right |
| 752 |
% place, see the documentation of \docstrip. |
| 753 |
% |
| 754 |
% \subsection{Refresh file name databases} |
| 755 |
% |
| 756 |
% If your \TeX~distribution |
| 757 |
% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh |
| 758 |
% these. For example, \TeX\,Live\ users run \verb|texhash| or |
| 759 |
% \verb|mktexlsr|. |
| 760 |
% |
| 761 |
% \subsection{Some details for the interested} |
| 762 |
% |
| 763 |
% \paragraph{Unpacking with \LaTeX.} |
| 764 |
% The \xfile{.dtx} chooses its action depending on the format: |
| 765 |
% \begin{description} |
| 766 |
% \item[\plainTeX:] Run \docstrip\ and extract the files. |
| 767 |
% \item[\LaTeX:] Generate the documentation. |
| 768 |
% \end{description} |
| 769 |
% If you insist on using \LaTeX\ for \docstrip\ (really, |
| 770 |
% \docstrip\ does not need \LaTeX), then inform the autodetect routine |
| 771 |
% about your intention: |
| 772 |
% \begin{quote} |
| 773 |
% \verb|latex \let\install=y\input{selinput.dtx}| |
| 774 |
% \end{quote} |
| 775 |
% Do not forget to quote the argument according to the demands |
| 776 |
% of your shell. |
| 777 |
% |
| 778 |
% \paragraph{Generating the documentation.} |
| 779 |
% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate |
| 780 |
% the documentation. The process can be configured by the |
| 781 |
% configuration file \xfile{ltxdoc.cfg}. For instance, put this |
| 782 |
% line into this file, if you want to have A4 as paper format: |
| 783 |
% \begin{quote} |
| 784 |
% \verb|\PassOptionsToClass{a4paper}{article}| |
| 785 |
% \end{quote} |
| 786 |
% An example follows how to generate the |
| 787 |
% documentation with pdf\LaTeX: |
| 788 |
% \begin{quote} |
| 789 |
%\begin{verbatim} |
| 790 |
%pdflatex selinput.dtx |
| 791 |
%makeindex -s gind.ist selinput.idx |
| 792 |
%pdflatex selinput.dtx |
| 793 |
%makeindex -s gind.ist selinput.idx |
| 794 |
%pdflatex selinput.dtx |
| 795 |
%\end{verbatim} |
| 796 |
% \end{quote} |
| 797 |
% |
| 798 |
% \begin{thebibliography}{9} |
| 799 |
% \bibitem{inputenx} |
| 800 |
% Heiko Oberdiek: \textit{The \xpackage{inputenx} package}; |
| 801 |
% 2007-04-11 v1.1; |
| 802 |
% \CTANpkg{inputenx}. |
| 803 |
% |
| 804 |
% \bibitem{adobe:glyphlist} |
| 805 |
% Adobe: \textit{Adobe Glyph List}; |
| 806 |
% 2002-09-20 v2.0; |
| 807 |
% \url{https://github.com/adobe-type-tools/agl-aglfn/blob/master/glyphlist.txt}. |
| 808 |
% |
| 809 |
% \bibitem{adobe:aglfn} |
| 810 |
% Adobe: \textit{Adobe Glyph List For New Fonts}; |
| 811 |
% 2005-11-18 v1.5; |
| 812 |
% \url{https://github.com/adobe-type-tools/agl-aglfn/blob/master/aglfn.txt}. |
| 813 |
% |
| 814 |
% \bibitem{stringenc} |
| 815 |
% Heiko Oberdiek: \textit{The \xpackage{stringenc} package}; |
| 816 |
% 2007-06-16 v1.1; |
| 817 |
% \CTANpkg{stringenc}. |
| 818 |
% |
| 819 |
% \end{thebibliography} |
| 820 |
% |
| 821 |
% \begin{History} |
| 822 |
% \begin{Version}{2007/06/16 v1.0} |
| 823 |
% \item |
| 824 |
% First version. |
| 825 |
% \end{Version} |
| 826 |
% \begin{Version}{2007/06/20 v1.1} |
| 827 |
% \item |
| 828 |
% Requested date for package \xpackage{stringenc} fixed. |
| 829 |
% \end{Version} |
| 830 |
% \begin{Version}{2007/09/09 v1.2} |
| 831 |
% \item |
| 832 |
% Line end fixed. |
| 833 |
% \end{Version} |
| 834 |
% \begin{Version}{2016/05/16 v1.3} |
| 835 |
% \item |
| 836 |
% Documentation updates. |
| 837 |
% \end{Version} |
| 838 |
% \begin{Version}{2016/05/17 v1.4} |
| 839 |
% \item |
| 840 |
% Documentation updates: Avoid T1 encoding with Unicode \TeX. |
| 841 |
% \end{Version} |
| 842 |
% \begin{Version}{2019/12/09 v1.5} |
| 843 |
% \item |
| 844 |
% Documentation updates. |
| 845 |
% \end{Version} |
| 846 |
% \begin{Version}{2019-12-10 v1.6} |
| 847 |
% \item Updated |
| 848 |
% \end{Version} |
| 849 |
% \end{History} |
| 850 |
% |
| 851 |
% \PrintIndex |
| 852 |
% |
| 853 |
% \Finale |
| 854 |
\endinput |