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/utf8ienc.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/utf8ienc.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/base/utf8ienc.dtx | 163 |
1 files changed, 82 insertions, 81 deletions
diff --git a/Master/texmf-dist/source/latex/base/utf8ienc.dtx b/Master/texmf-dist/source/latex/base/utf8ienc.dtx index a35b9416ef7..abd5d627ff7 100644 --- a/Master/texmf-dist/source/latex/base/utf8ienc.dtx +++ b/Master/texmf-dist/source/latex/base/utf8ienc.dtx @@ -2,29 +2,29 @@ % % 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. -% +% 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 @@ -37,6 +37,7 @@ Frank Mittelbach \and Chris Rowley\thanks{Borrowing heavily from code by David Carlisle and tables by Sebastian Rahtz; some table and code cleanup by Javier Bezos}} +\usepackage[utf8]{inputenc} \begin{document} \maketitle \tableofcontents @@ -54,10 +55,10 @@ % [The whole section is rather unfinished \ldots\ just like the code, sorry!] % % \subsection{Background and general stuff} -% +% % For many reasons what this package provides is a long way from any % type of `Unicode compliance'. -% +% % In stark contrast to 8-bit character sets, with 16 or more bits it can % easily be very inefficient to support the full range.\footnote{In % fact, \LaTeX's current 8-bit support does not go so far as to make @@ -66,63 +67,63 @@ % an acceptable visual representation of a sequence of characters and % this, for \LaTeX{}, means having available a suitably encoded 8-bit % font. -% +% % Unfortunately it is not possible to predict exactly what valid UTF-8 % octet sequences will appear in a particular file so it is best to % make all the unsupported but valid sequences produce a reasonably % clear and noticeable error message. -% +% % There are two directions from which to approach the question of what % to load. One is to specify the ranges of Unicode characters that will % result in some sensible typesetting; this requires the provider to % ensure that suitable fonts are loaded and that these input characters % generate the correct typesetting via the encodings of those fonts. The % other is to inspect the font encodings to be used and use these to -% define which input Unicode characters should be supported. -% +% define which input Unicode characters should be supported. +% % For Western European languages, at least, going in either direction % leads to many straightforward decisions and a few that are more % subjective. In both cases some of the specifications are \TeX{} % specific whilst most are independent of the particular typesetting % software in use. -% +% % As we have argued elsewhere, \LaTeX{} needs to refer to characters via % `seven-bit-text' names and, so far, these have been chosen by % reference to historical sources such as Plain \TeX{} or Adobe encoding % descriptions. It is unclear whether this ad hoc naming structure should % simply be extended or whether it would be useful to -% supplement it with standardised internal Unicode character names such as -% one or more of the following:\footnote{Burkhard und Holger Mittelbach +% supplement it with standardised internal Unicode character names such as +% one or more of the following:\footnote{Burkhard und Holger Mittelbach % spielen mit mir! Sie haben etwas hier geschrieben.} -% +% % \begin{verbatim} -% \ltxutwochar <4 hex digits> -% +% \ltxutwochar <4 hex digits> +% % \ltxuchar {<hex digits>} % B H U R R R % -% \ltxueightchartwo <2 utf8 octets as 8-bit char tokens> -% \ltxueightcharthree <3 utf8 octets ...> -% \ltxueightcharfour <4 utf8 octets ...> +% \ltxueightchartwo <2 utf8 octets as 8-bit char tokens> +% \ltxueightcharthree <3 utf8 octets ...> +% \ltxueightcharfour <4 utf8 octets ...> % \end{verbatim} -% -% +% +% % \subsection{More specific stuff} -% +% % In addition to setting up the mechanism for reading UTF-8 characters % and specifying the \LaTeX-level support available, this package % contains support for some default historically expected \TeX-related % characters and some example `Unicode definition files' for standard % font encodings. -% -% +% +% % \subsection{Notes} -% +% % This package does not support Unicode combining characters as \TeX{} % is not really equipped to make this possible. -% +% % No attempt is made to be useful beyond Latin, and maybe Cyrillic, -% for European languages (as of now). +% for European languages (as of now). % % % \subsection{Basic operation of the code} @@ -132,7 +133,7 @@ % input encoding files 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. % % The 8-bit input encodings currently supported by \texttt{inputenc} @@ -219,7 +220,7 @@ %<+all> \ProvidesFile{utf8enc.dfu} [2008/04/05 v1.1m UTF-8 support for inputenc] % \end{macrocode} -% +% % \begin{macrocode} %<*utf8> \makeatletter @@ -232,7 +233,7 @@ % \begin{macrocode} \catcode`\ \saved@space@catcode % \end{macrocode} -% +% % % % \subsection{Parsing UTF-8 input} @@ -266,19 +267,19 @@ \UTFviii@defined\csname u8:#1\string#2\endcsname} % \end{macrocode} % \end{macro} -% +% % \begin{macrocode} \def\UTFviii@three@octets#1#2#3{\expandafter \UTFviii@defined\csname u8:#1\string#2\string#3\endcsname} % \end{macrocode} % \end{macro} -% +% % \begin{macrocode} \def\UTFviii@four@octets#1#2#3#4{\expandafter \UTFviii@defined\csname u8:#1\string#2\string#3\string#4\endcsname} % \end{macrocode} % \end{macro} -% +% % \begin{macro}{\UTFviii@defined} % This tests whether its argument is different from |\relax|: it % either calls for a sensible error message (not done), or it gets @@ -294,7 +295,7 @@ % \changes{v1.1b}{2004/02/09}{No newlines allowed in error messages} % \changes{v1.1g}{2005/09/27}{Real spaces do not show up so use \cs{space}} % \begin{macrocode} - \PackageError{inputenc}{Unicode\space char\space \string#1\space + \PackageError{inputenc}{Unicode\space char\space \string#1\space not\space set\space up\space for\space use\space with\space LaTeX}\@eha \else\expandafter @@ -303,7 +304,7 @@ } % \end{macrocode} % \end{macro} -% +% % \begin{macro}{\UTFviii@loop} % This wonderful bit of code from Dr Carlisle defines the starting % octets to call |\UTFviii@two@octets| etc as appropriate. The starting @@ -314,7 +315,7 @@ % |\count@| and ending at |\@tempcnta|${} - 1$, each time executing % the code in |\UTFviii@tmp|. % -% All this is done in a group so that temporary catcode changes +% All this is done in a group so that temporary catcode changes % etc.~vanish after everything is set up. % % It may be a good idea to add code to deal with `illegal utf8 octets': @@ -326,7 +327,7 @@ \catcode`\~13 \catcode`\"12 % \end{macrocode} -% +% % \begin{macrocode} \def\UTFviii@loop{% \uccode`\~\count@ @@ -351,7 +352,7 @@ \def\UTFviii@tmp{\xdef~{\noexpand\UTFviii@three@octets\string~}} \UTFviii@loop % \end{macrocode} -% +% % Setting up 4-byte UTF-8: % \begin{macrocode} \count@"F0 @@ -368,7 +369,7 @@ % \begin{macrocode} \@inpenc@test % \end{macrocode} -% +% % % If this file (\texttt{utf8.def}) is not being read while setting % up \texttt{inputenc}, i.e.~in the preamble, but when @@ -376,8 +377,8 @@ % need to input the specific Unicode mappings again. We therefore % stop reading the file at this point. % \begin{macrocode} -\ifx\@begindocumenthook\@undefined - \makeatother +\ifx\@begindocumenthook\@undefined + \makeatother % \end{macrocode} % The |\fi| must be on the same line as |\endinput| or else it will % never be seen! @@ -388,12 +389,12 @@ % % \subsection{Mapping Unicode codes to \LaTeX{} internal forms} % -% +% % \begin{macro}{\DeclareUnicodeCharacter} % The |\DeclareUnicodeCharacter| declaration defines a mapping from % a Unicode character code point to a \LaTeX{} internal form. The first % argument is the Unicode number as hexadecimal digits and the second is -% the actual \LaTeX{} internal form. +% the actual \LaTeX{} internal form. % % We start by making sure that some characters have the right % |\catcode| when they are used in the definitions below. @@ -407,7 +408,7 @@ \catcode`\!=12 \catcode`\~=13 % \end{macrocode} -% +% % \begin{macrocode} \gdef\DeclareUnicodeCharacter#1#2{% \count@"#1\relax @@ -428,7 +429,7 @@ % single command with two character tokens as arguments: % \begin{quote} % [$t_{C2}$ and $t_{A3}$ are the characters corresponding to these -% two octets]\\ +% two octets]\\ % |\UTFviii@two@octets| $t_{\rm C2}t_{\rm A3}$ % \end{quote} % what we actually need to produce is a definition of the form @@ -453,7 +454,7 @@ % a csname after which the |\gdef| finally gets applied. % We add an irrelevant |\IeC| and braces around the definition, in % order to avoid any space after the command being gobbled up -% when the text is written out to an auxiliary file (see +% when the text is written out to an auxiliary file (see % \texttt{inputenc} for further details % \begin{macrocode} \expandafter\expandafter\expandafter @@ -494,11 +495,11 @@ % \uppercase{\count@\if x\noexpand#1"\else#1\fi#2}\relax % \end{macrocode} % As |\count@| already contains the right value we make -% |\parse@XML@charref| work without arguments. +% |\parse@XML@charref| work without arguments. % \changes{v1.1g}{2005/09/27}{Real spaces do not show up so use \cs{space}} % \begin{macrocode} \ifnum\count@<"A0\relax - \PackageError{inputenc}{Cannot\space define\space Unicode\space + \PackageError{inputenc}{Cannot\space define\space Unicode\space char\space value\space <\space 00A0}\@eha % \end{macrocode} % Do not ask us to provide an explanation for the code below, it is @@ -552,7 +553,7 @@ \uccode`#3\count@ \uppercase{\gdef\UTFviii@tmp{#2#3#4}}} % \end{macrocode} -% +% % \begin{macrocode} \endgroup % \end{macrocode} @@ -568,7 +569,7 @@ \@onlypreamble\parse@UTFviii@a \@onlypreamble\parse@UTFviii@b % \end{macrocode} -% +% % % \subsection{Loading Unicode mappings at begin document} % @@ -640,7 +641,7 @@ } %</utf8> % \end{macrocode} -% +% % % % \section{Mapping characters ---\newline based on font (glyph) encodings} @@ -663,7 +664,7 @@ % is that and not |\^i|. % % This list has been built from several sources, obviously including -% the Unicode Standard itself. These sources include Passive \TeX{} by +% the Unicode Standard itself. These sources include Passive \TeX{} by % Sebastian Rahtz, the \texttt{unicode} % package by Dominique P. G. Unruh (mainly for Latin encodings) and % \texttt{text4ht} by Eitan Gurari (for Cyrillic ones). @@ -676,7 +677,7 @@ % \subsection{About the table itself} % % In addition to generating indivdual files, the table below is, at present, -% a one-one (we think) partial relationship between the (ill-defined) set +% a one-one (we think) partial relationship between the (ill-defined) set % of LICRs and the Unicode slots "0080 to "FFFF. At present these entries % are used only to define a collection of partial mappings from Unicode % slots to LICRs; each of these mappings becomes full if we add an exception @@ -685,7 +686,7 @@ % It is probably not essential for the relationship in the full table to be % one-one; this raises questions suach as: the exact role of LICRs; % the formal relationships on the set of LICRs; the (non-mathematical) -% relationship between +% relationship between % LICRs and Unicode (which has its own somewhat fuzzy equivalences); % and ultimately what a character is and what a character representation % and/or name is. @@ -702,8 +703,8 @@ % Of course, \TeX{} itself typically does not treat even many perfectly % `normal text' 7-bit slots as text characters, so it is unclear % whether \LaTeX{} should even attempt to deal in any consistent way with -% those Unicode slots that are not definitive text characters. -% +% those Unicode slots that are not definitive text characters. +% % % \subsection{The mapping table} % @@ -711,7 +712,7 @@ % than \texttt{00BF}. % % There are few notes about inconsistencies etc at the end of the table. -% +% % \begin{macrocode} %<all,t1,ot1,ly1>\DeclareUnicodeCharacter{00A1}{\textexclamdown} %<all,ts1,ly1>\DeclareUnicodeCharacter{00A2}{\textcent} @@ -1001,7 +1002,7 @@ %<all,ot2>\DeclareUnicodeCharacter{0472}{\CYRFITA} %<all,ot2>\DeclareUnicodeCharacter{0473}{\cyrfita} % \end{macrocode} -% +% % \begin{macrocode} %<all,x2,ot2>\DeclareUnicodeCharacter{0474}{\CYRIZH} %<all,x2,ot2>\DeclareUnicodeCharacter{0475}{\cyrizh} @@ -1013,7 +1014,7 @@ %<all,x2>\DeclareUnicodeCharacter{0476}{\C\CYRIZH} %<all,x2>\DeclareUnicodeCharacter{0477}{\C\cyrizh} % \end{macrocode} -% +% % \begin{macrocode} %<all,t2c>\DeclareUnicodeCharacter{048C}{\CYRSEMISFTSN} %<all,t2c>\DeclareUnicodeCharacter{048D}{\cyrsemisftsn} @@ -1070,14 +1071,14 @@ % \end{macrocode} % The character |\CYRpalochka| is not defined by OT2 and LCY. However it is % looking identical to |\CYRII| and the Unicode standard explicitly refers -% to that (and to Latin I). So perhaps those encodings could get an alias? +% to that (and to Latin I). So perhaps those encodings could get an alias? % On the other hand, why are there two distinct slots in the T2 encodings % even though they are so pressed for space? Perhaps they don't always look % alike. % \begin{macrocode} %<all,x2,t2c,t2b,t2a>\DeclareUnicodeCharacter{04C0}{\CYRpalochka} % \end{macrocode} -% +% % \begin{macrocode} %<all,x2,t2c,t2b,t2a,ot2,lcy>\DeclareUnicodeCharacter{04C1}{\U\CYRZH} %<all,x2,t2c,t2b,t2a,ot2,lcy>\DeclareUnicodeCharacter{04C2}{\U\cyrzh} @@ -1086,12 +1087,12 @@ % \end{macrocode} % According to the Unicode standard Ux04C5 should be an L with ``tail'' not % with descender (which also exists as Ux04A2) but it looks as if the char -% names do not make this distinction). Should they? +% names do not make this distinction). Should they? % \begin{macrocode} %<all,x2,t2c,t2b>\DeclareUnicodeCharacter{04C5}{\CYRLDSC} %<all,x2,t2c,t2b>\DeclareUnicodeCharacter{04C6}{\cyrldsc} % \end{macrocode} -% +% % \begin{macrocode} %<all,x2,t2c,t2b>\DeclareUnicodeCharacter{04C7}{\CYRNHK} %<all,x2,t2c,t2b>\DeclareUnicodeCharacter{04C8}{\cyrnhk} @@ -1105,7 +1106,7 @@ %<all,x2,t2c>\DeclareUnicodeCharacter{04CD}{\CYRMDSC} %<all,x2,t2c>\DeclareUnicodeCharacter{04CE}{\cyrmdsc} % \end{macrocode} -% +% % \begin{macrocode} %<all,x2,t2c,t2b,t2a,ot2,lcy>\DeclareUnicodeCharacter{04D0}{\U\CYRA} %<all,x2,t2c,t2b,t2a,ot2,lcy>\DeclareUnicodeCharacter{04D1}{\U\cyra} @@ -1205,9 +1206,9 @@ %<all,ts1>\DeclareUnicodeCharacter{25EF}{\textbigcircle} %<all,ts1>\DeclareUnicodeCharacter{266A}{\textmusicalnote} % \end{macrocode} -% +% % \subsection{Notes} -% +% % \changes{v1.1e}{2004/05/22}{Added notes on inconsistency with `8-bit files'.} % The following inputs are inconsistent with the 8-bit inputenc files % since they will always only produce the `text character'. This is an @@ -1249,8 +1250,8 @@ %\DeclareTextCommand{\c}{OT1}[1] %\DeclareTextCommand{\d}{OT1}[1] %\DeclareTextCommand{\k}{T1}[1] -%\end{verbatim} -% +%\end{verbatim} +% % % % \subsection{Mappings for OT1 glyphs} @@ -1284,7 +1285,7 @@ %\DeclareTextCommand{\c}{OT1}[1] %\DeclareTextCommand{\d}{OT1}[1] %\end{verbatim} -% +% % % % \subsection{Mappings for OMS glyphs} @@ -1305,8 +1306,8 @@ %\DeclareTextSymbol{\textasteriskcentered}{OMS}{3} % "03 %\DeclareTextCommand{\textcircled}{OMS} %\end{verbatim} -% -% +% +% % % % \subsection{Mappings for TS1 glyphs} @@ -1319,7 +1320,7 @@ % There is also a collection of characters already set up in the kernel, % one way or the other. Since these do not clearly relate to any % particular font encoding they are mapped when the -% \texttt{utf8} support is first set up. +% \texttt{utf8} support is first set up. % % Also there are a number of |\providecommand|s in the various input % encoding files which may or may not go into this part. @@ -1331,7 +1332,7 @@ % \end{macrocode} % % -% \section{A test document} +% \section{A test document} % % Here is a very small test document which may or may not survive % if the current document is transfered from one place to the @@ -1360,7 +1361,7 @@ German umlauts in UTF-8: ^^c3^^a4^^c3^^b6^^c3^^bc -Some codes that should produce errors as nothing is set up +Some codes that should produce errors as nothing is set up for them: ^^c3F ^^e1^^a4^^b6 And some that are not legal utf8 sequences: ^^c3X ^^e1XY @@ -1370,7 +1371,7 @@ And some that are not legal utf8 sequences: ^^c3X ^^e1XY \stop %</test> % \end{macrocode} -% +% % \Finale % \endinput |