File: lltjp-xunicode.sty

package info (click to toggle)
texlive-lang 2016.20170123-5
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,093,148 kB
  • ctags: 15,901
  • sloc: perl: 46,074; xml: 29,603; makefile: 5,248; sh: 3,179; python: 2,949; ansic: 2,846; ruby: 945; lisp: 726; awk: 636; java: 159; sed: 142; cpp: 12
file content (99 lines) | stat: -rw-r--r-- 3,380 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
%
% lltjp-xunicode.sty
%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{lltjp-xunicode}[2017/01/19 Patch to xunicode for LuaTeX-ja]

\def\XeTeXpicfile{}
\RequirePackage{xunicode,luatexja}
{\catcode`\"=12
\gdef\check@hexcom@digits@#1#2#3#4#5@!@#6#7#8{%
 \ifx @#4\relax
  \UTFacc@warning@{insufficient hex digits #7 for #6-\string#8}%
 \else
  \ifcat \active\noexpand#8%
   \ifx\add@flag\@ne %
    \expandafter\def\csname\UTFencname\string#8\endcsname{\ltjalchar"#1#2#3#4\relax}%
    \ifx\unDeFiNed@#8%
     \ifx\cf@encoding\UTFencname
      \DeclareTextCommand{#8}{OT1}{\undefined}%
     \else
      \DeclareTextCommand{#8}{\cf@encoding}{\undefined}%
     \fi
    \else {% macro #8 exists already ...
      \let\protect\noexpand
      \edef\UTF@testi{#8}\def\UTF@testii{#8}%
      \ifx\UTF@testi\UTF@testii\aftergroup\UTF@ignore
      \else\aftergroup\UTF@doit\fi
     }%
     \iffalse
      % ... but when it isn't robust, make it so
      \expandafter\let\csname?-\string#8\endcsname#8\relax
      \edef\next@UTF@{{\cf@encoding}%
        {\expandafter\noexpand\csname?-\string#8\endcsname}}%
      \expandafter\DeclareTextCommand\expandafter
         {\expandafter#8\expandafter}\next@UTF@
     \fi
    \fi %
   \else % \add@flag \z@
    \expandafter\global\expandafter
      \let\csname\UTFencname\string#8\endcsname\relax
   \fi % end of \add@flag switch
  \else % not active catcode --- shouldn't happen
  % \typeout{*** did you really mean #8 ? ***}%
   \ifx\add@flag\@ne %
    \edef\tmp@name{\expandafter\string\csname\UTFencname\endcsname
      \expandafter\string\csname#8\endcsname}%
    \expandafter\def\csname\tmp@name\endcsname{\ltjalchar"#1#2#3#4\relax}%
    \ifx\cf@encoding\UTFencname
     \expandafter\DeclareTextCommand\expandafter
       {\csname#8\endcsname}{OT1}{\undefined}%
    \else
     \expandafter\DeclareTextCommand\expandafter
       {\csname#8\endcsname}{\cf@encoding}{\undefined}%
    \fi
   \else % \add@flag \z@
    \expandafter\global\expandafter\let\csname#8\endcsname\relax
   \fi % end of \add@flag switch
  \fi % end of \ifcat
 \fi}
\gdef\check@hex@digits@#1#2#3#4#5@!@#6#7#8#9{%
 \ifx @#4\relax
  \UTFacc@warning@{insufficient hex digits #7 for #6-\string#8#9}%
 \else
  \def\UTFchar{\ltjalchar"#1#2#3#4\relax}%
  \expandafter\expandafter\expandafter\declare@utf@composite
  \expandafter\expandafter\expandafter
   {\expandafter\csname#6\endcsname}{\UTFchar}{#8}{#9}\relax
 \fi}
\gdef\add@UTF@accent#1#2#3{\ifx\relax#2\relax\ltjalchar"#3\else
 \ifx\ #2\relax\ltjalchar"#3\else
 \expandafter\ifx\UTF@space#2\relax\ltjalchar"#3\else
 \ifx~#2\ltjalchar"#3\else#2\ltjalchar"#1\fi\fi\fi\fi\relax}
\gdef\add@UTF@accents#1#2#3{#2\ltjalchar"#1\ltjalchar"#3\relax}
}
% If unicode-math is already loaded, the following error occurs:
%    ! Undefined control sequence.
%    \hbar ->\hslash
% Therefore temporarily set \hbar=\relax.
\let\ltj@tmpa\hbar
\let\hbar\relax

\let\ltj@tmpb\iftipaonetoken
\let\iftipaonetoken\relax
%\typeout{UTFencname: \UTFencname}
\let\ltj@temp=\@temp
\edef\@temp{\noexpand\ReloadXunicode{\UTFencname}}\@temp
\makeatletter
\let\@temp=\ltj@temp\let\ltj@temp\relax
\let\hbar\ltj@tmpa
\let\iftipaonetoken\ltj@tmpb
\let\ltj@tmpb\relax % no more an if-token

%% ticket 30501
{\catcode`\!0\catcode`\\11!catcode`!2 11!catcode`!?11!catcode`!-11
 !expandafter!gdef!csname!UTFencname \nobreakspace!endcsname{!?-\nobreakspace}%
}

\endinput