Debian Codegraph @

texmf-dist/doc/xelatex/xecjk/xunicode-symbols.tex

raw
1 %%
2 %% This is file `xunicode-symbols.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% xeCJK.dtx (with options: `xunicode-symbols')
8 %%
9 \documentclass[a4paper]{article}
10 \usepackage[margin=2cm]{geometry}
11 \usepackage{fontspec}
12 \usepackage{xunicode-addon}
13 \usepackage{array,longtable,booktabs}
14 \usepackage{zref-base}
15
16 \setmainfont{FreeSerif}
17 \newfontfamily\falllbackfont{Segoe UI Symbol}
18
19 \makeatletter
20 \ExplSyntaxOn
21 \cs_new_protected:Npx \__xunsym_restore_catcode:
22 { \char_set_catcode:nn { 0 } { \char_value_catcode:n { 0 } } }
23 \file_if_exist:nTF { xunicode-commands.tex }
24 { \char_set_catcode_comment:n { 0 } }
25 { \char_set_catcode_ignore:n { 0 } }
26 ^^@ \tl_new:N \l__xunsym_command_tl
27 ^^@ \int_new:N \l__xunsym_command_int
28 ^^@ \iow_new:N \g__xunsym_command_iow
29 ^^@ \iow_new:N \g__xunsym_combine_mark_iow
30 ^^@ \ior_new:N \g__xunsym_unicode_ior
31 ^^@ \prop_new:N \l__xunsym_command_prop
32 ^^@ \prop_new:N \l__xunsym_combine_mark_prop
33 ^^@ \prop_new:N \l__xunsym_combine_marks_prop
34 ^^@ \cs_new_protected:Npn \SaveUTFCommands
35 ^^@ {
36 ^^@ \group_begin:
37 ^^@ \__xunsym_restore_catcode:
38 ^^@ \cs_set_eq:NN \DeclareTextAccent \use_none:nnn
39 ^^@ \cs_set_eq:NN \DeclareUTFComposite \use_none:n
40 ^^@ \cs_set_eq:NN \DeclareUTFEncodedAccent \use_none:nnn
41 ^^@ \cs_set_eq:NN \DeclareUTFDoubleEncodedAccent \use_none:nnn
42 ^^@ \cs_set_eq:NN \DeclareUTFDoubleEncodedSymbol \use_none:nnn
43 ^^@ \cs_set_eq:NN \DeclareUTFCommand \use_none:nn
44 ^^@ \cs_set_eq:NN \DeclareUTFTIPACommand \use_none:n
45 ^^@ \cs_set_eq:NN \DeclareUTFCompositeCommand \use_none:nnn
46 ^^@ \cs_set_eq:NN \DeclareUTFSymbol \__xunsym_save_UTF_command:Nn
47 ^^@ \cs_set_eq:NN \DeclareUTFCompositeSymbol \__xunsym_save_UTF_command:Nnn
48 ^^@ \cs_set_eq:NN \DeclareEncodedCompositeCharacter \__xunsym_save_combine_mark:nnnn
49 ^^@ \cs_set_eq:NN \DeclareEncodedCompositeAccents \__xunsym_save_combine_marks:nnnn
50 ^^@ \DeclareDocumentCommand \DeclareUTFcharacter { O { \UTFencname } m m }
51 ^^@ { \__xunsym_save_UTF_command:NNn \l__xunsym_command_prop {##3} {##2} }
52 ^^@ \DeclareDocumentCommand \DeclareUTFcomposite { O { \UTFencname } m m m }
53 ^^@ { \__xunsym_save_UTF_command:NNnn \l__xunsym_command_prop {##3} {##4} {##2} }
54 ^^@ \ReloadXunicode { \UTFencname }
55 ^^@ \ior_open:NnTF \g__xunsym_unicode_ior { UnicodeData.txt }
56 ^^@ {
57 ^^@ \iow_open:Nn \g__xunsym_command_iow { xunicode-commands.tex }
58 ^^@ \iow_open:Nn \g__xunsym_combine_mark_iow { xunicode-combine-marks.tex }
59 ^^@ \ior_map_inline:Nn \g__xunsym_unicode_ior { \__xunsym_make_table:w ##1 \q_stop }
60 ^^@ \__xunsym_write_combine_marks:
61 ^^@ \ior_close:N \g__xunsym_unicode_ior
62 ^^@ \iow_close:N \g__xunsym_command_iow
63 ^^@ \iow_close:N \g__xunsym_combine_mark_iow
64 ^^@ \group_end:
65 ^^@ }
66 ^^@ {
67 ^^@ \group_end:
68 ^^@ \msg_fatal:nn { __xunsym } { UnicodeData }
69 ^^@ }
70 ^^@ }
71 ^^@ \msg_new:nnn { __xunsym } { UnicodeData }
72 ^^@ { File~`UnicodeData.txt`~not~found. }
73 ^^@ \cs_new_protected:Npn \__xunsym_save_UTF_command:Nn
74 ^^@ { \__xunsym_save_UTF_command:NNn \l__xunsym_command_prop }
75 ^^@ \cs_new_protected:Npn \__xunsym_save_UTF_command:Nnn
76 ^^@ { \__xunsym_save_UTF_command:NNnn \l__xunsym_command_prop }
77 ^^@ \cs_new_protected:Npn \__xunsym_save_UTF_command:NNn #1#2#3
78 ^^@ { \__xunsym_save_UTF_text_command:Nxx #1 { \use_none:n #3 } { \token_to_str:N #2 } }
79 ^^@ \cs_new_protected:Npn \__xunsym_save_UTF_command:NNnn #1#2#3#4
80 ^^@ {
81 ^^@ \__xunsym_save_UTF_text_command:Nxx #1 { \use_none:n #4 }
82 ^^@ {
83 ^^@ \token_to_str:N #2 \c_left_brace_str
84 ^^@ \tl_if_single:nTF {#3} { \token_to_str:N #3 } { \tl_to_str:n {#3} }
85 ^^@ \c_right_brace_str
86 ^^@ }
87 ^^@ }
88 ^^@ \cs_new_protected:Npn \__xunsym_save_combine_mark:nnnn #1#2#3#4
89 ^^@ { \__xunsym_save_UTF_text_command:Nxx \l__xunsym_combine_mark_prop {#3} { \token_to_str:N #2 } }
90 ^^@ \cs_new_protected:Npn \__xunsym_save_combine_marks:nnnn #1#2#3#4
91 ^^@ { \__xunsym_save_UTF_text_command:Nxx \l__xunsym_combine_marks_prop { { "#4 } { "#3 } } { \token_to_str:N #2 } }
92 ^^@ \cs_new_protected:Npn \__xunsym_save_UTF_text_command:Nxx #1#2#3
93 ^^@ { \use:e { \__xunsym_save_UTF_text_command:Nnn \exp_not:N #1 {#2} {#3} } }
94 ^^@ \cs_new_protected:Npn \__xunsym_save_UTF_text_command:Nnn #1#2#3
95 ^^@ {
96 ^^@ \prop_get:NnNTF #1 {#2} \l__xunsym_command_tl
97 ^^@ { \prop_put:Nno #1 {#2} { \l__xunsym_command_tl , #3 } }
98 ^^@ { \prop_put:Nnn #1 {#2} {#3} }
99 ^^@ }
100 ^^@ \cs_new_protected:Npn \__xunsym_make_table:w #1 ; #2 ; #3 \q_stop
101 ^^@ {
102 ^^@ \prop_get:NnNT \l__xunsym_command_prop {#1} \l__xunsym_command_tl
103 ^^@ {
104 ^^@ \iow_now:Nx \g__xunsym_command_iow
105 ^^@ { \token_to_str:N \UnicodeTextSymbol { "#1 } { \l__xunsym_command_tl } {#2} }
106 ^^@ }
107 ^^@ \prop_get:NnNT \l__xunsym_combine_mark_prop {#1} \l__xunsym_command_tl
108 ^^@ {
109 ^^@ \iow_now:Nx \g__xunsym_combine_mark_iow
110 ^^@ { \token_to_str:N \UnicodeCombineMark { "#1 } { \l__xunsym_command_tl } {#2} }
111 ^^@ }
112 ^^@ }
113 ^^@ \cs_new_protected:Npn \__xunsym_write_combine_marks:
114 ^^@ {
115 ^^@ \prop_map_inline:Nn \l__xunsym_combine_marks_prop
116 ^^@ {
117 ^^@ \iow_now:Nx \g__xunsym_combine_mark_iow
118 ^^@ { \token_to_str:N \UnicodeCombineMarks ##1 {##2} }
119 ^^@ }
120 ^^@ }
121 ^^@ \ExplSyntaxOff
122 ^^@ \SaveUTFCommands
123 ^^@ \ExplSyntaxOn
124 \__xunsym_restore_catcode:
125 \int_new:N \g__xunsym_symbol_int
126 \int_new:N \g__xunsym_table_int
127 \DeclareDocumentCommand \UnicodeTextSymbol { m v m }
128 {
129 \int_gincr:N \g__xunsym_symbol_int
130 \use_none:n #1 &
131 \scan_stop:
132 \reverse_if:N \tex_iffontchar:D \tex_font:D #1 \exp_stop_f: \falllbackfont \fi:
133 \tex_char:D #1 \exp_stop_f: &
134 \tl_set:Nn \l_tmpa_clist {#2}
135 \clist_use:Nn \l_tmpa_clist { \par }
136 \strut
137 & #3 \\
138 }
139 \cs_set_eq:NN \UnicodeCombineMark \UnicodeTextSymbol
140 \DeclareDocumentCommand \UnicodeCombineMarks { m m v }
141 {
142 \int_gincr:N \g__xunsym_symbol_int
143 \use_none:n #1 ~ \use_none:n #2 &
144 \tex_char:D #1 \exp_stop_f: \tex_char:D #2 \exp_stop_f: &
145 \tl_set:Nn \l_tmpa_clist {#3}
146 \clist_use:Nn \l_tmpa_clist { \par }
147 \strut \\
148 }
149 \DeclareDocumentCommand \UTFTABLE { m m }
150 {
151 \int_gincr:N \g__xunsym_table_int
152 \exp_args:Nx \__xunsym_make_table:nnn { UTFTABLE - \int_use:N \g__xunsym_table_int } {#1} {#2}
153 }
154 \cs_new_protected:Npn \__xunsym_make_table:nnn #1#2#3
155 {
156 \section{#2~(\zref@extractdefault{#1}{default}{0})}
157 \zref@refused{#1}
158 \noindent
159 \begin{longtable}[c]{>{\ttfamily\footnotesize}rc>{\ttfamily\footnotesize}p{55mm}>{\tiny}l}
160 \toprule
161 \multicolumn1c{\normalfont\normalsize USV} &
162 \normalfont\normalsize Symbol &
163 \normalfont\normalsize Macro(s) &
164 \normalfont\normalsize Description \\
165 \midrule \endhead
166 \bottomrule \endfoot
167 \int_gzero:N \g__xunsym_symbol_int
168 \input{#3}
169 \end{longtable}
170 \group_begin:
171 \zref@setcurrent{default}{\int_use:N\g__xunsym_symbol_int}
172 \zref@wrapper@immediate{\zref@labelbyprops{#1}{default}}
173 \group_end:
174 }
175 \cs_generate_variant:Nn \__xunsym_make_table:nnn { x }
176 \ExplSyntaxOff
177
178 \begin{document}
179
180 \UTFTABLE{Symbols}{xunicode-commands.tex}
181
182 \UTFTABLE{Combining Marks}{xunicode-combine-marks.tex}
183
184 \end{document}
185 %%
186 %%
187 %% End of file `xunicode-symbols.tex'.