summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ucs/ucs.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/ucs/ucs.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/ucs/ucs.sty')
-rw-r--r--macros/latex/contrib/ucs/ucs.sty749
1 files changed, 749 insertions, 0 deletions
diff --git a/macros/latex/contrib/ucs/ucs.sty b/macros/latex/contrib/ucs/ucs.sty
new file mode 100644
index 0000000000..e5825447f7
--- /dev/null
+++ b/macros/latex/contrib/ucs/ucs.sty
@@ -0,0 +1,749 @@
+%%
+%% This is file `ucs.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ucs.dtx (with options: `ucs.sty')
+%%
+%% Copyright 2001 Dominique Unruh <unruh@ut.ee>
+%% Copyright 2013 Wolfgang Jeltsch <wolfgang@cs.ioc.ee>
+%%
+%% This program is provided under the terms of the LaTeX Project Public License with some
+%% modifications. See the file LICENSE for information.
+%%
+\catcode`\@11
+\ifx\@gobble\undefined\def\@gobble#1{}\fi
+\ifx\@gobbletwo\undefined\def\@gobbletwo#1#2{}\fi
+\ifx\@gobblethree\undefined\def\@gobblethree#1#2#3{}\fi
+\ifx\@gobblefour\undefined\def\@gobblefour#1#2#3#4{}\fi
+\ifx\@firstofone\undefined\def\@firstofone#1{#1}\fi
+\ifx\@tempcnta\undefined\csname newcount\endcsname\@tempcnta\fi
+\ifx\@tempcntb\undefined\csname newcount\endcsname\@tempcntb\fi
+\ifx\@testopt\undefined
+ \def\@testopt#1#2{%
+ \@ifnextchar[{#1}{#1[{#2}]}}\fi
+\ifx\@protected@testopt\undefined\def\@protected@testopt{\expandafter\@testopt\@gobble}\fi
+\let\@let@token\relax
+\ifx\@ifnextchar\undefined
+ \def\@ifnextchar#1#2#3{%
+ \let\reserved@d=#1%
+ \def\reserved@a{#2}%
+ \def\reserved@b{#3}%
+ \futurelet\@let@token\@ifnch}\fi
+\ifx\@ifnch\undefined
+ \def\@ifnch{%
+ \ifx\@let@token\@sptoken
+ \let\reserved@c\@xifnch
+ \else
+ \ifx\@let@token\reserved@d
+ \let\reserved@c\reserved@a
+ \else
+ \let\reserved@c\reserved@b
+ \fi
+ \fi
+ \reserved@c}\fi
+\ifx\@inputcheck\undefined\newread\@inputcheck\fi
+\ifx\IfFileExists\undefined
+\long\def\IfFileExists#1#2#3{%
+ \openin\@inputcheck#1 %SPACE
+ \ifeof\@inputcheck\def\reserved@a{#3}%
+ \else\closein\@inputcheck\def\reserved@a{#2}%
+ \fi
+ \reserved@a}%
+\fi
+\ifx\InputIfFileExists\undefined
+\long\def\InputIfFileExists#1#2{%
+ \IfFileExists{#1}{#2\input #1 }}
+\fi
+\ifx\protect\undefined\let\protect\relax\fi
+\ifx\@typeset@protect\undefined\let\@typeset@protect\relax\fi
+\ifx\IeC\undefined\def\IeC{\ifx\protect\@typeset@protect
+ \expandafter\@firstofone\else\noexpand\IeC\fi}\fi
+\def\unicode@knownoptions{}
+\def\XDeclareUnicodeOption#1#2#3#4#5{%
+ \expandafter\let\csname ifUnicodeOption#2\endcsname\iffalse
+ \expandafter\def\csname UnicodeOption#2true%
+ \expandafter\endcsname\expandafter{%
+ \expandafter\let\csname ifUnicodeOption#2\endcsname\iftrue}%
+ \expandafter\def\csname UnicodeOption#2false%
+ \expandafter\endcsname\expandafter{%
+ \expandafter\let\csname ifUnicodeOption#2\endcsname\iffalse}%
+ \expandafter\def\csname @unicode@option@#2\endcsname{%
+ #3\uni@activate@option{#2}{}{#4}{#5}}%
+ \expandafter\def\csname @unicode@option@no#2\endcsname{%
+ #3\uni@activate@option{#2}{no}{#4}{#5}}%
+ \ifx~#1~\else\LinkUnicodeOptionToPkg{#2}{#1}\fi
+ \let\uc@tempa\\\let\\\relax
+ \edef\unicode@knownoptions{\\{#2}\unicode@knownoptions}%
+ \let\\\uc@tempa
+ }%
+\let\uc@newcommand\def
+\uc@newcommand\DeclareUnicodeOption{\@protected@testopt\DeclareUnicodeOption\DeclareUnicodeOption@{}}
+\uc@newcommand\DeclareUnicodeOption@[#1]#2{%
+ \XDeclareUnicodeOption{#1}{#2}{}{}{}}%
+\uc@newcommand\uc@errormsg#1#2{%
+ \ifx\PackageError\undefined
+ {\newlinechar`\^^J\def\MessageBreak{^^J}%
+ \errhelp{#2}\errmessage{Package ucs: #1}}%
+ \else
+ \PackageError{ucs}{#1}{#2}%
+ \fi
+}%
+\uc@newcommand\uc@warnmsg#1{%
+ \ifx\PackageWarning\undefined
+ {\newlinechar`\^^J\def\MessageBreak{^^J}%
+ \message{Package ucs: #1\MessageBreak}}%
+ \else
+ \PackageWarning{ucs}{#1}%
+ \fi
+}%
+\def\uni@activate@option#1#2#3#4#5{%
+ \ifx\uni@dataloaded\undefined
+ \global\expandafter\def\csname @unicode@option@#1\endcsname##1{%
+ \csname UnicodeOption#1true\endcsname
+ \expandafter\def\csname uo-prio-#1\endcsname{##1}#3}%
+ \global\expandafter\def\csname @unicode@option@no#1\endcsname##1%
+ {\csname UnicodeOption#1false\endcsname#4}%
+ \global\expandafter\let\csname uni@active@#1\endcsname1%
+ \csname @unicode@option@#2#1\endcsname{#5}\else
+ \uc@errormsg{Option #1 must be activated or deactivated %SPACE
+ at least once in the preamble before using it in the document}{%
+ For optimization causes I must know all %SPACE
+ options before loading any unicode data.\MessageBreak
+ Try e.g. #1 or no#1 as package option to ucs.}\fi}
+\def\LinkUnicodeOptionToPkg#1#2{%
+ \AtBeginDocument{\@ifpackageloaded{#2}{\SetUnicodeOption{#1}}{}}}%
+\uc@newcommand\SetUnicodeOption{\@protected@testopt\SetUnicodeOption\SetUnicodeOption@{100}}
+\uc@newcommand\SetUnicodeOption@[#1]#2{%
+ \edef\uc@temp@a{@unicode@option@#2}%
+ \expandafter\ifx\csname\uc@temp@a\endcsname\relax
+ \PackageError{ucs}{Unknown unicode option #2}{}%
+ \else
+ \csname\uc@temp@a\endcsname{#1}%
+ \fi}
+\ifx\ProvidesPackage\undefined\else
+\ProvidesPackage{ucs}[2013/05/11 v2.2 UCS: Unicode input support]%
+\fi
+\ifx\@@input\undefined\input uni-global.def \else\input{uni-global.def}\fi
+\DeclareUnicodeOption{fasterrors}
+\DeclareUnicodeOption{warnunknown}
+\DeclareUnicodeOption{graphics}
+\DeclareUnicodeOption{savemem}
+\DeclareUnicodeOption{document}
+\SetUnicodeOption[1000]{document}
+\DeclareUnicodeOption{default}
+\SetUnicodeOption[0]{default}
+\XDeclareUnicodeOption{}{combine}{}{%
+ \let\uc@cmb\empty}{%
+ \ifx\unicodecombine\undefined\else\unicodecombine\fi
+ \def\uc@cmb{\uc@warn@nocombine}}%
+\ifx\AtBeginDocument\undefined\else
+ \AtEndDocument{\unicodecombine}\fi
+\SetUnicodeOption{nocombine}%
+\def\uc@cmb{\uc@warn@nocombine}%
+\ifx\DeclareOption\undefined\else
+\DeclareOption{showmagickern}{\def\uc@magic@glue{6805678}}%
+\DeclareOption{hyperref}{\AtEndOfPackage{\RequirePackage{ucshyper}}}%
+\DeclareOption*{\SetUnicodeOption{\CurrentOption}}\ProcessOptions*
+\fi
+\ifx\AtBeginDocument\undefined
+ \uc@warnmsg{Not loading ucsencs.def automatically.\MessageBreak
+ Please load it after initializing fontencodings}%
+\else
+ \AtBeginDocument{\input{ucsencs.def}}\fi
+\AtBeginDocument{\ifUnicodeOptiongraphics\RequirePackage{graphicx}\fi}%
+\uc@newcommand\unicode@numtohex{\protect\unicode@numtohex@}%
+\uc@newcommand\unicode@numtohex@#1#2#3{%
+ {%\let\empty\relax\relax
+ %\ifx\empty\relax\def\empty{}%
+ \count255=#2\relax\gdef#1{}%
+ \count252=#3%
+ \loop
+ \count253=\count252\advance\count253by\count255\relax
+ \ifnum\count253>0%
+ \ifnum\count252>0\advance\count252by-1\relax\fi
+ \count254=\count255%
+ \divide\count255by16%
+ \multiply\count255by16%
+ \advance\count254by-\count255%
+ \xdef#1{\ifcase\count254 0\or1\or2\or3\or4\or5\or6\or7\or
+ 8\or9\or A\or B\or C\or D\or E\or F\fi#1}%
+ \divide\count255by16\relax
+ \repeat
+ %\else
+ % \def#1{dec:#2}%
+ %\fi
+ }}
+\let\uc@spc\space
+\newcount\uc@secondtry
+\uc@newcommand\unicode@invalid#1{%
+ \unicode@combine%
+ \ifUnicodeOptiongraphics{%
+ \ifx\unicode@graphicsdir\undefined
+ \def\unicode@graphicsdir{ucs-glyphs}\fi
+ \ifx\unicode@graphicscmd\undefined
+ \def\unicode@graphicscmd{ucs-getglyph \hex\space \dec\space \path\space}\fi
+ \unicode@numtohex\hex{#1}4%
+ \count255=#1\relax
+ \divide\count255 by256\relax
+ \unicode@numtohex\uc@temp@b{\count255}2%
+ \edef\path{\unicode@graphicsdir/\uc@temp@b/U\hex.ps}%
+ \edef\dec{\number#1}%
+ \IfFileExists{\uc@temp@c}{}{%
+ \typeout{Running: \unicode@graphicscmd}%
+ \immediate\write18{\unicode@graphicscmd}%
+ }%
+ \IfFileExists{\path}{%
+ \setbox255=\hbox{X}%
+ \edef\uc@temp@b{\begingroup\noexpand\uni@resetcatcodes
+ \noexpand\includegraphics[height=\the\ht255, trim=0 22.5 0 17.5]%
+ {\path}%
+ \noexpand\ProvidesFile{U\hex.ps}%
+ [Downloaded glyph for U+\hex]%
+ \endgroup}%
+ \typeout{\meaning\uc@temp@b}%
+ \expandafter\unicodevirtual\expandafter{\uc@temp@b}%
+ }{%
+ \PackageWarning{ucs}{File \uc@temp@d\uc@temp@c.ps %SPACE
+ not found.\MessageBreak
+ Use\MessageBreak
+ \space\space\space\space\unicode@graphicscmd\MessageBreak
+ or start latex with option -shell-escape\MessageBreak
+ if you have not already done so.}%
+ \unicodevirtual{\unicode@invalidglyph{#1}}}}\else
+ \unicodevirtual{\unicode@invalidglyph{#1}}\fi}
+\uc@newcommand\unicode@invalidglyph#1{%
+ {\unicode@numtohex\uc@temp@d{#1}4%
+ \fontencoding{OT1}\texttt{[U+\uc@temp@d]}}}
+\uc@newcommand\uni@char#1{%
+ \ucs@protected@unichar\iftrue
+ \expandafter\ifx\csname u-\number#1-h/o\endcsname\relax
+ % \end{macrocode}
+ % If the character is not defined yet, load it.
+ % \begin{macrocode}
+ \begingroup
+ % In case \let is not executed, this (until ===) expands
+ % to \let\relax\relax,
+ % otherwise we have \let\uc@notloaderr\@gobble
+ % Number of \empty's must equal number of args of \uc@char@notloaded
+ \let\uc@notloaderr\@gobble\empty\@gobbletwo\relax\relax
+ % ===
+ \expandafter\endgroup
+ % If \let not executed: Warning is emitted (see |\uc@notloaderr|)
+ % otherwise: |\uc@char@notloaded| is called.
+ \uc@notloaderr{\number#1}\uc@char@notloaded{#1}%
+ \else
+ % \end{macrocode}
+ % If the character is loaded, run |\uc@checkopts|
+ % with the options of this character
+ % as first arg and the code position as second; this will
+ % display the character with
+ % the correct option.
+ % \begin{macrocode}
+ \expandafter\expandafter\expandafter\uc@checkopts
+ \expandafter\expandafter\expandafter
+ {\csname u-\number#1-h/o\endcsname}{#1}%
+ \fi
+ \else
+ \noexpand\unichar{#1}%
+ \fi
+}
+\begingroup
+ \lccode`\A=`\{\lccode`\B=`\}\lccode`\C=`\\%
+ \lccode`\P=`\P\lccode`\U=`\U%
+ \lowercase{%
+\endgroup
+ \uc@newcommand\uc@notloaderr#1#2#3{%
+ \ifx\@gobble#1\else[Please insert %SPACE
+ CPrerenderUnicodeACunicharA#1BB into preamble]\fi}}
+\uc@newcommand\uc@checkopts#1#2{%
+ \expandafter\uc@checkopt@error\expandafter{\number#2}%
+ {error}{error}{infinity}#1\@nil
+}
+\expandafter\uc@newcommand\csname uo-prio-infinity\endcsname{-2100000000}
+%% === BEGIN AUTOGENERATED CODE
+\uc@newcommand\uc@checkopt@stick#1#2#3#4#5{%
+ \ifx\@nil#5%
+\expandafter\ifx\csname u-#2-#1\endcsname\relax
+ \uc@localdeferr{#1}{#2}%
+\else
+ \uc@output{\csname u-#2-#1\endcsname}{#1}%
+\fi
+ \expandafter\@gobblefour
+ \else
+ \iftrue\csname fi\endcsname
+ \csname ifUnicodeOption#5\endcsname
+ \ifnum\csname uo-prio-#2\endcsname>\csname uo-prio-#5\endcsname\uc@spc
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \uc@checkopt@stick
+ \else
+ \ifnum\csname uo-prio-#2\endcsname<\csname uo-prio-#5\endcsname\uc@spc
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \uc@checkopt@change
+ \else
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \uc@checkopt@error
+ \fi
+ \fi
+ \else
+ \expandafter\expandafter\expandafter\uc@checkopt@stick
+ \fi
+ \fi
+ {#1}{#2}{#5}{#2}%
+}
+\uc@newcommand\uc@checkopt@change#1#2#3#4#5{%
+ \ifx\@nil#5%
+\expandafter\ifx\csname u-#3-#1\endcsname\relax
+ \uc@localdeferr{#1}{#3}%
+\else
+ \uc@output{\csname u-#3-#1\endcsname}{#1}%
+\fi
+ \expandafter\@gobblefour
+ \else
+ \iftrue\csname fi\endcsname
+ \csname ifUnicodeOption#5\endcsname
+ \ifnum\csname uo-prio-#3\endcsname>\csname uo-prio-#5\endcsname\uc@spc
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \uc@checkopt@stick
+ \else
+ \ifnum\csname uo-prio-#3\endcsname<\csname uo-prio-#5\endcsname\uc@spc
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \uc@checkopt@change
+ \else
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \uc@checkopt@error
+ \fi
+ \fi
+ \else
+ \expandafter\expandafter\expandafter\uc@checkopt@stick
+ \fi
+ \fi
+ {#1}{#3}{#5}{#3}%
+}
+\uc@newcommand\uc@checkopt@error#1#2#3#4#5{%
+ \ifx\@nil#5%
+\uc@errordrawopt{#1}{#2, #3}{#4}%
+ \expandafter\@gobblefour
+ \else
+ \iftrue\csname fi\endcsname
+ \csname ifUnicodeOption#5\endcsname
+ \ifnum\csname uo-prio-#4\endcsname>\csname uo-prio-#5\endcsname\uc@spc
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \uc@checkopt@errorstick
+ \else
+ \ifnum\csname uo-prio-#4\endcsname<\csname uo-prio-#5\endcsname\uc@spc
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \uc@checkopt@change
+ \else
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \uc@checkopt@error
+ \fi
+ \fi
+ \else
+ \expandafter\expandafter\expandafter\uc@checkopt@errorstick
+ \fi
+ \fi
+ {#1}{#2, #3}{#5}{#4}%
+}
+\uc@newcommand\uc@checkopt@errorstick#1#2#3#4#5{%
+ \ifx\@nil#5%
+\uc@errordrawopt{#1}{#2}{#4}%
+ \expandafter\@gobblefour
+ \else
+ \iftrue\csname fi\endcsname
+ \csname ifUnicodeOption#5\endcsname
+ \ifnum\csname uo-prio-#4\endcsname>\csname uo-prio-#5\endcsname\uc@spc
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \uc@checkopt@errorstick
+ \else
+ \ifnum\csname uo-prio-#4\endcsname<\csname uo-prio-#5\endcsname\uc@spc
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \uc@checkopt@change
+ \else
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \uc@checkopt@error
+ \fi
+ \fi
+ \else
+ \expandafter\expandafter\expandafter\uc@checkopt@errorstick
+ \fi
+ \fi
+ {#1}{#2}{#5}{#4}%
+}
+\let\unicode@empty\empty
+\uc@newcommand\uc@errordrawopt#1#2#3{%
+ \let\unicode@empty\relax\relax
+ \ifx\unicode@empty\relax\let\unicode@empty\empty
+ \unicode@numtohex\uc@temp@b{#1}4%
+ \ifnum\csname uo-prio-#3\endcsname=-2100000000\relax
+ \expandafter\ifx\csname
+ missing-unicode-warned-\number#1\endcsname\relax
+ \global\expandafter\let\csname
+ missing-unicode-warned-\number#1\endcsname\@ne
+ \unicode@error@unknown\@ne{Character \number#1\uc@spc
+ \uc@spc= U+\uc@temp@b\uc@spc
+ matches no activated options.\MessageBreak
+ Type H to see available options}{#1}%
+ \else
+ \PackageWarning{ucs}{Character % SPACE
+ \number#1 \uc@spc= 0x\uc@temp@b\uc@spc
+ appeared again.}%
+ \fi
+ \else
+ \@getcharinfo\uc@temp@c{#1}%
+ \PackageWarning{ucs}{Character %SPACE
+ \number#1 \uc@spc= 0x\uc@temp@b\uc@spc
+ matches options\MessageBreak
+ \uc@spc\uc@spc\uc@spc#2\MessageBreak
+ with same priority \csname uo-prio-#3\endcsname. %SPACE
+ Selecting option #3.\MessageBreak
+ \uc@temp@c}%
+ \uc@output{\csname u-#3-#1\endcsname}{#1}%
+ \fi
+ \else
+ \noexpand\unichar{#1}%
+ \fi
+}
+\uc@newcommand\uc@output#1#2{%
+ \ifx\unicode@delay1\let\unicode@delay\relax\else
+ \ifUnicodeOptioncombine
+ \expandafter\uc@combine\expandafter{#1}{#2}%
+ \else
+ \uc@prechar@exec{#2}%
+ \unicode@charfilter{#1{}}%
+ \fi
+ \ifx\uc@throw\undefined\else
+ \def\uc@got{#2}\uc@throw\global\let\uc@throw\undefined\fi
+ \fi
+}%
+\uc@newcommand\uc@prechar@exec#1{%
+ \ifx\uc@prechar\undefined\else\uc@prechar{#1}\fi}
+\uc@newcommand\uc@localdeferr#1#2{%
+ \@getcharinfo\uc@temp@a{#1}%
+ \PackageError{ucs}{Internal error in character \number#1, %SPACE
+ option #2}{I probably got confused by intermixed local %SPACE
+ and global definitions.\MessageBreak Try to load the needed %SPACE
+ code page via \noexpand\PreloadUnicodePage
+ before declaring anything by yourself.}{\uc@temp@a}%
+ \unicode@invalid{#1}%
+}%
+\uc@newcommand\uc@warn@nocombine{%
+ \PackageError{ucs}{Please activate option 'combine'}{Composed %SPACE
+ characters can only be rendered correctly, when the option %SPACE
+ 'combine' is activated}}
+\newtoks\uc@combtoks
+\newtoks\uc@combtoksb
+\newtoks\uc@temptokena
+\uc@newcommand\unicode@combine{%
+ \uc@check@magicglue%
+ \ifx\uc@combining@prechar\undefined\global\let\uc@comb@code\undefined\fi
+ \ifx\uc@comb@code\undefined\uc@temptokena{}\else
+ \uc@temptokena\expandafter{\expandafter\uc@prechar@exec
+ \expandafter{\uc@comb@code}}\fi%
+ \global\let\uc@comb@code\undefined
+ \global\expandafter\expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\uc@combtoksb
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter\the
+ \expandafter\expandafter\expandafter\uc@combtoksb
+ \expandafter\the\expandafter\uc@temptokena\the\uc@combtoks}%
+ \global\uc@combtoks{}}
+\def\uc@magic@glue{5381}
+\uc@newcommand\uc@check@magicglue{%
+ \ifnum\lastskip=\uc@magic@glue\unskip\else
+ \begingroup
+ \edef\uc@temp@a{\the\uc@combtoks}%
+ \ifx\uc@temp@a\empty\else
+ \PackageWarning{ucs}{Magic kern expected. Probably some %SPACE
+ non-unicode characters mixed in while option combine was %SPACE
+ in effect.}\fi\endgroup
+ \fi}
+\uc@newcommand\unicodevirtual#1{%
+ \def\uc@temp@a##1{#1}\uc@output{\csname uc@temp@a\endcsname}{"FFFF}}
+\uc@newcommand\unicodecombine{%
+ \ifx\protect\@typeset@protect
+ \unicode@combine%
+ %\typeout{WRITING: \the\uc@combtoksb}%
+ \the\uc@combtoksb
+ \uc@prechar@exec{-1}%
+ \global\uc@combtoksb{}%
+ \ifx\uc@throw\undefined\else
+ \def\uc@got{-1}\uc@throw\global\let\uc@throw\undefined\fi
+ \else
+ \noexpand\unicodecombine\fi
+}
+\uc@newcommand\uc@combine#1#2{%
+ \ifx\protect\@typeset@protect
+ \@temptokena\expandafter{#1{}}%
+ \expandafter\expandafter\expandafter\ifx
+ \expandafter\uc@firstofmany\the\@temptokena\uc@firstofmany\uc@cmb
+ \uc@check@magicglue%
+ \uc@combtoks\expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter\@gobble
+ \expandafter#1\expandafter{\the\uc@combtoks}}%
+ \else
+ \unicode@combine%
+ \xdef\uc@comb@code{\number#2}%
+ \global\uc@combtoks\expandafter{#1{}}%
+ \fi
+ %\typeout{->COMBTOKS: \the\uc@combtoks}%
+ \hskip\uc@magic@glue spplus0ptminus0pt %SPACE ; Insert magic glue
+ \else
+ \noexpand\unichar{\number#2}\fi
+}
+\uc@newcommand\uc@char@notloaded#1{%
+ \count255=#1\divide\count255 by 256%
+ \edef\uc@temp@a{uni-\number\count255.def}%
+ \expandafter\ifx\csname\uc@temp@a\endcsname\relax\else
+ \uc@secondtry#1\relax\fi
+ \ifnum\uc@secondtry=#1\relax
+ % If the file has already been loaded, but the character is unknown,
+ % output an error and show the replacement glyph
+ \unicode@numtohex\uc@temp@b{#1}4%
+ \expandafter\ifx\csname
+ missing-unicode-warned-\number#1\endcsname\relax
+ \global\expandafter\let\csname
+ missing-unicode-warned-\number#1\endcsname\@ne
+ \unicode@error@unknown\@ne{Unknown Unicode character % SPACE
+ \number#1 \uc@spc= U+\uc@temp@b,\MessageBreak
+ possibly declared in \uc@temp@a.\MessageBreak
+ Type H to see if it is available with options}{#1}%
+ \else
+ \PackageWarning{ucs}{Unknown character % SPACE
+ \number#1 \uc@spc = 0x\uc@temp@b\uc@spc
+ appeared again.}%
+ \unicode@invalid{#1}%
+ \fi
+ \else
+ \begingroup
+ \ifUnicodeOptionsavemem
+ \else
+ \global\expandafter\let\csname\uc@temp@a\endcsname\@ne
+ \fi
+ \def\uc@got{#1}%
+ \uni@resetcatcodes
+ \expandafter\InputIfFileExists\expandafter{\uc@temp@a}{%
+ \global\let\uni@dataloaded1%
+ }{%
+ }%
+ % End of local group for inputted file
+ \endgroup
+ % Retry displaying character. This won't cause infinite recursion,
+ % because we have marked this file as loaded (globally or, if
+ % |savemem| is set, at least here).
+ \uc@secondtry#1\relax%
+ \uni@char{#1}%
+ \fi
+ }
+\uc@newcommand\PreloadUnicodePage#1{%
+ \begingroup
+ \global\expandafter\let\csname uni-#1.def\endcsname\@ne
+ \uni@resetcatcodes
+ \InputIfFileExists{uni-#1.def}{\let\uni@dataloaded1}{%
+ \PackageError{ucs}{Could not find uni-#1.def}{}}%
+ \endgroup}
+\uc@newcommand\PrerenderUnicode{%
+ \@ifstar{\@prerenderunicode\unichar}{\@prerenderunicode\@gobble}}%
+\uc@newcommand\@prerenderunicode#1#2{%
+ \begingroup
+ \UnicodeCharFilter\@gobble
+ \let#1\@gobble\setbox0\hbox{#2}\endgroup}
+\uc@newcommand\DeclareUnicodeCharacter#1#2{%
+ \DeclareUnicodeCharacterAsOptional{#1}{document}{#2}}
+\uc@newcommand\DeclareUnicodeCharacterAsOptional{%
+ \let\uc@temp@a\relax\uni@declcharopt}
+\uc@newcommand\uc@dclc#1#2{%
+ \let\next=\uni@declcharopt
+ \ifUnicodeOptionsavemem
+ \ifnum\uc@got=#1\else
+ \let\next=\@gobblethree\fi
+ \fi
+ \ifx\next\uni@declcharopt
+ \expandafter\ifx\csname uni@active@#2\endcsname\relax
+ \let\next\@gobblethree\else
+ \expandafter\ifx\csname u-#2-\number#1\endcsname\relax\else
+ \let\next\@gobblethree\fi\fi
+ \let\uc@temp@a\global
+ \fi
+ \next{#1}{#2}}
+\uc@newcommand\uni@declcharopt#1#2#3{%
+ %\typeout{Defining: u-#2-\number#1 (\meaning\uc@temp@a)}%
+ \ifx\utf@viii@map\undefined\else
+ \expandafter\utf@viii@map\expandafter{\number#1}\fi
+ \expandafter\uc@temp@a\expandafter\def
+ \csname u-#2-\number#1\endcsname##1{#3}%\fi
+ \expandafter\ifx\csname u-\number#1-h/o\endcsname\relax
+ \expandafter\def\csname u-\number#1-h/o\endcsname{}\fi
+ \expandafter\uc@temp@a\expandafter\edef
+ \csname u-\number#1-h/o\endcsname{%
+ {#2}\csname u-\number#1-h/o\endcsname}%
+ }%
+\let\unichar\uni@char
+\uc@newcommand\unicodesuper#1{\textsuperscript{#1}}%
+\uc@newcommand\@getcharinfo#1#2{%
+ \begingroup
+ \countdef\uc@got0\relax\uc@got#2\relax
+ \global\def#1{Character's name unknown}%
+ \def\info##1{\xdef#1{##1}}%
+ \uni@resetcatcodes
+ \ifUnicodeOptionfasterrors
+ \global\def#1{No further informations known % SPACE
+ because of option fasterrors.}\else
+ {\InputIfFileExists{uninames.dat}{}{%
+ \global\def#1{Character database uninames.dat not found. %SPACE
+ \MessageBreak Character \number#2 \uc@spc unknown}}}%
+ \fi
+ \toks255{}%
+ \def\uc@dclc##1##2##3{\ifnum##1=\uc@got
+ \toks255\expandafter{\the\toks255, ##2}\fi}%
+ \count255\uc@got\divide\count255by256\relax
+ %\edef\temp@a{uni-\number\count255.def}%
+ \InputIfFileExists{uni-\number\count255.def}{}{}%
+ \expandafter\ifx\expandafter\@nil\the\toks255 \@nil
+ \xdef#1{#1\noexpand\MessageBreak
+ Character is not defined in uni-*.def files}%
+ \else
+ \expandafter\expandafter\expandafter\@getcharinfo@
+ \expandafter\expandafter\expandafter#1%
+ \expandafter\expandafter\expandafter
+ {\expandafter#1\expandafter}\the\toks255 \@nil%
+ \fi
+ \endgroup}
+\def\@getcharinfo@#1#2, #3\@nil{\gdef#1{#2\MessageBreak
+ Character available with following options:\MessageBreak
+ \uc@spc\uc@spc\uc@spc #3}}
+\uc@newcommand\PrintUnicodeName#1{{%
+ \@getcharinfo{\ci}{#1}%
+ \def\MessageBreak{^^J}%
+ \typeout{^^J\ci^^J}}}
+\uc@newcommand\UnicodeCharFilter#1{\let\unicode@charfilter=#1}
+\uc@newcommand\UCSProtectionNone{%
+ \def\ucs@protected@unichar{}%
+ \UnicodeCharFilter\@firstofone}
+\uc@newcommand\UCSProtectionIeC{%
+ \def\ucs@protected@unichar{}%
+ \UnicodeCharFilter\IeC}
+\uc@newcommand\UCSProtectionUnichar{%
+ \def\ucs@protected@unichar##1{\ifx\protect\@typeset@protect}%
+ \UnicodeCharFilter\@firstofone}
+\UCSProtectionIeC
+\uc@newcommand\uni@resetcatcodes{%
+ \endlinechar=13\relax
+ \def\reserved@a##1##2{%
+ \@tempcnta##1\relax
+ \@tempcntb##2\relax
+ \reserved@b
+ }%
+ \def\reserved@b{%
+ \ifnum\@tempcnta>\@tempcntb\else
+ \reserved@c\@tempcnta
+ \advance\@tempcnta\@ne
+ \expandafter\reserved@b
+ \fi
+ }%
+ \catcode`\ =10\relax
+ \catcode`\#=6\relax
+ \catcode`\$=3\relax
+ \catcode`\%=14\relax
+ \catcode`\&=4\relax
+ \catcode`\\=0\relax
+ \catcode`\^=7\relax
+ \catcode`\_=8\relax
+ \catcode`\{=1\relax
+ \catcode`\}=2\relax
+ \catcode`\~=13\relax
+ \catcode`\@=11\relax
+ \catcode`\^^I=10\relax
+ \catcode`\^^J=12\relax
+ \catcode`\^^L=12\relax
+ \catcode`\^^M=5\relax
+ \def\reserved@c##1{\catcode##1=12\relax}%
+ \reserved@c{`\!}%
+ \reserved@c{`\"}%
+ \reserved@a{`\'}{`\?}%
+ \reserved@c{`\[}%
+ \reserved@c{`\]}%
+ \reserved@c{`\`}%
+ \reserved@c{`\|}%
+ \def\reserved@c##1{\catcode##1=11\relax}%
+ \reserved@a{`\A}{`\Z}%
+ \reserved@a{`\a}{`\z}%
+ \def\reserved@c##1{\catcode##1=15\relax}%
+ \reserved@a{0}{`\^^H}%
+ \reserved@c{`\^^K}%
+ \reserved@a{`\^^N}{31}%
+ \catcode"7F=15\relax
+ \relax}
+\catcode`\!13\relax
+\uc@newcommand\unicode@error@unknown{\protect\unicode@error@unknown@}%
+\uc@newcommand\unicode@error@unknown@#1#2#3{%
+ {\expandafter\countdef\expandafter\uc@got\expandafter0%
+ \expandafter\relax\expandafter\uc@got\number#3\relax
+ \ifx\measuring@false\undefined\else\measuring@false\fi
+ \@getcharinfo\uc@temp@c{#3}%
+ \ifUnicodeOptionwarnunknown
+ \PackageWarning{ucs}{#2\MessageBreak\uc@temp@c.\MessageBreak
+ Enter I\noexpand!<RET> to define the glyph.}%
+ \ifx#1\@ne\unicode@invalid{#3}\fi
+ \else
+ \let!\unicode@read@definition\catcode`\!13\relax
+ \let\uc@read@definition\undefined
+ \PackageError{ucs}{#2}{\uc@temp@c.\MessageBreak
+ Enter I\noexpand!<RET> to define the glyph.}%
+ \ifx#1\@ne
+ \ifx\uc@read@definition\undefined\unicode@invalid{#3}%
+ \else\uc@read@definition\fi\fi
+ \fi}}
+\catcode`\!12\relax
+\uc@newcommand\unicode@read@definition{%
+ \uni@resetcatcodes
+ \typein[\definition]{Please enter definition for %SPACE
+ unicode character \number\uc@got}%
+ \global\let\uc@read@definition\definition
+ \toks255\expandafter{\definition}%
+ \edef\definition{\noexpand\DeclareUnicodeCharacter%
+ {\number\uc@got}{\the\toks255}}%
+ \toks255\expandafter{\definition}%
+ \typeout{Tip:\MessageBreak You may include\MessageBreak
+ \uc@spc\uc@spc\the\toks255\MessageBreak
+ into your document source.}%
+ \the\toks255\relax
+ }
+\def\uc@firstofmany#1#2\uc@firstofmany{#1}
+\ifx\AtBeginDocument\undefined\else
+\AtBeginDocument{\def\uc@tempa{\@inpenc@undefined@{utf8}}%
+ \ifx\@inpenc@undefined\uc@tempa
+ \ifx\restore@utf@viii@actives\undefined
+ \PackageWarning{ucs}{***************************\MessageBreak You %SPACE
+ seem to have loaded inputencoding utf8\MessageBreak (LaTeX kernel %SPACE
+ UTF-8) instead of utf8x (ucs.sty UTF-8).\MessageBreak Probably you %SPACE
+ are compiling a document written for a\MessageBreak
+ pre-august-2004 ucs.sty.\MessageBreak
+ ***************************\MessageBreak Please use %SPACE
+ \string\usepackage[utf8x]{inputenc} instead of\MessageBreak
+ \string\usepackage[utf8]{inputenc}.\MessageBreak
+ ***************************\MessageBreak If you should really want %SPACE
+ to use ucs.sty and kernel's\MessageBreak utf8.def together, use %SPACE
+ \string\usepackage[utf8x,utf8]{inputenc}\MessageBreak to disable %SPACE
+ compatibility mode\MessageBreak
+ ***************************\MessageBreak Activating compatibility %SPACE
+ mode.\MessageBreak ***************************\MessageBreak}%
+ \global\let\uc@inputencoding\inputencoding
+ \inputencoding{utf8x}%
+ \def\inputencoding#1{%
+ {\def\uc@tempa{#1}\def\uc@tempb{utf8}\ifx\uc@tempa\uc@tempb
+ \aftergroup\@firstoftwo\else\aftergroup\@secondoftwo\fi}%
+ {\restore@utf@viii@actives}{\uc@inputencoding{#1}}}%
+ \fi\fi
+}\fi