diff options
author | Norbert Preining <preining@logic.at> | 2014-05-08 05:45:04 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2014-05-08 05:45:04 +0000 |
commit | f8a7af47d643e11841911d1d6d7bcfad29af5a87 (patch) | |
tree | 254bbe12bb0c851f2dfb85aa2449b5fa176652a1 /Master/texmf-dist/source/latex/base/inputenc.dtx | |
parent | 4775c8ca9e258cf67c7c0bd7bce8234d12e7b449 (diff) |
latex 2e release (7May)
git-svn-id: svn://tug.org/texlive/trunk@33913 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/base/inputenc.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/base/inputenc.dtx | 209 |
1 files changed, 123 insertions, 86 deletions
diff --git a/Master/texmf-dist/source/latex/base/inputenc.dtx b/Master/texmf-dist/source/latex/base/inputenc.dtx index 20dfce417cf..0bdcb14dcbf 100644 --- a/Master/texmf-dist/source/latex/base/inputenc.dtx +++ b/Master/texmf-dist/source/latex/base/inputenc.dtx @@ -1,30 +1,30 @@ % \iffalse meta-comment % -% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 -% The LaTeX3 Project and any individual authors listed elsewhere -% in this file. -% +% Copyright 1993-2014 +% LaTeX3 Project and any individual authors listed elsewhere +% in this file. +% % This file is part of the LaTeX base system. % ------------------------------------------- -% +% % It may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3c % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt -% and version 1.3c or later is part of all distributions of LaTeX +% and version 1.3c or later is part of all distributions of LaTeX % version 2005/12/01 or later. -% +% % This file has the LPPL maintenance status "maintained". -% +% % The list of all files belonging to the LaTeX base distribution is % given in the file `manifest.txt'. See also `legal.txt' for additional % information. -% -% The list of derived (unpacked) files belonging to the distribution -% and covered by LPPL is defined by the unpacking scripts (with +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with % extension .ins) which are part of the distribution. -% +% % \fi % % \iffalse @@ -46,7 +46,7 @@ %</driver> % \fi % -% \CheckSum{3467} +% \CheckSum{3522} % %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -100,7 +100,7 @@ % \changes{v0.9j}{1995/11/14}{Remove \cs{endinput} so docstrip reaches % ansinew encoding} % \changes{v0.9k}{1995/11/29}{Replaced uses of \cs{textsterling} with -% \cs{pounds}.} +% \cs{pounds}.} % \changes{v0.9m}{1995/12/04}{Added German version} % \changes{v0.9m}{1995/12/04}{Replaced \cs{textasciitilde} by % \cs{nobreakspace}.} @@ -138,7 +138,7 @@ % THIS MAY CHANGE} % \changes{v0.95}{1997/12/20}{Updated documentation} % \changes{v0.97}{1998/03/05}{Spanish ords changed to text chars, pr/2579} -% \changes{v1.1b}{2006/03/04}{Number of normalisations in the LICR +% \changes{v1.1b}{2006/03/04}{Number of normalisations in the LICR % representation (pr/3849)} % \changes{v1.1c}{2006/11/18}{Added missing \cs{ProvidesFile} line for cp1257 (pr/3892)} % @@ -161,7 +161,7 @@ % languages suggested that it might be preferable to allow changing % the input encoding at any time, which is what is possible now % (though that is quite computing resource intensive). -% +% % The encodings provided by this package are: % \begin{itemize} % \item |ascii| ASCII encoding for the range 32--127 (all others are made @@ -202,7 +202,7 @@ % input encoding definitions to change this set-up. Similarly, whenever % |\inputencoding| is encountered in a document, first the upper % 8-bit characters are set back to produce an error and then the -% definitions for the new input encoding are loaded, changing some of the +% definitions for the new input encoding are loaded, changing some of the % previous settings. % % @@ -239,7 +239,7 @@ % better definition will not be over-written; their use is % recommended since, in general, the best definition depends on the % fonts available. -% +% % See the documentation in |fntguide.tex| and |ltoutenc.dtx| for % details of how to declare text commands. % @@ -365,7 +365,7 @@ % font encoding then please contribute that work to this package so that % others can benefit too. % -% +% % % @@ -416,7 +416,7 @@ %<cp858> \ProvidesFile{cp858.def} %<cp437> \ProvidesFile{cp437.def} %<cp437de> \ProvidesFile{cp437de.def} -%<cp865> \ProvidesFile{cp865.def} +%<cp865> \ProvidesFile{cp865.def} %<applemac> \ProvidesFile{applemac.def} %<applemacce> \ProvidesFile{macce.def} %<next> \ProvidesFile{next.def} @@ -424,16 +424,12 @@ %<cp1252&!ansinew> \ProvidesFile{cp1252.def} %<cp1250> \ProvidesFile{cp1250.def} %<cp1257> \ProvidesFile{cp1257.def} - [2008/03/30 v1.1d Input encoding file] + [2014/04/30 v1.2b Input encoding file] %<cp850>%% %<cp850>%% If you need a Euro symbol, try cp858 instead. %<cp850>%% % \end{macrocode} % -% Now we insert a |\makeatletter| at the beginning of all .def files. -% \begin{macrocode} -%<-package>\makeatletter -% \end{macrocode} % % \section{The package} % @@ -483,7 +479,7 @@ % The definition should contain only robust commands (and, for % correct ligatures and kerning, they must be defined via the % interfaces in the fontenc package). -% +% % \changes{v0.9b}{1995/05/23}{Added hackery with \cs{IeC} in order to % avoid space being gobbled.} % @@ -516,17 +512,17 @@ % The definition of |\IeC| was modified not to insert a |\protect| % unless it is needed, this means it works in |\hyphenation| % commands, and other such delicate places. It was then further -% changed to never insert a |\protect| as one is never needed; this +% changed to never insert a |\protect| as one is never needed; this % makes it work in even more places. -% +% % This still needs some attention. -% +% % \changes{v0.9m}{1995/12/12}{Modified \cs{IeC} in order to % work in \cs{hyphenation} latex/2004.} -% +% % \changes{v0.94}{1997/12/17}{Changed non-typeset case from % \cs{protect} to \cs{noexpand}: temporary fix.} -% +% % \begin{macrocode} \def\IeC{% \ifx\protect\@typeset@protect @@ -550,16 +546,21 @@ % \changes{v0.94}{1997/12/17}{Warning message reworded and line % number added, also for latex/2608} % \changes{v0.95}{1997/12/20}{Changed to work in any vmode, for David} -% +% \changes{v1.2a}{2014/04/20}{Added alternative definition for xe/lua tex (pr/4024)}% +% \changes{v1.2b}{2014/04/30}{Allow (x-)ascii and utf8x aliases for utf8 in xetex/luatex}% % This sets the encoding to be |#1|. It first sets all the % characters 128--255 to be active (and sets their initial % definition to be |\@inpenc@undefined|). % It now also does this for some `low' codes below 32, but % misses out Null, control-I, control-J, control-L and control-M. -% +% % It then inputs |#1.def|. But it first sets up a test that % produces a warning message if no suitable definitions get read. -% +% +% \begin{macrocode} +\ifx\Umathchar\@undefined +% \end{macrocode} +% % \begin{macrocode} \def\inputencoding#1{% % \end{macrocode} @@ -571,15 +572,16 @@ \gdef\@inpenc@test{\global\let\@inpenc@test\relax}% % \end{macrocode} % Keyboard characters which don't get a definition will be mapped to -% |\@inpenc@undefined| which gets a definition producing an error +% |\@inpenc@undefined| which gets a definition producing an error % message indicating in which input encoding the current keyboard % character is undefined: % \changes{v0.98}{1998/07/04}{Give better error message if key used % is undefined (pr/2845)} % \changes{v0.993}{2000/01/24}{Fix error message for undefined chars % (pr/3158)} +% \changes{v1.2a}{2014/04/20}{add \cs{protect} so undefined characters are robust (pr/4182)}% % \begin{macrocode} - \edef\@inpenc@undefined{\noexpand\@inpenc@undefined@{#1}}% + \edef\@inpenc@undefined{\noexpand\protect\noexpand\@inpenc@undefined@{#1}}% % \end{macrocode} % The |\edef| in the above definition is essential as |#1| may be % |\CurrentOption| in which case a later use would return incorrect @@ -589,7 +591,7 @@ % in a user accessible macro. % \changes{v1.1a}{2006/02/22}{Added \cs{inputencodingname}} % \begin{macrocode} - \edef\inputencodingname{#1}% + \edef\inputencodingname{#1}% % \end{macrocode} % % Now we make all potential input characters active. @@ -606,18 +608,22 @@ % we need to ensure that we don't get any stray spaces into the % horizontal mode or else we end up with extra space in the % paragraph. -% \changes{v0.998}{2001/05/25}{Suppress all spaces for horizontal mode +% \changes{v0.998}{2001/05/25}{Suppress all spaces for horizontal mode % (pr/3273)} % \changes{v1.0f}{2004/05/06}{Really do (pr/3273)} % \changes{v1.1d}{2007/08/06}{Set \cs{endlinechar} properly (pr/3926)} +% \changes{ v1.1e}{2012/06/06}{Save and restore \cs{catcode} of @ (pr/4192)} % \begin{macrocode} \xdef\saved@endlinechar@code{\the\endlinechar}% \endlinechar\m@ne \xdef\saved@space@catcode{\the\catcode`\ }% - \catcode`\ 9\relax + \catcode`\ 9\relax + \xdef\saved@at@catcode{\the\catcode`\@}% + \makeatletter \input{#1.def}% \endlinechar\saved@endlinechar@code\relax \catcode`\ \saved@space@catcode\relax + \catcode`\@\saved@at@catcode\relax % \end{macrocode} % % If there have been no |\DeclareInputText| or |\DeclareInputMath| @@ -634,11 +640,49 @@ % \changes{v1.1a}{2006/02/22}{Added \cs{inpenc@posthook}} % \begin{macrocode} \the\inpenc@posthook -} +} +% \end{macrocode} +% +% \begin{macrocode} +\else +% \end{macrocode} +% Unicode based TeX engines do not require this package at all, and always use UTF-8 +% input. Allow the package to be used if |[uf8]| or |[ascii]| options are used to simplify +% switching between TeX engines. +% \begin{macrocode} +\def\inputencoding#1{% +\edef\reserved@a{#1}% +\def\reserved@b{utf8x}% +\ifx\reserved@a\reserved@b\def\reserved@a{utf8}\fi +\def\reserved@b{utf8}% +\ifx\reserved@a\reserved@b +\PackageWarningNoLine + {inputenc}% + {inputenc package ignored with utf8 based engines}% +\else +\def\reserved@b{x-ascii}% +\ifx\reserved@a\reserved@b\def\reserved@a{ascii}\fi +\def\reserved@b{ascii}% +\ifx\reserved@a\reserved@b +\PackageWarningNoLine + {inputenc}% + {inputenc can't be used to ensure 7bit clean source\MessageBreak + with a utf engine: Package ignored: utf8 assumed}% +\else +\PackageError + {inputenc}% + {inputenc is not designed for xetex or luatex.\MessageBreak + only UTF-8 supported}% + {For xelatex or lualatex save the document in UTF-8 encoding\MessageBreak + and do not use inputenc, or use the [utf8] option.} +\fi +\fi +} +\fi % \end{macrocode} % \end{macro} % -% +% % \begin{macro}{\inpenc@prehook} % \changes{v1.1a}{2006/02/22}{Hook added} % \begin{macro}{\inpenc@posthook} @@ -651,7 +695,7 @@ % \end{macro} % \end{macro} % -% +% % \begin{macro}{\@inpenc@undefined@} % This command will assigned to any active character unless it % get a proper definition by the encoding. The argument is the @@ -690,7 +734,7 @@ \repeat} % \end{macrocode} % \end{macro} -% +% % % Then for each option, we input that encoding file. % \begin{macrocode} @@ -711,7 +755,7 @@ % % Note that this works reasonably well only because the encoding % files for both |OT1| and |T1| are loaded in the standard LaTeX -% format. +% format. % % \changes{v0.9a}{1995/04/23}{Default settings moved to own section} % @@ -730,19 +774,19 @@ % {Added \cs{textblacksquare}} % \changes{v0.9u}{1996/10/29} % {Corrected code for \cs{textblacksquare}} -% +% % \changes{v0.9u}{1996/10/29} % {Added cp865 and corrected cp850, cp852 and cp437 guards} % \changes{v0.94}{1997/12/17}{Removed entries that were solely in % next.def} % \changes{v0.995}{2000/05/22}{Added latin2 option for textdegree % (pr/3207) CAR} -% +% % The name |\textblacksquare| is derived from the AMS symbol name since % Adobe seem not to want this symbol. The default definition, as a % rule, makes no claim to being a good design. -% -% Some entries are repeated in case guards must all be on one line. +% +% Some entries are repeated in case guards must all be on one line. % \begin{macrocode} %<*latin1|decmulti|latin2|latin3|latin4|latin5|latin9|applemacce|latin10> \ProvideTextCommandDefault{\textdegree}{\ensuremath{{^\circ}}} @@ -775,7 +819,7 @@ % characters.} % % Some commands can't be faked, so we have them generate an error -% message. +% message. % \begin{macrocode} %<*latin1|decmulti|latin5|latin9|cp850|cp858|cp865|cp437|cp437de> \ProvideTextCommandDefault{\textcent} @@ -837,7 +881,7 @@ % `superior' glyphs.} % \changes{v0.97}{1998/03/05}{Removed ords: % changed to text chars, pr/2579} -% +% % Characters that are supposed to be used only in math will be defined % by |\providecommand| because \LaTeXe{} assumes that the font % encoding for math fonts is static. @@ -873,7 +917,7 @@ % \end{macrocode} % % \changes{v0.94}{1997/12/17}{Merged latin1 with ansinew/cp1252} -% +% % \section{The ISO Latin-2 encoding} % % The ISO Latin-2 encoding file defines the characters @@ -999,7 +1043,7 @@ % in the ISO 8859-3 encoding. It was contributed by % by J\"org Knappen (\texttt{joerg.knappen@uni-mainz.de}) and % adapted by Chris Rowley. -% +% % It can be used for general purpose applications in % typical office environments in the following languages: % Afrikaans, Catalan, English, Esperanto, French, Galician, German, @@ -1116,7 +1160,7 @@ % \section{The ISO Latin-4 encoding} % % The ISO Latin-4 encoding file defines the characters in the ISO -% 8859-4 encoding. It was contributed by Hana Skoumalov\'a +% 8859-4 encoding. It was contributed by Hana Skoumalov\'a % (\texttt{hana.skoumalova@ff.cuni.cz}). % % It was created for Estonian, Latvian, Lithuanian, Finnish, Lappish, @@ -1607,7 +1651,7 @@ % \changes{v0.91}{1997/08/19}{Replaced \cs{dh}/\cs{DH} by % \cs{dj}/\cs{DJ}.} % \changes{v0.99}{1999/04/14}{Changed 212, see pr/2992} -% +% % \begin{macrocode} %<*cp852> \DeclareInputText{128}{\c C} @@ -1731,7 +1775,7 @@ % The changes for cp865 are based on work by S\o ren Sandmann % (\texttt{sandmann@\linebreak[0]daimi.aau.dk}), with thanks to % them all. -% +% % The DOS graphics `letters' and a few % other positions are ignored (left undefined). % @@ -1751,7 +1795,7 @@ % \changes{v0.9t}{1996/10/28}{Changed \cs{maththreesuperior} to % \cs{mathnsuperior}} % \changes{v0.94}{1997/12/17}{Changed 158 to \cs{DeclareInputText}} -% +% % \begin{macrocode} %<*cp437|cp437de|cp865> \DeclareInputText{128}{\c C} @@ -1788,7 +1832,7 @@ \DeclareInputText{157}{\textyen} %</cp437|cp437de> %<*cp865> -\DeclareInputText{155}{\o} +\DeclareInputText{155}{\o} \DeclareInputText{156}{\pounds} \DeclareInputText{157}{\O} %</cp865> @@ -1814,7 +1858,7 @@ \DeclareInputText{173}{\textexclamdown} \DeclareInputText{174}{\guillemotleft} %<cp437|cp437de>\DeclareInputText{175}{\guillemotright} -%<cp865>\DeclareInputText{175}{\textcurrency} +%<cp865>\DeclareInputText{175}{\textcurrency} %\DeclareInputText{176}{\textlightgraybox} %\DeclareInputText{177}{\textgraybox} %\DeclareInputText{178}{\textdarkgraybox} @@ -1863,7 +1907,7 @@ %\DeclareInputMath{218}{\ensuremath{\lceil}} % upper left corner %\DeclareInputText{219}{} % black box %\DeclareInputText{220}{} % lower half of black box -%\DeclareInputText{221}{} % left bar +%\DeclareInputText{221}{} % left bar %\DeclareInputText{222}{} % right bar %\DeclareInputText{223}{} % upper half of black box % \end{macrocode} @@ -1895,7 +1939,7 @@ %\DeclareInputMath{244}{} % upper part of integral sign %\DeclareInputMath{245}{} % lower part of integral sign \DeclareInputMath{246}{\div} -\DeclareInputMath{247}{\approx} +\DeclareInputMath{247}{\approx} \DeclareInputText{248}{\textdegree} \DeclareInputText{249}{\textperiodcentered} \DeclareInputText{250}{\textbullet} @@ -2167,7 +2211,7 @@ % \cs{quotedblbase}: this may be temporary.} % \changes{v0.96}{1998/03/02}{Fixed typo in slot 159.} % \changes{v0.997}{2000/12/02}{Added all missing chars. (pr/3281)} -% +% % \begin{macrocode} %<*next> \DeclareInputText{128}{\nobreakspace} @@ -2317,13 +2361,13 @@ % % The MS Windows ANSI, cp 1252, input encoding was contributed by % Berthold K.P. Horn (\texttt{bkph@\linebreak[0]ai.mit.edu}). -% +% % It has two very different names so the same code produces two files. % These encoding files both define the characters in the % MS Windows 3.1 ANSI encoding (Western Europe), also known as code % page 1252, which is based on ISO Latin-1 but has important additions % in the 128--159 range. -% +% % Designed for: % Danish, Dutch, English, Finnish, French, German, Icelandic, % Italian, Norwegian, Portuguese, Spanish, and Swedish. @@ -2343,12 +2387,12 @@ % French and Finnish. Further, a slot for the Euro currency sign has % been added and this could be the killer argument for many 8-bit % texts to be written in Latin-9 in the future. -% +% % According to a Linux man page, ISO~Latin-9 supports Albanian, Basque, % Breton, Catalan, Danish, Dutch, -% English, Estonian, Faroese, Finnish, French, Frisian, Galician, German, -% Greenlandic, Icelandic, Irish Gaelic, Italian, Latin, Luxemburgish, -% Norwegian, Portuguese, Rhaeto-Romanic, Scottish Gaelic, Spanish and +% English, Estonian, Faroese, Finnish, French, Frisian, Galician, German, +% Greenlandic, Icelandic, Irish Gaelic, Italian, Latin, Luxemburgish, +% Norwegian, Portuguese, Rhaeto-Romanic, Scottish Gaelic, Spanish and % Swedish. % % The characters added in |latin9.def| are (in \LaTeX{} notation): @@ -2360,7 +2404,7 @@ % \textcurrency \textbrokenbar \"{} \'{} \c{} % \textonequarter \textonehalf \textthreequarters % \end{verbatim} -% +% % \changes{v0.9e}{1995/08/31}{Redeclared "AD to be soft hyphen.} % \changes{v0.9e}{1995/08/31}{Swapped ordfeminine and ordmasculine.} % @@ -2368,7 +2412,7 @@ % % \changes{v0.91}{1997/08/19}{Exchanged codes for % \cs{textendash} and \cs{textemdash}.} -% +% % \changes{v0.94}{1997/12/17}{Added cp1252 and merged latin1} % \changes{v0.94}{1997/12/17}{Changed \cs{ldots} to \cs{dots}, this % should be undetectable since \cs{ldots} is not robust.} @@ -2376,7 +2420,7 @@ % \changes{v0.99a}{2001/07/10}{Added latin9 (from Karsten Tinnefeld)} % \changes{v0.99b}{2002/06/16}{Added code points 142,158 for cp1252 (pr/3441)} % \changes{v0.99b}{2002/07/08}{Added code 128 (texteuro) for cp1252 (pr/3423)} -% +% % \begin{macrocode} %<*cp1252> \DeclareInputText{128}{\texteuro} @@ -2538,7 +2582,7 @@ %</cp1252|latin1|latin9> % \end{macrocode} % -% +% %\section{The ISO 8859-16 (Latin10) encoding} % % \changes{v1.0c}{2004/02/04}{Added ISO 8859-16 Latin10 (pr/3568)} @@ -2558,7 +2602,7 @@ % more widely implemented encoding suitable for Romanian. % % Data for the \LaTeX{} support was mainly provided by Ionel Ciob\^{i}c\u{a} -% with additions and corrections taken from\\ +% with additions and corrections taken from\\ % \texttt{http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-16.TXT}. % % \changes{v1.1b}{2006/03/03}{Corrections (pr/3849)} @@ -2578,7 +2622,7 @@ \fontsize\ssf@size\z@ \math@fontsfalse\selectfont,}\hidewidth}\egroup} % \end{macrocode} -% +% % \begin{macrocode} \ProvideTextCommandDefault\textpm{\ensuremath\pm} % \end{macrocode} @@ -2696,7 +2740,7 @@ %\section{The MS Windows encoding cp1250} % % This is an MS Windows encoding for Central and Eastern Europe, -% known as Code Page 1250; it was provided by Marcin Woli\'nski +% known as Code Page 1250; it was provided by Marcin Woli\'nski % \texttt{wolinski@melkor.mimuw.edu.pl} and edited by Chris Rowley % (see v0.94 below) to make it consistent with other files. % @@ -2715,7 +2759,7 @@ %\DeclareInputText{129}{} % n/u \DeclareInputText{130}{\quotesinglbase} %\DeclareInputText{131}{} % n/u -\DeclareInputText{132}{\quotedblbase} +\DeclareInputText{132}{\quotedblbase} \DeclareInputText{133}{\dots} \DeclareInputText{134}{\dag} \DeclareInputText{135}{\ddag} @@ -2776,7 +2820,7 @@ \DeclareInputText{187}{\guillemotright} \DeclareInputText{188}{\v L}% L caron (L') ? \DeclareInputText{189}{\H{}} -\DeclareInputText{190}{\v l}% l caron (l') ? +\DeclareInputText{190}{\v l}% l caron (l') ? \DeclareInputText{191}{\.z} % \end{macrocode} % @@ -2856,9 +2900,9 @@ % % This is an MS Windows encoding for Baltic languages, % known as Code Page 1257; provided by Heiko Oberdiek -% using the mappings to Unicode in -% \texttt{http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT} -% and +% using the mappings to Unicode in\\ +% \texttt{http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT}\\ +% and\\ % \texttt{http://www.microsoft.com/globaldev/reference/sbcs/1257.mspx}. % % \changes{v1.1b}{2006/03/03}{Large number of corrections (pr/3849)} @@ -2992,13 +3036,6 @@ %</cp1257> % \end{macrocode} % -% -% Finally, we reset the category code of the at sign at the end of all -% .def files. -% \begin{macrocode} -%<-package>\makeatother -% \end{macrocode} -% % \DeleteShortVerb{\|} % \Finale \endinput |