summaryrefslogtreecommitdiff
path: root/macros/xetex/generic
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/xetex/generic
Initial commit
Diffstat (limited to 'macros/xetex/generic')
-rw-r--r--macros/xetex/generic/devanagari/Changelog36
-rw-r--r--macros/xetex/generic/devanagari/README192
-rw-r--r--macros/xetex/generic/devanagari/devanagarinumerals.map21
-rw-r--r--macros/xetex/generic/devanagari/devanagarinumerals.tecbin0 -> 239 bytes
-rw-r--r--macros/xetex/generic/devanagari/harvardkyoto.map193
-rw-r--r--macros/xetex/generic/devanagari/harvardkyoto.tecbin0 -> 1182 bytes
-rw-r--r--macros/xetex/generic/devanagari/iast.map187
-rw-r--r--macros/xetex/generic/devanagari/iast.tecbin0 -> 1151 bytes
-rw-r--r--macros/xetex/generic/devanagari/velthuis-sanskrit.map303
-rw-r--r--macros/xetex/generic/devanagari/velthuis-sanskrit.tecbin0 -> 2264 bytes
-rw-r--r--macros/xetex/generic/devanagari/velthuis.map298
-rw-r--r--macros/xetex/generic/devanagari/velthuis.tecbin0 -> 2062 bytes
l---------macros/xetex/generic/harvardkyoto1
-rw-r--r--macros/xetex/generic/itrans/README144
-rw-r--r--macros/xetex/generic/itrans/brh-kan.map339
-rw-r--r--macros/xetex/generic/itrans/brh-kan.tecbin0 -> 1591 bytes
-rw-r--r--macros/xetex/generic/itrans/itrans-dvn.map327
-rw-r--r--macros/xetex/generic/itrans/itrans-dvn.tecbin0 -> 1713 bytes
-rw-r--r--macros/xetex/generic/itrans/itrans-iast.map409
-rw-r--r--macros/xetex/generic/itrans/itrans-iast.tecbin0 -> 1585 bytes
-rw-r--r--macros/xetex/generic/itrans/itrans-kan.map414
-rw-r--r--macros/xetex/generic/itrans/itrans-kan.tecbin0 -> 2557 bytes
-rw-r--r--macros/xetex/generic/itrans/itrans-sankan.map423
-rw-r--r--macros/xetex/generic/itrans/itrans-sankan.tecbin0 -> 2563 bytes
-rw-r--r--macros/xetex/generic/itrans/itrans-santel.map450
-rw-r--r--macros/xetex/generic/itrans/itrans-santel.tecbin0 -> 2755 bytes
-rw-r--r--macros/xetex/generic/itrans/itrans-sdvn.map341
-rw-r--r--macros/xetex/generic/itrans/itrans-sdvn.tecbin0 -> 1968 bytes
-rw-r--r--macros/xetex/generic/itrans/itrans-tamil-sample.pdfbin0 -> 19150 bytes
-rw-r--r--macros/xetex/generic/itrans/itrans-tamil-sample.tex29
-rw-r--r--macros/xetex/generic/itrans/itrans-tamil.map355
-rw-r--r--macros/xetex/generic/itrans/itrans-tamil.tecbin0 -> 1516 bytes
-rw-r--r--macros/xetex/generic/itrans/itrans-tel.map358
-rw-r--r--macros/xetex/generic/itrans/itrans-tel.tecbin0 -> 1724 bytes
-rw-r--r--macros/xetex/generic/tibetan/Changelog6
-rw-r--r--macros/xetex/generic/tibetan/README58
-rw-r--r--macros/xetex/generic/tibetan/loctib.map350
-rw-r--r--macros/xetex/generic/tibetan/loctib.tecbin0 -> 2475 bytes
-rw-r--r--macros/xetex/generic/tibetan/wylie.map346
-rw-r--r--macros/xetex/generic/tibetan/wylie.tecbin0 -> 2408 bytes
l---------macros/xetex/generic/tibetian1
l---------macros/xetex/generic/xeindex1
-rw-r--r--macros/xetex/generic/xesearch/README33
-rw-r--r--macros/xetex/generic/xesearch/t-xesearch.tex24
-rw-r--r--macros/xetex/generic/xesearch/xesearch.pdfbin0 -> 589055 bytes
-rw-r--r--macros/xetex/generic/xesearch/xesearch.sty1109
-rw-r--r--macros/xetex/generic/xesearch/xesearch.tex3574
-rw-r--r--macros/xetex/generic/xetexko/ChangeLog184
-rw-r--r--macros/xetex/generic/xetexko/README137
-rw-r--r--macros/xetex/generic/xetexko/hanja_hangul.tab20902
-rw-r--r--macros/xetex/generic/xetexko/hanjacom_hangul.tab302
-rw-r--r--macros/xetex/generic/xetexko/hanjaexa_hangul.tab6582
-rw-r--r--macros/xetex/generic/xetexko/xetexko-doc.pdfbin0 -> 222439 bytes
-rw-r--r--macros/xetex/generic/xetexko/xetexko-doc.tex626
-rw-r--r--macros/xetex/generic/xetexko/xetexko-font.sty597
-rw-r--r--macros/xetex/generic/xetexko/xetexko-hanging.sty133
-rw-r--r--macros/xetex/generic/xetexko/xetexko-josa.sty223
-rw-r--r--macros/xetex/generic/xetexko/xetexko-space.sty1650
-rw-r--r--macros/xetex/generic/xetexko/xetexko-vertical.sty177
-rw-r--r--macros/xetex/generic/xetexko/xetexko.sty122
-rw-r--r--macros/xetex/generic/xevlna/License.txt416
-rw-r--r--macros/xetex/generic/xevlna/README27
-rw-r--r--macros/xetex/generic/xevlna/xevlna-inc.tex199
-rw-r--r--macros/xetex/generic/xevlna/xevlna.pdfbin0 -> 46612 bytes
-rw-r--r--macros/xetex/generic/xevlna/xevlna.sty63
-rw-r--r--macros/xetex/generic/xevlna/xevlna.tex51
-rw-r--r--macros/xetex/generic/zhspacing/README.md46
-rw-r--r--macros/xetex/generic/zhspacing/t-zhspacing.tex117
-rw-r--r--macros/xetex/generic/zhspacing/zhfont.sty140
-rw-r--r--macros/xetex/generic/zhspacing/zhmath.sty169
-rw-r--r--macros/xetex/generic/zhspacing/zhs-man.pdfbin0 -> 168160 bytes
-rw-r--r--macros/xetex/generic/zhspacing/zhs-man.tex534
-rw-r--r--macros/xetex/generic/zhspacing/zhsmyclass.sty151
-rw-r--r--macros/xetex/generic/zhspacing/zhspacing-context-test.tex45
-rw-r--r--macros/xetex/generic/zhspacing/zhspacing.sty854
-rw-r--r--macros/xetex/generic/zhspacing/zhsusefulmacros.sty97
-rw-r--r--macros/xetex/generic/zhspacing/zhulem.sty18
77 files changed, 44884 insertions, 0 deletions
diff --git a/macros/xetex/generic/devanagari/Changelog b/macros/xetex/generic/devanagari/Changelog
new file mode 100644
index 0000000000..1d6e4ee186
--- /dev/null
+++ b/macros/xetex/generic/devanagari/Changelog
@@ -0,0 +1,36 @@
+xetex-devanagari (0.5) UNRELEASED; urgency=low
+
+ * improved Readme and Makefile.
+ * added tests.
+ * harvardkyoto.map and iast.map:
+ + fixed end-of-word-Virāma (manual Virāma dropped).
+ + added "+" (U+002B) as ligature breaker.
+ + straightened the code (e.g. changed to direct mapping where possible).
+ + added support for abbreviation (U+0970).
+ * harvardkyoto.map:
+ + dropped Hindi support.
+ * iast.map:
+ + added proper header.
+ + removed German comments.
+ + aligned definition sequence according to harvardkyoto.map.
+
+ -- Daniel Stender <danieldanielstender.com> Fri, 13 Jun 2014 19:30:17 +0200
+
+xetex-devanagari (0.4) released; urgency=low
+
+ * added velthuis.map, velthuis-sanskrit.map and devanagari-numerals.map
+ from the velthuis packet (thanks to Zdeněk Wagner).
+ * removed versioning from harvardkyoto.map.
+
+ -- Daniel Stender <daniel@danielstender.com> Thu, 21 Jul 2011 11:51:28 +0200
+
+xetex-devanagari (0.3) released; urgency=low
+
+ * changed revision numbering (0.2 was 0.99a).
+ * created changelog.
+ * harvardkyoto.map: ॐ (U+0950) is now reached through "OM".
+ * iast.map: changed input entity for "vocalic long r" from <U+1E5B U+0304>
+ (with combined mark) to U+1E5D (LATIN SMALL LETTER R WITH DOT BELOW
+ AND MACRON).
+
+ -- Daniel Stender <daniel@danielstender.com> Fri, 08 Jul 2011 15:51:49 +0200
diff --git a/macros/xetex/generic/devanagari/README b/macros/xetex/generic/devanagari/README
new file mode 100644
index 0000000000..430c4aa926
--- /dev/null
+++ b/macros/xetex/generic/devanagari/README
@@ -0,0 +1,192 @@
+xetex-devanagari 0.5
+====================
+
+Xetex-devanagari (1,2) are input mappings (*.map) for convenient LaTeX
+typesetting of simple Unicode Devanagari (0900-097F, 3) with the
+PDF-engine XeTeX (4).
+
+(1) http://www.ctan.org/tex-archive/macros/xetex/generic/devanagari
+(2) https://github.com/danstender/xetex-devanagari
+(3) http://www.unicode.org/charts/PDF/U0900.pdf
+(4) http://en.wikipedia.org/wiki/Xetex
+
+Their sources (*.tec) are to be compiled with the TECkit (5).
+
+(5) http://scripts.sil.org/TECkit
+
+The maps are maintained by Daniel Stender (6), please send hints and
+report problems to: daniel@danielstender.com.
+
+(6) http://www.danielstender.com/blog/
+
+Velthuis maps
+=============
+
+velthuis.map, velthuis-sanskrit.map and devanagarinumerals.map are taken
+over from the Velthuis packet (7), much thanks to Zdeněk Wagner.
+
+(7) http://www.ctan.org/tex-archive/language/devanagari/velthuis
+
+devanagarinumerals.tec is the simplest way to turn automatically
+generated counters to Devanagari (XeTeX displays the numbers in
+Devanagari while applications like Xindy could work with the original
+Arabic numbering).
+
+Since "~" expands to nonbreakable space it's important to set `~=12 in
+the preamble (8).
+
+(8) http://cikitsa.blogspot.com/2010/09/xelatex-velthuis-encoding-and-palatal.html
+
+velthuis-sanskrit.map (for Sanskrit)
+------------------------------------
+
+Input encoding includes:
+
+ input means
+ ------- -------------------
+ aa ā
+ ii ī
+ uu ū
+ .r ṛ
+ .R ṝ
+ .l ḷ
+ .L ḹ
+ "n ṅ
+ ~n ñ
+ .t ṭ
+ .d ḍ
+ .n ṇ
+ "s ś
+ .s ṣ
+ .m Anusvāra
+ .h Visarga
+ .a Avagrāha
+ .o ॐ
+ @ °
+ + ligature breaking
+
+For a complete list of Velthuis input scheme cf. the manual of the
+Velthuis packet (9), p. 6.
+
+(9) http://mirrors.ctan.org/language/devanagari/velthuis/doc/generic/velthuis/manual.pdf
+
+Usage like:
+
+ \documentclass{article}
+
+ \usepackage{fontspec}
+ \setmainfont[Script=Devanagari,Mapping=../tec/velthuis-sanskrit]{Sanskrit 2003}
+
+ \catcode`\~=12
+
+ \setlength\parindent{0pt}
+
+ \begin{document}
+ namastu"n+ga"sira"scumbicandracaamaracaarave |\\
+ trailokyanagaraarambhamuulas+tambhaaya "sambhave || 1 ||\\
+ haraka.n.thagrahaanandamiilitaak.sii.m namaamyumaam |\\
+ kaalakuu.tavi.saspar"sajaatamuurcchaagamaamiva || 2 ||
+ \end{document}
+
+velthuis.map (for Hindi)
+------------------------
+
+Input encoding includes:
+
+ input means
+ ------- -------
+ qa क़
+ .kha ख़
+ .ga ग़
+ za ज़
+ Ra ड़
+ Rha ढ़
+ fa फ़
+ La ळ
+
+Usage like:
+
+ \documentclass{article}
+
+ \usepackage{fontspec}
+ \setmainfont[Script=Devanagari,Mapping=../tec/velthuis]{Nakula}
+
+ \catcode`\~=12
+
+ \begin{document}
+ am.rt ek cho.te se ghaRe meM samudr ke tal meM sthit thaa | devataa aur asur
+ use nikaalane ke lie samudr ko mathanaa caahate the |
+ \end{document}
+
+harvardkyoto.map
+================
+
+Input coding includes (asterisk marks non-standard):
+
+ input means
+ ------- -------------------
+ A ā
+ I ī
+ U ū
+ R ṛ
+ RR ṝ
+ *L ḷ
+ G ṅ
+ J ñ
+ T ṭ
+ D ḍ
+ N ṇ
+ z ś
+ S ṣ
+ M Anusvāra
+ H Visarga
+ ' Avagrāha
+ OM ॐ
+ .l ळ
+ - Anudātta
+ ! Svarita
+ .m Anunāsika
+ ° abbrev (U+0970)
+ + ligature breaking
+
+Usage like:
+
+ \documentclass[12pt]{article}
+
+ \usepackage{fontspec}
+ \setmainfont[Script=Devanagari,Mapping=../tec/harvardkyoto]{Sanskrit 2003}
+
+ \setlength\parindent{0pt}
+
+ \begin{document}
+ namastuG+gazirazcumbicandracAmaracArave |\\
+ trailokyanagarArambhamUlastambhAya zambhave || 1 ||\\
+ harakaNThagrahAnandamIlitAkSIM namAmyumAm |\\
+ kAlakUTaviSasparzajAtamUrcchAgamAmiva || 2 ||\\[1ex]
+
+ a-gnimI!.le pu-rohi!taM ya-jJasya! de-vamR-tvijaM! |
+ hotA!raM ratna-dhA!tamaM || 1.1.1 ||
+ \end{document}
+
+iast.map
+========
+
+Input coding includes Unicode entities representing the IAST:
+
+- ā ī ū ṛ ṝ (1E5D) ḷ ṅ ñ ṭ ḍ ṇ ś ṣ ṃ ḥ
+
+Usage like:
+
+ \documentclass{article}
+
+ \usepackage{fontspec}
+ \setmainfont[Script=Devanagari,Mapping=../tec/iast]{Sanskrit 2003}
+
+ \setlength\parindent{0pt}
+
+ \begin{document}
+ namastuṅ+gaśiraścumbicandracāmaracārave |\\
+ trailokyanagarārambhamūlastambhāya śambhave || 1 ||\\
+ harakaṇṭhagrahānandamīlitākṣīṃ namāmyumām |\\
+ kālakūṭaviṣasparśajātamūrcchāgamāmiva || 2 ||
+ \end{document}
diff --git a/macros/xetex/generic/devanagari/devanagarinumerals.map b/macros/xetex/generic/devanagari/devanagarinumerals.map
new file mode 100644
index 0000000000..c55b7e65b6
--- /dev/null
+++ b/macros/xetex/generic/devanagari/devanagarinumerals.map
@@ -0,0 +1,21 @@
+; $Id: devanagarinumerals.map,v 1.1 2007-07-15 14:47:55 icebearsoft Exp $
+; TECkit mapping for conversion of arabic numerals to devanagari numerals
+LHSName "Devanagari-numerals"
+RHSName "UNICODE"
+LHSDescription "Arabic numerals"
+RHSDescription "Devanagari numerals"
+Version "1"
+Contact "http://devnag.sarovar.org"
+
+pass(Unicode)
+
+U+0030 > U+0966
+U+0031 > U+0967
+U+0032 > U+0968
+U+0033 > U+0969
+U+0034 > U+096A
+U+0035 > U+096B
+U+0036 > U+096C
+U+0037 > U+096D
+U+0038 > U+096E
+U+0039 > U+096F
diff --git a/macros/xetex/generic/devanagari/devanagarinumerals.tec b/macros/xetex/generic/devanagari/devanagarinumerals.tec
new file mode 100644
index 0000000000..4f6b6d9fc7
--- /dev/null
+++ b/macros/xetex/generic/devanagari/devanagarinumerals.tec
Binary files differ
diff --git a/macros/xetex/generic/devanagari/harvardkyoto.map b/macros/xetex/generic/devanagari/harvardkyoto.map
new file mode 100644
index 0000000000..e8c0d8ce30
--- /dev/null
+++ b/macros/xetex/generic/devanagari/harvardkyoto.map
@@ -0,0 +1,193 @@
+LHSName "harvardkyoto"
+RHSName "Unicode"
+LHSDescription "Harvard/Kyoto input method for Unicode Devanagari"
+Contact "daniel@danielstender.com"
+Copyright "LaTeX Project Public License"
+
+Define a U+0061
+Define A U+0041
+Define i U+0069
+Define I U+0049
+Define u U+0075
+Define U U+0055
+Define R U+0052
+Define L U+004C
+Define e U+0065
+Define o U+006F
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define G U+0047
+Define c U+0063
+Define j U+006A
+Define J U+004A
+Define T U+0054
+Define D U+0044
+Define N U+004E
+Define t U+0074
+Define d U+0064
+Define n U+006E
+Define p U+0070
+Define b U+0062
+Define m U+006D
+Define y U+0079
+Define r U+0072
+Define l U+006C
+Define v U+0076
+Define z U+007A
+Define S U+0053
+Define s U+0073
+Define dot U+002E
+
+Define asvara U+0905
+Define Asvara U+0906
+Define isvara U+0907
+Define Isvara U+0908
+Define usvara U+0909
+Define Usvara U+090A
+Define rvoc U+090B
+Define Rvoc U+0960
+Define lvoc U+090C
+Define esvara U+090F
+Define aisvara U+0910
+Define osvara U+0913
+Define ausvara U+0914
+Define Amatra U+093E
+Define imatra U+093F
+Define Imatra U+0940
+Define umatra U+0941
+Define Umatra U+0942
+Define rmatra U+0943
+Define Rmatra U+0944
+Define lmatra U+0962
+Define ematra U+0947
+Define aimatra U+0948
+Define omatra U+094B
+Define aumatra U+094C
+Define ka U+0915
+Define kha U+0916
+Define ga U+0917
+Define gha U+0918
+Define Ga U+0919
+Define ca U+091A
+Define cha U+091B
+Define ja U+091C
+Define jha U+091D
+Define Ja U+091E
+Define Ta U+091F
+Define Tha U+0920
+Define Da U+0921
+Define Dha U+0922
+Define Na U+0923
+Define ta U+0924
+Define tha U+0925
+Define da U+0926
+Define dha U+0927
+Define na U+0928
+Define pa U+092A
+Define pha U+092B
+Define ba U+092C
+Define bha U+092D
+Define ma U+092E
+Define ya U+092F
+Define ra U+0930
+Define la U+0932
+Define va U+0935
+Define za U+0936
+Define Sa U+0937
+Define sa U+0938
+Define ha U+0939
+Define lla U+0934
+Define virama U+094D
+Define zwnj U+200C
+
+pass(Unicode)
+a > asvara
+A > Asvara
+i > isvara
+I > Isvara
+u > usvara
+U > Usvara
+R > rvoc
+R R > Rvoc
+L > lvoc
+e > esvara
+a i > aisvara
+o > osvara
+a u > ausvara
+k > ka
+k h > kha
+g > ga
+g h > gha
+G > Ga
+c > ca
+c h > cha
+j > ja
+j h > jha
+J > Ja
+T > Ta
+T h > Tha
+D > Da
+D h > Dha
+N > Na
+t > ta
+t h > tha
+d > da
+d h > dha
+n > na
+p > pa
+p h > pha
+b > ba
+b h > bha
+m > ma
+y > ya
+r > ra
+l > la
+v > va
+z > za
+S > Sa
+s > sa
+h > ha
+U+004F U+004D > U+0950 ; om
+dot l > lla
+dot m > U+0901 ; anunāsika
+U+004D > U+0902 ; anusvara
+U+0048 > U+0903 ; visarga
+U+0027 > U+093D ; avagraha
+U+002D > U+0952 ; anudatta
+U+0021 > U+0951 ; svarita
+U+00B0 > U+0970 ; abbrev
+U+0030 > U+0966 ; digit 0
+U+0031 > U+0967 ; digit 1
+U+0032 > U+0968 ; digit 2
+U+0033 > U+0969 ; digit 3
+U+0034 > U+096A ; digit 4
+U+0035 > U+096B ; digit 5
+U+0036 > U+096C ; digit 6
+U+0037 > U+096D ; digit 7
+U+0038 > U+096E ; digit 8
+U+0039 > U+096F ; digit 9
+U+007C > U+0964 ; danda
+U+007C U+007C > U+0965 ; double danda
+U+002B > zwnj ; ligature breaker
+
+pass(Unicode)
+UniClass [vyanjana] = (ka .. ha)
+UniClass [svara] = (Asvara .. ausvara)
+UniClass [matra] = (Amatra .. aumatra)
+[vyanjana] [svara] > [vyanjana] [matra]
+[vyanjana] zwnj > [vyanjana] virama zwnj
+
+pass(Unicode)
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+pass(Unicode)
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+[vyanjana] / _ # > [vyanjana] virama / _ #
+
+pass(Unicode)
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana] asvara > [vyanjana]
+
diff --git a/macros/xetex/generic/devanagari/harvardkyoto.tec b/macros/xetex/generic/devanagari/harvardkyoto.tec
new file mode 100644
index 0000000000..6b1de45eb7
--- /dev/null
+++ b/macros/xetex/generic/devanagari/harvardkyoto.tec
Binary files differ
diff --git a/macros/xetex/generic/devanagari/iast.map b/macros/xetex/generic/devanagari/iast.map
new file mode 100644
index 0000000000..787baf745f
--- /dev/null
+++ b/macros/xetex/generic/devanagari/iast.map
@@ -0,0 +1,187 @@
+LHSName "iast"
+RHSName "Unicode"
+LHSDescription "IAST input method for Unicode Devanagari"
+Contact "daniel@danielstender.com"
+Copyright "LaTeX Project Public License"
+
+Define a U+0061
+Define A U+0101 ; ā
+Define i U+0069
+Define I U+012B ; ī
+Define u U+0075
+Define U U+016B ; ū
+Define R U+1E5B ; ṛ
+Define RR U+1E5D ; ṝ
+Define L U+1E37 ; ḷ
+Define e U+0065
+Define o U+006F
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define G U+1E45 ; ṅ
+Define c U+0063
+Define j U+006A
+Define J U+00F1 ; ñ
+Define T U+1E6D ; ṭ
+Define D U+1E0D ; ḍ
+Define N U+1E47 ; ṇ
+Define t U+0074
+Define d U+0064
+Define n U+006E
+Define p U+0070
+Define b U+0062
+Define m U+006D
+Define y U+0079
+Define r U+0072
+Define l U+006C
+Define v U+0076
+Define z U+015B ; ś
+Define S U+1E63 ; ṣ
+Define s U+0073
+
+Define asvara U+0905
+Define Asvara U+0906
+Define isvara U+0907
+Define Isvara U+0908
+Define usvara U+0909
+Define Usvara U+090A
+Define rvoc U+090B
+Define Rvoc U+0960
+Define lvoc U+090C
+Define esvara U+090F
+Define aisvara U+0910
+Define osvara U+0913
+Define ausvara U+0914
+Define Amatra U+093E
+Define imatra U+093F
+Define Imatra U+0940
+Define umatra U+0941
+Define Umatra U+0942
+Define rmatra U+0943
+Define Rmatra U+0944
+Define lmatra U+0962
+Define ematra U+0947
+Define aimatra U+0948
+Define omatra U+094B
+Define aumatra U+094C
+Define ka U+0915
+Define kha U+0916
+Define ga U+0917
+Define gha U+0918
+Define Ga U+0919
+Define ca U+091A
+Define cha U+091B
+Define ja U+091C
+Define jha U+091D
+Define Ja U+091E
+Define Ta U+091F
+Define Tha U+0920
+Define Da U+0921
+Define Dha U+0922
+Define Na U+0923
+Define ta U+0924
+Define tha U+0925
+Define da U+0926
+Define dha U+0927
+Define na U+0928
+Define pa U+092A
+Define pha U+092B
+Define ba U+092C
+Define bha U+092D
+Define ma U+092E
+Define ya U+092F
+Define ra U+0930
+Define la U+0932
+Define va U+0935
+Define za U+0936
+Define Sa U+0937
+Define sa U+0938
+Define ha U+0939
+Define virama U+094D
+Define zwnj U+200C
+
+pass(Unicode)
+a > asvara
+A > Asvara
+i > isvara
+I > Isvara
+u > usvara
+U > Usvara
+R > rvoc
+RR > Rvoc
+L > lvoc
+e > esvara
+a i > aisvara
+o > osvara
+a u > ausvara
+k > ka
+k h > kha
+g > ga
+g h > gha
+G > Ga
+c > ca
+c h > cha
+j > ja
+j h > jha
+J > Ja
+T > Ta
+T h > Tha
+D > Da
+D h > Dha
+N > Na
+t > ta
+t h > tha
+d > da
+d h > dha
+n > na
+p > pa
+p h > pha
+b > ba
+b h > bha
+m > ma
+y > ya
+r > ra
+l > la
+v > va
+z > za
+S > Sa
+s > sa
+h > ha
+U+1E25 > U+0903 ; ḥ
+U+1E43 > U+0902 ; ṃ
+U+0027 > U+093D ; avagraha
+U+00B0 > U+0970 ; abbrev
+U+0030 > U+0966 ; digit 0
+U+0031 > U+0967
+U+0032 > U+0968
+U+0033 > U+0969
+U+0034 > U+096A
+U+0035 > U+096B
+U+0036 > U+096C
+U+0037 > U+096D
+U+0038 > U+096E
+U+0039 > U+096F
+U+007C > U+0964 ; danda
+U+007C U+007C > U+0965 ; double danda
+U+002B > zwnj ; ligature breaker
+
+pass(Unicode)
+UniClass [vyanjana] = (ka .. ha)
+UniClass [svara] = (Asvara .. ausvara)
+UniClass [matra] = (Amatra .. aumatra)
+[vyanjana] [svara] > [vyanjana] [matra]
+[vyanjana] zwnj > [vyanjana] virama zwnj
+
+pass(Unicode)
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+pass(Unicode)
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+[vyanjana] / _ # > [vyanjana] virama / _ #
+
+pass(Unicode)
+Uniclass [vyanjana] = (ka .. ha)
+[vyanjana] asvara > [vyanjana]
+
diff --git a/macros/xetex/generic/devanagari/iast.tec b/macros/xetex/generic/devanagari/iast.tec
new file mode 100644
index 0000000000..2e2037def1
--- /dev/null
+++ b/macros/xetex/generic/devanagari/iast.tec
Binary files differ
diff --git a/macros/xetex/generic/devanagari/velthuis-sanskrit.map b/macros/xetex/generic/devanagari/velthuis-sanskrit.map
new file mode 100644
index 0000000000..175ca3386b
--- /dev/null
+++ b/macros/xetex/generic/devanagari/velthuis-sanskrit.map
@@ -0,0 +1,303 @@
+; $Id: velthuis-sanskrit.map,v 1.2 2008-03-12 19:41:03 icebearsoft Exp $
+; TECkit mapping for conversion of Velthuis transliteration
+; into UTF-8 directly by XeTeX.
+; Viramas are added after the final consonant.
+; Rules from tex-text.map and devanagarinumerals.map are included.
+LHSName "Velthuis-sanskrit"
+RHSName "UNICODE"
+LHSDescription "Velthuis Devanagari for Sanskrit"
+Version "1"
+Contact "http://devnag.sarovar.org"
+
+Define a U+0061 ;a
+Define b U+0062 ;b
+Define c U+0063 ;c
+Define d U+0064 ;d
+Define e U+0065 ;e
+Define f U+0066 ;f
+Define g U+0067 ;g
+Define h U+0068 ;h
+Define i U+0069 ;i
+Define j U+006A ;j
+Define k U+006B ;k
+Define l U+006C ;l
+Define m U+006D ;m
+Define n U+006E ;n
+Define o U+006F ;o
+Define p U+0070 ;p
+Define q U+0071 ;q
+Define r U+0072 ;r
+Define s U+0073 ;s
+Define t U+0074 ;t
+Define u U+0075 ;u
+Define v U+0076 ;v
+Define w U+0077 ;w
+Define x U+0078 ;x
+Define y U+0079 ;y
+Define z U+007A ;z
+Define A U+0041 ;A
+Define B U+0042 ;B
+Define C U+0043 ;C
+Define D U+0044 ;D
+Define G U+0047 ;G
+Define I U+0049 ;I
+Define J U+004A ;J
+Define K U+004B ;K
+Define L U+004C ;L
+Define M U+004d ;M
+Define P U+0050 ;P
+Define R U+0052 ;R
+Define T U+0054 ;T
+Define U U+0055 ;U
+
+Define quot U+0022
+Define hash U+0023
+Define amper U+0026
+Define plus U+002B
+Define dot U+002E
+Define slash U+002F
+Define at U+0040
+Define under U+005F
+Define lbrace U+007B
+Define bar U+007C
+Define rbrace U+007D
+Define tlde U+007E
+
+Define candrabindu U+0901
+Define bindu U+0902
+Define visarga U+0903
+Define asvara U+0905
+Define Asvara U+0906
+Define isvara U+0907
+Define Isvara U+0908
+Define usvara U+0909
+Define Usvara U+090A
+Define rvoc U+090B
+Define lvoc U+090C
+Define esvara U+090F
+Define aisvara U+0910
+Define ocandra U+0911
+Define osvara U+0913
+Define ausvara U+0914
+Define ka U+0915
+Define kha U+0916
+Define ga U+0917
+Define gha U+0918
+Define nga U+0919
+Define ca U+091A
+Define cha U+091B
+Define ja U+091C
+Define jha U+091D
+Define nya U+091E
+Define Ta U+091F
+Define Tha U+0920
+Define Da U+0921
+Define Dha U+0922
+Define Na U+0923
+Define ta U+0924
+Define tha U+0925
+Define da U+0926
+Define dha U+0927
+Define na U+0928
+Define pa U+092A
+Define pha U+092B
+Define ba U+092C
+Define bha U+092D
+Define ma U+092E
+Define ya U+092F
+Define ra U+0930
+Define la U+0932
+Define La U+0933
+Define va U+0935
+Define sha U+0936
+Define Sa U+0937
+Define sa U+0938
+Define ha U+0939
+Define avagraha U+093D
+Define Amatra U+093E
+Define imatra U+093F
+Define Imatra U+0940
+Define umatra U+0941
+Define Umatra U+0942
+Define rmatra U+0943
+Define Rmatra U+0944
+Define ematra U+0947
+Define aimatra U+0948
+Define ocmatra U+0949
+Define omatra U+094B
+Define aumatra U+094C
+Define virama U+094D
+Define aum U+0950
+Define qa U+0958
+Define khha U+0959
+Define ghha U+095A
+Define za U+095B
+Define Ra U+095C
+Define Rha U+095D
+Define fa U+095E
+Define Rvoc U+0960
+Define Lvoc U+0961
+Define lmatra U+0962
+Define Lmatra U+0963
+Define danda U+0964
+Define dbldanda U+0965
+Define abbrev U+0970
+
+Define zwnj U+200C
+Define zwj U+200D
+
+;; First pass
+pass(Unicode)
+; From TeX-text
+U+002D U+002D <> U+2013 ; -- -> en dash
+U+002D U+002D U+002D <> U+2014 ; --- -> em dash
+
+U+0027 <> U+2019 ; ' -> right single quote
+U+0027 U+0027 <> U+201D ; '' -> right double quote
+U+0022 > U+201D ; " -> right double quote
+
+U+0060 <> U+2018 ; ` -> left single quote
+U+0060 U+0060 <> U+201C ; `` -> left double quote
+
+; Numerals
+U+0030 > U+0966
+U+0031 > U+0967
+U+0032 > U+0968
+U+0033 > U+0969
+U+0034 > U+096A
+U+0035 > U+096B
+U+0036 > U+096C
+U+0037 > U+096D
+U+0038 > U+096E
+U+0039 > U+096F
+
+; Vowels, all independent
+a <> asvara
+a a > Asvara
+A <> Asvara
+i <> isvara
+i i > Isvara
+I <> Isvara
+u <> usvara
+u u > Usvara
+U <> Usvara
+dot r <> rvoc
+dot R <> Rvoc
+dot l <> lvoc
+dot L <> Lvoc
+e <> esvara
+a i <> aisvara
+o <> osvara
+a u <> ausvara
+M <> bindu
+dot m > bindu
+tlde m <> candrabindu
+slash > candrabindu
+dot h <> visarga
+under <> virama
+amper > virama
+dot a <> avagraha
+tlde o <> ocandra
+dot o <> aum
+
+; Consonants, no conjuncts
+k <> ka
+k h <> kha
+K > kha
+g <> ga
+g h <> gha
+G > gha
+quot n <> nga
+q <> qa
+dot k h <> khha
+dot g <> ghha
+c <> ca
+c h <> cha
+C > cha
+j <> ja
+j h <> jha
+J > jha
+tlde n <> nya
+z <> za
+dot t <> Ta
+dot t h <> Tha
+dot T > Tha
+dot d <> Da
+dot d h <> Dha
+dot D > Dha
+dot n <> Na
+R <> Ra
+R h <> Rha
+t <> ta
+t h <> tha
+T > tha
+d <> da
+d h <> dha
+D > dha
+n <> na
+p <> pa
+p h <> pha
+P > pha
+b <> ba
+b h <> bha
+B > bha
+m <> ma
+f <> fa
+y <> ya
+r <> ra
+l <> la
+v <> va
+L <> La
+quot s <> sha
+dot s <> Sa
+s <> sa
+h <> ha
+; Symbols
+at <> abbrev
+bar <> danda
+
+; Ligature breaking
+plus <> zwj
+
+;; Second pass: converting vowels + a few simple rules
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha qa .. fa)
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc Lvoc esvara aisvara \
+ osvara ausvara ocandra)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra Lmatra ematra \
+ aimatra omatra aumatra ocmatra)
+
+[vyanjana] [svara] <> [vyanjana] [matra]
+[vyanjana] zwj <> [vyanjana] virama zwj
+danda danda <> dbldanda
+
+;; Third pass: making conjuncts
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha qa .. fa)
+
+[vyanjana]=v1 [vyanjana]=v2 <> @v1 virama @v2
+
+;; Fourth pass: making remaining conjuncts (for groups of two or more consonants)
+;; and adding viramas to the end of the words in Sanskrit
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha qa .. fa)
+UniClass [spacepunct] = (U+0009 .. U+0040 U+005B .. U+0060 U+007B .. U+007D danda dbldanda \
+ U+2013 U+2014 U+2018 U+2019 U+201C U+201D)
+
+[vyanjana]=v1 [vyanjana]=v2 <> @v1 virama @v2
+[vyanjana] / _ [spacepunct] <> [vyanjana] virama / _ [spacepunct]
+[vyanjana] / _ # <> [vyanjana] virama / _ #
+
+;; Fifth pass: removing inherent "a"
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha qa .. fa)
+
+[vyanjana] asvara <> [vyanjana]
diff --git a/macros/xetex/generic/devanagari/velthuis-sanskrit.tec b/macros/xetex/generic/devanagari/velthuis-sanskrit.tec
new file mode 100644
index 0000000000..f58c528aa9
--- /dev/null
+++ b/macros/xetex/generic/devanagari/velthuis-sanskrit.tec
Binary files differ
diff --git a/macros/xetex/generic/devanagari/velthuis.map b/macros/xetex/generic/devanagari/velthuis.map
new file mode 100644
index 0000000000..c028dc62a2
--- /dev/null
+++ b/macros/xetex/generic/devanagari/velthuis.map
@@ -0,0 +1,298 @@
+; $Id: velthuis.map,v 1.1 2007-07-15 14:47:55 icebearsoft Exp $
+; TECkit mapping for conversion of Velthuis transliteration
+; to UTF-8 directly in XeTeX
+; Viramas are NOT added after the final consonant.
+; Rules from tex-text.map and devanagarinumerals.map are included.
+LHSName "Velthuis-standard-hindi"
+RHSName "UNICODE"
+LHSDescription "Velthuis Devanagari for Standard Hindi"
+Version "1"
+Contact "http://devnag.sarovar.org"
+
+Define a U+0061 ;a
+Define b U+0062 ;b
+Define c U+0063 ;c
+Define d U+0064 ;d
+Define e U+0065 ;e
+Define f U+0066 ;f
+Define g U+0067 ;g
+Define h U+0068 ;h
+Define i U+0069 ;i
+Define j U+006A ;j
+Define k U+006B ;k
+Define l U+006C ;l
+Define m U+006D ;m
+Define n U+006E ;n
+Define o U+006F ;o
+Define p U+0070 ;p
+Define q U+0071 ;q
+Define r U+0072 ;r
+Define s U+0073 ;s
+Define t U+0074 ;t
+Define u U+0075 ;u
+Define v U+0076 ;v
+Define w U+0077 ;w
+Define x U+0078 ;x
+Define y U+0079 ;y
+Define z U+007A ;z
+Define A U+0041 ;A
+Define B U+0042 ;B
+Define C U+0043 ;C
+Define D U+0044 ;D
+Define G U+0047 ;G
+Define I U+0049 ;I
+Define J U+004A ;J
+Define K U+004B ;K
+Define L U+004C ;L
+Define M U+004d ;M
+Define P U+0050 ;P
+Define R U+0052 ;R
+Define T U+0054 ;T
+Define U U+0055 ;U
+
+Define quot U+0022
+Define hash U+0023
+Define amper U+0026
+Define plus U+002B
+Define dot U+002E
+Define slash U+002F
+Define at U+0040
+Define under U+005F
+Define lbrace U+007B
+Define bar U+007C
+Define rbrace U+007D
+Define tlde U+007E
+
+Define candrabindu U+0901
+Define bindu U+0902
+Define visarga U+0903
+Define asvara U+0905
+Define Asvara U+0906
+Define isvara U+0907
+Define Isvara U+0908
+Define usvara U+0909
+Define Usvara U+090A
+Define rvoc U+090B
+Define lvoc U+090C
+Define esvara U+090F
+Define aisvara U+0910
+Define ocandra U+0911
+Define osvara U+0913
+Define ausvara U+0914
+Define ka U+0915
+Define kha U+0916
+Define ga U+0917
+Define gha U+0918
+Define nga U+0919
+Define ca U+091A
+Define cha U+091B
+Define ja U+091C
+Define jha U+091D
+Define nya U+091E
+Define Ta U+091F
+Define Tha U+0920
+Define Da U+0921
+Define Dha U+0922
+Define Na U+0923
+Define ta U+0924
+Define tha U+0925
+Define da U+0926
+Define dha U+0927
+Define na U+0928
+Define pa U+092A
+Define pha U+092B
+Define ba U+092C
+Define bha U+092D
+Define ma U+092E
+Define ya U+092F
+Define ra U+0930
+Define la U+0932
+Define La U+0933
+Define va U+0935
+Define sha U+0936
+Define Sa U+0937
+Define sa U+0938
+Define ha U+0939
+Define avagraha U+093D
+Define Amatra U+093E
+Define imatra U+093F
+Define Imatra U+0940
+Define umatra U+0941
+Define Umatra U+0942
+Define rmatra U+0943
+Define Rmatra U+0944
+Define ematra U+0947
+Define aimatra U+0948
+Define ocmatra U+0949
+Define omatra U+094B
+Define aumatra U+094C
+Define virama U+094D
+Define aum U+0950
+Define qa U+0958
+Define khha U+0959
+Define ghha U+095A
+Define za U+095B
+Define Ra U+095C
+Define Rha U+095D
+Define fa U+095E
+Define Rvoc U+0960
+Define Lvoc U+0961
+Define lmatra U+0962
+Define Lmatra U+0963
+Define danda U+0964
+Define dbldanda U+0965
+Define abbrev U+0970
+
+Define zwnj U+200C
+Define zwj U+200D
+
+;; First pass
+pass(Unicode)
+; From TeX-text
+U+002D U+002D <> U+2013 ; -- -> en dash
+U+002D U+002D U+002D <> U+2014 ; --- -> em dash
+
+U+0027 <> U+2019 ; ' -> right single quote
+U+0027 U+0027 <> U+201D ; '' -> right double quote
+U+0022 > U+201D ; " -> right double quote
+
+U+0060 <> U+2018 ; ` -> left single quote
+U+0060 U+0060 <> U+201C ; `` -> left double quote
+
+; Numerals
+U+0030 > U+0966
+U+0031 > U+0967
+U+0032 > U+0968
+U+0033 > U+0969
+U+0034 > U+096A
+U+0035 > U+096B
+U+0036 > U+096C
+U+0037 > U+096D
+U+0038 > U+096E
+U+0039 > U+096F
+
+; Vowels, all independent
+a <> asvara
+a a > Asvara
+A <> Asvara
+i <> isvara
+i i > Isvara
+I <> Isvara
+u <> usvara
+u u > Usvara
+U <> Usvara
+dot r <> rvoc
+dot R <> Rvoc
+dot l <> lvoc
+dot L <> Lvoc
+e <> esvara
+a i <> aisvara
+o <> osvara
+a u <> ausvara
+M <> bindu
+dot m > bindu
+tlde m <> candrabindu
+slash > candrabindu
+dot h <> visarga
+under <> virama
+amper > virama
+dot a <> avagraha
+tlde o <> ocandra
+dot o <> aum
+
+; Consonants, no conjuncts
+k <> ka
+k h <> kha
+K > kha
+g <> ga
+g h <> gha
+G > gha
+quot n <> nga
+q <> qa
+dot k h <> khha
+dot g <> ghha
+c <> ca
+c h <> cha
+C > cha
+j <> ja
+j h <> jha
+J > jha
+tlde n <> nya
+z <> za
+dot t <> Ta
+dot t h <> Tha
+dot T > Tha
+dot d <> Da
+dot d h <> Dha
+dot D > Dha
+dot n <> Na
+R <> Ra
+R h <> Rha
+t <> ta
+t h <> tha
+T > tha
+d <> da
+d h <> dha
+D > dha
+n <> na
+p <> pa
+p h <> pha
+P > pha
+b <> ba
+b h <> bha
+B > bha
+m <> ma
+f <> fa
+y <> ya
+r <> ra
+l <> la
+v <> va
+L <> La
+quot s <> sha
+dot s <> Sa
+s <> sa
+h <> ha
+; Symbols
+at <> abbrev
+bar <> danda
+
+; Ligature breaking
+plus <> zwj
+
+;; Second pass: converting vowels + a few simple rules
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha qa .. fa)
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc Lvoc esvara aisvara \
+ osvara ausvara ocandra)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra Lmatra ematra \
+ aimatra omatra aumatra ocmatra)
+
+[vyanjana] [svara] <> [vyanjana] [matra]
+[vyanjana] zwj <> [vyanjana] virama zwj
+danda danda <> dbldanda
+
+;; Third pass: making conjuncts
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha qa .. fa)
+
+[vyanjana]=v1 [vyanjana]=v2 <> @v1 virama @v2
+
+;; Fourth pass: making remaining conjuncts (for groups of two or more consonants)
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha qa .. fa)
+
+[vyanjana]=v1 [vyanjana]=v2 <> @v1 virama @v2
+
+;; Fifth pass: removing inherent "a"
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha qa .. fa)
+
+[vyanjana] asvara <> [vyanjana]
diff --git a/macros/xetex/generic/devanagari/velthuis.tec b/macros/xetex/generic/devanagari/velthuis.tec
new file mode 100644
index 0000000000..03b0d95e98
--- /dev/null
+++ b/macros/xetex/generic/devanagari/velthuis.tec
Binary files differ
diff --git a/macros/xetex/generic/harvardkyoto b/macros/xetex/generic/harvardkyoto
new file mode 120000
index 0000000000..c01dc6616f
--- /dev/null
+++ b/macros/xetex/generic/harvardkyoto
@@ -0,0 +1 @@
+devanagari \ No newline at end of file
diff --git a/macros/xetex/generic/itrans/README b/macros/xetex/generic/itrans/README
new file mode 100644
index 0000000000..a86cbe457a
--- /dev/null
+++ b/macros/xetex/generic/itrans/README
@@ -0,0 +1,144 @@
+% README for ITRANS and Baraha mapping files to be used with XeLaTeX.
+% Copyright (C) 2010-2014, Abhinandan S. Prasad and Shrisha Rao.
+%
+% Version 4.2, Time-stamp: <2014-09-01 11:47:23 shrao>
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% 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.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Shrisha Rao.
+%
+% This work consists of the files brh-kan.map, brh-kan.tec,
+% itrans-dvn.map, itrans-dvn.tec, itrans-sdvn.map, itrans-sdvn.tec,
+% itrans-iast.map, itrans-iast.tec, itrans-kan.map, itrans-kan.tec,
+% itrans-sankan.map, itrans-sankan.tec, itrans-santel.map,
+% itrans-santel.tec, itrans-tamil.map, itrans-tamil.tec,
+% itrans-tamil-sample.pdf, itrans-tamil-sample.tex, itrans-tel.map,
+% itrans-tel.tec, and README.
+
+The following files are mappings that can be used with XeLaTeX for
+codings done in the ITRANS and Baraha formats. In each instance, the
+*.map file is the actual (ASCII) mapping, while the *.tec file is the
+compiled version used by the software.
+
+The itrans-tel mapping is by Kattamuri Ekanadham.
+
+brh-kan: This mapping should be used with codings done in Baraha,
+ where the output is desired in Kannada script.
+
+itrans-dvn: This mapping should be used with codings done in ITRANS,
+ where the output is desired in Devanagari script. The
+ codings are typically, but not necessarily, of Sanskrit
+ texts (they could also be, e.g., Hindi or Marathi).
+
+itrans-sdvn: This mapping is very similar to the above, but does not
+ need the use of a vowel `a' at the ends of words; thus,
+ `rAm' can be used rather than `rAma'.
+
+itrans-iast: This mapping should be used with codings done in ITRANS,
+ where the output is desired in accented Roman (IAST)
+ script.
+
+itrans-kan: This mapping should be used with codings done in ITRANS
+ of Kannada texts, where the output is desired in Kannada
+ script.
+
+itrans-sankan: This mapping should be used with codings done in ITRANS
+ of Sanskrit texts, where the output is desired in Kannada
+ script.
+
+itrans-santel: This mapping should be used with codings done in ITRANS
+ of Sanskrit texts, where the output is desired in Telugu
+ script.
+
+itrans-tamil: This mapping should be used with codings done in ITRANS
+ of Tamil texts, where the output is desired in Tamil
+ script.
+
+itrans-tel: This mapping should be used with codings done in ITRANS
+ of Telugu texts, where the output is desired in Telugu
+ script.
+
+Note that `e' and `o' get mapped to the long-vowels with itrans-sankan
+and in itrans-santel, but to the short vowels in itrans-kan and
+itrans-tel (where `E' and `O' are needed for the long vowels).
+
+To use these mappings, insert one or more of the following sets of
+lines in your *.tex files after the \documentclass command and
+appropriate other includes and settings.
+
+\newcommand\abc{\catcode`\^=11
+ \catcode`\~=11
+ \fontspec[Script=Kannada,Mapping=brh-kan]{<fontname>}}
+
+\newcommand\abc{\catcode`\^=11
+ \catcode`\~=11
+ \fontspec[Script=Devanagari,Mapping=itrans-dvn]{<fontname>}}
+
+\newcommand\abc{\catcode`\^=11
+ \catcode`\~=11
+ \fontspec[Script=Devanagari,Mapping=itrans-sdvn]{<fontname>}}
+
+\newcommand\abc{\catcode`\^=11
+ \catcode`\~=11
+ \fontspec[Script=Roman,Mapping=itrans-iast]{<fontname>}}
+
+\newcommand\abc{\catcode`\^=11
+ \catcode`\~=11
+ \fontspec[Script=Kannada,Mapping=itrans-kan]{<fontname>}}
+
+\newcommand\abc{\catcode`\^=11
+ \catcode`\~=11
+ \fontspec[Script=Kannada,Mapping=itrans-sankan]{<fontname>}}
+
+\newcommand\abc{\catcode`\^=11
+ \catcode`\~=11
+ \fontspec[Mapping=itrans-santel]{<fontname>}}
+
+\newcommand\abc{\catcode`\^=11
+ \catcode`\~=11
+ \fontspec[Script=Tamil,Mapping=itrans-tamil]{<fontname>}}
+
+\newcommand\abc{\catcode`\^=11
+ \catcode`\~=11
+ \fontspec[Mapping=itrans-tel]{<fontname>}}
+
+Replace `abc' by the desired macro name, and <fontname> by the name of
+an appropriate Unicode font in that script (e.g., Sanskrit 2003 for
+Devanagari, Kedage for Kannada, Pothana for Telugu).
+
+The following is a small example using the Kannada `Kedage' font.
+Save the following as a *.tex file; if your installation and settings
+(including fonts) are correct, it will compile and produce a proper
+PDF output. (See itrans-tamil-sample.tex and itrans-tamil-sample.pdf
+for a Tamil usage example.)
+
+\documentclass[a4paper,11pt]{article}
+
+\usepackage{ifxetex}
+\RequireXeTeX
+\usepackage{xltxtra}
+
+\setlength{\parindent}{0mm}
+
+\newcommand\ked{\catcode`\^=11
+ \catcode`\~=11
+ \fontspec[Script=Kannada,Mapping=itrans-sankan]{Kedage}}
+
+\begin{document}
+
+{\ked
+OM || nArAyaNaM suraguruM jagadekanAthaM \\
+bhaktapriyaM sakalalokanamaskR^itaM cha | \\
+traiguNyavarjitamajaM vibhumAdyamIshaM \\
+vande bhavaghnamamarAsurasiddhavandyam.h ||
+}
+
+\end{document}
diff --git a/macros/xetex/generic/itrans/brh-kan.map b/macros/xetex/generic/itrans/brh-kan.map
new file mode 100644
index 0000000000..e226f8fe1c
--- /dev/null
+++ b/macros/xetex/generic/itrans/brh-kan.map
@@ -0,0 +1,339 @@
+; TECkit mapping for Baraha input scheme for writing Unicode Kannada (0C80-0CFF)
+; by Abhinandan S.P. <abhinandan.sp@iiitb.net> and Shrisha Rao <shrao@acm.org>,
+; based on harvardkyoto.map written by Daniel Stender
+;
+; Updated 2009-12-04
+
+LHSName "brh-kan"
+RHSName "Unicode"
+LHSDescription "Baraha input method for Unicode Kannada"
+Version "0.91b"
+
+Define dot U+002E
+
+Define a U+0061
+Define A U+0041
+Define i U+0069
+Define I U+0049
+Define u U+0075
+Define U U+0055
+Define R U+0052
+Define L U+004C
+
+Define e U+0065
+Define E U+0045
+Define o U+006F
+Define H U+0048
+
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define G U+0047
+
+Define c U+0063
+Define C U+0043
+Define j U+006A
+Define J U+004A
+
+Define T U+0054
+Define D U+0044
+Define N U+004E
+
+Define t U+0074
+Define d U+0064
+Define n U+006E
+
+Define p U+0070
+Define b U+0062
+Define m U+006D
+
+Define y U+0079
+Define r U+0072
+Define l U+006C
+Define v U+0076
+Define w U+0077
+
+Define z U+007A
+Define S U+0053
+Define s U+0073
+Define Y U+0059
+Define O U+004F
+Define K U+004B
+Define B U+0042
+Define P U+0050
+
+Define anudatta U+002D ; -
+Define svarita U+0021 ; !
+Define tlde U+007E
+Define cret U+005E
+Define M U+004D
+
+Define q U+0071
+Define f U+0066
+Define x U+0078
+
+
+Define anunasika U+0901
+Define anusvara U+0C82
+Define visarga U+0C83
+
+Define asvara U+0C85
+Define Asvara U+0C86
+Define isvara U+0C87
+Define Isvara U+0C88
+Define usvara U+0C89
+Define Usvara U+0C8A
+Define rvoc U+0C8B
+Define Rvoc U+0CE0
+Define lvoc U+0C8C
+Define Lvoc U+0CE1
+Define esvara U+0C8E
+Define Esvara U+0C8F
+Define aisvara U+0C90
+Define osvara U+0C92
+Define Osvara U+0C93
+Define ausvara U+0C94
+
+Define Amatra U+0CBE
+Define imatra U+0CBF
+Define Imatra U+0CC0
+Define umatra U+0CC1
+Define Umatra U+0CC2
+Define rmatra U+0CC3
+Define Rmatra U+0CC4
+Define lmatra U+0CE2
+Define Lmatra U+0CE3
+Define ematra U+0CC6
+Define Ematra U+0CC7
+Define aimatra U+0CC8
+Define omatra U+0CCA
+Define Omatra U+0CCB
+Define aumatra U+0CCC
+
+Define ka U+0C95
+Define kha U+0C96
+Define ga U+0C97
+Define gha U+0C98
+Define Ga U+0C99
+Define cha U+0C9A
+Define Cha U+0C9B
+Define ja U+0C9C
+Define jha U+0C9D
+Define Ja U+0C9E
+Define Ta U+0C9F
+Define Tha U+0CA0
+Define Da U+0CA1
+Define Dha U+0CA2
+Define Na U+0CA3
+Define ta U+0CA4
+Define tha U+0CA5
+Define da U+0CA6
+Define dha U+0CA7
+Define na U+0CA8
+Define pa U+0CAA
+Define pha U+0CAB
+Define ba U+0CAC
+Define bha U+0CAD
+Define ma U+0CAE
+Define ya U+0CAF
+Define ra U+0CB0
+Define rra U+0CB1
+Define la U+0CB2
+Define va U+0CB5
+Define wa U+0CB5
+Define sha U+0CB6
+Define Sha U+0CB7
+Define sa U+0CB8
+Define ha U+0CB9
+
+;Define hka U+0958
+;Define hkha U+0959
+;Define hga U+095A
+;Define hja U+095B
+;Define hDa U+095C
+;Define hda U+095D
+;Define hna U+0929
+;Define hpha U+095E
+;Define hya U+095F
+;Define hra U+0931
+;Define hla U+0934
+
+Define rla U+0CB3
+;Define vstroke U+0951
+;Define hstroke U+0952
+
+Define danda U+0964
+Define ddanda U+0965
+Define virama U+0CCD
+Define avagraha U+0CBD
+Define lcb U+007B
+Define rcb U+007D
+
+;Define om U+0950
+
+
+pass(Unicode)
+
+a > asvara
+a a > Asvara
+A > Asvara
+tlde A > Asvara
+i > isvara
+e e > Isvara
+I > Isvara
+u > usvara
+o o > Usvara
+U > Usvara
+R u > rvoc
+R U > Rvoc
+
+e > esvara
+E > Esvara
+
+a i > aisvara
+o > osvara
+O > Osvara
+a u > ausvara
+o u > ausvara
+
+k > ka
+k h > kha
+K > kha
+g > ga
+g h > gha
+G > gha
+tlde g > Ga
+
+c > cha
+c h > cha
+C h > Cha
+C > Cha
+j > ja
+J > jha
+j h > jha
+tlde j > Ja
+
+T > Ta
+T h > Tha
+D > Da
+D h > Dha
+N > Na
+
+t > ta
+t h > tha
+d > da
+d h > dha
+n > na
+
+p > pa
+p h > pha
+P > pha
+b > ba
+b h > bha
+B > bha
+m > ma
+
+y > ya
+Y > ya
+r > ra
+R > ra
+r x > rra
+L x > rra
+l > la
+L > rla
+v > va
+w > wa
+s h > sha
+S > sha
+S h > Sha
+s > sa
+h > ha
+tlde h > ha
+k S h > ka virama Sha
+j tlde n > ja virama Ja
+
+dot > dot
+
+;A U M > om
+
+
+;q > hka
+;x > hkha
+;dot g > hga
+;dot z > hja
+;f > hpha
+
+;svarita > vstroke
+;anudatta > hstroke
+
+;L > rla
+dot m > anunasika
+
+U+004D > anusvara
+;a n > anusvara
+dot n > anusvara
+;N cret > anusvara
+U+0048 > visarga
+;dot a > avagraha
+U+0026 > avagraha
+U+002C > virama
+
+U+007C > danda
+U+007C U+007C > ddanda
+
+;O M > om
+
+U+0030 > U+0CE6 ; Numerals
+U+0031 > U+0CE7
+U+0032 > U+0CE8
+U+0033 > U+0CE9
+U+0034 > U+0CEA
+U+0035 > U+0CEB
+U+0036 > U+0CEC
+U+0037 > U+0CED
+U+0038 > U+0CEE
+U+0039 > U+0CEF
+
+;; Second pass: converting vowels + a few simple rules
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha rla rra)
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc esvara Esvara aisvara \
+ osvara Osvara ausvara)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra ematra Ematra \
+ aimatra omatra Omatra aumatra)
+
+[vyanjana] [svara] <> [vyanjana] [matra]
+danda danda <> ddanda
+
+;; Third pass: making conjuncts
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha rla rra)
+
+[vyanjana]=v1 [vyanjana]=v2 <> @v1 virama @v2
+
+;; Fourth pass: making remaining conjuncts (for groups of two or more consonants)
+;; and adding viramas to the end of the words in Sanskrit
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha rla rra)
+UniClass [spacepunct] = (U+0009 .. U+0040 U+005B .. U+0060 U+007B .. U+007D danda ddanda \
+ U+2013 U+2014 U+2018 U+2019 U+201C U+201D)
+
+[vyanjana]=v1 [vyanjana]=v2 <> @v1 virama @v2
+[vyanjana] / _ [spacepunct] <> [vyanjana] virama / _ [spacepunct]
+[vyanjana] / _ # <> [vyanjana] virama / _ #
+
+;; Fifth pass: removing inherent "a"
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha rla rra)
+
+[vyanjana] asvara <> [vyanjana]
+
+
diff --git a/macros/xetex/generic/itrans/brh-kan.tec b/macros/xetex/generic/itrans/brh-kan.tec
new file mode 100644
index 0000000000..44aa29de5e
--- /dev/null
+++ b/macros/xetex/generic/itrans/brh-kan.tec
Binary files differ
diff --git a/macros/xetex/generic/itrans/itrans-dvn.map b/macros/xetex/generic/itrans/itrans-dvn.map
new file mode 100644
index 0000000000..238368ccb5
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-dvn.map
@@ -0,0 +1,327 @@
+; TECkit mapping for ITRANS input scheme for writing Unicode Devanagari (0900-097F)
+; by Abhinandan S.P. <abhinandan.sp@iiitb.net> and Shrisha Rao <shrao@acm.org>,
+; based on harvardkyoto.map written by Daniel Stender.
+;
+; Updated 2014-09-01
+
+LHSName "itrans-dvn"
+RHSName "Unicode"
+LHSDescription "ITRANS input method for Unicode Devanagari"
+Version "1.00"
+
+Define dot U+002E
+
+Define a U+0061
+Define A U+0041
+Define i U+0069
+Define I U+0049
+Define u U+0075
+Define U U+0055
+Define R U+0052
+Define L U+004C
+
+Define e U+0065
+Define o U+006F
+
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define G U+0047
+
+Define c U+0063
+Define C U+0043
+Define j U+006A
+Define J U+004A
+
+Define T U+0054
+Define D U+0044
+Define N U+004E
+
+Define t U+0074
+Define d U+0064
+Define n U+006E
+
+Define p U+0070
+Define b U+0062
+Define m U+006D
+
+Define y U+0079
+Define r U+0072
+Define l U+006C
+Define v U+0076
+Define w U+0077
+
+Define z U+007A
+Define S U+0053
+Define s U+0073
+Define Y U+0059
+Define O U+004F
+
+Define anudatta U+002D ; -
+Define svarita U+0021 ; !
+Define tlde U+007E
+Define cret U+005E
+Define M U+004D
+
+Define q U+0071
+Define f U+0066
+Define x U+0078
+
+
+Define anunasika U+0901
+Define anusvara U+0902
+Define visarga U+0903
+
+Define asvara U+0905
+Define Asvara U+0906
+Define isvara U+0907
+Define Isvara U+0908
+Define usvara U+0909
+Define Usvara U+090A
+Define rvoc U+090B
+Define Rvoc U+0960
+Define lvoc U+090C
+Define Lvoc U+0961
+Define esvara U+090F
+Define aisvara U+0910
+Define osvara U+0913
+Define ausvara U+0914
+
+Define Amatra U+093E
+Define imatra U+093F
+Define Imatra U+0940
+Define umatra U+0941
+Define Umatra U+0942
+Define rmatra U+0943
+Define Rmatra U+0944
+Define lmatra U+0962
+Define ematra U+0947
+Define aimatra U+0948
+Define omatra U+094B
+Define aumatra U+094C
+
+Define ka U+0915
+Define kha U+0916
+Define ga U+0917
+Define gha U+0918
+Define Ga U+0919
+Define cha U+091A
+Define Cha U+091B
+Define ja U+091C
+Define jha U+091D
+Define Ja U+091E
+Define Ta U+091F
+Define Tha U+0920
+Define Da U+0921
+Define Dha U+0922
+Define Na U+0923
+Define ta U+0924
+Define tha U+0925
+Define da U+0926
+Define dha U+0927
+Define na U+0928
+Define pa U+092A
+Define pha U+092B
+Define ba U+092C
+Define bha U+092D
+Define ma U+092E
+Define ya U+092F
+Define ra U+0930
+Define la U+0932
+Define va U+0935
+Define wa U+0935
+Define sha U+0936
+Define Sha U+0937
+Define sa U+0938
+Define ha U+0939
+
+Define hka U+0958
+Define hkha U+0959
+Define hga U+095A
+Define hja U+095B
+Define hDa U+095C
+Define hda U+095D
+Define hna U+0929
+Define hpha U+095E
+Define hya U+095F
+Define hra U+0931
+Define hla U+0934
+
+Define rla U+0933
+Define vstroke U+0951
+Define hstroke U+0952
+
+Define danda U+0964
+Define ddanda U+0965
+Define virama U+094D
+Define avagraha U+093D
+
+Define om U+0950
+
+
+pass(Unicode)
+
+a > asvara
+a a > Asvara
+A > Asvara
+i > isvara
+i i > Isvara
+I > Isvara
+u > usvara
+u u > Usvara
+U > Usvara
+R R i > rvoc
+R cret i > rvoc
+R R I > Rvoc
+R cret I > Rvoc
+L L i > lvoc
+L cret i > lvoc
+L L I > Lvoc
+L cret I > Lvoc
+
+e > esvara
+a i > aisvara
+o > osvara
+a u > ausvara
+
+k > ka
+k h > kha
+k dot h > ka virama
+k h dot h > kha virama
+g > ga
+g dot h > ga virama
+g h > gha
+g h dot h > gha virama
+tlde N > Ga
+N cret > Ga
+G G > Ga
+tlde N dot h > Ga virama
+N cret dot h > Ga virama
+c h > cha
+c h h > Cha
+c h dot h > cha virama
+C h > Cha
+C h dot h > Cha virama
+c h h dot h > Cha virama
+j > ja
+j dot h > ja virama
+j h > jha
+j h dot h > jha virama
+tlde n > Ja
+tlde n dot h > Ja virama
+J N > Ja
+T > Ta
+T dot h > Ta virama
+T h > Tha
+T h dot h > Tha virama
+D > Da
+D dot h > Da virama
+D h > Dha
+D h dot h > Dha virama
+N > Na
+N dot h > Na virama
+t > ta
+t dot h > ta virama
+t h > tha
+t h dot h > tha virama
+d > da
+d dot h > da virama
+d h > dha
+d h dot h > dha virama
+n > na
+n dot h > na virama
+p > pa
+p dot h > pa virama
+p h > pha
+p h dot h > pha virama
+b > ba
+b dot h > ba virama
+b h > bha
+b h dot h > bha virama
+m > ma
+m dot h > ma virama
+y > ya
+y dot h > ya virama
+r > ra
+r dot h > ra virama
+l > la
+l dot h > la virama
+v > va
+v dot h > va virama
+w > wa
+w dot h > wa virama
+s h > sha
+s h dot h > sha virama
+s h h > Sha
+s h h dot h > Sha virama
+S h > Sha
+S h dot h > Sha virama
+s > sa
+s dot h > sa virama
+h > ha
+h dot h > ha virama
+x > ka virama Sha
+x dot h > ka virama Sha virama
+k S h > ka virama Sha
+k S h dot h > ka virama Sha virama
+G Y > ja virama Ja
+A U M > om
+
+
+q > hka
+x > hkha
+dot g > hga
+dot z > hja
+f > hpha
+
+svarita > vstroke
+anudatta > hstroke
+
+L > rla
+dot m > anunasika
+
+U+004D > anusvara
+dot n > anusvara
+U+0048 > visarga
+dot a > avagraha
+U+002C > virama
+
+U+007C > danda
+U+007C U+007C > ddanda
+
+O M > om
+
+U+0030 > U+0966 ; Numerals
+U+0031 > U+0967
+U+0032 > U+0968
+U+0033 > U+0969
+U+0034 > U+096A
+U+0035 > U+096B
+U+0036 > U+096C
+U+0037 > U+096D
+U+0038 > U+096E
+U+0039 > U+096F
+
+
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha rla hka .. hpha)
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc esvara aisvara osvara ausvara)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra ematra aimatra omatra aumatra)
+[vyanjana] [svara] > [vyanjana] [matra]
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+pass(Unicode)
+
+Uniclass [vyanjana] = (ka .. ha rla hka .. hpha)
+[vyanjana] asvara > [vyanjana]
diff --git a/macros/xetex/generic/itrans/itrans-dvn.tec b/macros/xetex/generic/itrans/itrans-dvn.tec
new file mode 100644
index 0000000000..89d0d00523
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-dvn.tec
Binary files differ
diff --git a/macros/xetex/generic/itrans/itrans-iast.map b/macros/xetex/generic/itrans/itrans-iast.map
new file mode 100644
index 0000000000..f95e3725d6
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-iast.map
@@ -0,0 +1,409 @@
+; TECkit mapping for ITRANS input scheme for writing Unicode IAST (0000-200D)
+; by Abhinandan S.P. <abhinandan.sp@iiitb.net> and Shrisha Rao <shrao@acm.org>,
+; based on harvardkyoto.map written by Daniel Stender.
+;
+; Updated 2014-09-01
+
+LHSName "itrans-iast"
+RHSName "Unicode"
+LHSDescription "Devanagari-ITRANS input method for Unicode Roman (IAST)"
+Version "2.00"
+
+Define dot U+002E
+
+Define a U+0061
+Define A U+0041
+Define i U+0069
+Define I U+0049
+Define u U+0075
+Define U U+0055
+Define R U+0052
+Define L U+004C
+
+Define e U+0065
+Define E U+0045
+Define o U+006F
+Define H U+0048
+
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define G U+0047
+
+Define c U+0063
+Define C U+0043
+Define j U+006A
+Define J U+004A
+
+Define T U+0054
+Define D U+0044
+Define N U+004E
+
+Define t U+0074
+Define d U+0064
+Define n U+006E
+
+Define p U+0070
+Define b U+0062
+Define m U+006D
+
+Define y U+0079
+Define r U+0072
+Define l U+006C
+Define v U+0076
+Define w U+0077
+
+Define z U+007A
+Define S U+0053
+Define s U+0073
+Define Y U+0059
+Define O U+004F
+
+Define anudatta U+002D ; -
+Define svarita U+0021 ; !
+Define tlde U+007E
+Define cret U+005E
+Define M U+004D
+
+Define q U+0071
+Define f U+0066
+Define x U+0078
+
+Define zwj U+200D
+Define zwn U+200C
+
+Define anunasika U+0901
+Define anusvara U+0C82
+Define visarga U+0C83
+
+
+Define mdot U+1E43
+Define ndot U+1E47
+Define ntilde U+00F1
+Define tdot U+1E6D
+Define ddot U+1E0D
+Define ndota U+1E45
+Define sacute U+015B
+Define sdot U+1E63
+Define lbelow U+1E3B
+Define ldot U+1E37
+
+Define asvara a
+Define Asvara U+0101
+Define isvara i
+Define Isvara U+012B
+Define usvara u
+Define Usvara U+016B
+Define rvoc U+1E5B
+Define Rvoc U+1E5D
+Define lvoc U+1E37
+Define Lvoc U+1E38
+Define Esvara e
+Define aisvara a i
+Define Osvara o
+Define ausvara a u
+
+Define ka k
+Define kha k h
+Define ga g
+Define gha g h
+Define Ga ndota
+Define cha c
+Define Cha c h
+Define ja j
+Define jha j h
+Define Ja ntilde
+Define Ta tdot
+Define Tha tdot h
+Define Da ddot
+Define Dha ddot h
+Define Na ndot
+Define ta t
+Define tha t h
+Define da d
+Define dha d h
+Define na n
+Define pa p
+Define pha p h
+Define ba b
+Define bha b h
+Define ma m
+Define ya y
+Define ra r
+Define la l
+Define va v
+;Define wa U+0CB5
+Define sha sacute
+Define Sha sdot
+Define sa s
+Define ha h
+
+Define rla ldot
+
+Define danda U+0964
+Define ddanda U+0965
+;Define U+0CCD
+Define avagraha U+2019
+Define lcb U+007B
+Define rcb U+007D
+Define zero U+0CE6
+Define cbindu U+0901
+Define ksha ka Sha
+
+
+pass(Unicode)
+
+a > asvara
+a a > Asvara
+A > Asvara
+i > isvara
+i i > Isvara
+I > Isvara
+u > usvara
+u u > Usvara
+U > Usvara
+R R i > rvoc
+R cret i > rvoc
+R R I > Rvoc
+R cret I > Rvoc
+L L i > lvoc
+L cret i > lvoc
+L L I > Lvoc
+L cret I > Lvoc
+
+e > Esvara
+
+a i > aisvara
+a M > a mdot
+o > Osvara
+o o > Osvara
+O > Osvara
+a u > ausvara
+a dot N > a m cbindu
+k > ka
+k h > kha
+k dot h > ka
+k x > ka ksha
+k h dot h > kha
+k h x > kha ksha
+g > ga
+g dot h > ga
+g x > ga ksha
+g a dot n > ga anusvara
+g h > gha
+g h dot h > gha
+g h x > gha ksha
+tlde N > Ga
+N cret > Ga
+N tlde > Ga
+G G > Ga
+tlde N dot h > Ga
+N cret dot h > Ga
+tlde N x > Ga ksha
+N cret dot h > Ga
+;N cret x > zero ksha
+;N cret g > zero ga
+;N cret g h > zero gha
+n g > na ga
+c > cha
+c h > cha
+c h h > Cha
+;c h dot h > cha
+;c h x > Cha ksha
+;c h h x > Cha ksha
+C h > Cha
+C h x > Cha ksha
+;C h dot h > Cha
+;c h h dot h > Cha
+j > ja
+j dot h > ja
+j x > ja ksha
+j h > jha
+j h x > jha ksha
+j h dot h > jha
+tlde n > ntilde
+tlde n a > Ja
+tlde n x > Ja ksha
+tlde n dot h > Ja
+J N > Ja
+J N x > Ja ksha
+T > Ta
+T x > Ta ksha
+T dot h > Ta
+T h > Tha
+T h dot h > Tha
+T h x > Tha ksha
+D > Da
+D x > Da ksha
+D dot h > Da
+D h > Dha
+D h dot h > Dha
+D h x > Dha ksha
+N > Na
+N dot h > Na
+N x > Na ksha
+;N N > Na Na
+t > ta
+t dot h > ta
+t x > ta ksha
+t h > tha
+t h x > tha ksha
+t h dot h > tha
+d > da
+d x > da ksha
+d dot h > da
+d h > dha
+d h x > dha ksha
+d h dot h > dha
+n > na
+n x > na ksha
+n dot h > na
+p > pa
+p x > pa ksha
+p dot h > pa
+p h x > pha ksha
+p h dot h > pha
+b > ba
+b x > ba ksha
+b dot h > ba
+b h > bha
+b h x > bha ksha
+b h dot h > bha
+m > ma
+m dot h > ma
+m x > ma ksha
+y > ya
+y dot h > ya
+y x > ya ksha
+r > ra
+r x > ra ksha
+r dot h > ra
+l > la
+l x > la ksha
+L > rla
+L x > rla ksha
+l dot h > la
+L dot h > rla
+v > va
+v x > va ksha
+v dot h > va
+w > va
+w x > va ksha
+w dot h > va
+s h > sha
+s h x > sha ksha
+s h dot h > sha
+s h h > Sha
+s h h x > Sha ksha
+s h h dot h > Sha
+S h > Sha
+S h x > Sha ksha
+S h dot h > Sha
+s > sa
+s x > sa ksha
+s dot h > sa
+h > ha
+h x > ha ksha
+h dot h > ha
+N cret x > zero ksha
+x > ksha
+x dot h > ksha
+k S h > ksha
+k S h dot h > ksha
+G Y > ja Ja
+j tlde n > ja Ja
+v a cret cret r > va ra
+m lcb rcb > ma
+lcb rcb > zwn
+H > U+1E25
+M > mdot
+dot n > mdot
+L > ldot
+
+;dot m > anunasika
+
+
+;U+004D > anusvara
+;U+0029 M > U+0029 U+0CE6
+;dot a M > avagraha zero
+;dot n > anusvara
+;U+0048 > visarga
+dot a > avagraha
+dot a lcb rcb > avagraha
+;dot a N cret > avagraha U+0CE6
+
+;U+002C >
+;dot N > na
+
+;U+002F dot > dot
+;U+007C > danda
+;U+007C U+007C > ddanda
+;U+002D > U+002D
+;U+005C dot > dot
+;U+0022 > U+201D
+;U+0027 > U+0027
+;U+0028 > U+0028
+;U+0029 > U+0029
+;U+0060 > U+2018
+;U+0060 U+0060 > U+201C
+
+;U+0030 > U+0CE6 ; Numerals
+;U+0031 > U+0CE7
+;U+0032 > U+0CE8
+;U+0033 > U+0CE9
+;U+0034 > U+0CEA
+;U+0035 > U+0CEB
+;U+0036 > U+0CEC
+;U+0037 > U+0CED
+;U+0038 > U+0CEE
+;U+0039 > U+0CEF
+
+;pass(Unicode)
+
+;UniClass [vyanjana] = (ka..dha pha..ba ra..la)
+;UniClass [mvyanjana] = (pa ba bha)
+
+;UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc Esvara aisvara Osvara ausvara)
+;UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra Ematra aimatra Omatra aumatra)
+;UniClass [naletter] = (na)
+;UniClass [anusvaraletter] = (zero)
+;UniClass [avaletter] = (avagraha)
+;UniClass [maletter] = (ma)
+;UniClass [Naletter] = (Na)
+;UniClass [galetter] = (Ga)
+;UniClass [jaletter] = (Ja)
+;UniClass [osvaraletter] = (Osvara)
+;UniClass [omatra] = (Omatra)
+
+;UniClass [vletter] = ( )
+
+;[naletter] [vyanjana] > [anusvaraletter] [vyanjana]
+;[maletter] [mvyanjana] > [anusvaraletter] [mvyanjana]
+;[maletter] [maletter] [osvaraletter] > [anusvaraletter] [maletter] [omatra]
+;[galetter] [vyanjana] > [anusvaraletter] [vyanjana]
+;[jaletter] [vyanjana] > [anusvaraletter] [vyanjana]
+;[Naletter] [vyanjana] > [anusvaraletter] [vyanjana]
+;[anusvaraletter] [vyanjana] [svara] > [anusvaraletter] [vyanjana][matra]
+
+;pass(Unicode)
+
+;UniClass [vyanjana] = (ka .. ha rla)
+;UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc Esvara aisvara Osvara ausvara)
+;UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra Ematra aimatra Omatra aumatra)
+;[vyanjana] [svara] > [vyanjana] [matra]
+
+
+;pass(Unicode)
+
+;UniClass [vyanjana] = (ka .. ha)
+;[vyanjana]=v1 [vyanjana]=v2 > @v1 @v2
+
+;pass(Unicode)
+
+;UniClass [vyanjana] = (ka .. ha)
+;[vyanjana]=v1 [vyanjana]=v2 > @v1 @v2
+
+;pass(Unicode)
+
+;Uniclass [vyanjana] = (ka .. ha rla)
+;[vyanjana] asvara > [vyanjana]
diff --git a/macros/xetex/generic/itrans/itrans-iast.tec b/macros/xetex/generic/itrans/itrans-iast.tec
new file mode 100644
index 0000000000..805249d9ec
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-iast.tec
Binary files differ
diff --git a/macros/xetex/generic/itrans/itrans-kan.map b/macros/xetex/generic/itrans/itrans-kan.map
new file mode 100644
index 0000000000..48ebf0dd4e
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-kan.map
@@ -0,0 +1,414 @@
+; TECkit mapping for ITRANS input scheme for writing Unicode Kannada (0900-097F)
+; by Abhinandan S.P. <abhinandan.sp@iiitb.net> and Shrisha Rao <shrao@acm.org>,
+; based on harvardkyoto.map written by Daniel Stender.
+;
+; Updated 2014-09-01
+
+LHSName "itrans-kan"
+RHSName "Unicode"
+LHSDescription "ITRANS input method for Unicode Kannada"
+Version "2.00"
+
+Define dot U+002E
+
+Define a U+0061
+Define A U+0041
+Define i U+0069
+Define I U+0049
+Define u U+0075
+Define U U+0055
+Define R U+0052
+Define L U+004C
+
+Define e U+0065
+Define E U+0045
+Define o U+006F
+Define H U+0048
+
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define G U+0047
+
+Define c U+0063
+Define C U+0043
+Define j U+006A
+Define J U+004A
+
+Define T U+0054
+Define D U+0044
+Define N U+004E
+
+Define t U+0074
+Define d U+0064
+Define n U+006E
+
+Define p U+0070
+Define b U+0062
+Define m U+006D
+
+Define y U+0079
+Define r U+0072
+Define l U+006C
+Define v U+0076
+Define w U+0077
+
+Define z U+007A
+Define S U+0053
+Define s U+0073
+Define Y U+0059
+Define O U+004F
+
+Define anudatta U+002D ; -
+Define svarita U+0021 ; !
+Define tlde U+007E
+Define cret U+005E
+Define M U+004D
+
+Define q U+0071
+Define f U+0066
+Define x U+0078
+
+Define zwj U+200D
+Define zwn U+200C
+
+Define anunasika U+0901
+Define anusvara U+0C82
+Define visarga U+0C83
+
+Define asvara U+0C85
+Define Asvara U+0C86
+Define isvara U+0C87
+Define Isvara U+0C88
+Define usvara U+0C89
+Define Usvara U+0C8A
+Define rvoc U+0C8B
+Define Rvoc U+0CE0
+Define lvoc U+0C8C
+Define Lvoc U+0CE1
+Define esvara U+0C8E
+Define Esvara U+0C8F
+Define aisvara U+0C90
+Define osvara U+0C92
+Define Osvara U+0C93
+Define ausvara U+0C94
+
+Define Amatra U+0CBE
+Define imatra U+0CBF
+Define Imatra U+0CC0
+Define umatra U+0CC1
+Define Umatra U+0CC2
+Define rmatra U+0CC3
+Define Rmatra U+0CC4
+Define lmatra U+0CE2
+Define Lmatra U+0CE3
+Define ematra U+0CC6
+Define Ematra U+0CC7
+Define aimatra U+0CC8
+Define omatra U+0CCA
+Define Omatra U+0CCB
+Define aumatra U+0CCC
+
+Define ka U+0C95
+Define kha U+0C96
+Define ga U+0C97
+Define gha U+0C98
+Define Ga U+0C99
+Define cha U+0C9A
+Define Cha U+0C9B
+Define ja U+0C9C
+Define jha U+0C9D
+Define Ja U+0C9E
+Define Ta U+0C9F
+Define Tha U+0CA0
+Define Da U+0CA1
+Define Dha U+0CA2
+Define Na U+0CA3
+Define ta U+0CA4
+Define tha U+0CA5
+Define da U+0CA6
+Define dha U+0CA7
+Define na U+0CA8
+Define pa U+0CAA
+Define pha U+0CAB
+Define ba U+0CAC
+Define bha U+0CAD
+Define ma U+0CAE
+Define ya U+0CAF
+Define ra U+0CB0
+Define la U+0CB2
+Define va U+0CB5
+Define wa U+0CB5
+Define sha U+0CB6
+Define Sha U+0CB7
+Define sa U+0CB8
+Define ha U+0CB9
+
+Define rla U+0CB3
+
+Define danda U+0964
+Define ddanda U+0965
+Define virama U+0CCD
+Define avagraha U+0CBD
+Define lcb U+007B
+Define rcb U+007D
+Define zero U+0CE6
+Define cbindu U+0901
+Define ksha ka virama Sha
+
+
+pass(Unicode)
+
+a > asvara
+a a > Asvara
+A > Asvara
+i > isvara
+i i > Isvara
+I > Isvara
+u > usvara
+u u > Usvara
+U > Usvara
+R R i > rvoc
+R cret i > rvoc
+R R I > Rvoc
+R cret I > Rvoc
+L L i > lvoc
+L cret i > lvoc
+L L I > Lvoc
+L cret I > Lvoc
+
+e > esvara
+E > Esvara
+
+a i > aisvara
+o > osvara
+o o > Osvara
+O > Osvara
+a u > ausvara
+a m s > U+0CE6 sa
+
+k > ka
+k h > kha
+
+k dot h > ka virama
+k x > ka virama zwn ksha
+k h dot h > kha virama
+k h x > kha virama zwn ksha
+g > ga
+g dot h > ga virama
+g x > ga virama zwn ksha
+g a dot n > ga anusvara
+g h > gha
+g h dot h > gha virama
+g h x > gha virama zwn ksha
+tlde N > Ga
+N cret > Ga
+G G > Ga
+tlde N dot h > Ga virama
+N cret dot h > Ga virama
+tlde N x > Ga virama zwn ksha
+N cret dot h > Ga virama
+N cret x > zero zwn ksha
+N cret g > zero zwn ga
+N cret g h > zero zwn gha
+n g > na virama ga
+c h > cha
+c h h > Cha
+c h dot h > cha virama
+c h x > cha virama zwn ksha
+c h h x > Cha virama zwn ksha
+C h > Cha
+C h x > Cha virama zwn ksha
+C h dot h > Cha virama
+c h h dot h > Cha virama
+j > ja
+j dot h > ja virama
+j x > ja virama zwn ksha
+j h > jha
+j h dot h > jha virama
+j h x > jha virama zwn ksha
+tlde n a > Ja
+tlde n x > Ja virama zwn ksha
+tlde n dot h > Ja virama
+J N > Ja
+J N x > Ja virama zwn ksha
+T > Ta
+T dot h > Ta virama
+T x > Ta virama zwn ksha
+T h > Tha
+T h dot h > Tha virama
+T h x > Tha virama zwn ksha
+D > Da
+D dot h > Da virama
+D x > Da virama zwn ksha
+D h > Dha
+D h x > Dha virama zwn ksha
+D h dot h > Dha virama
+N > Na
+N x > Na virama zwn ksha
+N dot h > Na virama
+N N > Na virama Na
+t > ta
+t dot h > ta virama
+t x > ta virama zwn ksha
+t h > tha
+t h dot h > tha virama
+t h x > tha virama zwn ksha
+d > da
+d dot h > da virama
+d x > da virama zwn ksha
+d h > dha
+d h dot h > dha virama
+d h x > dha virama zwn ksha
+n > na
+n dot h > na virama
+n x > na virama zwn ksha
+p > pa
+p dot h > pa virama
+p x > pa virama zwn ksha
+p h > pha
+p h dot h > pha virama
+p h x > pha virama zwn ksha
+b > ba
+b dot h > ba virama
+b x > ba virama zwn ksha
+b h > bha
+b h dot h > bha virama
+b h x > bha virama zwn ksha
+m > ma
+m dot h > ma virama
+m x > ma virama zwn ksha
+y > ya
+y x > ya virama zwn ksha
+y dot h > ya virama
+r > ra
+r x > ra virama zwn ksha
+r dot h > ra virama
+l > la
+l x > la virama zwn ksha
+L > rla
+L x > rla virama zwn ksha
+l dot h > la virama
+L dot h > rla virama
+v > va
+v x > va virama zwn ksha
+v dot h > va virama
+w > wa
+w x > wa virama zwn ksha
+w dot h > wa virama
+s h > sha
+s h x > sha virama zwn ksha
+s h dot h > sha virama
+s h h > Sha
+s h h x > Sha virama zwn ksha
+s h h dot h > Sha virama
+S h > Sha
+S h dot h > Sha virama
+S h x > Sha virama zwn ksha
+s > sa
+s dot h > sa virama
+s x > sa virama zwn ksha
+h > ha
+h dot h > ha virama
+h x > ha virama zwn ksha
+x > ksha
+x dot h > ksha virama
+k S h > ksha
+k S h dot h > ksha virama
+G Y > ja virama Ja
+j tlde n > ja virama Ja
+v a cret cret r > va ra virama
+m lcb rcb > ma virama
+lcb rcb > zwn
+
+
+dot m > anunasika
+
+
+U+004D > anusvara
+U+0029 M > U+0029 U+0CE6
+dot a M > avagraha zero
+dot n > anusvara
+U+0048 > visarga
+dot a > avagraha
+dot a lcb rcb > avagraha
+dot a N cret > avagraha U+0CE6
+
+U+002C > virama
+dot N > na
+
+U+002F dot > dot
+U+007C > danda
+U+007C U+007C > ddanda
+U+002D > U+002D
+U+005C dot > dot
+U+0022 > U+201D
+U+0027 > U+0027
+U+0028 > U+0028
+U+0029 > U+0029
+U+0060 > U+2018
+U+0060 U+0060 > U+201C
+
+U+0030 > U+0CE6 ; Numerals
+U+0031 > U+0CE7
+U+0032 > U+0CE8
+U+0033 > U+0CE9
+U+0034 > U+0CEA
+U+0035 > U+0CEB
+U+0036 > U+0CEC
+U+0037 > U+0CED
+U+0038 > U+0CEE
+U+0039 > U+0CEF
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka..dha pha..ba ra..la)
+UniClass [mvyanjana] = (pa ba bha sa)
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc esvara Esvara aisvara osvara Osvara ausvara)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra ematra Ematra aimatra omatra Omatra aumatra)
+UniClass [naletter] = (na)
+Uniclass [galetter] = (ga)
+UniClass [anusvaraletter] = (zero)
+UniClass [avaletter] = (avagraha)
+UniClass [maletter] = (ma)
+UniClass [Naletter] = (Na)
+UniClass [Galetter] = (Ga)
+UniClass [jaletter] = (Ja)
+UniClass [Oletter] = (Omatra)
+UniClass [vletter] = (virama)
+UniClass [osvaraletter] = (Osvara)
+
+[naletter] [vyanjana] > [anusvaraletter] [vyanjana]
+[galetter] [vyanjana] > [anusvaraletter] [vyanjana]
+[maletter] [mvyanjana] > [anusvaraletter] [mvyanjana]
+[maletter] [maletter] [osvaraletter] > [anusvaraletter] [maletter] [Oletter]
+[Galetter] [vyanjana] > [anusvaraletter] [vyanjana]
+[jaletter] [vyanjana] > [anusvaraletter] [vyanjana]
+[Naletter] [vyanjana] > [anusvaraletter] [vyanjana]
+[anusvaraletter] [vyanjana] [svara] > [anusvaraletter] [vyanjana][matra]
+
+pass(Unicode)
+
+Uniclass [vyanjana] = (ka .. ha rla)
+[vyanjana] asvara > [vyanjana]
+
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha rla)
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc esvara Esvara aisvara osvara Osvara ausvara)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra ematra Ematra aimatra omatra Omatra aumatra)
+[vyanjana] [svara] > [vyanjana] [matra]
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+
+
diff --git a/macros/xetex/generic/itrans/itrans-kan.tec b/macros/xetex/generic/itrans/itrans-kan.tec
new file mode 100644
index 0000000000..6577f19ab7
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-kan.tec
Binary files differ
diff --git a/macros/xetex/generic/itrans/itrans-sankan.map b/macros/xetex/generic/itrans/itrans-sankan.map
new file mode 100644
index 0000000000..111fe999b3
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-sankan.map
@@ -0,0 +1,423 @@
+; TECkit mapping for ITRANS input scheme for writing Unicode Kannada (0C80-0CFF)
+; by Abhinandan S.P. <abhinandan.sp@iiitb.net> and Shrisha Rao <shrao@acm.org>,
+; based on harvardkyoto.map written by Daniel Stender.
+;
+; Updated 2014-09-01
+
+LHSName "itrans-sankan"
+RHSName "Unicode"
+LHSDescription "Devanagari-ITRANS input method for Unicode Kannada"
+Version "3.00"
+
+Define dot U+002E
+
+Define a U+0061
+Define A U+0041
+Define i U+0069
+Define I U+0049
+Define u U+0075
+Define U U+0055
+Define R U+0052
+Define L U+004C
+
+Define e U+0065
+Define E U+0045
+Define o U+006F
+Define H U+0048
+
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define G U+0047
+
+Define c U+0063
+Define C U+0043
+Define j U+006A
+Define J U+004A
+
+Define T U+0054
+Define D U+0044
+Define N U+004E
+
+Define t U+0074
+Define d U+0064
+Define n U+006E
+
+Define p U+0070
+Define b U+0062
+Define m U+006D
+
+Define y U+0079
+Define r U+0072
+Define l U+006C
+Define v U+0076
+Define w U+0077
+
+Define z U+007A
+Define S U+0053
+Define s U+0073
+Define Y U+0059
+Define O U+004F
+
+Define anudatta U+002D ; -
+Define svarita U+0021 ; !
+Define tlde U+007E
+Define cret U+005E
+Define M U+004D
+
+Define q U+0071
+Define f U+0066
+Define x U+0078
+
+Define zwj U+200D
+Define zwn U+200C
+
+Define anunasika U+0901
+Define anusvara U+0C82
+Define visarga U+0C83
+
+Define asvara U+0C85
+Define Asvara U+0C86
+Define isvara U+0C87
+Define Isvara U+0C88
+Define usvara U+0C89
+Define Usvara U+0C8A
+Define rvoc U+0C8B
+Define Rvoc U+0CE0
+Define lvoc U+0C8C
+Define Lvoc U+0CE1
+Define Esvara U+0C8F
+Define aisvara U+0C90
+Define Osvara U+0C93
+Define ausvara U+0C94
+
+Define Amatra U+0CBE
+Define imatra U+0CBF
+Define Imatra U+0CC0
+Define umatra U+0CC1
+Define Umatra U+0CC2
+Define rmatra U+0CC3
+Define Rmatra U+0CC4
+Define lmatra U+0CE2
+Define Lmatra U+0CE3
+Define Ematra U+0CC7
+Define aimatra U+0CC8
+Define Omatra U+0CCB
+Define aumatra U+0CCC
+
+Define ka U+0C95
+Define kha U+0C96
+Define ga U+0C97
+Define gha U+0C98
+Define Ga U+0C99
+Define cha U+0C9A
+Define Cha U+0C9B
+Define ja U+0C9C
+Define jha U+0C9D
+Define Ja U+0C9E
+Define Ta U+0C9F
+Define Tha U+0CA0
+Define Da U+0CA1
+Define Dha U+0CA2
+Define Na U+0CA3
+Define ta U+0CA4
+Define tha U+0CA5
+Define da U+0CA6
+Define dha U+0CA7
+Define na U+0CA8
+Define pa U+0CAA
+Define pha U+0CAB
+Define ba U+0CAC
+Define bha U+0CAD
+Define ma U+0CAE
+Define ya U+0CAF
+Define ra U+0CB0
+Define la U+0CB2
+Define va U+0CB5
+Define wa U+0CB5
+Define sha U+0CB6
+Define Sha U+0CB7
+Define sa U+0CB8
+Define ha U+0CB9
+
+Define rla U+0CB3
+
+Define danda U+0964
+Define ddanda U+0965
+Define virama U+0CCD
+Define avagraha U+0CBD
+Define lcb U+007B
+Define rcb U+007D
+Define zero U+0CE6
+Define cbindu U+0901
+Define ksha ka virama Sha
+Define knukta ka U+0CBC
+
+
+pass(Unicode)
+
+a > asvara
+a a > Asvara
+A > Asvara
+i > isvara
+i i > Isvara
+I > Isvara
+u > usvara
+u u > Usvara
+U > Usvara
+R R i > rvoc
+R cret i > rvoc
+R R I > Rvoc
+R cret I > Rvoc
+L L i > lvoc
+L cret i > lvoc
+L L I > Lvoc
+L cret I > Lvoc
+
+e > Esvara
+
+a i > aisvara
+o > Osvara
+o o > Osvara
+O > Osvara
+a u > ausvara
+a m s > U+0CE6 sa
+k > ka
+k h > kha
+k dot h > ka virama
+k x > ka virama zwn ksha
+k h dot h > kha virama
+k h x > kha virama zwn ksha
+g > ga
+g dot h > ga virama
+g x > ga virama zwn ksha
+g a dot n > ga anusvara
+g h > gha
+g h dot h > gha virama
+g h x > gha virama zwn ksha
+tlde N > Ga
+N cret > Ga
+G G > Ga
+tlde N dot h > Ga virama
+N cret dot h > Ga virama
+tlde N x > Ga virama zwn ksha
+N cret dot h > Ga virama
+N cret x > zero zwn ksha
+N cret g > zero zwn ga
+N cret g h > zero zwn gha
+n g > na virama ga
+c h > cha
+c h h > Cha
+c h dot h > cha virama
+c h x > cha virama zwn ksha
+c h h x > Cha virama zwn ksha
+C h > Cha
+C h x > Cha virama zwn ksha
+C h dot h > Cha virama
+c h h dot h > Cha virama
+j > ja
+j dot h > ja virama
+j x > ja virama zwn ksha
+j h > jha
+j h x > jha virama zwn ksha
+j h dot h > jha virama
+tlde n a > Ja
+tlde n > Ja
+tlde n x > Ja virama zwn ksha
+tlde n dot h > Ja virama
+J N > Ja
+J N x > Ja virama zwn ksha
+T > Ta
+T x > Ta virama zwn ksha
+T dot h > Ta virama
+T h > Tha
+T h dot h > Tha virama
+T h x > Tha virama zwn ksha
+D > Da
+D x > Da virama zwn ksha
+D dot h > Da virama
+D h > Dha
+D h dot h > Dha virama
+D h x > Dha virama zwn ksha
+N > Na
+N dot h > Na virama
+N x > Na virama zwn ksha
+N N > Na virama Na
+t > ta
+t dot h > ta virama
+t x > ta virama zwn ksha
+t h > tha
+t h x > tha virama zwn ksha
+t h dot h > tha virama
+d > da
+d x > da virama zwn ksha
+d dot h > da virama
+d h > dha
+d h x > dha virama zwn ksha
+d h dot h > dha virama
+n > na
+n x > na virama zwn ksha
+n dot h > na virama
+p > pa
+p x > pa virama zwn ksha
+p dot h > pa virama
+p h > pha
+p h x > pha virama zwn ksha
+p h dot h > pha virama
+b > ba
+b x > ba virama zwn ksha
+b dot h > ba virama
+b h > bha
+b h x > bha virama zwn ksha
+b h dot h > bha virama
+m > ma
+m dot h > ma virama
+m x > ma virama zwn ksha
+y > ya
+y dot h > ya virama
+y x > ya virama zwn ksha
+r > ra
+r x > ra virama zwn ksha
+r dot h > ra virama
+l > la
+l x > la virama zwn ksha
+L > rla
+L x > rla virama zwn ksha
+l dot h > la virama
+L dot h > rla virama
+v > va
+v x > va virama zwn ksha
+v dot h > va virama
+w > wa
+w x > va virama zwn ksha
+w dot h > wa virama
+s h > sha
+s h x > sha virama zwn ksha
+s h dot h > sha virama
+s h h > Sha
+s h h x > Sha virama zwn ksha
+s h h dot h > Sha virama
+S h > Sha
+S h x > Sha virama zwn ksha
+S h dot h > Sha virama
+s > sa
+s x > sa virama zwn ksha
+s dot h > sa virama
+h > ha
+h x > ha virama zwn ksha
+h dot h > ha virama
+N cret x > zero ksha
+x > ksha
+x dot h > ksha virama
+k S h > ksha
+k S h dot h > ksha virama
+G Y > ja virama Ja
+j tlde n > ja virama Ja
+v a cret cret r > va ra virama
+m lcb rcb > ma virama
+lcb rcb > zwn
+
+
+dot m > anunasika
+q > knukta
+
+U+004D > anusvara
+U+0029 M > U+0029 U+0CE6
+dot a M > avagraha zero
+dot n > anusvara
+U+0048 > visarga
+dot a > avagraha
+dot a lcb rcb > avagraha
+dot a N cret > avagraha U+0CE6
+
+U+002C > virama
+dot N > na
+
+U+002F dot > dot
+U+007C > danda
+U+007C U+007C > ddanda
+U+002D > U+002D
+U+005C dot > dot
+U+0022 > U+201D
+U+0027 > U+0027
+U+0028 > U+0028
+U+0029 > U+0029
+U+0060 > U+2018
+U+0060 U+0060 > U+201C
+
+U+0030 > U+0CE6 ; Numerals
+U+0031 > U+0CE7
+U+0032 > U+0CE8
+U+0033 > U+0CE9
+U+0034 > U+0CEA
+U+0035 > U+0CEB
+U+0036 > U+0CEC
+U+0037 > U+0CED
+U+0038 > U+0CEE
+U+0039 > U+0CEF
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka..dha pha..ba ra..la)
+UniClass [mvyanjana] = (pa ba bha)
+
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc Esvara aisvara Osvara ausvara)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra Ematra aimatra Omatra aumatra)
+UniClass [naletter] = (na)
+UniClass [anusvaraletter] = (zero)
+UniClass [avaletter] = (avagraha)
+UniClass [maletter] = (ma)
+UniClass [Naletter] = (Na)
+UniClass [galetter] = (Ga)
+UniClass [jaletter] = (Ja)
+UniClass [osvaraletter] = (Osvara)
+UniClass [omatra] = (Omatra)
+
+UniClass [vletter] = (virama)
+
+[naletter] [vyanjana] > [anusvaraletter] [vyanjana]
+[maletter] [mvyanjana] > [anusvaraletter] [mvyanjana]
+[maletter] [maletter] [osvaraletter] > [anusvaraletter] [maletter] [omatra]
+[galetter] [vyanjana] > [anusvaraletter] [vyanjana]
+[jaletter] [vyanjana] > [anusvaraletter] [vyanjana]
+[Naletter] [vyanjana] > [anusvaraletter] [vyanjana]
+[anusvaraletter] [vyanjana] [svara] > [anusvaraletter] [vyanjana][matra]
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha rla)
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc Esvara aisvara Osvara ausvara)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra Ematra aimatra Omatra aumatra)
+[vyanjana] [svara] > [vyanjana] [matra]
+
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+;; In this mapping, target language is kannada and generally Kannada words does not
+;; end with virama. Also, this causes buggy output in Kannada. Hence, commenting fourth pass
+;; Fourth pass: making remaining conjuncts (for groups of two or more consonants)
+;; and adding viramas to the end of the words in Sanskrit
+
+;;pass (Unicode)
+
+;; Classes
+;;UniClass [vyanjana] = (ka .. ha rla)
+;;UniClass [spacepunct] = (U+0009 .. U+0040 U+005B .. U+0060 U+007B .. U+007D danda ddanda \
+;; U+2013 U+2014 U+2018 U+2019 U+201C U+201D)
+
+;;[vyanjana]=v1 [vyanjana]=v2 <> @v1 virama @v2
+;;[vyanjana] / _ [spacepunct] <> [vyanjana] virama / _ [spacepunct]
+;;[vyanjana] / _ # <> [vyanjana] virama / _ #
+
+pass(Unicode)
+
+Uniclass [vyanjana] = (ka .. ha rla)
+[vyanjana] asvara > [vyanjana]
diff --git a/macros/xetex/generic/itrans/itrans-sankan.tec b/macros/xetex/generic/itrans/itrans-sankan.tec
new file mode 100644
index 0000000000..bea0998a09
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-sankan.tec
Binary files differ
diff --git a/macros/xetex/generic/itrans/itrans-santel.map b/macros/xetex/generic/itrans/itrans-santel.map
new file mode 100644
index 0000000000..7b185e5f03
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-santel.map
@@ -0,0 +1,450 @@
+; TECkit mapping for ITRANS input scheme for writing Unicode Kannada (0C80-0CFF)
+; by Shrisha Rao <shrao@acm.org> and Abhinandan S.P.,
+; based on harvardkyoto.map written by Daniel Stender.
+;
+; Updated 2014-09-01
+
+LHSName "itrans-santel"
+RHSName "Unicode"
+LHSDescription "Devanagari-ITRANS input method for Unicode Telugu"
+Version "1.00"
+
+Define dot U+002E
+
+Define a U+0061
+Define A U+0041
+Define i U+0069
+Define I U+0049
+Define u U+0075
+Define U U+0055
+Define R U+0052
+Define L U+004C
+
+Define e U+0065
+Define E U+0045
+Define o U+006F
+Define O U+004F
+
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define G U+0047
+
+Define c U+0063
+Define C U+0043
+Define j U+006A
+Define J U+004A
+
+Define T U+0054
+Define D U+0044
+Define N U+004E
+
+Define t U+0074
+Define d U+0064
+Define n U+006E
+
+Define p U+0070
+Define b U+0062
+Define m U+006D
+
+Define y U+0079
+Define r U+0072
+Define l U+006C
+Define v U+0076
+Define w U+0077
+
+Define z U+007A
+Define S U+0053
+Define s U+0073
+Define Y U+0059
+
+Define Q U+0051 ;;;eknath
+Define Z U+005A ;;;eknath
+
+;;;;;Define anudatta U+002D ; - allow -
+;;;;;Define svarita U+0021 ; ! allow !
+Define tlde U+007E
+Define cret U+005E
+Define M U+004D
+
+Define q U+0071
+Define f U+0066
+Define x U+0078
+
+Define X U+007C
+
+Define zwj U+200D
+Define zwn U+200C
+
+Define anunasika U+0C01
+Define anusvara U+0C02
+Define visarga U+0C03
+
+Define asvara U+0C05
+Define Asvara U+0C06
+Define isvara U+0C07
+Define Isvara U+0C08
+Define usvara U+0C09
+Define Usvara U+0C0A
+Define rvoc U+0C0B
+Define Rvoc U+0C60
+Define lvoc U+0C0C
+Define Lvoc U+0C61
+Define esvara U+0C0E
+Define Esvara U+0C0F
+Define aisvara U+0C10
+Define osvara U+0C12
+Define Osvara U+0C13
+Define ausvara U+0C14
+
+Define Msvara U+0C02
+
+Define Amatra U+0C3E
+Define imatra U+0C3F
+Define Imatra U+0C40
+Define umatra U+0C41
+Define Umatra U+0C42
+Define rmatra U+0C43
+Define Rmatra U+0C44
+Define lmatra U+0C62
+Define ematra U+0C46
+Define Ematra U+0C47
+Define aimatra U+0C48
+Define omatra U+0C4A
+Define Omatra U+0C4B
+Define aumatra U+0C4C
+
+
+
+Define ka U+0C15
+Define kha U+0C16
+Define ga U+0C17
+Define gha U+0C18
+Define Ga U+0C19
+Define cha U+0C1A
+Define Cha U+0C1B
+Define ja U+0C1C
+Define jha U+0C1D
+Define Ja U+0C1E
+Define Ta U+0C1F
+Define Tha U+0C20
+Define Da U+0C21
+Define Dha U+0C22
+Define Na U+0C23
+Define ta U+0C24
+Define tha U+0C25
+Define da U+0C26
+Define dha U+0C27
+Define na U+0C28
+Define pa U+0C2A
+Define pha U+0C2B
+Define ba U+0C2C
+Define bha U+0C2D
+Define ma U+0C2E
+Define ya U+0C2F
+Define ra U+0C30
+Define Ra U+0C31 ;;eknath
+Define la U+0C32
+Define va U+0C35
+Define wa U+0C35
+Define sha U+0C36
+Define Sha U+0C37
+Define sa U+0C38
+Define ha U+0C39
+
+Define hka U+0C58
+Define hkha U+0C59
+Define hga U+0C5A
+Define hja U+0C5B
+Define hDa U+0C5C
+Define hda U+0C5D
+Define hna U+0C29
+Define hpha U+0C5E
+Define hya U+0C5F
+Define hra U+0C31
+Define hla U+0C34
+
+Define rla U+0C33
+;;;;Define vstroke U+0C51 ;;dont know what this is
+Define hstroke U+0C52
+
+Define danda U+0C64
+Define ddanda U+0C65
+Define virama U+0C4D
+Define avagraha U+093D
+
+Define lcb U+007B
+Define rcb U+007D
+Define zero U+0C02
+Define cbindu U+0901
+Define ksha ka virama Sha
+Define knukta ka U+0CBC
+
+
+
+
+pass(Unicode)
+
+a > asvara
+a a > Asvara
+A > Asvara
+i > isvara
+i i > Isvara
+I > Isvara
+u > usvara
+u u > Usvara
+U > Usvara
+R R i > rvoc
+R cret i > rvoc
+R R I > Rvoc
+R cret I > Rvoc
+L L i > lvoc
+L cret i > lvoc
+L L I > Lvoc
+L cret I > Lvoc
+
+e > Esvara
+
+a i > aisvara
+o > Osvara
+o o > Osvara
+O > Osvara
+a u > ausvara
+
+k > ka
+k h > kha
+k dot h > ka virama
+k x > ka virama zwn ksha
+k h dot h > kha virama
+k h x > kha virama zwn ksha
+g > ga
+g dot h > ga virama
+g x > ga virama zwn ksha
+g a dot n > ga anusvara
+g h > gha
+g h dot h > gha virama
+g h x > gha virama zwn ksha
+tlde N > Ga
+N cret > Ga
+G G > Ga
+tlde N dot h > Ga virama
+N cret dot h > Ga virama
+tlde N x > Ga virama zwn ksha
+N cret dot h > Ga virama
+N cret x > zero zwn ksha
+N cret g > zero zwn ga
+N cret g h > zero zwn gha
+n g > na virama ga
+c h > cha
+c h h > Cha
+c h dot h > cha virama
+c h x > cha virama zwn ksha
+c h h x > Cha virama zwn ksha
+C h > Cha
+C h x > Cha virama zwn ksha
+C h dot h > Cha virama
+c h h dot h > Cha virama
+j > ja
+j dot h > ja virama
+j x > ja virama zwn ksha
+j h > jha
+j h x > jha virama zwn ksha
+j h dot h > jha virama
+tlde n a > Ja
+tlde n > Ja
+tlde n x > Ja virama zwn ksha
+tlde n dot h > Ja virama
+J N > Ja
+J N x > Ja virama zwn ksha
+T > Ta
+T x > Ta virama zwn ksha
+T dot h > Ta virama
+T h > Tha
+T h dot h > Tha virama
+T h x > Tha virama zwn ksha
+D > Da
+D x > Da virama zwn ksha
+D dot h > Da virama
+D h > Dha
+D h dot h > Dha virama
+D h x > Dha virama zwn ksha
+N > Na
+N dot h > Na virama
+N x > Na virama zwn ksha
+N N > Na virama Na
+t > ta
+t dot h > ta virama
+t x > ta virama zwn ksha
+t h > tha
+t h x > tha virama zwn ksha
+t h dot h > tha virama
+d > da
+d x > da virama zwn ksha
+d dot h > da virama
+d h > dha
+d h x > dha virama zwn ksha
+d h dot h > dha virama
+n > na
+n x > na virama zwn ksha
+n dot h > na virama
+p > pa
+p x > pa virama zwn ksha
+p dot h > pa virama
+p h > pha
+p h x > pha virama zwn ksha
+p h dot h > pha virama
+b > ba
+b x > ba virama zwn ksha
+b dot h > ba virama
+b h > bha
+b h x > bha virama zwn ksha
+b h dot h > bha virama
+m > ma
+m dot h > ma virama
+m x > ma virama zwn ksha
+y > ya
+y dot h > ya virama
+y x > ya virama zwn ksha
+r > ra
+r x > ra virama zwn ksha
+r dot h > ra virama
+l > la
+l x > la virama zwn ksha
+L > rla
+L x > rla virama zwn ksha
+l dot h > la virama
+L dot h > rla virama
+v > va
+v x > va virama zwn ksha
+v dot h > va virama
+w > wa
+w x > va virama zwn ksha
+w dot h > wa virama
+s h > sha
+s h x > sha virama zwn ksha
+s h dot h > sha virama
+s h h > Sha
+s h h x > Sha virama zwn ksha
+s h h dot h > Sha virama
+S h > Sha
+S h x > Sha virama zwn ksha
+S h dot h > Sha virama
+s > sa
+s x > sa virama zwn ksha
+s dot h > sa virama
+h > ha
+h x > ha virama zwn ksha
+h dot h > ha virama
+N cret x > zero ksha
+x > ksha
+x dot h > ksha virama
+k S h > ksha
+k S h dot h > ksha virama
+G Y > ja virama Ja
+j tlde n > ja virama Ja
+v a cret cret r > va ra virama
+m lcb rcb > ma virama
+lcb rcb > zwn
+
+
+dot m > anunasika
+q > knukta
+
+U+004D > anusvara
+U+0029 M > U+0029 U+0CE6
+dot a M > avagraha zero
+dot n > anusvara
+U+0048 > visarga
+dot a > avagraha
+dot a lcb rcb > avagraha
+dot a N cret > avagraha U+0CE6
+
+U+002C > virama
+dot N > na
+
+U+002F dot > dot
+;U+007C > danda
+;U+007C U+007C > ddanda
+U+002D > U+002D
+U+005C dot > dot
+U+0022 > U+201D
+U+0027 > U+0027
+U+0028 > U+0028
+U+0029 > U+0029
+U+0060 > U+2018
+U+0060 U+0060 > U+201C
+
+U+0030 > U+0C66 ; Numerals
+U+0031 > U+0C67
+U+0032 > U+0C68
+U+0033 > U+0C69
+U+0034 > U+0C6A
+U+0035 > U+0C6B
+U+0036 > U+0C6C
+U+0037 > U+0C6D
+U+0038 > U+0C6E
+U+0039 > U+0C6F
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka..dha pha..ba ra..la)
+UniClass [mvyanjana] = (pa ba bha)
+
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc Esvara aisvara Osvara ausvara)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra Ematra aimatra Omatra aumatra)
+UniClass [naletter] = (na)
+UniClass [anusvaraletter] = (zero)
+UniClass [avaletter] = (avagraha)
+UniClass [maletter] = (ma)
+UniClass [Naletter] = (Na)
+UniClass [galetter] = (Ga)
+UniClass [jaletter] = (Ja)
+UniClass [osvaraletter] = (Osvara)
+UniClass [xomatra] = (Omatra)
+;UniClass [omatra] = (Omatra)
+
+UniClass [vletter] = (virama)
+
+[naletter] [vyanjana] > [anusvaraletter] [vyanjana]
+[maletter] [mvyanjana] > [anusvaraletter] [mvyanjana]
+[maletter] [maletter] [osvaraletter] > [anusvaraletter] [maletter] [xomatra]
+[galetter] [vyanjana] > [anusvaraletter] [vyanjana]
+[jaletter] [vyanjana] > [anusvaraletter] [vyanjana]
+[Naletter] [vyanjana] > [anusvaraletter] [vyanjana]
+[anusvaraletter] [vyanjana] [svara] > [anusvaraletter] [vyanjana][matra]
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha rla)
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc Esvara aisvara Osvara ausvara)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra Ematra aimatra Omatra aumatra)
+[vyanjana] [svara] > [vyanjana] [matra]
+
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+;; Fourth pass: making remaining conjuncts (for groups of two or more consonants)
+;; and adding viramas to the end of the words in Sanskrit
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha rla)
+UniClass [spacepunct] = (U+0009 .. U+0040 U+005B .. U+0060 U+007B .. U+007D danda ddanda \
+ U+2013 U+2014 U+2018 U+2019 U+201C U+201D)
+
+[vyanjana]=v1 [vyanjana]=v2 <> @v1 virama @v2
+[vyanjana] / _ [spacepunct] <> [vyanjana] virama / _ [spacepunct]
+[vyanjana] / _ # <> [vyanjana] virama / _ #
+
+pass(Unicode)
+
+Uniclass [vyanjana] = (ka .. ha rla)
+[vyanjana] asvara > [vyanjana]
diff --git a/macros/xetex/generic/itrans/itrans-santel.tec b/macros/xetex/generic/itrans/itrans-santel.tec
new file mode 100644
index 0000000000..dc963c6067
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-santel.tec
Binary files differ
diff --git a/macros/xetex/generic/itrans/itrans-sdvn.map b/macros/xetex/generic/itrans/itrans-sdvn.map
new file mode 100644
index 0000000000..2140c4ca3c
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-sdvn.map
@@ -0,0 +1,341 @@
+; TECkit mapping for ITRANS input scheme for writing Unicode Devanagari (0900-097F)
+; by Abhinandan S.P. <abhinandan.sp@iiitb.net> and Shrisha Rao <shrao@acm.org>,
+; based on harvardkyoto.map written by Daniel Stender.
+;
+; Updated 2014-09-01
+
+LHSName "itrans-sdvn"
+RHSName "Unicode"
+LHSDescription "ITRANS input method for Unicode Devanagari"
+Version "1.00"
+
+Define dot U+002E
+
+Define a U+0061
+Define A U+0041
+Define i U+0069
+Define I U+0049
+Define u U+0075
+Define U U+0055
+Define R U+0052
+Define L U+004C
+
+Define e U+0065
+Define o U+006F
+
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define G U+0047
+
+Define c U+0063
+Define C U+0043
+Define j U+006A
+Define J U+004A
+
+Define T U+0054
+Define D U+0044
+Define N U+004E
+
+Define t U+0074
+Define d U+0064
+Define n U+006E
+
+Define p U+0070
+Define b U+0062
+Define m U+006D
+
+Define y U+0079
+Define r U+0072
+Define l U+006C
+Define v U+0076
+Define w U+0077
+
+Define z U+007A
+Define S U+0053
+Define s U+0073
+Define Y U+0059
+Define O U+004F
+
+Define anudatta U+002D ; -
+Define svarita U+0021 ; !
+Define tlde U+007E
+Define cret U+005E
+Define M U+004D
+
+Define q U+0071
+Define f U+0066
+Define x U+0078
+
+
+Define anunasika U+0901
+Define anusvara U+0902
+Define visarga U+0903
+
+Define asvara U+0905
+Define Asvara U+0906
+Define isvara U+0907
+Define Isvara U+0908
+Define usvara U+0909
+Define Usvara U+090A
+Define rvoc U+090B
+Define Rvoc U+0960
+Define lvoc U+090C
+Define Lvoc U+0961
+Define esvara U+090F
+Define aisvara U+0910
+Define osvara U+0913
+Define ausvara U+0914
+
+Define Amatra U+093E
+Define imatra U+093F
+Define Imatra U+0940
+Define umatra U+0941
+Define Umatra U+0942
+Define rmatra U+0943
+Define Rmatra U+0944
+Define lmatra U+0962
+Define ematra U+0947
+Define aimatra U+0948
+Define omatra U+094B
+Define aumatra U+094C
+
+Define ka U+0915
+Define kha U+0916
+Define ga U+0917
+Define gha U+0918
+Define Ga U+0919
+Define cha U+091A
+Define Cha U+091B
+Define ja U+091C
+Define jha U+091D
+Define Ja U+091E
+Define Ta U+091F
+Define Tha U+0920
+Define Da U+0921
+Define Dha U+0922
+Define Na U+0923
+Define ta U+0924
+Define tha U+0925
+Define da U+0926
+Define dha U+0927
+Define na U+0928
+Define pa U+092A
+Define pha U+092B
+Define ba U+092C
+Define bha U+092D
+Define ma U+092E
+Define ya U+092F
+Define ra U+0930
+Define la U+0932
+Define va U+0935
+Define wa U+0935
+Define sha U+0936
+Define Sha U+0937
+Define sa U+0938
+Define ha U+0939
+
+Define hka U+0958
+Define hkha U+0959
+Define hga U+095A
+Define hja U+095B
+Define hDa U+095C
+Define hda U+095D
+Define hna U+0929
+Define hpha U+095E
+Define hya U+095F
+Define hra U+0931
+Define hla U+0934
+
+Define rla U+0933
+Define vstroke U+0951
+Define hstroke U+0952
+
+Define danda U+0964
+Define ddanda U+0965
+Define virama U+094D
+Define avagraha U+093D
+
+Define om U+0950
+
+
+pass(Unicode)
+
+a > asvara
+a a > Asvara
+A > Asvara
+i > isvara
+i i > Isvara
+I > Isvara
+u > usvara
+u u > Usvara
+U > Usvara
+R R i > rvoc
+R cret i > rvoc
+R R I > Rvoc
+R cret I > Rvoc
+L L i > lvoc
+L cret i > lvoc
+L L I > Lvoc
+L cret I > Lvoc
+
+e > esvara
+a i > aisvara
+o > osvara
+a u > ausvara
+
+k > ka
+k h > kha
+k dot h > ka virama
+k h dot h > kha virama
+g > ga
+g dot h > ga virama
+g h > gha
+g h dot h > gha virama
+tlde N > Ga
+N cret > Ga
+G G > Ga
+tlde N dot h > Ga virama
+N cret dot h > Ga virama
+c h > cha
+c h h > Cha
+c h dot h > cha virama
+C h > Cha
+C h dot h > Cha virama
+c h h dot h > Cha virama
+j > ja
+j dot h > ja virama
+j h > jha
+j h dot h > jha virama
+tlde n > Ja
+tlde n dot h > Ja virama
+J N > Ja
+T > Ta
+T dot h > Ta virama
+T h > Tha
+T h dot h > Tha virama
+D > Da
+D dot h > Da virama
+D h > Dha
+D h dot h > Dha virama
+N > Na
+N dot h > Na virama
+t > ta
+t dot h > ta virama
+t h > tha
+t h dot h > tha virama
+d > da
+d dot h > da virama
+d h > dha
+d h dot h > dha virama
+n > na
+n dot h > na virama
+p > pa
+p dot h > pa virama
+p h > pha
+p h dot h > pha virama
+b > ba
+b dot h > ba virama
+b h > bha
+b h dot h > bha virama
+m > ma
+m dot h > ma virama
+y > ya
+y dot h > ya virama
+r > ra
+r dot h > ra virama
+l > la
+l dot h > la virama
+v > va
+v dot h > va virama
+w > wa
+w dot h > wa virama
+s h > sha
+s h dot h > sha virama
+s h h > Sha
+s h h dot h > Sha virama
+S h > Sha
+S h dot h > Sha virama
+s > sa
+s dot h > sa virama
+h > ha
+h dot h > ha virama
+x > ka virama Sha
+x dot h > ka virama Sha virama
+k S h > ka virama Sha
+k S h dot h > ka virama Sha virama
+G Y > ja virama Ja
+A U M > om
+
+
+q > hka
+x > hkha
+dot g > hga
+dot z > hja
+f > hpha
+
+svarita > vstroke
+anudatta > hstroke
+
+L > rla
+dot m > anunasika
+
+U+004D > anusvara
+dot n > anusvara
+U+0048 > visarga
+dot a > avagraha
+U+002C > virama
+
+U+007C > danda
+U+007C U+007C > ddanda
+
+O M > om
+
+U+0030 > U+0966 ; Numerals
+U+0031 > U+0967
+U+0032 > U+0968
+U+0033 > U+0969
+U+0034 > U+096A
+U+0035 > U+096B
+U+0036 > U+096C
+U+0037 > U+096D
+U+0038 > U+096E
+U+0039 > U+096F
+
+
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha rla hka .. hpha)
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc esvara aisvara osvara ausvara)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra ematra aimatra omatra aumatra)
+[vyanjana] [svara] > [vyanjana] [matra]
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+;; Fourth pass: making remaining conjuncts (for groups of two or more consonants)
+;; and adding viramas to the end of the words in Sanskrit
+pass (Unicode)
+
+;; Classes
+UniClass [vyanjana] = (ka .. ha rla hka..hpha)
+UniClass [spacepunct] = (U+0009 .. U+0040 U+005B .. U+0060 U+007B .. U+007D danda ddanda \
+ U+2013 U+2014 U+2018 U+2019 U+201C U+201D)
+
+[vyanjana]=v1 [vyanjana]=v2 <> @v1 virama @v2
+[vyanjana] / _ [spacepunct] <> [vyanjana] virama / _ [spacepunct]
+[vyanjana] / _ # <> [vyanjana] virama / _ #
+
+
+pass(Unicode)
+
+Uniclass [vyanjana] = (ka .. ha rla hka .. hpha)
+[vyanjana] asvara > [vyanjana]
diff --git a/macros/xetex/generic/itrans/itrans-sdvn.tec b/macros/xetex/generic/itrans/itrans-sdvn.tec
new file mode 100644
index 0000000000..5043c9b3be
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-sdvn.tec
Binary files differ
diff --git a/macros/xetex/generic/itrans/itrans-tamil-sample.pdf b/macros/xetex/generic/itrans/itrans-tamil-sample.pdf
new file mode 100644
index 0000000000..3c00a78376
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-tamil-sample.pdf
Binary files differ
diff --git a/macros/xetex/generic/itrans/itrans-tamil-sample.tex b/macros/xetex/generic/itrans/itrans-tamil-sample.tex
new file mode 100644
index 0000000000..43b5be1956
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-tamil-sample.tex
@@ -0,0 +1,29 @@
+\documentclass[12pt]{article}
+\usepackage{ifxetex}
+\RequireXeTeX
+\usepackage{fontspec}
+\newcommand\dn{\catcode`\^=11
+ \catcode`\~=11
+ \fontspec[Script=Tamil,Mapping=itrans-tamil]{JanaTamil}}
+
+\obeylines
+
+\begin{document}
+
+{\dn
+
+a aa A i ii I u uu U e E ai o O au q
+
+ka ga ~Na N^a cha ~na Ta Tha Na ta tha na ^na pa ba
+
+ma ya ra la va wa Ja za La Ra Sha sa ja ha xa
+
+1 2 3 4 5 6 7 8 9 10 100 1000
+
+ka kaa kA ki kii kI ku kuu kU ke kE kai ko kO kau kq
+
+na^nRi
+
+}
+\end{document}
+
diff --git a/macros/xetex/generic/itrans/itrans-tamil.map b/macros/xetex/generic/itrans/itrans-tamil.map
new file mode 100644
index 0000000000..872f3a4c78
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-tamil.map
@@ -0,0 +1,355 @@
+; TECkit mapping for ITRANS input scheme for writing Unicode Tamil (0B80-0BFF)
+; by Abhinandan S.P. <abhinandan.sp@iiitb.net> and Shrisha Rao <shrao@acm.org>,
+; based on harvardkyoto.map written by Daniel Stender.
+;
+; Updated 2010-10-19
+
+LHSName "itrans-tamil"
+RHSName "Unicode"
+LHSDescription "Itrans input method for Unicode Tamil"
+Version "1.00"
+
+Define dot U+002E
+
+Define a U+0061
+Define A U+0041
+Define i U+0069
+Define I U+0049
+Define u U+0075
+Define U U+0055
+Define R U+0052
+Define L U+004C
+
+Define e U+0065
+Define E U+0045
+Define o U+006F
+
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define G U+0047
+
+Define c U+0063
+Define C U+0043
+Define j U+006A
+Define J U+004A
+
+Define T U+0054
+Define D U+0044
+Define N U+004E
+
+Define t U+0074
+Define d U+0064
+Define n U+006E
+
+Define p U+0070
+Define b U+0062
+Define m U+006D
+
+Define y U+0079
+Define r U+0072
+Define l U+006C
+Define v U+0076
+Define w U+0077
+
+Define z U+007A
+Define S U+0053
+Define s U+0073
+Define Y U+0059
+Define O U+004F
+
+Define anudatta U+002D ; -
+Define svarita U+0021 ; !
+Define tlde U+007E
+Define cret U+005E
+Define M U+004D
+
+Define q U+0071
+Define f U+0066
+Define x U+0078
+
+
+;Define anunasika U+0901
+Define anusvara U+0B82
+Define visarga U+0B83
+
+Define asvara U+0B85
+Define Asvara U+0B86
+Define isvara U+0B87
+Define Isvara U+0B88
+Define usvara U+0B89
+Define Usvara U+0B8A
+;Define rvoc U+0C8B
+;Define Rvoc U+0CE0
+;Define lvoc U+0C8C
+;Define Lvoc U+0CE1
+Define esvara U+0B8E
+Define Esvara U+0B8F
+Define aisvara U+0B90
+Define osvara U+0B92
+Define Osvara U+0B93
+Define ausvara U+0B94
+
+Define Amatra U+0BBE
+Define imatra U+0BBF
+Define Imatra U+0BC0
+Define umatra U+0BC1
+Define Umatra U+0BC2
+;Define rmatra U+0CC3
+;Define Rmatra U+0CC4
+;Define lmatra U+0CE2
+;Define Lmatra U+0CE3
+Define ematra U+0BC6
+Define Ematra U+0BC7
+Define aimatra U+0BC8
+Define omatra U+0BCA
+Define Omatra U+0BCB
+Define aumatra U+0BCC
+
+Define ka U+0B95
+;Define kha U+0C96
+Define ga U+0B95
+;Define gha U+0C98
+Define Ga U+0B99
+Define cha U+0B9A
+;Define Cha U+0C9B
+Define ja U+0B9C
+;Define jha U+0C9D
+Define Ja U+0B9E
+Define Ta U+0B9F
+Define Tha U+0B9F
+;Define Da U+0CA1
+;Define Dha U+0CA2
+Define Na U+0BA3
+Define ta U+0BA4
+Define tha U+0BA4
+;Define da U+0CA6
+;Define dha U+0CA7
+Define na U+0BA8
+Define nnaa U+0BA9
+Define pa U+0BAA
+;Define pha U+0CAB
+Define ba U+0BAA
+;Define bha U+0CAD
+Define ma U+0BAE
+Define ya U+0BAF
+Define ra U+0BB0
+Define rra U+0BB1
+Define la U+0BB2
+Define lla U+0BB3
+Define llla U+0BB4
+Define va U+0BB5
+Define wa U+0BB5
+Define sha U+0BB6
+Define Sha U+0BB7
+Define sa U+0BB8
+Define ha U+0BB9
+
+;Define hka U+0958
+;Define hkha U+0959
+;Define hga U+095A
+;Define hja U+095B
+;Define hDa U+095C
+;Define hda U+095D
+;Define hna U+0929
+;Define hpha U+095E
+;Define hya U+095F
+;Define hra U+0931
+;Define hla U+0934
+
+;Define rla U+0CB3
+;Define vstroke U+0951
+;Define hstroke U+0952
+
+Define danda U+0964
+Define ddanda U+0965
+Define virama U+0BCD
+Define avagraha U+0CBD
+
+Define om U+0BD0
+
+
+pass(Unicode)
+
+a > asvara
+a a > Asvara
+A > Asvara
+i > isvara
+i i > Isvara
+I > Isvara
+u > usvara
+u u > Usvara
+U > Usvara
+;R R i > rvoc
+;R cret i > rvoc
+;R R I > Rvoc
+;R cret I > Rvoc
+;L L i > lvoc
+;L cret i > lvoc
+;L L I > Lvoc
+;L cret I > Lvoc
+
+e > esvara
+E > Esvara
+a i > aisvara
+o > osvara
+O > Osvara
+a u > ausvara
+
+k > ka
+;k h > kha
+k dot h > ka virama
+;k h dot h > kha virama
+g > ga
+g dot h > ga virama
+;g h > gha
+;g h dot h > gha virama
+tlde N > Ga
+N cret > Ga
+tlde N dot h > Ga virama
+N cret dot h > Ga virama
+c h > cha
+;c h h > Cha
+c h dot h > cha virama
+;C h > Cha
+;C h dot h > Cha virama
+;c h h dot h > Cha virama
+j > ja
+j dot h > ja virama
+;j h > jha
+;j h dot h > jha virama
+tlde n > Ja
+tlde n dot h > Ja virama
+J N > Ja
+T > Ta
+T dot h > Ta virama
+T h > Tha
+T h dot h > Tha virama
+;D > Da
+;D dot h > Da virama
+;D h > Dha
+;D h dot h > Dha virama
+N > Na
+N dot h > Na virama
+t > ta
+t dot h > ta virama
+t h > tha
+t h dot h > tha virama
+;d > da
+;d dot h > da virama
+;d h > dha
+;d h dot h > dha virama
+n > na
+n dot h > na virama
+cret n > nnaa
+cret n dot h > nnaa virama
+
+p > pa
+p dot h > pa virama
+;p h > pha
+;p h dot h > pha virama
+b > ba
+b dot h > ba virama
+;b h > bha
+;b h dot h > bha virama
+m > ma
+m dot h > ma virama
+y > ya
+y dot h > ya virama
+r > ra
+r dot h > ra virama
+R > rra
+R dot h > rra virama
+l > la
+L > lla
+J > llla
+z > llla
+l dot h > la virama
+L dot h > lla virama
+J dot h > lla virama
+z dot h > lla virama
+v > va
+v dot h > va virama
+w > wa
+w dot h > wa virama
+s h > sha
+s h dot h > sha virama
+s h h > Sha
+s h h dot h > Sha virama
+S h > Sha
+S h dot h > Sha virama
+s > sa
+s dot h > sa virama
+h > ha
+h dot h > ha virama
+x > ka virama Sha
+x dot h > ka virama Sha virama
+k S h > ka virama Sha
+k S h dot h > ka virama Sha virama
+G Y > ja virama Ja
+A U M > om
+
+s r i > U+0BB6 U+0BCD U+0BB0 U+0BC0
+
+;q > hka
+;x > hkha
+;dot g > hga
+;dot z > hja
+;f > hpha
+
+;svarita > vstroke
+;anudatta > hstroke
+
+;L > rla
+;dot m > anunasika
+
+U+004D > anusvara
+a n > anusvara
+dot n > anusvara
+N cret > anusvara
+q > visarga
+U+0048 > visarga
+dot a > avagraha
+U+002C > virama
+
+U+007C > danda
+U+007C U+007C > ddanda
+
+O M > om
+
+U+0030 > U+0BE6 ; Numerals
+U+0031 > U+0BE7
+U+0032 > U+0BE8
+U+0033 > U+0BE9
+U+0034 > U+0BEA
+U+0035 > U+0BEB
+U+0036 > U+0BEC
+U+0037 > U+0BED
+U+0038 > U+0BEE
+U+0039 > U+0BEF
+
+U+0031 U+0030 > U+0BF0
+U+0031 U+0030 U+0030 > U+0BF1
+U+0031 U+0030 U+0030 U+0030 > U+0BF2
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara esvara Esvara aisvara osvara Osvara ausvara)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra ematra Ematra aimatra omatra Omatra aumatra)
+[vyanjana] [svara] > [vyanjana] [matra]
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+pass(Unicode)
+
+Uniclass [vyanjana] = (ka .. ha)
+[vyanjana] asvara > [vyanjana]
diff --git a/macros/xetex/generic/itrans/itrans-tamil.tec b/macros/xetex/generic/itrans/itrans-tamil.tec
new file mode 100644
index 0000000000..5d31ae329c
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-tamil.tec
Binary files differ
diff --git a/macros/xetex/generic/itrans/itrans-tel.map b/macros/xetex/generic/itrans/itrans-tel.map
new file mode 100644
index 0000000000..600810d61b
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-tel.map
@@ -0,0 +1,358 @@
+; TECkit mapping for ITRANS input scheme for writing Unicode Telugu (0C00-0C7F)
+; by Eknath <eknath2k@gmail.com>, with help from Shrisha Rao <shrao@nyx.net>
+; based on harvardkyoto.map written by Daniel Stender.
+;
+; Updated 2014-09-01
+
+LHSName "itrans-tel"
+RHSName "Unicode"
+LHSDescription "ITRANS input method for Unicode Telugu"
+Version "1.00"
+
+Define dot U+002E
+
+Define a U+0061
+Define A U+0041
+Define i U+0069
+Define I U+0049
+Define u U+0075
+Define U U+0055
+Define R U+0052
+Define L U+004C
+
+Define e U+0065
+Define E U+0045
+Define o U+006F
+Define O U+004F
+
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define G U+0047
+
+Define c U+0063
+Define C U+0043
+Define j U+006A
+Define J U+004A
+
+Define T U+0054
+Define D U+0044
+Define N U+004E
+
+Define t U+0074
+Define d U+0064
+Define n U+006E
+
+Define p U+0070
+Define b U+0062
+Define m U+006D
+
+Define y U+0079
+Define r U+0072
+Define l U+006C
+Define v U+0076
+Define w U+0077
+
+Define z U+007A
+Define S U+0053
+Define s U+0073
+Define Y U+0059
+
+Define Q U+0051 ;;;eknath
+Define Z U+005A ;;;eknath
+
+;;;;;Define anudatta U+002D ; - allow -
+;;;;;Define svarita U+0021 ; ! allow !
+Define tlde U+007E
+Define cret U+005E
+Define M U+004D
+
+Define q U+0071
+Define f U+0066
+Define x U+0078
+
+Define X U+007C
+
+
+
+
+Define anunasika U+0C01
+Define anusvara U+0C02
+Define visarga U+0C03
+
+Define asvara U+0C05
+Define Asvara U+0C06
+Define isvara U+0C07
+Define Isvara U+0C08
+Define usvara U+0C09
+Define Usvara U+0C0A
+Define rvoc U+0C0B
+Define Rvoc U+0C60
+Define lvoc U+0C0C
+Define Lvoc U+0C61
+Define esvara U+0C0E
+Define Esvara U+0C0F
+Define aisvara U+0C10
+Define osvara U+0C12
+Define Osvara U+0C13
+Define ausvara U+0C14
+
+Define Msvara U+0C02
+
+Define Amatra U+0C3E
+Define imatra U+0C3F
+Define Imatra U+0C40
+Define umatra U+0C41
+Define Umatra U+0C42
+Define rmatra U+0C43
+Define Rmatra U+0C44
+Define lmatra U+0C62
+Define ematra U+0C46
+Define Ematra U+0C47
+Define aimatra U+0C48
+Define omatra U+0C4A
+Define Omatra U+0C4B
+Define aumatra U+0C4C
+
+
+
+Define ka U+0C15
+Define kha U+0C16
+Define ga U+0C17
+Define gha U+0C18
+Define Ga U+0C19
+Define cha U+0C1A
+Define Cha U+0C1B
+Define ja U+0C1C
+Define jha U+0C1D
+Define Ja U+0C1E
+Define Ta U+0C1F
+Define Tha U+0C20
+Define Da U+0C21
+Define Dha U+0C22
+Define Na U+0C23
+Define ta U+0C24
+Define tha U+0C25
+Define da U+0C26
+Define dha U+0C27
+Define na U+0C28
+Define pa U+0C2A
+Define pha U+0C2B
+Define ba U+0C2C
+Define bha U+0C2D
+Define ma U+0C2E
+Define ya U+0C2F
+Define ra U+0C30
+Define Ra U+0C31 ;;eknath
+Define la U+0C32
+Define va U+0C35
+Define wa U+0C35
+Define sha U+0C36
+Define Sha U+0C37
+Define sa U+0C38
+Define ha U+0C39
+
+Define hka U+0C58
+Define hkha U+0C59
+Define hga U+0C5A
+Define hja U+0C5B
+Define hDa U+0C5C
+Define hda U+0C5D
+Define hna U+0C29
+Define hpha U+0C5E
+Define hya U+0C5F
+Define hra U+0C31
+Define hla U+0C34
+
+Define rla U+0C33
+;;;;Define vstroke U+0C51 ;;dont know what this is
+Define hstroke U+0C52
+
+Define danda U+0C64
+Define ddanda U+0C65
+Define virama U+0C4D
+Define avagraha U+093D
+
+
+
+
+
+
+
+pass(Unicode)
+
+a > asvara
+a a > Asvara
+A > Asvara
+i > isvara
+i i > Isvara
+I > Isvara
+u > usvara
+u u > Usvara
+U > Usvara
+R R i > rvoc
+R cret i > rvoc
+R R I > Rvoc
+R cret I > Rvoc
+L L i > lvoc
+L cret i > lvoc
+L L I > Lvoc
+L cret I > Lvoc
+
+e > esvara
+E > Esvara
+a i > aisvara
+o > osvara
+O > Osvara
+a u > ausvara
+
+k > ka
+k h > kha
+k dot h > ka virama
+k h dot h > kha virama
+g > ga
+g dot h > ga virama
+g h > gha
+g h dot h > gha virama
+tlde N > Ga
+N cret > Ga
+G G > Ga
+tlde N dot h > Ga virama
+N cret dot h > Ga virama
+c h > cha
+c h h > Cha
+c h dot h > cha virama
+C h > Cha
+C h dot h > Cha virama
+c h h dot h > Cha virama
+j > ja
+j dot h > ja virama
+j h > jha
+j h dot h > jha virama
+tlde n > Ja
+Q > Ja ;;eknath
+Z > Ga ;;eknath
+tlde n dot h > Ja virama
+J N > Ja
+T > Ta
+T dot h > Ta virama
+T h > Tha
+T h dot h > Tha virama
+D > Da
+D dot h > Da virama
+D h > Dha
+D h dot h > Dha virama
+N > Na
+N dot h > Na virama
+t > ta
+t dot h > ta virama
+t h > tha
+t h dot h > tha virama
+d > da
+d dot h > da virama
+d h > dha
+d h dot h > dha virama
+n > na
+n dot h > na virama
+p > pa
+p dot h > pa virama
+p h > pha
+p h dot h > pha virama
+b > ba
+b dot h > ba virama
+b h > bha
+b h dot h > bha virama
+m > ma
+m dot h > ma virama
+y > ya
+y dot h > ya virama
+r > ra
+R > Ra ;;eknath
+r dot h > ra virama
+l > la
+l dot h > la virama
+v > va
+v dot h > va virama
+w > wa
+w dot h > wa virama
+s h > sha
+s h dot h > sha virama
+s h h > Sha
+s h h dot h > Sha virama
+S h > Sha
+S h dot h > Sha virama
+s > sa
+s dot h > sa virama
+h > ha
+h dot h > ha virama
+x > ka virama Sha
+x dot h > ka virama Sha virama
+k S h > ka virama Sha
+k S h dot h > ka virama Sha virama
+G Y > ja virama Ja
+A U M > Osvara Msvara
+
+dot a > avagraha
+
+
+q > hka
+x > hkha
+dot g > hga
+dot z > hja
+f > hpha
+
+;;;svarita > vstroke ;;;allow !
+;;;anudatta > hstroke ;;;allow -
+
+L > rla
+dot m > anunasika
+
+U+004D > anusvara
+dot n > anusvara
+U+0048 > visarga
+dot a > avagraha
+;;;U+002C > virama ;; this is to enable comma
+
+;;U+007C > danda
+;;U+007C U+007C > ddanda
+
+O M > Osvara Msvara
+
+U+0030 > U+0C66 ; Numerals
+U+0031 > U+0C67
+U+0032 > U+0C68
+U+0033 > U+0C69
+U+0034 > U+0C6A
+U+0035 > U+0C6B
+U+0036 > U+0C6C
+U+0037 > U+0C6D
+U+0038 > U+0C6E
+U+0039 > U+0C6F
+
+
+
+
+
+
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha rla hka .. hpha)
+UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc esvara Esvara aisvara osvara Osvara ausvara)
+UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra ematra Ematra aimatra omatra Omatra aumatra)
+[vyanjana] [svara] > [vyanjana] [matra]
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+pass(Unicode)
+
+UniClass [vyanjana] = (ka .. ha)
+[vyanjana]=v1 [vyanjana]=v2 > @v1 virama @v2
+
+pass(Unicode)
+
+Uniclass [vyanjana] = (ka .. ha rla hka .. hpha)
+[vyanjana] asvara > [vyanjana]
diff --git a/macros/xetex/generic/itrans/itrans-tel.tec b/macros/xetex/generic/itrans/itrans-tel.tec
new file mode 100644
index 0000000000..e44c86f802
--- /dev/null
+++ b/macros/xetex/generic/itrans/itrans-tel.tec
Binary files differ
diff --git a/macros/xetex/generic/tibetan/Changelog b/macros/xetex/generic/tibetan/Changelog
new file mode 100644
index 0000000000..93e751b04f
--- /dev/null
+++ b/macros/xetex/generic/tibetan/Changelog
@@ -0,0 +1,6 @@
+xetex-tibetan (0.1) UNRELEASED; urgency=low
+
+ * Initial release, includes wylie.map.
+
+ -- Daniel Stender <daniel@danielstender.com> Fri, 11 Jan 2013 16:33:21 +0100
+
diff --git a/macros/xetex/generic/tibetan/README b/macros/xetex/generic/tibetan/README
new file mode 100644
index 0000000000..c8b24257cc
--- /dev/null
+++ b/macros/xetex/generic/tibetan/README
@@ -0,0 +1,58 @@
+xetex-tibetan 0.1
+=================
+
+TECkit input mappings for typesetting of Unicode Tibetan (0F00-0FFF)
+with the LateX PDF-engine XeTeX. Created by Daniel Stender
+<daniel@danielstender.com>.
+
+wylie.map
+---------
+
+Input following Turrell Wylie: A standard system of Tibetan
+transliteration (Harvard Journal of Asiatic Studies 22, 1959, pp. 261
+sq.):
+
+- ka kh g ng c ch j ny t th d n p ph b m
+- ts tsh dz w zh z 'a y r l sh s h a
+
+Usage like:
+
+ \documentclass{article}
+ \usepackage{fontspec}
+ \setmainfont[Script=Tibetan,Mapping=wylie]{DDC Uchen}
+ \begin{document}
+ mkhas.pa.yon.dan.mdzod.'dzin.pa | \\
+ de.dag.legs.bshad.rin.chen.sdud | \\
+ rga.mtsho.chen.po.chu.yi.bder | \\
+ yin.phir.chu.bo.thams.cad.'bab || \\
+ skye.bo.yon.dan.yod.med.pa'i | \\
+ blang.dor.blo.gros.ldan.pa.mkhas | \\
+ rdul.dang.'dres.pa'i.lcags.phye.rnams | \\
+ khab.len.rdo.yis.len.par.shes ||
+ \end{document}
+
+loctib.map
+----------
+
+Input following the Library of Congress input scheme (cf. Herbert Franke
+(Hrsg.): Wörterbuch der tibetischen Schriftsprache. 1. Lieferung: ka-kun
+chub par byed pa. München 2005, p. xx):
+
+- ka kh g ṅ (U+1E45) c ch j ñ (U+00F1) t th d n p ph b m
+- ts tsh dz w ź (U+017A) z 'a y r l ś (U+015B) s h a
+
+Usage like:
+
+ \documentclass{article}
+ \usepackage{fontspec}
+ \setmainfont[Script=Tibetan,Mapping=loctib]{DDC Uchen}
+ \begin{document}
+ mkhas.pa.yon.dan.mdzod.'dzin.pa | \\
+ de.dag.legs.bśad.rin.chen.sdud | \\
+ rga.mtsho.chen.po.chu.yi.bder | \\
+ yin.phir.chu.bo.thams.cad.'bab || \\
+ skye.bo.yon.dan.yod.med.pa'i | \\
+ blaṅ.dor.blo.gros.ldan.pa.mkhas | \\
+ rdul.dang.'dres.pa'i.lcags.phye.rnams | \\
+ khab.len.rdo.yis.len.par.śes ||
+ \end{document}
diff --git a/macros/xetex/generic/tibetan/loctib.map b/macros/xetex/generic/tibetan/loctib.map
new file mode 100644
index 0000000000..616d2e3a27
--- /dev/null
+++ b/macros/xetex/generic/tibetan/loctib.map
@@ -0,0 +1,350 @@
+EncodingName "loctib"
+DescriptiveName "Input map for Unicode Tibetan (U0F00)"
+Contact "daniel@danielstender.com"
+Copyright "LaTeX Project Public License"
+
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define G U+1E45 ; ṅ
+Define c U+0063
+Define j U+006A
+Define J U+00F1 ; ñ
+Define t U+0074
+Define d U+0064
+Define n U+006E
+Define p U+0070
+Define b U+0062
+Define m U+006D
+Define s U+0073
+Define Z U+017A ; ź
+Define z U+007A
+Define w U+0077
+Define y U+0079
+Define r U+0072
+Define l U+006C
+Define S U+015B ; ś
+
+Define x1 U+0027 ; '
+
+Define a U+0061
+Define i U+0069
+Define u U+0075
+Define e U+0065
+Define o U+006F
+
+Define ka U+0F40
+Define Ka U+0F41
+Define ga U+0F42
+Define Ga U+0F44
+Define ca U+0F45
+Define Ca U+0F46
+Define ja U+0F47
+Define Ja U+0F49
+define ta U+0F4F
+Define Ta U+0F50
+Define da U+0F51
+Define na U+0F53
+Define pa U+0F54
+Define Pa U+0F55
+Define ba U+0F56
+Define ma U+0F58
+Define tsa U+0F59
+Define Tsa U+0F5A
+Define dza U+0F5B
+Define wa U+0F5D
+Define Za U+0F5E
+Define za U+0F5F
+Define ya U+0F61
+Define ra U+0F62
+Define la U+0F63
+Define Sa U+0F64
+Define sa U+0F66
+Define ha U+0F67
+
+Define xwa U+0FAD
+Define xya U+0FB1
+Define xra U+0FB2
+Define xla U+0FB3
+
+Define xka U+0F90
+Define xga U+0F92
+Define xGa U+0F94
+Define xca U+0F95
+Define xja U+0F97
+Define xJa U+0F99
+Define xta U+0F9F
+Define xda U+0FA1
+Define xna U+0FA3
+Define xpa U+0FA4
+Define xba U+0FA6
+Define xma U+0FA8
+Define xtsa U+0FA9
+Define xdza U+0FAB
+Define xha U+0FB7
+
+Define xa U+0F60
+Define xA U+0F68
+Define xi U+0F72
+Define xu U+0F74
+Define xe U+0F7A
+Define xo U+0F7C
+
+pass(Unicode)
+
+UniClass [iv] = (i u e o)
+UniClass [ov] = (xi xu xe xo)
+
+k a > ka
+k [iv] > ka [ov]
+k w a > ka xwa
+k y a > ka xya
+k y [iv] > ka xya [ov]
+k r a > ka xra
+k r [iv] > ka xra [ov]
+k l a > ka xla
+k l [iv] > ka xla [ov]
+r k a > ra xka
+r k [iv] > ra xka [ov]
+r k y a > ra xka xya
+r k y [iv] > ra xka xya [ov]
+l k a > la xka
+l k [iv] > la xka [ov]
+s k a > sa xka
+s k [iv] > sa xka [ov]
+s k y a > sa xka xya
+s k y [iv] > sa xka xya [ov]
+s k r a > sa xka xra
+s k r [iv] > sa xka xra [ov]
+k h a > Ka
+k h [iv]=t1 > Ka [ov]=t1
+k h w a > Ka xwa
+k h y a > Ka xya
+k h y [iv]=t1 > Ka xya [ov]=t1
+k h r a > Ka xra
+k h r [iv]=t1 > Ka xra [ov]=t1
+g a > ga
+g [iv] > ga [ov]
+g w a > ga xwa
+g y a > ga xya
+g y [iv] > ga xya [ov]
+g r a > ga xra
+g r [iv] > ga xra [ov]
+g r w a > ga xra xwa
+g l a > ga xla
+g l [iv] > ga xla [ov]
+r g a > ra xga
+r g [iv] > ra xga [ov]
+r g y a > ra xga xya
+r g y [iv] > ra xga xya [ov]
+l g a > la xga
+l g [iv] > la xga [ov]
+l g y a > la xga xya
+s g a > sa xga
+s g [iv] > sa xga [ov]
+s g y a > sa xga xya
+s g y [iv] > sa xga xya [ov]
+s g r a > sa xga xra
+s g r [iv] > sa xga xra [ov]
+G a > Ga
+G [iv] > Ga [ov]
+G w a > Ja xwa
+r G a > ra xGa
+r G [iv] > ra xGa [ov]
+l G a > la xGa
+s G a > sa xGa
+s G [iv] > sa xGa [ov]
+c a > ca
+c [iv] > ca [ov]
+c w a > ca xwa
+l c a > la xca
+c h a > Ca
+c h [iv]=t1 > Ca [ov]=t1
+j a > ja
+j [iv] > ja [ov]
+r j a > ra xja
+r j [iv] > ra xja [ov]
+l j a > la xja
+l j [iv] > la xja [ov]
+J a > Ja
+J [iv] > Ja [ov]
+r J a > ra xJa
+r J [iv] > ra xJa [ov]
+s J a > sa xJa
+s J [iv] > sa xJa [ov]
+t a > ta
+t [iv] > ta [ov]
+t w a > ta xwa
+t r a > ta xra
+t r [iv] > ta xra [ov]
+r t a > ra xta
+r t [iv] > ra xta [ov]
+l t a > la xta
+l t [iv] > la xta [ov]
+s t a > sa xta
+s t [iv] > sa xta [ov]
+t h a > Ta
+t h [iv]=t1 > Ta [ov]=t1
+t h r a > Ta xra
+d a > da
+d [iv] > da [ov]
+d w a > da xwa
+d r a > da xra
+d r [iv] > da xra [ov]
+r d a > ra xda
+r d [iv] > ra xda [ov]
+l d a > la xda
+l d [iv] > la xda [ov]
+s d a > sa xda
+s d [iv] > sa xda [ov]
+n a > na
+n [iv] > na [ov]
+r n a > ra xna
+r n [iv] > ra xna [ov]
+s n a > sa xna
+s n [iv] > sa xna [ov]
+s n r [iv] > sa xna xra [ov]
+p a > pa
+p [iv] > pa [ov]
+p r a > pa xra
+p r [iv] > pa xra [ov]
+p y a > pa xya
+p y [iv] > pa xya [ov]
+l p a > la xpa
+s p a > sa xpa
+s p [iv] > sa xpa [ov]
+s p y a > sa xpa xya
+s p y [iv] > sa xpa xya [ov]
+s p r a > sa xpa xra
+s p r [iv] > sa xpa xra [ov]
+p h a > Pa
+p h [iv]=t1 > Pa [ov]=t1
+p h y a > Pa xya
+p h y [iv]=t1 > Pa xya [ov]=t1
+p h y w a > Pa xya xwa
+p h r a > Pa xra
+p h r [iv]=t1 > Pa xra [ov]=t1
+b a > ba
+b [iv] > ba [ov]
+b h a > ba xha
+b y a > ba xya
+b y [iv] > ba xya [ov]
+b r a > ba xra
+b r [iv] > ba xra [ov]
+b l a > ba xla
+b l [iv] > ba xla [ov]
+r b a > ra xba
+r b [iv] > ra xba [ov]
+l b a > la xba
+l b [iv] > la xba [ov]
+s b a > sa xba
+s b [iv] > sa xba [ov]
+s b y a > sa xba xya
+s b y [iv] > sa xba xya [ov]
+s b r a > sa xba xra
+s b r [iv] > sa xba xra [ov]
+m a > ma
+m [iv] > ma [ov]
+m y a > ma xya
+m y [iv] > ma xya [ov]
+m r a > ma xra
+r m a > ra xma
+r m [iv] > ra xma [ov]
+r m y a > ra xma xya
+s m a > sa xma
+s m [iv] > sa xma [ov]
+s m y a > sa xma xya
+s m y [iv] > sa xma xya [ov]
+s m r a > sa xma xra
+s m r [iv] > sa xma xra [ov]
+t s a > tsa
+t s [iv]=t1 > tsa [ov]=t1
+t s w a > tsa xwa
+r t s a > ra xtsa
+r t s [iv]=t1 > ra xtsa [ov]=t1
+r t s w a > ra xtsa xwa
+s t s a > sa xtsa
+t s h a > Tsa
+t s h [iv]=t1 > Tsa [ov]=t1
+t s h w a > Tsa xwa
+d z a > dza
+d z [iv]=t1 > dza [ov]=t1
+r d z a > ra xdza
+r d z [iv]=t1 > ra xdza [ov]=t1
+w a > wa
+w [iv] > wa [ov]
+Z a > Za
+Z [iv] > Za [ov]
+Z w a > Za xwa
+z a > za
+z [iv] > za [ov]
+z w a > za xwa
+z l a > za xla
+z l [iv] > za xla [ov]
+y a > ya
+y [iv] > ya [ov]
+r a > ra
+r [iv] > ra [ov]
+r w a > ra xwa
+r l a > ra xla
+r l [iv] > ra xla [ov]
+l a > la
+l [iv] > la [ov]
+l w a > la xwa
+S a > Sa
+S [iv] > Sa [ov]
+S w a > Sa xwa
+S r a > Sa xra
+s a > sa
+s [iv] > sa [ov]
+s w a > sa xwa
+s r a > sa xra
+s r [iv] > sa xra [ov]
+s l a > sa xla
+s l [iv] > sa xla [ov]
+h a > ha
+h [iv] > ha [ov]
+h w a > ha xwa
+h r a > ha xra
+h r [iv] > ha xra [ov]
+l h a > la xha
+l h [iv] > la xha [ov]
+
+g > ga
+G > Ga
+d > da
+n > na
+b > ba
+m > ma
+r > ra
+l > la
+s > sa
+
+g U+002D y a > ga ya
+
+a > xA
+i > xA xi
+u > xA xu
+e > xA xe
+o > xA xo
+
+x1 > xa
+x1 a > xa
+x1 i > xa xi
+x1 u > xa xu
+x1 o > xa xo
+
+U+002E > U+0F0B
+U+007C > U+0F0D
+U+007C U+007C > U+0F0E
+U+0030 > U+0F20
+U+0031 > U+0F21
+U+0032 > U+0F22
+U+0033 > U+0F23
+U+0034 > U+0F24
+U+0035 > U+0F25
+U+0036 > U+0F26
+U+0037 > U+0F27
+U+0038 > U+0F28
+U+0039 > U+0F29
+
diff --git a/macros/xetex/generic/tibetan/loctib.tec b/macros/xetex/generic/tibetan/loctib.tec
new file mode 100644
index 0000000000..171716eae4
--- /dev/null
+++ b/macros/xetex/generic/tibetan/loctib.tec
Binary files differ
diff --git a/macros/xetex/generic/tibetan/wylie.map b/macros/xetex/generic/tibetan/wylie.map
new file mode 100644
index 0000000000..a350456e61
--- /dev/null
+++ b/macros/xetex/generic/tibetan/wylie.map
@@ -0,0 +1,346 @@
+EncodingName "wylie"
+DescriptiveName "Input map for Unicode Tibetan (U0F00)"
+Contact "daniel@danielstender.com"
+Copyright "LaTeX Project Public License"
+
+Define k U+006B
+Define h U+0068
+Define g U+0067
+Define c U+0063
+Define j U+006A
+Define t U+0074
+Define d U+0064
+Define n U+006E
+Define p U+0070
+Define b U+0062
+Define m U+006D
+Define s U+0073
+Define z U+007A
+Define w U+0077
+Define y U+0079
+Define r U+0072
+Define l U+006C
+
+Define x1 U+0027 ; '
+
+Define a U+0061
+Define i U+0069
+Define u U+0075
+Define e U+0065
+Define o U+006F
+
+Define ka U+0F40
+Define Ka U+0F41
+Define ga U+0F42
+Define Ga U+0F44
+Define ca U+0F45
+Define Ca U+0F46
+Define ja U+0F47
+Define Ja U+0F49
+define ta U+0F4F
+Define Ta U+0F50
+Define da U+0F51
+Define na U+0F53
+Define pa U+0F54
+Define Pa U+0F55
+Define ba U+0F56
+Define ma U+0F58
+Define tsa U+0F59
+Define Tsa U+0F5A
+Define dza U+0F5B
+Define wa U+0F5D
+Define Za U+0F5E
+Define za U+0F5F
+Define ya U+0F61
+Define ra U+0F62
+Define la U+0F63
+Define Sa U+0F64
+Define sa U+0F66
+Define ha U+0F67
+
+Define xwa U+0FAD
+Define xya U+0FB1
+Define xra U+0FB2
+Define xla U+0FB3
+
+Define xka U+0F90
+Define xga U+0F92
+Define xGa U+0F94
+Define xca U+0F95
+Define xja U+0F97
+Define xJa U+0F99
+Define xta U+0F9F
+Define xda U+0FA1
+Define xna U+0FA3
+Define xpa U+0FA4
+Define xba U+0FA6
+Define xma U+0FA8
+Define xtsa U+0FA9
+Define xdza U+0FAB
+Define xha U+0FB7
+
+Define xa U+0F60
+Define xA U+0F68
+Define xi U+0F72
+Define xu U+0F74
+Define xe U+0F7A
+Define xo U+0F7C
+
+pass(Unicode)
+
+UniClass [iv] = (i u e o)
+UniClass [ov] = (xi xu xe xo)
+
+k a > ka
+k [iv] > ka [ov]
+k w a > ka xwa
+k y a > ka xya
+k y [iv] > ka xya [ov]
+k r a > ka xra
+k r [iv] > ka xra [ov]
+k l a > ka xla
+k l [iv] > ka xla [ov]
+r k a > ra xka
+r k [iv] > ra xka [ov]
+r k y a > ra xka xya
+r k y [iv] > ra xka xya [ov]
+l k a > la xka
+l k [iv] > la xka [ov]
+s k a > sa xka
+s k [iv] > sa xka [ov]
+s k y a > sa xka xya
+s k y [iv] > sa xka xya [ov]
+s k r a > sa xka xra
+s k r [iv] > sa xka xra [ov]
+k h a > Ka
+k h [iv]=t1 > Ka [ov]=t1
+k h w a > Ka xwa
+k h y a > Ka xya
+k h y [iv]=t1 > Ka xya [ov]=t1
+k h r a > Ka xra
+k h r [iv]=t1 > Ka xra [ov]=t1
+g a > ga
+g [iv] > ga [ov]
+g w a > ga xwa
+g y a > ga xya
+g y [iv] > ga xya [ov]
+g r a > ga xra
+g r [iv] > ga xra [ov]
+g r w a > ga xra xwa
+g l a > ga xla
+g l [iv] > ga xla [ov]
+r g a > ra xga
+r g [iv] > ra xga [ov]
+r g y a > ra xga xya
+r g y [iv] > ra xga xya [ov]
+l g a > la xga
+l g [iv] > la xga [ov]
+l g y a > la xga xya
+s g a > sa xga
+s g [iv] > sa xga [ov]
+s g y a > sa xga xya
+s g y [iv] > sa xga xya [ov]
+s g r a > sa xga xra
+s g r [iv] > sa xga xra [ov]
+n g a > Ga
+n g [iv]=t1 > Ga [ov]=t1
+n g w a > Ja xwa
+r n g a > ra xGa
+r n g [iv]=t1 > ra xGa [ov]=t1
+l n g a > la xGa
+s n g a > sa xGa
+s n g [iv]=t1 > sa xGa [ov]=t1
+c a > ca
+c [iv] > ca [ov]
+c w a > ca xwa
+l c a > la xca
+c h a > Ca
+c h [iv]=t1 > Ca [ov]=t1
+j a > ja
+j [iv] > ja [ov]
+r j a > ra xja
+r j [iv] > ra xja [ov]
+l j a > la xja
+l j [iv] > la xja [ov]
+n y a > Ja
+n y [iv]=t1 > Ja [ov]=t1
+r n y a > ra xJa
+r n y [iv]=t1 > ra xJa [ov]=t1
+s n y a > sa xJa
+s n y [iv]=t1 > sa xJa [ov]=t1
+t a > ta
+t [iv] > ta [ov]
+t w a > ta xwa
+t r a > ta xra
+t r [iv] > ta xra [ov]
+r t a > ra xta
+r t [iv] > ra xta [ov]
+l t a > la xta
+l t [iv] > la xta [ov]
+s t a > sa xta
+s t [iv] > sa xta [ov]
+t h a > Ta
+t h [iv]=t1 > Ta [ov]=t1
+t h r a > Ta xra
+d a > da
+d [iv] > da [ov]
+d w a > da xwa
+d r a > da xra
+d r [iv] > da xra [ov]
+r d a > ra xda
+r d [iv] > ra xda [ov]
+l d a > la xda
+l d [iv] > la xda [ov]
+s d a > sa xda
+s d [iv] > sa xda [ov]
+n a > na
+n [iv] > na [ov]
+r n a > ra xna
+r n [iv] > ra xna [ov]
+s n a > sa xna
+s n [iv] > sa xna [ov]
+s n r [iv] > sa xna xra [ov]
+p a > pa
+p [iv] > pa [ov]
+p r a > pa xra
+p r [iv] > pa xra [ov]
+p y a > pa xya
+p y [iv] > pa xya [ov]
+l p a > la xpa
+s p a > sa xpa
+s p [iv] > sa xpa [ov]
+s p y a > sa xpa xya
+s p y [iv] > sa xpa xya [ov]
+s p r a > sa xpa xra
+s p r [iv] > sa xpa xra [ov]
+p h a > Pa
+p h [iv]=t1 > Pa [ov]=t1
+p h y a > Pa xya
+p h y [iv]=t1 > Pa xya [ov]=t1
+p h y w a > Pa xya xwa
+p h r a > Pa xra
+p h r [iv]=t1 > Pa xra [ov]=t1
+b a > ba
+b [iv] > ba [ov]
+b h a > ba xha
+b y a > ba xya
+b y [iv] > ba xya [ov]
+b r a > ba xra
+b r [iv] > ba xra [ov]
+b l a > ba xla
+b l [iv] > ba xla [ov]
+r b a > ra xba
+r b [iv] > ra xba [ov]
+l b a > la xba
+l b [iv] > la xba [ov]
+s b a > sa xba
+s b [iv] > sa xba [ov]
+s b y a > sa xba xya
+s b y [iv] > sa xba xya [ov]
+s b r a > sa xba xra
+s b r [iv] > sa xba xra [ov]
+m a > ma
+m [iv] > ma [ov]
+m y a > ma xya
+m y [iv] > ma xya [ov]
+m r a > ma xra
+r m a > ra xma
+r m [iv] > ra xma [ov]
+r m y a > ra xma xya
+s m a > sa xma
+s m [iv] > sa xma [ov]
+s m y a > sa xma xya
+s m y [iv] > sa xma xya [ov]
+s m r a > sa xma xra
+s m r [iv] > sa xma xra [ov]
+t s a > tsa
+t s [iv]=t1 > tsa [ov]=t1
+t s w a > tsa xwa
+r t s a > ra xtsa
+r t s [iv]=t1 > ra xtsa [ov]=t1
+r t s w a > ra xtsa xwa
+s t s a > sa xtsa
+t s h a > Tsa
+t s h [iv]=t1 > Tsa [ov]=t1
+t s h w a > Tsa xwa
+d z a > dza
+d z [iv]=t1 > dza [ov]=t1
+r d z a > ra xdza
+r d z [iv]=t1 > ra xdza [ov]=t1
+w a > wa
+w [iv] > wa [ov]
+z h a > Za
+z h [iv]=t1 > Za [ov]=t1
+z h w a > Za xwa
+z a > za
+z [iv] > za [ov]
+z w a > za xwa
+z l a > za xla
+z l [iv] > za xla [ov]
+y a > ya
+y [iv] > ya [ov]
+r a > ra
+r [iv] > ra [ov]
+r w a > ra xwa
+r l a > ra xla
+r l [iv] > ra xla [ov]
+l a > la
+l [iv] > la [ov]
+l w a > la xwa
+s h a > Sa
+s h [iv]=t1 > Sa [ov]=t1
+s h w a > Sa xwa
+s h r a > Sa xra
+s a > sa
+s [iv] > sa [ov]
+s w a > sa xwa
+s r a > sa xra
+s r [iv] > sa xra [ov]
+s l a > sa xla
+s l [iv] > sa xla [ov]
+h a > ha
+h [iv] > ha [ov]
+h w a > ha xwa
+h r a > ha xra
+h r [iv] > ha xra [ov]
+l h a > la xha
+l h [iv] > la xha [ov]
+
+g > ga
+n g > Ga
+d > da
+n > na
+b > ba
+m > ma
+r > ra
+l > la
+s > sa
+
+g U+002D y a > ga ya
+
+a > xA
+i > xA xi
+u > xA xu
+e > xA xe
+o > xA xo
+
+x1 > xa
+x1 a > xa
+x1 i > xa xi
+x1 u > xa xu
+x1 o > xa xo
+
+U+002E > U+0F0B
+U+007C > U+0F0D
+U+007C U+007C > U+0F0E
+U+0030 > U+0F20
+U+0031 > U+0F21
+U+0032 > U+0F22
+U+0033 > U+0F23
+U+0034 > U+0F24
+U+0035 > U+0F25
+U+0036 > U+0F26
+U+0037 > U+0F27
+U+0038 > U+0F28
+U+0039 > U+0F29
+
diff --git a/macros/xetex/generic/tibetan/wylie.tec b/macros/xetex/generic/tibetan/wylie.tec
new file mode 100644
index 0000000000..cbea166a77
--- /dev/null
+++ b/macros/xetex/generic/tibetan/wylie.tec
Binary files differ
diff --git a/macros/xetex/generic/tibetian b/macros/xetex/generic/tibetian
new file mode 120000
index 0000000000..d6ffe5720a
--- /dev/null
+++ b/macros/xetex/generic/tibetian
@@ -0,0 +1 @@
+tibetan \ No newline at end of file
diff --git a/macros/xetex/generic/xeindex b/macros/xetex/generic/xeindex
new file mode 120000
index 0000000000..fca9866383
--- /dev/null
+++ b/macros/xetex/generic/xeindex
@@ -0,0 +1 @@
+../latex/xeindex \ No newline at end of file
diff --git a/macros/xetex/generic/xesearch/README b/macros/xetex/generic/xesearch/README
new file mode 100644
index 0000000000..9232fe8dcc
--- /dev/null
+++ b/macros/xetex/generic/xesearch/README
@@ -0,0 +1,33 @@
+This is the README file for xesearch.sty v.0.2.
+Read xesearch.pdf for the documentation.
+t-xeseach.tex is a third party file to use
+XeSearch in ConTeXt.
+
+XeSearch is a string finder for XeTeX
+(and associated formats).
+It searches for words or phrases, possibly
+underspecified, and manipulates them, in
+essence turning every string into a possible
+command.
+
+Both the documentation (xesearch.pdf) and
+the files (xesearch.sty and t-xesearch.tex)
+are produced from xesearch.tex with the CodeDoc class.
+
+To typeset the documentation, run XeLaTeX
+on xesearch.tex with the 'produce' option
+commented out on line 8.
+
+To create xesearch.sty and t-xesearch.teX,
+run (Xe)LaTeX again, but uncomment 'produce'
+on the same line.
+
+Licensing of this package is covered by LPPL.
+
+Originally written by Paul Isambert, the package is
+now maintained by Yuri Robbers.
+
+Any reaction is welcome: yuri.robbers@gmail.com
+
+Yuri Robbers
+
diff --git a/macros/xetex/generic/xesearch/t-xesearch.tex b/macros/xetex/generic/xesearch/t-xesearch.tex
new file mode 100644
index 0000000000..04a2933f32
--- /dev/null
+++ b/macros/xetex/generic/xesearch/t-xesearch.tex
@@ -0,0 +1,24 @@
+% This is t-xesearch, produced by the CodeDoc class
+% with the `produce' option on.
+%
+% To create the documentation, compile xesearch.tex
+% without the `produce' option.
+%
+% SOURCE: xesearch.tex
+% DATE: 2019.04.24
+% VERSION: v.0.1
+%D \module
+%D [ file=t-xesearch,
+%D version=2019.04.24,
+%D title=\CONTEXT\ User Module,
+%D subtitle=XeSearch,
+%D author=Paul Isambert,
+%D date=\currentdate,
+%D copyright=Paul Isambert,
+%D email=zappathustra@free.fr,
+%D license=LaTeX Project Public License]
+
+\writestatus{loading}{ConTeXt User Module / XeSearch}
+\csname xs@contextmodule\endcsname
+\input xesearch.sty
+\endinput
diff --git a/macros/xetex/generic/xesearch/xesearch.pdf b/macros/xetex/generic/xesearch/xesearch.pdf
new file mode 100644
index 0000000000..e8008ee37f
--- /dev/null
+++ b/macros/xetex/generic/xesearch/xesearch.pdf
Binary files differ
diff --git a/macros/xetex/generic/xesearch/xesearch.sty b/macros/xetex/generic/xesearch/xesearch.sty
new file mode 100644
index 0000000000..4c8074c2a7
--- /dev/null
+++ b/macros/xetex/generic/xesearch/xesearch.sty
@@ -0,0 +1,1109 @@
+% This is xesearch, produced by the CodeDoc class
+% with the `produce' option on.
+%
+% To create the documentation, compile xesearch.tex
+% without the `produce' option.
+%
+% SOURCE: xesearch.tex
+% DATE: 2019/04/24
+% VERSION: v.0.2
+\ifx\csname XeTeXrevision\endcsname\relax
+ \errmessage{You need XeTeX to run xesearch. It won't be loaded.}
+ \expandafter\endinput
+\else
+ \expandafter\ifx\csname xs@ChangeCatcodes\endcsname\relax
+ \else
+ \expandafter\expandafter\expandafter\endinput
+ \fi
+\fi
+\catcode`@=11
+\def\xs@ChangeCatcodes{%
+ \chardef\xs@questioncode=\catcode`\?%
+ \chardef\xs@exclamationcode=\catcode`\!%
+ \chardef\xs@commacode=\catcode`\,%
+ \chardef\xs@starcode=\catcode`\*%
+ \chardef\xs@semicoloncode=\catcode`\;%
+ \catcode`\?12
+ \catcode`\!12
+ \catcode`\,12
+ \catcode`\*12
+ \catcode`\;12
+ }
+\def\xs@RestoreCatcodes{%
+ \catcode`\?\xs@questioncode
+ \catcode`\!\xs@exclamationcode
+ \catcode`\,\xs@commacode
+ \catcode`\*\xs@starcode
+ \catcode`\;\xs@semicoloncode
+ }
+\xs@ChangeCatcodes
+\ifdefined\ProvidesPackage
+ \def\xs@err#1{\PackageError{xesearch}{#1}{}}
+ \ProvidesPackage{xesearch}[2019/04/24 v.0.2 Searching documents.]
+\else
+ \def\MessageBreak{^^J}
+ \def\xs@err#1{%
+ \bgroup
+ \newlinechar`\^^J%
+ \errorcontextlines=0
+ \errmessage{xsearch error: #1}%
+ \egroup
+ }
+\fi
+\ifcsname xs@contextmodule\endcsname
+ \let\xs@unexpanded\normalunexpanded
+\else
+ \let\xs@unexpanded\unexpanded
+\fi
+\def\xs@end{\xs@end}
+\def\xs@empty{}
+\def\xs@star{*}
+\def\xs@exclamation{!}
+\def\xs@question{?}
+\def\xs@starexclam{*!}
+\def\xs@exclamstar{!*}
+\def\xs@words{words}
+\def\xs@prefixes{prefixes}
+\def\xs@suffixes{suffixes}
+\def\xs@gobble#1{}
+\def\xs@Lowercase#1#2{\lowercase{\def#2{#1}}}
+\let\xs@relax\relax
+\newcount\xs@TempCount
+\newcount\xs@CaseSensitive
+\newcount\xs@TempLength
+\newcount\xs@Length
+\newbox\xs@Box
+\newif\ifxs@Concatenate
+\newif\ifxs@String
+\newif\ifxs@Affix
+\newif\ifxs@Prefix
+\newif\ifxs@Suffix
+\newif\ifxs@BadWord
+\newif\ifxs@Star
+\newif\ifxs@Phrase
+\newif\ifxs@Match
+\newtoks\xs@DefToks
+\newtoks\xs@NoReplaceToks
+\chardef\xs@NatDel=\e@alloc@intercharclass@top
+\chardef\xs@lrDel=\numexpr\e@alloc@intercharclass@top-1\relax
+\chardef\xs@Classes=\numexpr\e@alloc@intercharclass@top-2\relax
+\chardef\xs@Classless=0
+\XeTeXinterchartoks\xs@lrDel\xs@Classless={\xs@LearnLetter}
+\XeTeXinterchartoks\xs@NatDel\xs@Classless={\xs@LearnLetter}
+\XeTeXinterchartoks\xs@NatDel\xs@lrDel{\xs@EndString}
+\xs@TempCount\xs@Classes
+\def\xs@Delimiters{}
+\def\xs@MakeDel#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \let\xs@next\xs@MakeDel
+ \unless\ifnum\the\XeTeXcharclass`#1=7
+ \unless\ifnum\the\XeTeXcharclass`#1=8
+ \XeTeXcharclass`#1=\xs@lrDel
+ \expandafter\def\expandafter\xs@Delimiters\expandafter{\xs@Delimiters#1}%
+ \fi
+ \fi
+ \fi\xs@next}
+\xs@MakeDel\{\}.,;:!?[()]-'`\xs@end
+\def\MakeBoundary#1{%
+ \xs@MakeDel#1\xs@end
+ }
+\def\UndoBoundary#1{%
+ \xs@UndoBoundary#1\xs@end
+ }
+\def\xs@UndoBoundary#1{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@end
+ \let\xs@next\relax
+ \else
+ \ifnum\the\XeTeXcharclass`#1=\xs@lrDel
+ \def\xs@RemoveFromDelimiters##1#1##2\xs@end{%
+ \def\xs@Delimiters{##1##2}%
+ }%
+ \expandafter\xs@RemoveFromDelimiters\xs@Delimiters\xs@end
+ \fi
+ \XeTeXcharclass`#1=0
+ \let\xs@next\xs@UndoBoundary
+ \fi\xs@next
+ }
+\def\xs@Letters{}%
+\def\xs@CreateLetter#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \expandafter\def\expandafter\xs@Letters\expandafter{\xs@Letters#1}%
+ \XeTeXcharclass`#1=\xs@TempCount
+ \expandafter\def\csname\the\xs@TempCount @xstring@letter\endcsname{#1}%
+ \edef\xs@PolyglossiaPatch{%
+ \xs@unexpanded{\XeTeXinterchartoks\xs@TempCount7}{%
+ \xs@unexpanded{\xdef\xs@String{\xs@String#1}\xs@EndString}%
+ \the\XeTeXinterchartoks0 7}%
+ \xs@unexpanded{\XeTeXinterchartoks\xs@TempCount8}{%
+ \xs@unexpanded{\xdef\xs@String{\xs@String#1}\xs@EndString}%
+ \the\XeTeXinterchartoks0 8}%
+ \xs@unexpanded{\XeTeXinterchartoks8\xs@TempCount}{%
+ \the\XeTeXinterchartoks8 0 \xs@unexpanded{\xs@StartSring}}%
+ }%
+ \xs@PolyglossiaPatch
+ \XeTeXinterchartoks\xs@TempCount\xs@Classless{%
+ \xdef\xs@String{\xs@String#1}%
+ \xs@LearnLetter}%
+ \XeTeXinterchartoks\xs@lrDel\xs@TempCount{%
+ \xs@StopTracing
+ \xs@StartString
+ }%
+ \XeTeXinterchartoks\xs@NatDel\xs@TempCount{%
+ \xs@StopTracing
+ \xs@StartString
+ }%
+ \XeTeXinterchartoks\xs@TempCount\xs@lrDel{%
+ \xdef\xs@String{\xs@String#1}\xs@EndString}%
+ \XeTeXinterchartoks\xs@TempCount\xs@NatDel{%
+ \xdef\xs@String{\xs@String#1}%
+ \ifcsname\xs@String @xs@phrases@cs\endcsname
+ \XeTeXinterchartokenstate0
+ \xdef\xs@Stack{%
+ \xs@String\noexpand\xs@end\xs@unexpanded\expandafter{\xs@Stack}%
+ }%
+ \edef\xs@String{\xs@unexpanded\expandafter{\xs@String} }%
+ \XeTeXinterchartokenstate1
+ \else
+ \expandafter\xs@Lowercase\expandafter{\xs@String}\xs@lcString
+ \ifcsname\xs@lcString @xs@phrases@ncs\endcsname
+ \XeTeXinterchartokenstate0
+ \xdef\xs@Stack{%
+ \xs@String\noexpand\xs@end\xs@unexpanded\expandafter{\xs@Stack}%
+ }%
+ \edef\xs@String{\xs@unexpanded\expandafter{\xs@String} }%
+ \XeTeXinterchartokenstate1
+ \else
+ \expandafter\expandafter\expandafter\xs@EndString
+ \fi
+ \fi
+ }%
+ \xs@TempCount\xs@Classes
+ \xs@MakeInterCharToks#1%
+ \advance\xs@TempCount-1
+ \let\xs@next\xs@CreateLetter
+ \fi\xs@next
+ }
+\def\xs@MakeInterCharToks#1{%
+ \ifnum\xs@TempCount=\XeTeXcharclass`#1
+ \XeTeXinterchartoks\xs@TempCount\xs@TempCount{\xdef\xs@String{\xs@String#1}}%
+ \let\xs@next\relax
+ \else\let\xs@next\relax
+ \expandafter\expandafter\expandafter%
+ \xs@Xict\csname\the\xs@TempCount @xstring@letter\endcsname%
+ \xs@TempCount{\XeTeXcharclass`#1}%
+ \xs@Xict#1{\XeTeXcharclass`#1}\xs@TempCount
+ \advance\xs@TempCount-1
+ \def\xs@next{\xs@MakeInterCharToks#1}%
+ \fi\xs@next}
+\def\xs@Xict#1#2#3{%
+ \XeTeXinterchartoks#2#3{\xdef\xs@String{\xs@String#1}}%
+ }
+\def\xs@PendingLetters{}%
+\def\xs@LearnLetter#1{%
+ \xs@CreateLetter#1\xs@end
+ \ifxs@String
+ \xdef\xs@PendingLetters{\xs@PendingLetters#1}%
+ \fi
+ #1}
+\def\SearchList{%
+ \xs@ChangeCatcodes
+ \xs@StarOrExclam\xs@Search
+ }
+\def\xs@StarOrExclam#1#2#{%
+ \def\xs@temp{#2}%
+ \ifx\xs@temp\xs@star
+ \xs@CaseSensitive2
+ \xs@Concatenatefalse
+ \else
+ \ifx\xs@temp\xs@exclamation
+ \xs@CaseSensitive0
+ \xs@Concatenatetrue
+ \else
+ \ifx\xs@temp\xs@starexclam
+ \xs@CaseSensitive2
+ \xs@Concatenatetrue
+ \else
+ \ifx\xs@temp\xs@exclamstar
+ \xs@CaseSensitive2
+ \xs@Concatenatetrue
+ \else
+ \xs@CaseSensitive0
+ \xs@Concatenatefalse
+ \fi
+ \fi
+ \fi
+ \fi#1%
+ }
+\def\xs@Search#1#2#3{%
+ \ifcsname#1@xs@searchlist\endcsname
+ \xs@err{%
+ `#1' already exists.\MessageBreak
+ Use \string\AddToList{#1}{<words>} to add words to it%
+ }%
+ \else
+ \def\xs@ListName{#1}%
+ \expandafter\def\csname\xs@ListName @words\endcsname{}%
+ \expandafter\def\csname #1@xs@searchlist\endcsname##1{#2}%
+ \expandafter\def\csname #1@xs@searchlist@noreplace\endcsname##1{#2}%
+ \expandafter\xs@MakeWord#3,\xs@end,%
+ \xs@RestoreCatcodes
+ \fi
+ }
+\def\AddToList{%
+ \xs@ChangeCatcodes
+ \xs@StarOrExclam\xs@AddToList
+ }
+\def\xs@AddToList#1#2{%
+ \ifcsname#1@xs@searchlist\endcsname
+ \def\xs@ListName{#1}%
+ \expandafter\xs@MakeWord#2,\xs@end,%
+ \xs@RestoreCatcodes
+ \else
+ \xs@err{`#1' is not a list}%
+ \fi
+ \xs@RestoreCatcodes
+ }
+\def\xs@MakeWord#1,{%
+ \def\xs@TempWord{#1}%
+ \ifx\xs@TempWord\xs@end
+ \let\xs@next\relax
+ \else
+ \ifcsname\ifnum\xs@CaseSensitive=2*\fi#1@\xs@ListName\endcsname
+ \xs@err{You have already specified `\ifnum\xs@CaseSensitive=2*\fi#1'%
+ in `\xs@ListName'. \MessageBreak You can't do it twice}%
+ \else
+ \csname#1@\xs@ListName\endcsname
+ \edef\xs@TempWord{#1}%
+ \chardef\xs@ParseState=0
+ \xs@BadWordfalse
+ \xs@Starfalse
+ \xs@Prefixfalse
+ \xs@Suffixfalse
+ \xs@ParseWord#1\xs@end
+ \unless\ifxs@BadWord
+ \ifxs@Star
+ \xs@CaseSensitive1
+ \expandafter\xs@SuppressPrefix\xs@TempWord\xs@end
+ \fi
+ \ifxs@Prefix
+ \expandafter\xs@SuppressSuffix\xs@TempWord
+ \else
+ \ifxs@Suffix
+ \expandafter\xs@SuppressPrefix\xs@TempWord\xs@end
+ \fi
+ \fi
+ \def\xs@Phrase{}%
+ \ifcase\xs@CaseSensitive
+ \expandafter\xs@Lowercase\expandafter{\xs@TempWord}\xs@TempWord
+ \def\xs@cs{ncs}%
+ \expandafter\xs@CheckSpaces\xs@TempWord\xs@end
+ \or
+ \def\xs@cs{cs}%
+ \expandafter\xs@CheckSpaces\xs@TempWord\xs@end
+ \xs@CaseSensitive0
+ \or
+ \def\xs@cs{cs}%
+ \expandafter\xs@CheckSpaces\xs@TempWord\xs@end
+ \fi
+ \ifxs@Prefix
+ \xs@MakePrefix
+ \def\xs@WordType{prefixes}%
+ \expandafter\xs@PatchDef\csname\xs@ListName @xs@searchlist\endcsname
+ \else
+ \ifxs@Suffix
+ \xs@MakeSuffix
+ \def\xs@WordType{suffixes}%
+ \expandafter\xs@PatchDef\csname\xs@ListName @xs@searchlist\endcsname
+ \else
+ \def\xs@WordType{words}%
+ \expandafter\xs@PatchDef\csname\xs@ListName @xs@searchlist\endcsname
+ \fi
+ \fi
+ \fi
+ \fi
+ \let\xs@next\xs@MakeWord
+ \fi\xs@next
+ }
+\def\xs@ParseWord#1{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@end
+ \let\xs@next\relax
+ \ifxs@Suffix
+ \ifnum\xs@ParseState=3
+ \xs@err{You can't have a prefix and a suffix in the same word.\MessageBreak
+ `\xs@unexpanded\expandafter{\xs@TempWord}' won't be searched}%
+ \xs@BadWordtrue
+ \fi
+ \fi
+ \else
+ \let\xs@next\xs@ParseWord
+ \expandafter\ifcat\noexpand#1\relax
+ \xs@BadChar#1{control sequences are forbidden}%
+ \else
+ \ifcase\xs@ParseState
+ \chardef\xs@TempNum=\XeTeXcharclass`#1 %
+ \ifx\xs@temp\xs@star
+ \xs@Startrue
+ \chardef\xs@ParseState=1
+ \let\xs@next\xs@ParseWord
+ \else
+ \ifx\xs@temp\xs@question
+ \xs@Suffixtrue
+ \chardef\xs@ParseState=2
+ \let\xs@next\xs@ParseWord
+ \else
+ \ifnum\xs@TempNum>\xs@Classes
+ \xs@BadChar#1{it's already a string delimiter}%
+ \else
+ \chardef\xs@ParseState=2
+ \ifnum\xs@TempNum=0
+ \xs@CreateLetter#1\xs@end
+ \let\xs@next\xs@ParseWord
+ \fi
+ \fi
+ \fi
+ \fi
+%
+ \or
+ \chardef\xs@ParseState=2
+ \chardef\xs@TempNum=\XeTeXcharclass`#1 %
+ \let\xs@next\xs@ParseWord
+ \ifx\xs@temp\xs@question
+ \xs@Suffixtrue
+ \else
+ \ifnum\xs@TempNum>\xs@Classes
+ \xs@BadChar#1{it's already a string delimiter}%
+ \else
+ \ifnum\xs@TempNum=0
+ \xs@CreateLetter#1\xs@end
+ \let\xs@next\xs@ParseWord
+ \fi
+ \fi
+ \fi
+%
+ \or
+ \let\xs@next\xs@ParseWord
+ \chardef\xs@TempNum=\XeTeXcharclass`#1 %
+ \ifx\xs@temp\xs@question
+ \xs@Prefixtrue
+ \chardef\xs@ParseState=3
+ \else
+ \ifnum\xs@TempNum>\xs@Classes
+ \xs@BadChar#1{it's already a string delimiter}%
+ \else
+ \let\xs@next\xs@ParseWord
+ \fi
+ \fi
+ \or
+ \xs@BadChar?{it's already a string delimiter}%
+ \fi
+ \fi
+ \fi\xs@next
+ }
+\def\xs@BadChar#1#2{%
+ \def\xs@next##1\xs@end{}%
+ \xs@BadWordtrue
+ \xs@err{%
+ You can't use `\noexpand#1' in `\xs@unexpanded\expandafter{\xs@TempWord}',\MessageBreak
+ #2.\MessageBreak
+ `\xs@unexpanded\expandafter{\xs@TempWord}' won't be searched
+ }%
+ }
+\def\xs@CheckSpaces#1\xs@end{%
+ \xs@@CheckSpaces#1 \xs@end
+ }
+\def\xs@@CheckSpaces#1 #2\xs@end{%
+ \def\xs@temp{#2}%
+ \ifx\xs@temp\xs@empty
+ \let\xs@next\relax
+ \else
+ \expandafter\xs@MakePhrase\xs@Phrase\xs@end#1\xs@end
+ \def\xs@next{\xs@@CheckSpaces#2\xs@end}%
+ \fi\xs@next
+ }
+\def\xs@MakePhrase#1\xs@end#2\xs@end{%
+ \ifx\xs@Phrase\xs@empty
+ \expandafter\def\csname#2@xs@phrases@\xs@cs\endcsname{}%
+ \edef\xs@Phrase{#2}%
+ \else
+ \expandafter\def\csname#1 #2@xs@phrases@\xs@cs\endcsname{}%
+ \edef\xs@Phrase{#1 #2}%
+ \fi
+ }%
+\def\xs@GetFirstLetter#1#2\xs@end{%
+ \def\xs@FirstLetter{#1}%
+ }
+\def\xs@MakePrefix{%
+ \expandafter\ifx\csname\xs@TempWord @\xs@cs @xs@prefixes\endcsname\relax
+ \expandafter\xs@GetFirstLetter\xs@TempWord\xs@end
+ \ifcsname xs@prefixes@\xs@FirstLetter @\xs@cs\endcsname
+ \expandafter\edef\csname xs@prefixes@\xs@FirstLetter @\xs@cs\endcsname{%
+ \csname xs@prefixes@\xs@FirstLetter @\xs@cs\endcsname\xs@TempWord,}%
+ \def\xs@Sign{<}%
+ \xs@Insert{\xs@TempWord}{\csname xs@prefixes@\xs@FirstLetter @\xs@cs @longer\endcsname}%
+ \def\xs@Sign{>}%
+ \xs@Insert{\xs@TempWord}{\csname xs@prefixes@\xs@FirstLetter @\xs@cs @shorter\endcsname}%
+ \else
+ \expandafter\edef\csname xs@prefixes@\xs@FirstLetter @\xs@cs\endcsname{\xs@TempWord,}%
+ \expandafter\edef\csname xs@prefixes@\xs@FirstLetter @\xs@cs @longer\endcsname{\xs@TempWord,}%
+ \expandafter\edef\csname xs@prefixes@\xs@FirstLetter @\xs@cs @shorter\endcsname{\xs@TempWord,}%
+ \fi
+ \fi
+ }
+\def\xs@GetLastLetter#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \let\xs@next\xs@GetLastLetter
+ \def\xs@LastLetter{#1}%
+ \fi\xs@next
+ }
+\def\xs@MakeSuffix{%
+ \expandafter\ifx\csname\xs@TempWord @\xs@cs @xs@suffixes\endcsname\relax
+ \expandafter\xs@GetLastLetter\xs@TempWord\xs@end
+ \ifcsname xs@suffixes@\xs@LastLetter @\xs@cs\endcsname
+ \expandafter\edef\csname xs@suffixes@\xs@LastLetter @\xs@cs\endcsname{%
+ \csname xs@suffixes@\xs@LastLetter @\xs@cs\endcsname\xs@TempWord,}%
+ \def\xs@Sign{<}%
+ \xs@Insert{\xs@TempWord}{\csname xs@suffixes@\xs@LastLetter @\xs@cs @longer\endcsname}%
+ \def\xs@Sign{>}%
+ \xs@Insert{\xs@TempWord}{\csname xs@suffixes@\xs@LastLetter @\xs@cs @shorter\endcsname}%
+ \else
+ \expandafter\edef\csname xs@suffixes@\xs@LastLetter @\xs@cs\endcsname{\xs@TempWord,}%
+ \expandafter\edef\csname xs@suffixes@\xs@LastLetter @\xs@cs @longer\endcsname{\xs@TempWord,}%
+ \expandafter\edef\csname xs@suffixes@\xs@LastLetter @\xs@cs @shorter\endcsname{\xs@TempWord,}%
+ \fi
+ \fi
+ }
+\def\xs@SuppressPrefix#1#2\xs@end{\def\xs@TempWord{#2}}
+\def\xs@SuppressSuffix#1?{\def\xs@TempWord{#1}}
+\def\xs@CountLetter#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \advance\xs@Length1
+ \let\xs@next\xs@CountLetter
+ \fi\xs@next
+ }
+\def\xs@SortList#1,{%
+ \ifx#1\xs@end
+ \edef\xs@templist{\xs@templist\xs@TempAffix,}%
+ \let\xs@next\relax
+ \else
+ \xs@Length0
+ \xs@CountLetter#1\xs@end
+ \ifnum\xs@Length\xs@Sign\xs@AffixLength
+ \edef\xs@templist{\xs@templist\xs@TempAffix,#1,}%
+ \let\xs@next\xs@EndList
+ \else
+ \edef\xs@templist{\xs@templist#1,}%
+ \let\xs@next\xs@SortList
+ \fi
+ \fi\xs@next
+ }
+\def\xs@EndList#1\xs@end,{%
+ \edef\xs@templist{\xs@templist#1}%
+ }
+\def\xs@Insert#1#2{%
+ \def\xs@TempAffix{#1}%
+ \xs@Length0
+ \expandafter\xs@CountLetter#1\xs@end
+ \chardef\xs@AffixLength\xs@Length
+ \def\xs@templist{}%
+ \expandafter\expandafter\expandafter\xs@SortList#2\xs@end,
+ \expandafter\let#2\xs@templist
+ }
+\def\xs@PatchDef#1{%
+ \expandafter\edef\csname\xs@ListName @words\endcsname{%
+ \csname\xs@ListName @words\endcsname
+ \xs@TempWord:::\xs@cs:::\xs@WordType:::\ifxs@Concatenate!\fi:::%
+ }%
+ \expandafter\ifx\csname\xs@TempWord @\xs@cs @xs@\xs@WordType\endcsname\relax%
+ \xs@DefToks{\xs@FinalString}%
+ \else
+ \xs@DefToks\expandafter\expandafter\expandafter{%
+ \csname\xs@TempWord @\xs@cs @xs@\xs@WordType\endcsname}%
+ \fi
+ \expandafter\ifx\csname\xs@TempWord @\xs@cs @xs@\xs@WordType @noreplace\endcsname\relax
+ \xs@NoReplaceToks{}%
+ \else
+ \xs@NoReplaceToks\expandafter\expandafter\expandafter{%
+ \csname\xs@TempWord @\xs@cs @xs@\xs@WordType @noreplace\endcsname}%
+ \fi
+ \ifxs@Concatenate
+ \expandafter\edef\csname\xs@TempWord @\xs@cs @xs@\xs@WordType\endcsname{\the\xs@DefToks}%
+ \expandafter\edef\csname\xs@TempWord @\xs@cs @xs@\xs@WordType @noreplace\endcsname{%
+ \the\xs@NoReplaceToks
+ \xs@unexpanded{\expandafter#1\expandafter{\xs@String}}%
+ }%
+ \else
+ \expandafter\edef\csname\xs@TempWord @\xs@cs @xs@\xs@WordType\endcsname{%
+ \noexpand\expandafter\noexpand#1\noexpand\expandafter{\the\xs@DefToks}%
+ }%
+ \fi
+ }
+\def\StopList{%
+ \xs@ChangeCatcodes
+ \xs@StopList
+ }
+\def\xs@StopList#1{%
+ \xs@@StopList#1,\xs@end,%
+ \xs@RestoreCatcodes
+ }
+\def\xs@@StopList#1,{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@end
+ \let\xs@next\relax
+ \else
+ \ifcsname#1@xs@searchlist\endcsname
+ \unless\ifcsname#1@xs@stoppedlist\endcsname
+ \csname#1@xs@stoppedlist\endcsname
+ \expandafter\def\expandafter\xs@ToRemove\expandafter{%
+ \csname#1@xs@searchlist\endcsname
+ }%
+ \expandafter\expandafter\expandafter%
+ \xs@PatchWords\csname #1@words\endcsname\xs@end::::::::::::%
+ \fi
+ \else
+ \xs@err{`#1' is not a list}%
+ \fi
+ \let\xs@next\xs@@StopList
+ \fi\xs@next
+ }
+\def\xs@PatchWords#1:::#2:::#3:::#4:::{%
+ \def\xs@TempWord{#1}%
+ \ifx\xs@TempWord\xs@end
+ \let\xs@next\relax
+ \else
+ \def\xs@temp{#4}%
+ \ifx\xs@temp\xs@exclamation
+ \expandafter\expandafter\expandafter%
+ \xs@RemoveFromNoReplace\expandafter\xs@ToRemove\csname#1@#2@xs@#3@noreplace\endcsname
+ \fi
+ \def\xs@cs{#2}%
+ \def\xs@WordType{#3}%
+ \expandafter\xs@RemoveFromDef\csname#1@#2@xs@#3\endcsname
+ \let\xs@next\xs@PatchWords
+ \fi\xs@next
+ }
+\def\xs@RemoveFromNoReplace#1#2{%
+ \def\xs@Erase##1\expandafter#1\expandafter##2##3\xs@end{%
+ \def#2{##1##3}%
+ \ifx#2\xs@empty
+ \let#2\relax
+ \fi
+ }%
+ \expandafter\xs@Erase#2\xs@end
+ }
+\def\xs@final{\xs@FinalString}
+\def\xs@TempDef{}
+\def\xs@RemoveFromDef#1{%
+ \def\xs@TempDef{}%
+ \def\xs@Def{\xs@FinalString}%
+ \unless\ifx#1\xs@final
+ \expandafter\xs@Extract#1%
+ \fi
+ \let#1\xs@Def
+ \ifx#1\xs@final
+ \expandafter\ifx\csname\expandafter\xs@gobble\string#1@noreplace\endcsname\relax
+ \ifx\xs@WordType\xs@words
+ \let#1\relax
+ \else
+ \xs@RemoveFromAffixes
+ \fi
+ \fi
+ \fi
+ }
+\def\xs@Extract\expandafter#1\expandafter#2{%
+ \def\xs@temp{#1}%
+ \unless\ifx\xs@temp\xs@ToRemove
+ \edef\xs@TempDef{%
+ \noexpand#1,%
+ \xs@unexpanded\expandafter{\xs@TempDef}%
+ }%
+ \fi
+ \def\xs@temp{#2}%
+ \ifx\xs@temp\xs@final
+ \def\xs@next{%
+ \expandafter\xs@Rebuild\xs@TempDef\xs@end,%
+ }%
+ \else
+ \def\xs@next{%
+ \xs@Extract#2%
+ }%
+ \fi\xs@next
+ }
+\def\xs@Rebuild#1,{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \let\xs@next\xs@Rebuild
+ \edef\xs@Def{%
+ \xs@unexpanded{\expandafter#1\expandafter}%
+ \noexpand{%
+ \xs@unexpanded\expandafter{\xs@Def}%
+ \noexpand}%
+ }%
+ \fi\xs@next
+ }%
+\def\xs@RemoveFromAffixes{%
+ \ifx\xs@WordType\xs@prefixes
+ \expandafter\xs@GetFirstLetter\xs@TempWord\xs@end
+ \let\xs@Letter\xs@FirstLetter
+ \else
+ \expandafter\xs@GetLastLetter\xs@TempWord\xs@end
+ \let\xs@Letter\xs@LastLetter
+ \fi
+ \def\xs@templist{}%
+ \expandafter\expandafter\expandafter%
+ \xs@CleanList\csname xs@\xs@WordType @\xs@Letter @\xs@cs\endcsname\xs@end,%
+ \expandafter\let\csname xs@\xs@WordType @\xs@Letter @\xs@cs\endcsname\xs@templist
+ \def\xs@templist{}%
+ \expandafter\expandafter\expandafter%
+ \xs@CleanList\csname xs@\xs@WordType @\xs@Letter @\xs@cs @shorter\endcsname\xs@end,%
+ \expandafter\let\csname xs@\xs@WordType @\xs@Letter @\xs@cs @shorter\endcsname\xs@templist
+ \def\xs@templist{}%
+ \expandafter\expandafter\expandafter%
+ \xs@CleanList\csname xs@\xs@WordType @\xs@Letter @\xs@cs @longer\endcsname\xs@end,%
+ \expandafter\let\csname xs@\xs@WordType @\xs@Letter @\xs@cs @longer\endcsname\xs@templist
+ \expandafter\let\csname\xs@TempWord @\xs@cs @xs@\xs@WordType\endcsname\relax
+ }
+\def\xs@CleanList#1,{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@end
+ \let\xs@next\relax
+ \else
+ \let\xs@next\xs@CleanList
+ \unless\ifx\xs@temp\xs@TempWord
+ \edef\xs@templist{\xs@templist#1,}%
+ \fi
+ \fi\xs@next
+ }
+\def\xs@Stack{}
+\def\xs@Remainder{}
+\def\xs@StartString{%
+ \xs@Stringtrue
+ \let\xs@StartString\relax
+ \def\xs@String{}%
+ \def\PrefixFound{}%
+ \def\SuffixFound{}%
+ \def\AffixFound{}%
+ \def\xs@Stack{}%
+ \def\xs@Remainder{}%
+ \xs@Phrasefalse
+ \setbox\xs@Box=\hbox\bgroup
+ }
+\let\xs@@StartString\xs@StartString
+\def\xs@EndString{%
+ \ifxs@String
+ \egroup
+ \xs@Stringfalse
+ \expandafter\xs@CreateLetter\xs@PendingLetters\xs@end
+ \gdef\xs@PendingLetters{}%
+ \xs@Evaluate
+ \xs@Restore
+ \xs@StartTracing
+ \expandafter\xs@Remainder
+ \fi
+ }
+\def\xs@@F@Test{%
+ \expandafter\unless\expandafter\ifx\csname\xs@String @cs@xs@words\endcsname\relax
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \def%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \xs@FinalString%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter{%
+ \csname\xs@String @cs@xs@words\endcsname}%
+ \expandafter\unless\expandafter\ifx\csname\xs@String @cs@xs@words@noreplace\endcsname\relax
+ \edef\xs@NoReplace{%
+ \xs@unexpanded\expandafter{\xs@NoReplace}%
+ \xs@unexpanded\expandafter{\csname\xs@String @cs@xs@words@noreplace\endcsname}%
+ }%
+ \fi
+ \xs@Matchtrue
+ \xs@relax
+ \xs@relax
+ \fi
+ }
+\def\xs@@f@Test{%
+ \expandafter\xs@Lowercase\expandafter{\xs@String}\xs@lcString
+ \expandafter\unless\expandafter\ifx\csname\xs@lcString @ncs@xs@words\endcsname\relax
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \def%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \xs@FinalString%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter{%
+ \csname\xs@lcString @ncs@xs@words\endcsname}%
+ \expandafter\unless\expandafter\ifx\csname\xs@lcString @ncs@xs@words@noreplace\endcsname\relax
+ \edef\xs@NoReplace{%
+ \xs@unexpanded\expandafter{\xs@NoReplace}%
+ \xs@unexpanded\expandafter{\csname\xs@lcString @ncs@xs@words@noreplace\endcsname}%
+ }%
+ \fi
+ \xs@Matchtrue
+ \xs@relax
+ \xs@relax
+ \fi
+ }
+\def\xs@@p@Test{%
+ \xs@Affixfalse
+ \expandafter\xs@GetFirstLetter\xs@lcString\xs@end
+ \ifcsname xs@prefixes@\xs@FirstLetter @ncs\endcsname
+ \let\xs@@String\xs@lcString
+ \def\xs@cs{ncs}%
+ \let\xs@WhatNext\xs@p@WhatNext
+ \expandafter\expandafter\expandafter%
+ \xs@CheckPrefixes\csname xs@prefixes@\xs@FirstLetter @ncs\p@order\endcsname\xs@end,%
+ \fi
+ \ifxs@Affix
+ \xs@Affixfalse
+ \xs@Matchtrue
+ \xs@relax
+ \xs@relax
+ \fi
+ }
+\def\xs@@P@Test{%
+ \xs@Affixfalse
+ \expandafter\xs@GetFirstLetter\xs@String\xs@end
+ \ifcsname xs@prefixes@\xs@FirstLetter @cs\endcsname
+ \let\xs@@String\xs@String
+ \def\xs@cs{cs}%
+ \let\xs@WhatNext\xs@P@WhatNext
+ \expandafter\expandafter\expandafter%
+ \xs@CheckPrefixes\csname xs@prefixes@\xs@FirstLetter @cs\P@order\endcsname\xs@end,%
+ \fi
+ \ifxs@Affix
+ \xs@Affixfalse
+ \xs@Matchtrue
+ \xs@relax
+ \xs@relax
+ \fi
+ }
+\def\xs@CheckPrefixes#1,{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@end
+ \let\xs@next\relax
+ \else
+ \def\xs@TestPrefix##1#1##2\xs@end{%
+ \def\xs@temp{##1}%
+ \ifx\xs@temp\xs@empty
+ \xs@Affixtrue
+ \def\PrefixFound{#1}%
+ \def\AffixFound{#1}%
+ \let\xs@next\xs@WhatNext
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \def%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \xs@FinalString%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter{%
+ \csname#1@\xs@cs @xs@prefixes\endcsname}%
+ \expandafter\unless\expandafter\ifx\csname#1@\xs@cs @xs@prefixes@noreplace\endcsname\relax
+ \edef\xs@NoReplace{%
+ \xs@unexpanded\expandafter{\xs@NoReplace}%
+ \xs@unexpanded\expandafter{\csname#1@\xs@cs @xs@prefixes@noreplace\endcsname}%
+ }%
+ \fi
+ \else
+ \let\xs@next\xs@CheckPrefixes
+ \fi
+ }%
+ \expandafter\xs@TestPrefix\xs@@String#1\xs@end
+ \fi\xs@next
+ }
+\def\xs@@S@Test{%
+ \xs@Affixfalse
+ \expandafter\xs@GetLastLetter\xs@String\xs@end
+ \ifcsname xs@suffixes@\xs@LastLetter @cs\endcsname
+ \let\xs@@String\xs@String
+ \def\xs@cs{cs}%
+ \let\xs@WhatNext\xs@S@WhatNext
+ \expandafter\expandafter\expandafter%
+ \xs@CheckSuffixes\csname xs@suffixes@\xs@LastLetter @cs\S@order\endcsname\xs@end,%
+ \fi
+ \ifxs@Affix
+ \xs@Affixfalse
+ \xs@Matchtrue
+ \xs@relax
+ \xs@relax
+ \fi
+ }
+\def\xs@@s@Test{%
+ \xs@Affixfalse
+ \expandafter\xs@GetLastLetter\xs@lcString\xs@end
+ \ifcsname xs@suffixes@\xs@LastLetter @ncs\endcsname
+ \let\xs@@String\xs@lcString
+ \def\xs@cs{ncs}%
+ \let\xs@WhatNext\xs@s@WhatNext
+ \expandafter\expandafter\expandafter%
+ \xs@CheckSuffixes\csname xs@suffixes@\xs@LastLetter @ncs\s@order\endcsname\xs@end,%
+ \fi
+ \ifxs@Affix
+ \xs@Affixfalse
+ \xs@Matchtrue
+ \xs@relax
+ \xs@relax
+ \fi
+ }
+\def\xs@CheckSuffixes#1,{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@end
+ \let\xs@next\relax
+ \else
+ \def\xs@TestSuffix##1#1##2\xs@end{%
+ \def\xs@@temp{##2}%
+ \ifx\xs@temp\xs@@temp
+ \xs@Affixtrue
+ \def\SuffixFound{#1}%
+ \def\AffixFound{#1}%
+ \let\xs@next\xs@WhatNext
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \def%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \xs@FinalString%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ {%
+ \csname#1@\xs@cs @xs@suffixes\endcsname}%
+ \expandafter\unless\expandafter\ifx\csname#1@\xs@cs @xs@suffixes@noreplace\endcsname\relax
+ \edef\xs@NoReplace{%
+ \xs@unexpanded\expandafter{\xs@NoReplace}%
+ \xs@unexpanded\expandafter{\csname#1@\xs@cs @xs@suffixes@noreplace\endcsname}%
+ }%
+ \fi
+ \else%
+ \let\xs@next\xs@CheckSuffixes
+ \fi
+ }%
+ \expandafter\xs@TestSuffix\xs@@String#1\xs@end
+ \fi\xs@next
+ }
+\def\SearchOrder{%
+ \xs@ChangeCatcodes
+ \xs@SearchOrder
+ }
+\def\xs@SearchOrder#1{%
+ \def\xs@Order{}%
+ \xs@@SearchOrder#1\xs@end;%
+ \edef\xs@Evaluate{%
+ \xs@unexpanded{%
+ \XeTeXinterchartokenstate=0
+ \def\xs@NoReplace{}%
+ \let\xs@FinalString\xs@String
+ \expandafter\xs@Lowercase\expandafter{\xs@String}\xs@lcString
+ }%
+ \xs@unexpanded\expandafter{%
+ \xs@Order
+ \ifxs@Match
+ \def\xs@next{%
+ \xs@FinalString
+ }%
+ \else
+ \unless\ifx\xs@Stack\xs@empty
+ \xs@Phrasetrue
+ \expandafter\xs@PopStack\xs@Stack\xs@@end
+ \let\xs@next\xs@Evaluate
+ \else
+ \ifxs@Phrase
+ \def\xs@Stack{}%
+ \def\xs@next{\xs@String\xs@Restore}%
+ \else
+ \def\xs@next{\unhbox\xs@Box\xs@Restore}%
+ \fi
+ \fi
+ \fi\xs@next
+ }%
+ }%
+ \let\xs@f@Test\xs@@f@Test
+ \let\xs@F@Test\xs@@F@Test
+ \let\xs@p@Test\xs@@p@Test
+ \let\xs@P@Test\xs@@P@Test
+ \let\xs@s@Test\xs@@s@Test
+ \let\xs@S@Test\xs@@S@Test
+ \xs@RestoreCatcodes
+ }
+\def\xs@@SearchOrder#1#2;{%
+ \def\xs@temp{#1#2}%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \def\xs@Inhibit{}%
+ \xs@MakeInhibit#2\xs@end
+ \expandafter\expandafter\expandafter\xs@PatchTest\csname xs@@#1@Test\endcsname#1%
+ \edef\xs@Order{%
+ \xs@unexpanded\expandafter{\xs@Order}%
+ \xs@unexpanded\expandafter{\csname xs@#1@Test\endcsname}}%
+ \let\xs@next\xs@@SearchOrder
+ \fi\xs@next
+ }
+\def\xs@MakeInhibit#1{%
+ \def\xs@temp{#1}%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \let\xs@next\xs@MakeInhibit
+ \unless\ifx\xs@temp\xs@exclamation%
+ \edef\xs@Inhibit{%
+ \xs@unexpanded\expandafter{\xs@Inhibit
+ \expandafter\let\csname xs@#1@Test\endcsname\relax}%
+ }%
+ \fi
+ \fi\xs@next
+ }
+\def\xs@PatchTest#1\xs@relax#2\xs@relax#3#4{%
+ \expandafter\edef\csname xs@@#4@Test\endcsname{%
+ \xs@unexpanded{#1}%
+ \xs@unexpanded\expandafter{\expandafter\xs@relax\xs@Inhibit\xs@relax\fi}%
+ }%
+ }
+\def\xs@Restore{%
+ \xs@Matchfalse
+ \let\xs@f@Test\xs@@f@Test
+ \let\xs@F@Test\xs@@F@Test
+ \let\xs@p@Test\xs@@p@Test
+ \let\xs@P@Test\xs@@P@Test
+ \let\xs@s@Test\xs@@s@Test
+ \let\xs@S@Test\xs@@S@Test
+ \let\xs@StartString\xs@@StartString
+ \edef\xs@Remainder{%
+ \xs@unexpanded\expandafter{\xs@NoReplace}%
+ \xs@unexpanded\expandafter{\xs@Remainder}%
+ }%
+ \XeTeXinterchartokenstate=1
+ }
+\def\xs@PopWord#1\xs@end#2\xs@end{%
+ \def\xs@String{#2}%
+ \def\xs@@PopWord#2##1\xs@end{%
+ \edef\xs@Remainder{##1\xs@unexpanded\expandafter{\xs@Remainder}%
+ }%
+ }%
+ \xs@@PopWord#1\xs@end
+ }
+\def\xs@PopStack#1\xs@end#2\xs@@end{%
+ \def\xs@Stack{#2}%
+ \expandafter\xs@PopWord\xs@String\xs@end#1\xs@end
+ }
+\def\SortByLength#1{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@star
+ \def\xs@AffixOrder{@shorter}%
+ \let\xs@next\xs@SortByLength
+ \else
+ \def\xs@AffixOrder{@longer}%
+ \def\xs@next{\xs@@SortByLength#1\xs@end}%
+ \fi
+ \xs@next}%
+\def\xs@SortByLength#1{%
+ \xs@@SortByLength#1\xs@end
+ }
+\def\xs@@SortByLength#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \expandafter\let\csname #1@order\endcsname\xs@AffixOrder
+ \let\xs@next\xs@@SortByLength
+ \fi\xs@next
+ }
+\def\DoNotSort{%
+ \def\xs@AffixOrder{}%
+ \xs@SortByLength
+ }
+\def\SearchAll#1{%
+ \xs@SearchAll#1\xs@end
+ }
+\def\xs@SearchAll#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else\let\xs@next\xs@SearchAll
+ \if#1p%
+ \let\xs@p@WhatNext\xs@CheckPrefixes
+ \else
+ \if#1P
+ \let\xs@P@WhatNext\xs@CheckPrefixes
+ \else
+ \if#1s
+ \let\xs@s@WhatNext\xs@CheckSuffixes
+ \else
+ \let\xs@S@WhatNext\xs@CheckSuffixes
+ \fi
+ \fi
+ \fi
+ \fi\xs@next
+ }
+\def\SearchOnlyOne#1{%
+ \xs@SearchOne#1\xs@end
+ }
+\def\xs@SearchOne#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax^^I
+ \else
+ \let\xs@next\xs@SearchOne
+ \expandafter\def\csname xs@#1@WhatNext\endcsname##1\xs@end,{}%
+ \fi\xs@next
+ }
+\def\StopSearching{%
+ \let\xs@StartString\relax
+ }
+\def\StartSearching{%
+ \let\xs@StartString\xs@@StartString
+ }
+\let\xs@OldOutput\relax
+\def\PatchOutput{%
+ \ifx\xs@OldOutput\relax
+ \edef\xs@PatchOutput{%
+ \noexpand\def\noexpand\xs@OldOutput{%
+ \the\output
+ }%
+ \noexpand\output{%
+ \noexpand\StopSearching
+ \the\output
+ \noexpand\StartSearching
+ }%
+ }%
+ \expandafter\xs@PatchOutput
+ \else
+ \xs@err{Output already patched}%
+ \fi
+ }
+\def\NormalOutput{%
+ \ifx\xs@OldOutput\relax
+ \xs@err{Output has not been patched}%
+ \else
+ \expandafter\output\expandafter{%
+ \xs@OldOutput
+ }%
+ \let\xs@OldOutput\relax
+ \fi
+ }
+\def\PatchTracing{%
+ \def\xs@StopTracing{%
+ \chardef\xs@tracingcommands\tracingcommands
+ \chardef\xs@tracingmacros\tracingmacros
+ \tracingcommands0 \tracingmacros0\relax
+ }%
+ \def\xs@StartTracing{%
+ \tracingcommands\xs@tracingcommands
+ \tracingmacros\xs@tracingmacros
+ }%
+ }
+\def\NormalTracing{%
+ \let\xs@StopTracing\relax
+ \let\xs@StartTracing\relax
+ }
+\NormalTracing
+\xs@RestoreCatcodes \catcode`@=12
+\SearchOrder{
+ F!fPpSs;
+ f!PpSs;
+ P!pSs;
+ p!Ss;
+ S!s;
+ s;
+ }
+\DoNotSort{pPsS}
+\SearchAll{pPsS}
+\XeTeXinterchartokenstate1
+\endinput
diff --git a/macros/xetex/generic/xesearch/xesearch.tex b/macros/xetex/generic/xesearch/xesearch.tex
new file mode 100644
index 0000000000..f894f24b59
--- /dev/null
+++ b/macros/xetex/generic/xesearch/xesearch.tex
@@ -0,0 +1,3574 @@
+\expandafter\ifx\csname XeTeXinputencoding\endcsname\relax
+\else
+ \XeTeXinputencoding=cp1252
+\fi
+\ifnum\month<10 \edef\month{0\the\month}\else \edef\month{\the\month}\fi
+\ifnum\day<10 \edef\day{0\the\day}\else \edef\day{\the\day}\fi
+\documentclass[article(11pt),%
+% produce,% Uncomment this line to produce xesearch.sty
+index]{codedoc}
+
+% CodeDoc declaration
+\ProduceFile{xesearch.sty}[xesearch][v.0.2][\the\year/\month/\day]
+
+
+
+
+
+% Fonts
+\usepackage{xltxtra}
+\setmainfont[Numbers=OldStyle,Ligatures=Common,Mapping=tex-text]{Palatino Linotype}
+\makeatletter
+% Old style numbers won't climb into
+% footnote status.
+\def\@makefnmark{%
+ \bgroup
+ \fontspec[Ligatures=Common,Mapping=tex-text]{Palatino Linotype}%
+ \textsuperscript{\@thefnmark}%
+ \egroup
+ }
+\makeatother
+\setsansfont[Scale=.85]{Verdana}
+\newfontfamily\altmono[Scale=.85]{Excalibur Monospace}
+\def\ttslant#1{%
+ {\fontspec[FakeSlant=.2,Scale=.85]{Excalibur Monospace}#1}%
+ }
+\def\texttt#1{{\altmono#1}}
+
+
+
+
+
+
+% Here it is.
+\usepackage{xesearch}
+\SearchList*{logos}{\csname#1\endcsname}{?TeX,?ConTeXt,xesearch}
+\def\ConTeXt{Con\TeX t}
+% The \Xe must be redefined
+% because it's ugly in Verdana.
+\def\xesearch{%
+ \textsf{%
+ X%
+ \kern-.12em
+ \lower.2em\hbox{\reflectbox{E}}%
+ \kern-.03em Search%
+ }%
+ }
+\def\Protect#1{%
+ \StopSearching
+ #1%
+ \StartSearching{}%
+ }
+
+
+
+
+
+
+
+% Page dimensions and colors.
+\usepackage[paperheight=21cm,paperwidth=31.7cm,left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
+\usepackage{xcolor}
+\pagestyle{empty}
+
+% For the implementation.
+\usepackage{parcolumns}
+
+% One wonderful package.
+\usepackage{flowfram}
+\newcount\startpage\startpage3
+\newcount\endpage \endpage\startpage \advance\endpage15
+\newcount\codepage \codepage\endpage \advance\codepage1
+\newcount\indexpage \indexpage\codepage \advance\indexpage32
+%\def\startpage{3}
+%\def\endpage{18}
+%\def\indexpage{51}
+%
+\newflowframe[1]{31.7cm}{21cm}{-2cm}{-2cm}[title]
+\newflowframe[2-\endpage]{15cm}{17cm}{0cm}{0cm}[main]
+\newflowframe[\codepage-\indexpage]{27.7cm}{17cm}{0cm}{0cm}[maincode]
+\newflowframe[>\indexpage]{5cm}{17cm}{0cm}{0cm}[index1]
+\newflowframe[>\indexpage]{5cm}{17cm}{5.5cm}{0cm}[index2]
+\newflowframe[>\indexpage]{5cm}{17cm}{11cm}{0cm}[index3]
+\newflowframe[>\indexpage]{5cm}{17cm}{16.5cm}{0cm}[index4]
+\newflowframe[>\indexpage]{5cm}{17cm}{22cm}{0cm}[index5]
+\def\CodeColor{black!60!red}
+%
+\newdynamicframe[1]{11.7cm}{10cm}{16cm}{0cm}[toc]
+%
+\newdynamicframe[\startpage-\endpage]{11.7cm}{17cm}{16cm}{0cm}[exblock]
+\setdynamicframe*{exblock}{clear=true,backcolor={yellow!14!white}}
+%
+\newdynamicframe[>1]{5cm}{\baselineskip}{24cm}{18cm}[header]
+\setdynamiccontents*{header}{\fontspec{Palatino Linotype}\itshape\Xe Search user guide\ \textbullet\ \thepage}
+%
+\vtwotone[<\codepage,>\indexpage]{\paperwidth-.1cm}{yellow!11!white}{wW}{.1cm}{red!80!black}{rR}
+\vNtone[\codepage-\indexpage]{3}{12.2cm}{yellow!11!white}{wWw}{\paperwidth-12.3cm}{yellow!14!white}{cCc}{.1cm}{red!80!black}{rRr}
+%
+
+
+
+
+\newcount\lettercount
+\newcount\casecount
+\newcount\rancolor
+\newcount\ranangle
+\newdimen\ranwidth
+\newdimen\ranheight
+\newdimen\ranWidth
+\newdimen\ranHeight
+\newif\iftoc
+\newbox\letterbox
+
+\def\ranletter{%
+ \setrannum\lettercount{1}{26}%
+ \setrannum\casecount{0}{1}%
+ \setrandim\ranWidth{0em}{45cm}%
+ \setrandim\ranwidth{0pt}{\ranWidth}%
+ \setrandim\ranHeight{0em}{25cm}%
+ \setrandim\ranheight{0pt}{\ranHeight}%
+ \setrannum\rancolor{0}{100}%
+ \setrannum\ranangle{0}{360}%
+ \tocfalse
+ \advance\ranwidth-1cm
+ \advance\ranheight-1cm
+ \ifdim\ranwidth>40cm
+ \toctrue
+ \else
+ \ifdim\ranheight>30cm
+ \toctrue
+ \else
+ \ifdim\ranwidth>17cm
+ \ifdim\ranheight>8.5cm
+ \toctrue
+ \fi
+ \fi
+ \fi
+ \fi
+ \unless\iftoc
+ \setbox\letterbox=\hbox{%
+ \lower\ranheight\hbox{%
+ \kern\ranwidth
+ \color{yellow!11!white!\the\rancolor!black}%
+ \rotatebox{\the\ranangle}{\csname @\ifcase\casecount a\else A\fi lph\endcsname\lettercount}%
+ }
+ }%
+ \wd\letterbox0cm \ht\letterbox0cm \dp\letterbox0cm
+ \box\letterbox
+ \fi
+ }
+
+\newcount\generator
+\def\generate{%
+ \ifnum\generator<10000
+ \ranletter
+ \advance\generator1
+ \let\next\generate
+ \else
+ \ranletter
+ \let\next\relax
+ \fi\next
+ }
+
+
+
+
+
+
+% CodeDoc verbatim environments.
+\ShortVerb"
+%
+% This to add to the right frame.
+\long\def\AppendEx#1\EOE{%
+ \appenddynamiccontents*{exblock}{%
+ \rightskip.3cm
+ #1}
+ }
+%
+% Create the title and label of
+% the example.
+\makeatletter
+\long\def\extitle#1#2{%
+ \advance\excount1
+ \def\@currentlabel{\the\excount}%
+ \label{#1}%
+ \def\ExTitle{#2}%
+ }
+\makeatother
+%
+%
+% Put the final product in a box.
+% I need a new box for each example
+% on the same page, so I simply
+% create a new box for each example.
+\def\ExampleBox{%
+ \expandafter\newbox\csname box@\the\excount\endcsname
+ \edef\excaption{
+ \noexpand\hfil\noexpand\bfseries\noexpand\scshape
+ \noexpand\normalsize
+ Example \the\excount: \ExTitle}%
+ \global\expandafter\setbox\csname box@\the\excount\endcsname=\vbox\bgroup
+ \ifcase\subexbox
+ \or
+ \expandafter\unvbox\csname subbox@1\endcsname
+ \or
+ \expandafter\unvbox\csname subbox@1\endcsname
+ \expandafter\unvbox\csname subbox@2\endcsname
+ \or
+ \expandafter\unvbox\csname subbox@1\endcsname
+ \expandafter\unvbox\csname subbox@2\endcsname
+ \expandafter\unvbox\csname subbox@3\endcsname
+ \fi
+ \global\subexbox0
+ }
+%
+%
+% Layout of the example.
+\def\inexample#1#2{%
+ \StopList{logos}%
+ \small
+ \hsize11.5cm
+ \parindent0pt
+ \leftskip.4cm
+ \vskip.3cm
+ \textcolor{\CodeColor}{#1}%
+ \leftskip.1cm
+ \vskip.2cm
+ #2%
+ }
+
+\def\MakeBox{%
+ \egroup
+ \expandafter\AppendEx\expandafter\vfil\expandafter\unvbox\csname box@\the\excount\endcsname\EOE
+ }
+%
+% The example that is typeset in
+% the right frame.
+\newcount\excount
+\NewExample{sidex}%
+ {\altmono#}{#}%
+ {%
+ \ExampleBox
+ \inexample{\CodeInput}{\CodeOutput}%
+ \vskip.4cm
+ \excaption
+ \MakeBox
+ }
+%
+% This one also goes in the
+% right frame but under the
+% same heading as the following
+% sidex example.
+\newcount\subexbox
+\NewExample{sidex2}%
+ {\altmono#}{#}%
+ {%
+ \global\advance\subexbox1
+ \expandafter\newbox\csname subbox@\the\subexbox\endcsname
+ \expandafter\global\expandafter\setbox\csname subbox@\the\subexbox\endcsname=\vbox{%
+ \inexample{\CodeInput}{\CodeOutput}%
+ \vskip.1cm
+ }%
+ }
+%
+% Verbatim text in the main text:
+\NewExample{mainex}%
+ {\par
+ \altmono#}%
+ {}{%
+ \StopList{logos}%
+ \vskip.2cm plus .1cm minus .1cm
+ \leftskip2\parindent
+ \CodeInput
+ \vskip.2cm plus .1cm minus .1cm
+ }
+%
+% Syntax highlighting examples only
+% show the input code, with the desired
+% specifications.
+\NewExample{hilite}%
+ {#}{}%
+ {
+ \ExampleBox
+ \inexample{\codefontspec\CodeInput}{}%
+ \vskip.4cm
+ \excaption
+ \MakeBox
+ }
+%
+%
+% Example with only \CodeOutput shown.
+\NewExample{outputonly}%
+ {\altmono#}{#}%
+ {%
+ \ExampleBox
+ \inexample{}{\CodeOutput}%
+ \vskip.4cm
+ \excaption
+ \MakeBox
+ }
+
+
+
+
+
+% How the argument to \DescribeMacro
+% is typeset.
+\newif\ifmacroalready
+\def\PrintMacro#1{%
+ \unless\ifmacroalready
+ \unless\ifdim\lastskip>0pt
+ \vskip.1cm plus .05cm minus .05cm
+ \fi
+ \fi
+ \macroalreadyfalse
+ {\fontspec[Scale=.9]{Verdana}%
+ \noindent
+ \textcolor{\CodeColor}{\textbf{\llap{\textbullet\ }#1}}%
+ \vskip.1cm plus .05cm minus .05cm
+ \noindent
+ }}
+\DescribeIndexFont{\color{red!80!black}\bfseries}
+
+
+% Generic macros used in the examples.
+\def\blue{\textcolor{blue}}
+\def\red{\textcolor{red}}
+\def\green{\textcolor{green}}
+\def\violet{\textcolor{blue!50!red}}
+\let\bold\textbf
+\let\italics\textit
+\def\frame#1{\fbox{#1}}
+\def\reverse#1{\reflectbox{#1}}
+
+
+
+% Another big one.
+\usepackage[pdfborder=0 0 0,xetex,pdfauthor={Paul Isambert},pdftitle={XeSearch user guide}]{hyperref}
+
+
+
+
+% Miscellanea.
+\newcount\remcount
+\def\rem{%
+ \advance\remcount1
+ \par\noindent
+ \the\remcount.~%
+ }
+\let\citex\textbf
+
+\begin{document}
+
+\makeatletter
+\renewcommand*\l@section[2]{%
+ \ifnum \c@tocdepth >\z@
+ \addpenalty\@secpenalty
+ \addvspace{0em}%
+ \setlength\@tempdima{1.5em}%
+ \begingroup
+ \parindent \z@ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+ \leavevmode \bfseries
+ \advance\leftskip\@tempdima
+ \hskip -\leftskip
+ #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
+ \endgroup
+ \fi}
+\makeatother
+\appenddynamiccontents*{toc}{\vfill\footnotesize\tableofcontents}
+
+\StartIgnore
+\IfFileExists{random.tex}
+ {\input{random.tex}%
+ \leavevmode\generate}
+ {%
+\leavevmode\par
+You should have a nice explosion of letters here,\par
+but you don't have Donald Arseneau's \texttt{random.tex}.\par
+Download if from CTAN and run XeLaTeX again.}
+\StopIgnore
+\par
+\hfill\colorbox{red!80!black}{\kern1em\color{white}\Large\textbf{\Xe Search}\kern.6em}\par\vskip2pt
+\hfill\colorbox{red!80!black}{\kern1em\color{white}\Large\textbf{\FileVersion}\kern.6em}\par\vskip2pt
+\hfill\colorbox{red!80!black}{\kern1em\color{white}\Large\textbf{\FileDate}\kern.6em}\par\vskip2pt
+\hfill\colorbox{red!80!black}{\kern1em\color{white}\Large\textbf{Paul Isambert}\kern.6em}\par\vskip2pt
+\hfill\colorbox{red!80!black}{\kern1em\color{white}\Large\ttfamily\textbf{zappathustra@free.fr}\kern.6em}
+
+\framebreak
+
+\setcounter{section}{-1}
+\section{Changes}
+\long\def\Change#1#2{%
+ \leftskip2cm
+ \leavevmode
+ \llap{\textbf{#1}\enspace}#2\par}
+
+{%
+\parindent0pt
+\Change{\FileDate}
+{%
+Corrected for new versions of the XeTeX executable (thanks to Yuri Robbers):\par
+The XeTeX executable now has an increased number of character classes to 4096. This
+has been accomodated by also increasing xesearch's upper bound from 255 to 4095. Not
+changing xesearch would result in an error. For compatibility with other versions of
+the executable, this solution has been implemented using system primitives rather than
+hard coded numbers.
+}
+\Change{2009/11/04}
+{%
+v.0.1 Corrected for ConTeXt (thanks to Wolfgang Schuster):\par
+Now there's a third party file, \texttt{t-xesearch.tex}, so that
+xesearch can be properly loaded with \texttt{\bslash usemodule[xesearch]}.\par
+The clash between ConTeXt's \texttt{\bslash unexpanded} macro and XeTeX's
+(actually $\varepsilon$-TeX's) \texttt{\bslash unexpanded} primitive has been fixed.}
+\Change{2009/10/24}{Initial version}
+}
+
+\framebreak
+
+\strut
+\vfill
+\section{Introductory remarks}
+
+\rem This set of macros requires the XeTeX engine.
+
+\rem This set of macros is totally experimental.
+
+\rem This set of macros is written with plain XeTeX, and so
+it should be compatible with all formats, at least if
+they implement such basic macros as "\newcount" or "\newif",
+which is the case at least for LaTeX and ConTeXt.
+
+\rem As a consequence of the preceding remark, I've used
+in the examples of this documentation control sequences
+that don't exist in any format (as far as I know) but whose
+meaning is transparent enough, like "\blue" or "\italics", which
+typeset \blue{blue} and \italics{italics}. They are not part of xesearch.
+
+\rem This set of macros tweaks XeTeX's character class
+mechanism badly. This mechanism was not designed to do what
+it does here. Anyway, since it is used mainly for non-alphabetical
+writing systems, there's little chance of clashing with xesearch.
+I have tried to make xesearch compatible
+with Franois Charette's \textsf{polyglossia} for language with
+special punctuation pattern, like French. I have not tried
+to patch \textsf{babel} German shorthands in \textsf{polyglossia},
+simply because I was not able to make them work.
+
+\rem xesearch is local all the way down, that is, there's
+not a single global command. So it can be used in a controlled way.%
+\footnote{If your knowledge of TeX is confined to LaTeX, you might
+not be very familiar with the notion of locality to groups, since
+in LaTeX pretty much everything is global by default, whereas in
+plain TeX the contrary holds. So to make things simple, just remember
+that if you use xesearch inside a LaTeX environment, even one you've
+defined yourself with \texttt{\bslash newenvironment}, nothing
+will spread outside this environment. (I don't know the situation
+for ConTeXt, so I won't say anything.)}
+
+\rem To see what xesearch does, see \citex{example~\ref{simple}}
+ on the right.
+
+\extitle{simple}{A Simple Example}
+\begin{sidex}
+\SearchList{color}{\csname#1\endcsname{#1}}{blue,red,green}
+This is blue and this is red and this is green,
+but apparently yellow was not defined.
+\end{sidex}
+
+\rem To load the package in LaTeX, say
+%
+\begin{mainex}
+\usepackage{xesearch}
+\end{mainex}
+%
+\noindent In ConTeXt:
+%
+\begin{mainex}
+\usemodule[xesearch]
+\end{mainex}
+%
+\noindent In plain XeTeX:
+%
+\begin{mainex}
+\input xesearch.sty
+\end{mainex}
+
+
+
+
+
+\clearpage
+\section{Let's search}
+
+
+\DescribeMacro{\SearchList\meta{*!}\marg{name}\marg{replacement text}\marg{list of words}}%
+The star and exclamation mark are optional and their relative
+order does not matter. Sticking to mandatory arguments for the moment,
+here's how this macro works: first, you give
+a \meta{name} to this list, for further reference. Then you specify
+the \meta{replacement text}, which will be substituted for all of
+the words in \meta{list of words} (separated by commas). In this
+\meta{replacement text}, the substituted word is designed by "#1",
+so just think about it as an argument to a control sequence.
+If you forget "#1", the word disappears (until we learn how to
+use the exclamation mark), as can be seen in \citex{example~\ref{vanish}}.
+
+\extitle{vanish}{Words As Arguments}
+\begin{sidex}
+\SearchList{list1}{\italics{#1}}{obviously}
+\SearchList{list2}{}{something}
+Obviously, I have forgotten something.
+\end{sidex}
+
+Note that there's still a space between
+\emph{forgotten} and the full stop. Where does it come from? Well, it
+is the space that was between \emph{forgotten} and \emph{something}. At
+the time when xesearch manipulates \emph{something}, this space has already
+been read and typeset, so it does not disappear.
+
+But there's something much more interesting in this example. As you might
+have noticed, the first line says:
+%
+\begin{mainex}
+\SearchList{list1}{\italics{#1}}{obviously}
+\end{mainex}
+%
+\noindent and in the text to be searched we find `\texttt{Obviously}',
+with an uppercase first letter. Nonetheless, it is found and
+modified according to the replacement text. We thus discover one basic
+principle of xesearch: \emph{it isn't case-sensitive by default}.
+Hence the two following lists
+
+\VerbCommand!()
+%
+\begin{mainex}
+\SearchList{list1}{!ttslant(<whatever>)}{word}
+\SearchList{list2}{!ttslant(<whatever>)}{Word}
+\end{mainex}
+%
+%
+\UndoVerbCommand
+\noindent will find exactly the same set of words, namely `\texttt{word}'
+`\texttt{Word}', `\texttt{woRd}', `\texttt{WORD}', etc.
+How scary. This isn't customary in good programming and in TeX in
+particular. Fortunately, this default setting can be easily changed:
+the optional star just after "\SearchList" will make the entire list
+case-sensitive. Besides, if a list is not case-sensitive, i.e. if it
+has no star, a star before a word in that list will make the search
+for that particular word case-sensitive.%
+\footnote{However, if \texttt{\string\SearchList} is suffixed with
+a star, all words in the list will be case-sensitive.}
+This is illustrated in \citex{example~\ref{case}}.
+
+\extitle{case}{Illustrating Case-Sensitivity}
+\begin{sidex2}
+\SearchList{Case insensitive}{\blue{#1}}{woRd}
+Word word woRd WORD
+\StopList{Case insensitive}
+\end{sidex2}
+
+\begin{sidex2}
+\SearchList*{Case sensitive}{\red{#1}}{word}
+Word word woRd WORD
+\StopList{Case sensitive}
+\end{sidex2}
+
+\begin{sidex}
+\SearchList{Mixed}{\green{#1}}{word,*Worm}
+Word word woRd WORD\par
+Worm worm woRm WORM\par
+\end{sidex}
+
+In this example we discover another macro, whose meaning is clear:
+
+
+
+
+\DescribeMacro{\StopList\marg{list of lists}}
+The lists, separated by commas, are turned off.
+
+Let's turn back to "\SearchList" again. It can also take an exclamation
+mark beside the star (the order between the two of them is not important).
+In this case, the word is not subsituted anymore; i.e. the
+replacement text will follow the word (still with "#1" standing for it).
+These concatenating replacements
+are very dangerous because they are expanded \emph{after} the search
+has started again. You see what I mean: if the word you've found
+does not endure some transformation that'll make it different from
+itself as far as typesetting is concerned, ooops, here's the loop.
+"WORD" expands to "WORD\command{WORD}" to "WORD\command{WORD\command{WORD}}",
+etc., and there's no way out of it.
+
+So, what's the point? The point is: the reason why those replacements
+are placed after the no-search area has stopped is because they are
+meant to host argument-taking commands to act on the rest of the streams.
+Such commands can't be placed in normal replacement texts without
+an exclamation mark, because they would stumble upon precisely
+what starts the search again. So be careful. Either use "!"-marked
+searches with non-typesetting macros, for instance to index the word,
+or make sure that you know exactly the many interactions you might
+create. The exclamation mark says it all.
+\citex{Example~\ref{exclam}} is silly but I hope you can see the point.
+
+
+\extitle{exclam}{A Silly One}
+\begin{sidex2}
+\SearchList*!{Hamlet}%
+ { Or Not \StopSearching#1\StartSearching}%
+ {To Be}
+To Be...
+\end{sidex2}
+
+\begin{sidex2}
+\SearchList!{typo}{\red{!!!}}{tipo}
+There's a tipo here.
+\end{sidex2}
+
+\begin{sidex}
+\SearchList!{XeTeX}{ \green}{is}
+This is \XeTeX.\par
+\end{sidex}
+
+Note the space at the beginning of the first and third replacement
+texts. Concatenating replacement texts (which replace nothing but
+whatever) stick to their targets. Besides, in the third example,
+"\green" would have gobbled the subsequent space.
+
+I hope you have noticed that the "Hamlet" list contains not a word but
+a phrase. So you know: xesearch can find phrases. Now we can't avoid
+going into a little more detail concerning the way xesearch works.
+But before that, let's see one simple macro:
+
+\DescribeMacro{\AddToList\meta{*!}\marg{name}\marg{list of words}}
+This adds the words to the \meta{name} list, which of course should
+already exist. The presence or absence of a star and/or an
+exclamation mark doesn't depend at all on the original list. You
+can see that in \citex{example~\ref{add}}.
+
+\extitle{add}{Adding Words To An Existing List\par\hfil(Another Silly One)}
+\begin{sidex}
+\SearchList{Stupid list}{\blue{#1}}{word}
+Word and beep.
+\AddToList*{Stupid list}{Beep}
+Or Beep and word and beep.
+\end{sidex}
+
+Finally, the words in "\SearchList" and "\AddToList" should
+be made of characters only, but these can be the product of
+expansion. For instance, if you have "\def\word{a word}",
+then you can say "\AddToList{mylist}{\word}". If anything
+else shows up xesearch won't accept the word (and you'll
+probably have a good deal of errors beforehand).
+
+
+\section{What xesearch looks for and how it finds it}
+
+xesearch can see only two things: letters and non-letters. Non-letters
+it doesn't like because it's then forced to spit the letters it has
+gathered and form a word, and most times it's not allowed to take it
+away. (Un)fortunately, xesearch is quite short-sighted: it considers letters
+what you tell it are not non-letters (xesearch apparently has some formal
+education in philosophy).
+
+More seriously (and clearly), xesearch forms a word as long as there are
+letters. As you can see in \citex{example~\ref{macro}}, macros are expanded
+and if they yield letters, xesearch can recognize a word.
+%
+\extitle{macro}{Macros Can't Hide Letters}%
+\begin{sidex}
+\SearchList{Will it find me?}{\blue{#1}}{word}
+\def\rd{rd}
+Here is a wo\rd.
+\end{sidex}%
+%
+So when does it stop searching? There are two main cases:
+
+\remcount0
+\rem It encounters a space, or any primitive control sequence. The former
+case is quite natural: you want spaces to delimit words (including "\skip"s
+and associates). But the latter is less obvious: as soon as TeX does something
+that is not typesetting letters, xesearch gives up. And this includes something
+as seemingly innocuous as a "\relax", as you can see in \citex{example~\ref{relax}}.
+That's the reason why, for instance, xesearch will never find \Protect{\texttt{TeX}
+in \texttt{\bslash TeX}}: the definition contains many operations that aren't
+strictly speaking putting letters in the stream. Fortunately, the bulk of
+a manuscript is made of letters and spaces, and one seldom inserts "\relax"es
+in the middle of words.
+
+\extitle{relax}{But Primitive Can}
+\begin{sidex}
+\SearchList{This time I'm prepared}{\blue{#1}}{word}
+\def\rd{\relax rd}
+Here is a wo\rd.
+\end{sidex}
+%
+
+\rem xesearch encounters a character that you've declared as a non-letter,
+that is a word boundary. This leads us to the following macro:
+
+\DescribeMacro{\MakeBoundary\marg{characters}}\macroalreadytrue
+\DescribeMacro{\UndoBoundary\marg{characters}}
+The characters should be simply put one after the other, as in for instance
+\begin{mainex}
+\MakeBoundary{,;:!}
+\UndoBoundary{?()\{\}}
+\end{mainex}
+\noindent The basic set of such characters is as follows%
+\footnote{That is: full stop, comma, semi-colon, colon, exclamation
+mark, question mark, dash, inverted comma, apostrophe (i.e.
+left and right quote), parentheses, brackets, curly braces. This
+is rather arbitrary, despite some basic sensible assumptions.}
+%
+\begin{mainex}
+.,;:!?-`'()[]{}
+\end{mainex}
+%
+\noindent Now, if xesearch encounters a character that you've made
+into a boundary, it will stop forming a word and evaluate what
+it has gathered. Conversely, such characters cannot appear in
+the list of words in "\SearchList"; they wouldn't be found anyway.
+This is illustrated in \citex{example~\ref{boundary}}.
+%
+\extitle{boundary}{Where Words Start And Stop}
+\begin{sidex2}
+\MakeBoundary{/}
+\SearchList{separated}{\ddag#1\ddag}{waka,jawaka}
+Waka/Jawaka
+\end{sidex2}
+
+\begin{sidex}
+\UndoBoundary{/}
+\SearchList{united}{\ddag#1\ddag}{waka/jawaka}
+Waka/Jawaka
+\end{sidex}
+
+There is one big difference between those two cases. Characters
+defined as boundaries are not only word boundaries but also phrase
+boundaries. If xesearch smells a possible phrase, spaces and
+primitive commands won't stop it, whereas boundary characters will.
+You can see that in \citex{example~\ref{phrase}}.
+This example also illustrates one fact and one sad truth. The fact
+is that words aren't searched for inside phrases; so the first two
+\emph{you}'s were not turned to italics, since they belonged to
+\emph{you are what you is}. The third one, one the other hand,
+was recognized since \emph{you are neither good nor bad} was
+missed because of the intervenig comma.
+
+
+\extitle{phrase}{Phrases And Words}
+\begin{sidex}
+\SearchList{word}{\italics{#1}}{you}
+\SearchList{phrases}{\red{#1}}
+ {you are what you is,
+ you are neither good nor bad}
+
+You are what\kern1cm % What a kern!
+you is but you are neither good, nor bad.
+\end{sidex}
+
+The sad truth is that the "\kern" disappeared. This is one
+shortcoming of xesearch: primitives disappear
+when they're in the middle of a possible phrase, even if that
+phrase is not recognized in the end. By `possible phrase' I
+mean a string of words that form the beginning of a phrase
+that you want identified, e.g. the kern in
+
+\VerbCommand![]
+\begin{mainex}
+\SearchList{H(a)unting primitives}{!ttslant[<whatever>]}%
+ {xesearch feeds on kerns}
+xesearch feeds on\kern1cm skips
+\end{mainex}
+\UndoVerbCommand
+
+\noindent will disappear, even though no string
+matches in the end. Hopefully such commands are
+rather rare in the bulk of a document. If some
+are unavoidable --- and for other uses too ---
+there exists a pair of commands, whose function I
+probably don't need to explain (except that "\StartSearching"
+doesn't need to be issued at the beginning of your
+document, it is there by default):
+
+\DescribeMacro\StartSearching\macroalreadytrue
+\DescribeMacro\StopSearching
+
+
+
+
+
+\vskip-\lastskip
+\section{(A very blunt form of) regular expressions}
+
+Words are cool, and phrases too. But life doesn't always
+reach their level of achievement. Sometimes you don't know
+what you want. Something beginning with a `B', why not?
+or maybe something that ends in `et'? Then look at
+\citex{example~\ref{affixes}}.
+
+\extitle{affixes}{Prefixes And Suffixes}
+\begin{sidex}
+\SearchList{Affixes}{\red{#1}}{*B?,?et,?ET}
+
+A \italics{Black Page} in B, actually some kind of
+duet for Terry Bozzio and Chad Wackerman, lay
+on the drumset beside the PET facility.
+\end{sidex}
+
+There are several things to see in this example. First,
+xesearch has entered the "\italics" command and imposed
+its will.\footnote{Provided I'm using commands that don't
+cancel each other, like plain TeX's \texttt{\bslash bf}
+and \texttt{\bslash it}.} Next, affixes\footnote{I use the
+word \emph{affixes} to refer to both \emph{prefixes}
+(like \texttt{B?}) and \emph{suffixes} (like \texttt{?et}).
+From a linguistic point of view, prefixes and suffixes
+(and infixes, actually) are indeed affixes, but from the
+same point a view, what we're talking about here has nothing
+to do with prefixes or suffixes, just with bits of words.
+I hope you don't mind.} are also sensitive
+to case-sensitivity, so to speak, since \emph{beside} was
+not identified ("*B?" being case-sensitive), whereas \emph{PET}
+was found ("?et" not being case-sensitive). Note that a
+word matches an affix search if it is at least as long
+as the specified part of the affix. Thus, \emph{B} matches
+"B?". So the question mark means `from zero to any number
+of additional letters,' and not `at least one additional letter.'
+
+Phrases can take only suffixes, and they affect the last
+word only. So
+
+\VerbCommand!()
+\begin{mainex}
+\SearchList{list}{!ttslant(<whatever>)}{some interesting wor?}
+\end{mainex}
+\UndoVerbCommand
+
+\noindent will find \texttt{some interesting world}, \texttt{some interesting words},
+but not \texttt{some interesting word thesaurus}. An affix mark
+anywhere else will have no effect.
+
+Marking the unspecified part of a word with "?" is the only
+possibility for the question mark to enter a "\SearchList",
+and obviously it doesn't stand for itself. So, unless of
+course you undo it as a string boundary, "?" can appear
+only at the beginning or the end of a word.\footnote{And if
+a star is present, it should precede the question mark.}
+In any other place, it will be recognized as a boundary
+that has no right to be there and you'll be blamed. This
+means that infixes don't exist in xesearch, i.e. you
+can't say "B?et" to search for "bullet", for instance. Also,
+you can't say "?ull?" to match "bullet". One affix at a time.
+
+Finally, don't try to use a joker, i.e.
+
+\VerbCommand!()
+\begin{mainex}
+\SearchList{list}{!ttslant(<whatever>)}{?}
+\end{mainex}
+\UndoVerbCommand
+
+\noindent as an attempt to match all words. This won't work.%
+\footnote{If you want to match all words\par
+\noindent\texttt{\bslash SearchList\{list\}\{\ttslant{<whatever>}\}\{a?,b?,...,z?\}}\par
+\noindent should do. Ok, now you've read it, you might have
+the impression that the title of this section verges
+on dishonesty. You might be right.}
+
+
+
+\section{Search order(s)}
+
+Now we shall see what happens when a word is matched by
+several searches. There are three different cases:
+
+\remcount0
+\rem A word is matched by two or more strictly identical searches,
+e.g.:
+\VerbCommand!()
+\begin{mainex}
+\SearchList{list1}{!ttslant(<whatever>)}{word}
+\SearchList{list2}{!ttslant(<whatever else>)}{word}
+... word ...
+\end{mainex}
+
+\noindent\rem A word is matched by two or more prefixes
+or two or more suffixes identical in case-sensitivity, e.g.:
+\begin{mainex}
+\SearchList{list1}{!ttslant(<whatever>)}{*wor?}
+\SearchList{list2}{!ttslant(<whatever else>)}{*wo?}
+... word ...
+\end{mainex}
+
+\noindent\rem A word is matched by two or more different
+searches, e.g.:
+\begin{mainex}
+\SearchList{list1}{!ttslant(<whatever>)}{*wor?}
+\SearchList{list2}{!ttslant(<whatever else>)}{word}
+\SearchList{list3}{!ttslant(<anything>)}{?ord}
+... word ...
+\end{mainex}
+\UndoVerbCommand
+
+\vskip-\lastskip
+\subsection{Strictly identical searches}
+In this case, the word will execute all the
+replacement texts. Their interactions depend
+on the way they are defined: the replacement
+texts that are defined without an exclamation
+mark take as arguments the replacement texts
+that are defined just before them and will themselves
+become arguments to subsequent replacement texts.
+See \citex{example~\ref{nested}}
+
+\extitle{nested}{Nested Replacement Texts}
+\begin{sidex}
+\SearchList{list1}{\blue{#1}}{blue word}
+\SearchList{list2}{\dag#1\dag}{blue word}
+\SearchList{list3}{\ddag#1\ddag}{blue word}
+
+This blue word wears earrings and is equivalent
+to \ddag\dag\blue{term}\dag\ddag.
+\end{sidex}
+
+If the replacement texts are defined with and exclamation
+mark, they are simply concatenated, and most importantly,
+their argument is the word itself alone, not the accumulation
+of previous remplacement texts. See \citex{example~\ref{concatenation}}.
+Of course, if a word is matched by both kinds of replacement
+texts, the same rules apply, as in \citex{example~\ref{both}},
+where you can also be entertained by some not-very-fun-but-%
+you-can-hopefully-see-the-point-again fiddling with !-marked
+macros. If you want to know what those three "\expandafter"s
+are doing here, see section~\ref{texnic}.
+
+
+\extitle{concatenation}{Concatenation\par\hfil(Yet Another Silly Example)}
+\begin{sidex}
+\SearchList!{list1}{+}{wor?}
+\SearchList!{list2}{\dag}{wor?}
+\SearchList!{list3}{\ddag}{wor?}
+This word is a freight train.
+\end{sidex}
+
+
+\extitle{both}{Everything Together\par\hfil(This Is Mind-Blowing)}
+\begin{sidex}
+\SearchList{list1}{\green{#1}}{*?ORD}
+\SearchList{list2}{\ddag#1\ddag}{*?ORD}
+\def\whisper#1{\italics{ (#1)}}
+\def\ingreen{in green}
+\SearchList!{list3}
+ {\expandafter\expandafter\expandafter\whisper}
+ {*?ORD}
+\SearchList!{list4}{\ingreen}{*?ORD}
+This WORD must be upset.
+\end{sidex}
+
+
+
+\subsection{Affixes with identical characteristics}
+
+When a word is found by two or more affixes of the
+same kind (i.e. only prefixes or only suffixes) and
+with the same case-sensitivity, then you decide. xesearch
+provides the following commands:
+
+\DescribeMacro{\SortByLength\meta*\marg{pPsS}}\macroalreadytrue
+\DescribeMacro{\DoNotSort\marg{pPsS}}\macroalreadytrue
+\DescribeMacro{\SearchAll\marg{pPsS}}\macroalreadytrue
+\DescribeMacro{\SearchOnlyOne\marg{pPsS}}
+"p", "P", "s" and "S" are shorthands for (respectively)
+`case-insensitive prefix', `case-sensitive prefix',
+`case-insensitive suffix' and `case-sensitive suffix'.
+They refer to the type of affix to modify and those commands
+can take one or several of them, e.g. "\SearchAll{pSP}".
+By default, affixes follow the same rules as full words:
+each replacement text will take the replacement text
+defined just before as argument.
+But you can also create an order between them:
+with "\SortByLength", longer affixes match words before
+shorter ones, and their replacement texts are thus more
+deeply nested; adding a star to "\SortByLength" reverses
+the order: shorter affixes before longer ones. "\DoNotSort"
+resets to default, i.e. replacement texts follow the order
+in which they were defined. See \citex{example~\ref{affixorder}}.
+
+
+\extitle{affixorder}{This Is Fascinating}
+\begin{sidex}
+\SearchList{Three letters}{\ddag#1\ddag}{*adv?}
+\SearchList{Two letters}{\red{#1}}{*ad?}
+\SearchList{Four letters}{\dag#1\dag}{*adve?}
+
+\SortByLength{P} adverb
+\SortByLength*{P} adverb
+\DoNotSort{P} adverb
+\end{sidex}
+
+"\SearchAll" and "\SearchOnlyOne" sets what should happen
+when a word is matched by an affix: shall the search stop,
+or shall xesearch continue to investigate whether other
+affixes might fit too? By default, all affixes are
+tested, but you might want a different behavior. Thus
+"\SearchOnlyOne{PS}" will make case-sensitive prefixes and
+suffixes search only once (and thus the order defined
+just before becomes extremely important) while "\SearchAll{PS}"
+will return to default, as illustrated in \citex{example~\ref{searchall}}.
+
+
+
+
+\subsection{Different searches}
+
+%
+% The example is after the new section so it'll go on
+% the right page.
+%
+
+\extitle{searchall}{This Guy Sure Ain't No David Foster Wallace}
+\begin{sidex}
+\SearchList{just a list}{\blue{#1}}{bl?,*bo?}
+\SearchList{just another list}{\bold{#1}}{blu?,*bol?}
+
+\SearchOnlyOne{P} Blue and bold and
+\SortByLength{P} bold and blue.
+\end{sidex}
+
+
+Finally, we have to see what xesearch should do when several
+searches match a word. Once again, you decide, thanks
+to the following command:
+
+\DescribeMacro{\SearchOrder\marg{order and inhibitions}}
+You know what "p", "P", "s" and "S" mean; "f" and "F" mean
+`case-insensitive full word' and `case-sensitive full word.'
+In the macro above, \meta{order and inhibitions} is a list
+of one or more sequences like
+\texttt{f\red{!ps};} (with the semi-colon as part of the expression)
+in which the red part is optional and which means: if a word
+matches a full-word case-insensitive search, then xesearch
+will not test case-insensitive prefixes and suffixes on this
+word. Such declarations are put one after the other, and this
+defines the search order. For instance, the default order for
+xesearch is:
+
+\begin{mainex}
+\SearchOrder{
+ F!fPpSs;
+ f!PpSs;
+ P!pSs;
+ p!Ss;
+ S!s;
+ s;
+ }
+\end{mainex}
+
+\noindent and it simply means that full words should be searched for
+before prefixes, and prefixes before suffixes, with case-sensitive
+search first in each case, and that any
+successful search inhibits any subsequent test. You can have
+as many sequences as you wish. If XeTeX goes crazy and never terminates,
+then you've probably forgotten a semi-colon (I do it very frequently).
+See \citex{example~\ref{order}} for an illustration.
+
+\extitle{order}{Search Order}
+\begin{sidex}
+\SearchList{word}{\green{#1}}{*Word}
+\SearchList{prefix}{\frame{#1}}{wor?}
+\SearchList{suffix}{\reverse{#1}}{?ord}
+
+\SearchOrder{F;p;s;}
+This Word is well-matched.
+
+\SearchOrder{F!p;p;S;}
+This Word is not so well-matched anymore.
+
+\SearchOrder{f;}
+This Word is not matched at all.
+\end{sidex}
+
+Remember that e.g. "word?" will find `"word"' as a prefix, not
+as a full word, so that `"word"' will not be found if you say
+for instance "\SearchList{list}{"\ttslant{<whatever>}"}{word?}"
+and "\SearchOrdef{f;}". Finally,
+although something like "\SearchOrder{f;}" is perfectly okay
+to search for case-insensitive full words only,
+"\SearchOrder{;}" will only make XeTeX crazy; "\StopSearching"
+is simpler.
+
+
+
+
+\section{Some TeX\relax nical matters}\label{texnic}
+
+This section is not vital to the comprehension of xesearch,
+but it may be useful.
+
+\DescribeMacro\PrefixFound\macroalreadytrue
+\DescribeMacro\SuffixFound\macroalreadytrue
+\DescribeMacro\AffixFound
+When a word is found thanks to an affix search, the prefix
+or suffix used is stored in the relevant macros. If there
+are several matching affixes, the last prefix and the last
+suffix win in their respective categories, and between them
+the same rule apply for "\AffixFound". These macros are available
+as long as the search has not started again, i.e. they're
+fully available in normal replacement texts, but in
+\texttt{!}-marked definitions they're erased as soon as
+a letter is typeset, so they can be used only at the very
+beginning. The rest of the time they are empty.
+
+The affix itself respects the case in which it was declared
+if it is case-sensitive, but it is in lowercase otherwise,
+however it was fed to "\SearchList". See \citex{example~\ref{found}}.
+
+\extitle{found}{Finding Affixes}
+\begin{sidex2}
+\SearchList{A case-sensitive suffix}{Suf\blue\SuffixFound}{*?FiX}
+SufFiX.
+\end{sidex2}
+\begin{sidex}
+\SearchList{A case-insensitive affix}{\blue\AffixFound fix}{Pre?}
+PREfix.
+\end{sidex}
+
+\DescribeMacro\PatchOutput\macroalreadytrue
+\DescribeMacro\NormalOutput
+By default, xesearch doesn't patch the output routine so
+footers and headers are searched. This can be done by these
+two commands. "\PatchOutput" should of course be issued
+after any modification to the output routine. "\NormalOutput"
+restores the value of the output routine at work when
+"\PatchOutput" was executed.
+
+\DescribeMacro\PatchTracing\macroalreadytrue
+\DescribeMacro\NormalTracing
+If you want to give a look at your log file with some
+tracing on, you will find hundreds if not thousands
+of totally uninformative lines. That's xesearch
+recursively discovering new letters and testing
+words. With "\PatchTracing", xesearch will try to
+keep quiet during those painful moments, i.e.
+"\tracingcommands" and "\tracingmacros" will be
+turned to zero. It can't
+exactly be totally silent, so just know that all
+its words begin with "xs@". "\NormalTracing"
+lets xesearch express itself again.
+
+Now just consider \citex{example~\ref{catcode}}. When
+xesearch reads the input, it introduces itself to
+all the letters it doesn't know. Most importantly,
+it writes down some information about them, like
+their catcode. Now, if a letter is met with a given
+category catcode, that's the way xesearch will remember
+it, and this will influence how prefixes and suffixes
+are recognized. More precisely: the identification
+of a letter (e.g. the first occurence of it in the
+typestting stream) and its definition as part of an
+affix should be done under the same category code.
+
+% Ok, I had to do this in advance because of
+% the internal mechanisms of the CodeDoc class
+% and the flowfram package.
+%
+\catcode`\Z=12
+\SearchList{makeZ}{}{Z}
+\StopList{makeZ}
+\catcode`\Z=11
+
+\extitle{catcode}{The Mysterious Z}
+\begin{sidex}
+\catcode`\Z=12
+Here's a Z.
+\catcode`\Z=11
+
+\SearchList{fz}{\italics{#1}}{Frank Zap?}
+Look, here comes Frank Zappa!
+
+\StopList{fz}
+\catcode`\Z=12
+\SearchList{true fz}{\italics{#1}}{Frank Zap?}
+One more time for the world.
+Here comes Frank Zappa!
+\end{sidex}
+
+Note that in \citex{example~\ref{catcode}} I first
+had to stop the "fz" list, otherwise the prefix
+"Frank Zap?" would not have been recreated. Another
+solution would have been to create another prefix
+like "Frank Za?" or "*Frank Zap?".
+
+Finally, here's how replacement texts are processed.
+Suppose you have:
+
+\begin{mainex}
+\SearchList{listone}{\italics{#1}}{word}
+\SearchList{listtwo}{\blue{#1}}{word}
+\SearchList{listthree}{\bold{#1}}{word}
+\end{mainex}
+
+\noindent then xesearch does something like this:
+
+\begin{mainex}
+\def\command@listone#1{\italics{#1}}
+\def\command@listtwo#1{\blue{#1}}
+\def\command@listthree#1{\bold{#1}}
+\end{mainex}
+
+\noindent and when "word" is encountered it is turned to
+
+\begin{mainex}
+\expandafter\command@listthree\expandafter{%
+ \expandafter\command@listtwo\expandafter{%
+ \expandafter\command@listone\expandafter{\WORD}}}
+\end{mainex}
+
+\noindent where "\WORD" contains exactly "word"; as you
+can see, this is equivalent to
+
+\begin{mainex}
+\command@listthree{\command@listtwo{\command@listone{word}}}
+\end{mainex}
+
+\noindent which you won't have failed to notice is not equivalent
+to
+
+\begin{mainex}
+\bold{\blue{\italics{word}}}
+\end{mainex}
+
+\noindent although in this example the difference is immaterial.
+Now, if you really want three expansions with superior
+precision on one word, you probably don't need xesearch:
+just use a good old macro instead.
+
+Finally, !-marked replacement texts are simply concatenated,
+as in:
+
+\begin{mainex}
+\expandafter\command@listone\expandafter{\WORD}
+\expandafter\command@listthree\expandafter{\WORD}
+\expandafter\command@listtwo\expandafter{\WORD}
+\end{mainex}
+
+\noindent Now you can see the reason for the three "\expandafter"'s in
+\citex{example~\ref{both}}.
+
+
+
+
+
+
+
+\section{Examples}
+xesearch was first designed as the basis for the
+\textsf{\Xe Index} package, an automatic indexing package
+for XeLaTeX. It developped into a stand-alone
+project, and standing so alone that there are no other application yet.
+So here are some ideas.
+
+First, this document has the following list:
+
+\begin{mainex}
+\SearchList*{logos}{\csname#1\endcsname}{?TeX,?ConTeXt,xesearch}
+\end{mainex}
+
+\noindent (with "\xesearch" properly defined beforehand) so throughout this
+document I was able to type \Protect{`\texttt{xesearch can do this or that}'}
+to produce `xesearch can do this or that'. That's not fascinating
+but it was a test.
+
+Being a linguist I can also directly paste examples from my
+database and turn on xesearch to highlight some words. For instance,
+suppose you're studying the grammaticalization of, say, \emph{going to}
+in English,\footnote{If you're a linguist, I apologize for my lack
+of originality.} and you have many examples. Then you just create
+a command like "\startexample", or patch an existing command to activate
+xesearch just for this stretch of text, among other things. For
+instance:
+
+\VerbCommand!()
+\begin{mainex}
+\SearchList{goingto}{\bold{#1}}{going to}
+\def\startexample{%
+ !ttslant(!color(!CodeColor)Here you can modify margins, for instance.)
+ \StartSearching
+ }
+\def\stopexample{%
+ \StopSearching
+ !ttslant(!color(!CodeColor)Here you restore previous values.)
+ }
+\end{mainex}
+\UndoVerbCommand
+
+\noindent Otherwise you can locally use "\StopList" if
+you're searching the rest of the document too.
+
+What follows are some sketchy ideas. Concerning syntax highlighting,
+I won't try to compete with the \textsf{listings} package.
+
+
+
+
+\subsection{Spelling}
+
+\extitle{spelling}{The Words In Red Don't Belong To The Top 40,000}
+\begin{outputonly}
+\IfFileExists{english.dic}
+ {\input{english.dic}%
+ \SearchList{spelling}{%
+ \lowercase{\ifcsname##1@wordlist\endcsname}%
+ ##1%
+ \else
+ \red{##1}%
+ \fi}
+ {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?}
+ \SearchOrder{p;}
+ }%
+ {%
+ \emph{Unrecognized words should be in red, but you
+ should create \texttt{english.dic} beforehand}%
+ }
+
+Stately, plump Buck Mulligan came from the stairhead, bearing a bowl of lather on which a mirror and a razor lay crossed. A yellow dressinggown, ungirdled, was sustained gently behind him on the mild morning air. He held the bowl aloft and intoned:
+
+--- \textit{Introibo ad altare Dei}.
+
+Halted, he peered down the dark winding stairs and called out coarsely:
+
+--- Come up, Kinch! Come up, you fearful jesuit!
+
+Solemnly he came forward and mounted the round gunrest. He faced about and blessed gravely thrice the tower, the surrounding land and the awaking mountains. Then, catching sight of Stephen Dedalus, he bent towards him and made rapid crosses in the air, gurgling in his throat and shaking his head. Stephen Dedalus, displeased and sleepy, leaned his arms on the top of the staircase and looked coldly at the shaking gurgling face that blessed him, equine in its length, and at the light untonsured hair, grained and hued like pale oak.
+
+Buck Mulligan peeped an instant under the mirror and then covered the bowl smartly.
+
+--- Back to barracks! he said sternly.
+
+He added in a preacher's tone:
+
+--- For this, O dearly beloved, is the genuine Christine: body and soul and blood and ouns. Slow music, please. Shut your eyes, gents. One moment. A little trouble about those white corpuscles. Silence, all.
+\end{outputonly}
+
+
+Here's a recipe to create an English spellchecker. Take
+the list of the 40,000 most frequent words of English
+by Wiktionary: \url{http://en.wiktionary.org/wiki/Wiktionary:Frequency_lists#English}.
+Use TeX to turn it into a file, say "english.dic",
+whose only content is "\csname"\texttt{\ttslant{<word>}}"@dic\endcsname"
+for each word of the list, with \ttslant{<word>} in lowercase. What! you exclaim,
+that creates 40,000 control sequences! True. But TeX
+distributions can easily do that today. Input "english.dic"
+at the beginning of your document. Then set up xesearch as follows:
+
+\begin{mainex}
+\SearchList{spelling}{%
+ \lowercase{\ifcsname#1@dic\endcsname}%
+ #1%
+ \else
+ \red{#1}%
+ \fi}
+ {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?}
+\SearchOrder{p;}
+\end{mainex}
+
+\noindent Now, for each word, xesearch checks whether it
+belongs to the frequency list. If it doesn't, it puts it
+in red, thus signaling a likely spelling error. It could
+also issue an error message, or whatever.
+
+Some words will never belong to that list. Then we use a
+simple macro to add them beforehand:
+
+\begin{mainex}
+\def\AddWord#1{\lowercase{\csname#1@dic\endcsname}}
+\end{mainex}
+
+\noindent We could also create more specific macros like
+"\AddRegularVerb" which from e.g. "change" would add "change",
+"changes", "changed", "changing". TeX could also rewrite
+"english.dic" on the fly so there'd be no need to respecify
+those words on every document. And so on and so forth.
+
+Using a list like the frequency list is important because
+we want all forms of a word to appear; i.e. organized
+word lists have "hear" and not "hears", because there
+exists either an algorithm or at least the user's brain
+to derive "hears" from "hear".
+
+
+
+
+
+\subsection{Word count}
+Another simple use of xesearch is counting words in a document.
+We define a case-insensitive list with all letters as prefixes,
+so all words will be matched (we could add numbers too), as
+we did in the previous example. Supposing
+we want words like \emph{don't} to be counted as one word, then
+we remove the apostrophe from the word boundaries (in case it
+signals a dialogue, the following space will delimit the word
+anyway). And we define the search order as case-sensitive
+prefixes only, because we don't need anything else. The
+"\shownumber" macro is clear, I believe. In the first version
+of the text on the right it is "\let" to "\relax". It's just
+for fun.
+
+The "\advance" on "\wordcount" has to be "\global" because
+there might be (hidden) groups in the text, for instance
+in font-changing commands.
+
+\begin{mainex}
+\newcount\wordcount
+\def\shownumber{%
+ \raise.6\baselineskip\hbox to0pt{\hss\tiny\red{\the\wordcount}}
+ }
+\SearchList!{wordcount}{\global\advance\wordcount1\shownumber{}}
+ {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?}
+\UndoBoundary{'}
+\SearchOrder{p;}
+\end{mainex}
+
+\extitle{wordcount}{Counting Words}
+\begin{outputonly}
+\newcount\wordcount
+\let\shownumber\relax
+\SearchList!{wordcount}{\global\advance\wordcount1\shownumber{}}
+{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?}
+\UndoBoundary{'}
+\SearchOrder{p;}
+
+Stately, plump Buck Mulligan came from the stairhead, bearing a bowl of lather on which a mirror and a razor lay crossed. A yellow dressinggown, ungirdled, was sustained gently behind him on the mild morning air. He held the bowl aloft and intoned:
+
+--- \textit{Introibo ad altare Dei}.
+
+Halted, he peered down the dark winding stairs and called out coarsely:
+
+--- Come up, Kinch! Come up, you fearful jesuit!
+
+Solemnly he came forward and mounted the round gunrest. He faced about and blessed gravely thrice the tower, the surrounding land and the awaking mountains. Then, catching sight of Stephen Dedalus, he bent towards him and made rapid crosses in the air, gurgling in his throat and shaking his head. Stephen Dedalus, displeased and sleepy, leaned his arms on the top of the staircase and looked coldly at the shaking gurgling face that blessed him, equine in its length, and at the light untonsured hair, grained and hued like pale oak.
+
+
+{\leavevmode\par\StopList{wordcount}
+\emph{There are \the\wordcount\ words.}}
+
+\leavevmode\par
+
+\def\shownumber{\raise.6\baselineskip\hbox to0pt{\hss\tiny\red{\the\wordcount}}}
+
+Buck Mulligan peeped an instant under the mirror and then covered the bowl smartly.
+
+--- Back to barracks! he said sternly.
+
+He added in a preacher's tone:
+
+--- For this, O dearly beloved, is the genuine Christine: body and soul and blood and ouns. Slow music, please. Shut your eyes, gents. One moment. A little trouble about those white corpuscles. Silence, all.
+
+\leavevmode\par
+
+\StopList{wordcount}
+\emph{The total number of words is: \the\wordcount.}
+\end{outputonly}
+
+
+
+\subsection{Syntax highlighting: TeX}
+
+At first I'd designed a colorful scheme but it was
+ugly, so here's something much more sober. We simply
+create an empty list in which we design a macro
+to add "\string"ed primitive commands.
+
+\begin{mainex}
+\SearchList{hilitex}{\bold{#1}}{}
+\def\Add#1{%
+ \AddToList{hilitex}{#1}%
+ }
+\expandafter\Add\expandafter{\string\def}
+\expandafter\Add\expandafter{\string\expandafter}
+\expandafter\Add\expandafter{\string\else}
+\expandafter\Add\expandafter{\string\fi}
+\expandafter\Add\expandafter{\string\else}
+\end{mainex}
+
+\noindent We can't do that for prefixes (and we need
+them if we want e.g. to underline all user-defined "\if"),
+because they would be "\string"ed and thus of category
+code 12, which \citex{example~\ref{catcode}} has shown
+was a trouble. So we design a macro to add words with
+a backslash added beforehand. And we use it.
+
+\begin{mainex}
+\def\gobble#1{}
+\def\AddPrefix#1{%
+ \AddToList*{hilitex}{\expandafter\gobble\string\\#1?}%
+ }
+\AddPrefix{new} \AddPrefix{if}
+\end{mainex}
+
+We need one last thing. We want "\" to be recognized as
+a letter, because it should be put in bold too. But we
+also want it to be recognized as a string boundary. The
+only solution is to make it active and let it expand
+to "\relax" (a natural string boundary) plus itself
+in catcode 12 (which is not defined with "\MakeBoundary"
+and is thus a letter for xesearch).
+
+\goodbreak
+\begin{mainex}
+\catcode`\|=0
+\catcode`\\=13
+|def\{|relax|string\}
+\end{mainex}
+
+\noindent If we pack everything into an usual macro to
+make verbatim text, then we obtain something along the
+lines of \citex{example~\ref{hilite}}. Don't forget the
+typewriter font for the real thrill!
+
+The implementation section of this documentation displays
+a subtler kind of syntax highlighting, viz. "\def" and
+associates put the following command in red and index it
+too, except commands I don't want to see treated as such,
+like temporary commands. However, the implementation
+depends on CodeDoc's macros, so I won't show it here,
+although you can look at the source.
+
+%
+% TeX example...
+\extitle{hilite}{\TeX\ Highlighted}
+
+\def\codefontspec{\fontspec{Courier New}\large}
+
+\bgroup
+\catcode`\|=0
+\catcode`\\=13
+|gdef|makeescape{%
+ |catcode`|\=13
+ |gdef\{|relax|string\}
+ }
+|egroup
+
+\def\CodeSpec{%
+ \def\bold##1{%
+ {\fontspec[FakeBold=1.5,Scale=.85]{Excalibur Monospace}##1}%
+ }%
+ \SearchList{hilitex}{\bold{##1}}{}%
+ \def\Add##1{%
+ \AddToList*{hilitex}{##1}%
+ }%
+ \expandafter\Add\expandafter{\string\def}%
+ \expandafter\Add\expandafter{\string\expandafter}%
+ \expandafter\Add\expandafter{\string\else}%
+ \expandafter\Add\expandafter{\string\fi}%
+ \expandafter\Add\expandafter{\string\else}%
+ \def\gobble##1{}%
+ \def\AddPrefix##1{%
+ \expandafter\expandafter\expandafter\Add\expandafter\expandafter\expandafter{%
+ \expandafter\gobble\string\\##1}%
+ }%
+ \AddPrefix{new?} \AddPrefix{if?}%
+ }%
+
+\VerbCommand!()
+\begin{hilite}
+!makeescape()!CodeSpec()
+\def\mycommand#1{%
+ \expandafter\myothercommand#1%
+ \ifwhatever
+ \newtoks\mytoks
+ \mytoks={...}%
+ \else
+ \mytoks={...}%
+ \fi
+ }
+\end{hilite}
+\UndoVerbCommand
+
+
+\subsection{Syntax highlighting: HTML}
+
+Coloring HTML is rather easy. The most complicated
+part concerns word boundaries. xesearch is used
+to find elements and attributes. Only case-insensitive
+full words need to be searched for.
+
+\begin{mainex}
+\MakeBoundary{<>/=}
+\SearchList{elements}{\bold{\violet{#1}}}
+ {html,meta,head,body,span,p,div,b,h1,img}
+\SearchList{attributes}{\bold{#1}}{align,class,style,src}
+\SearchOrder{f;}
+\end{mainex}
+
+\noindent
+"<" and ">" delimit markup, so we use them to switch
+xesearch on and off.
+
+\begin{mainex}
+\catcode`\<=13
+\catcode`\>=13
+\def<{\bgroup\catcode`\'=13\catcode`\"=13\char`\<\StartSearching{}}
+\def>{\egroup\char`\>}
+\end{mainex}
+
+\noindent
+Quoted text should not be searched, because values
+to attributes are simply put in blue. Double quotes
+and single quotes should exclude each other.
+
+\begin{mainex}
+\catcode`\"=13
+\newif\ifdbbegin
+\def"{%
+ \unless\ifsgbegin
+ \ifdbbegin \egroup \char`\"
+ \else \char`\" \bgroup \dbbegintrue \color{blue}\StopSearching
+ \fi
+ \fi
+ }
+\catcode`\'=13
+\newif\ifsgbegin
+\def'{%
+ \unless\ifdbbegin
+ \ifsgbegin \egroup \char`\'
+ \else \char`\' \bgroup \sgbegintrue \color{blue}\StopSearching
+ \fi
+ \fi
+ }
+\end{mainex}
+
+\noindent
+"src" and "href" take links as values, usually
+underlined. So we do just that.
+
+\begin{mainex}
+\SearchList!{links}{\makelink}{src,href}
+\def\makelink=#1{%
+ \ifx#1"
+ \expandafter\makedbqlink
+ \else
+ \expandafter\makesgqlink
+ \fi
+ }
+\def\makedbqlink#1"{\StopSearching="\underline{#1}"\StartSearching}
+\def\makesgqlink#1'{\StopSearching='\underline{#1}'\StartSearching}
+\end{mainex}
+
+
+\noindent
+The "&...;" character denotation is often in red.
+
+\begin{mainex}
+\catcode`\&=13
+\def&#1;{%
+ \char`\&
+ \red{#1;}%
+ }
+\end{mainex}
+
+\noindent
+Finally we turn off TeX's special characters (quotes
+are made active by "<" and ">"), and we make some
+useful adjustments.
+
+\begin{mainex}
+\catcode`\"=12
+\catcode`\'=12
+\catcode`\#=12
+\catcode`\_=12
+\catcode`\^=12
+\catcode`\%=12
+\obeylines
+\def\par{\leavevmode\endgraf}
+\parindent0pt
+\end{mainex}
+
+
+\citex{Example~\ref{html}} shows the bottom of the CTAN page.
+
+
+
+\bgroup
+\catcode`\&=13
+\catcode`\"=13
+\catcode`\'=13
+\catcode`\<=13
+\catcode`\>=13
+\gdef\makehtmlchar{%
+ \catcode`\&=13
+ \def&##1;{%
+ \char`\&
+ \bgroup\color{red}##1;\egroup
+ }%
+ \newif\ifdbbegin
+ \def"{%
+ \unless\ifsgbegin
+ \ifdbbegin
+ \egroup
+ \char`\"
+ \else
+ \char`\"
+ \bgroup
+ \dbbegintrue
+ \color{blue}%
+ \StopSearching
+ \fi
+ \fi
+ }%
+ \newif\ifsgbegin
+ \def'{%
+ \unless\ifdbbegin
+ \ifsgbegin
+ \egroup
+ \char`\'
+ \else
+ \char`\'
+ \bgroup
+ \sgbegintrue
+ \color{blue}%
+ \StopSearching
+ \fi
+ \fi
+ }%
+ \def<{\bgroup\catcode`\'=13\catcode`\"=13\char`\<\StartSearching{}}%
+ \def>{\egroup\char`\>}%
+ }
+
+\gdef\makehtml{%
+ \makehtmlchar
+ \MakeBoundary{<>/=}%
+ \catcode`\<=13
+ \catcode`\>=13
+ \SearchList{elements}{\textbf{\textcolor{blue!50!red}{##1}}}{p,a,div,hr,table,tr,td,body,html,span}%
+ \SearchList{attributes}{\textbf{##1}}{href,width,id,align}%
+ \SearchList!{links}{\makelink}{src,href}%
+ \SearchOrder{f;}%
+ \def\makelink=##1{%
+ \ifx##1"
+ \expandafter\makedbqlink
+ \else
+ \expandafter\makesgqlink
+ \fi
+ }
+ \def\makedbqlink##1"{\StopSearching="\underline{##1}"\StartSearching}%
+ \def\makesgqlink##1'{\StopSearching='\underline{##1}'\StartSearching}%
+ \catcode`\"=12
+ \catcode`\'=12
+ \catcode`\#=12
+ \catcode`\_=12
+ \catcode`\^=12
+ \catcode`\%=12
+ \obeylines
+ \def\par{\leavevmode\endgraf}%
+ \parindent0pt%
+ \StopSearching
+}%
+\egroup
+
+\def\codefontspec{\ttfamily}
+\def\myskip{-.5em}
+
+\extitle{html}{Colorful HTML}
+\VerbCommand!()
+\begin{hilite}
+!makehtml()!color(black)!leftskip!myskip
+...
+<p>
+A perhaps less taxing way to express your appreciation
+is to make a
+
+<a href="https://www.tug.org/donate.html#ctan">donation</a>&nbsp;&mdash;
+small efforts add up!
+</p>
+
+
+<div id='footer'><hr />
+<table width='100%'>
+ <tr>
+ <td align='left'>
+ <span id='footer_author'>Site sponsor:
+ <a href='http://www.tug.org'>TeX Users Group</a></span></td>
+ <td>
+ <span id='footer_middle'>Internet connection provided by
+ <a href='http://www.smcvt.edu'>St Michael's College</a></span></td>
+ <td align='right'>
+ <span id='footer_home'>
+ <a href='/what_is_ctan.html'>What is CTAN?</a></span></td>
+ </tr>
+</table>
+
+</div>
+
+</body>
+</html>
+\end{hilite}
+\UndoVerbCommand
+
+
+
+
+\framebreak
+
+
+
+
+
+
+
+
+
+\section{Implementation}
+
+
+\newif\ifdef
+\def\PrintMacro#1{}
+
+\def\csprefix{cs}
+\def\exprefix{ex}
+{\catcode`\#=12
+\gdef\hash{#}
+\catcode`\%=12
+\gdef\com{%}
+}
+
+\def\makedef#1#2#3{%
+ \def\temp{#2#3}%
+ \ifx\temp\csprefix
+ \def\defnext{%
+ #1#2#3%
+ }%
+ \else
+ \ifx\temp\exprefix
+ \def\defnext{%
+ #1#2#3%
+ }%
+ \else
+ \def\temp{#1}%
+ \ifx\temp\hash
+ \def\defnext{%
+ #1#2#3%
+ }%
+ \else
+ \ifx\temp\com
+ \def\defnext{%
+ #1#2#3%
+ }%
+ \else
+ \deftrue
+ \def\defnext{#2#3}%
+ \fi
+ \fi
+ \fi
+ \fi\defnext
+ }
+
+\def\codesearch{%
+ \StopList{logos}%
+ \MakeBoundary{\\}%
+ \MakeBoundary{\#}%
+ \MakeBoundary{=}%
+ \MakeBoundary{\%}%
+ \SearchList{deff}{%
+ \ifdef
+ \deffalse
+ \IgnorePrefix{xs@}\expandafter\DefineMacro\expandafter{\csname##1\endcsname}%
+ \textcolor{red}{\char`\\##1}%
+ \else
+ ##1%
+ \fi}{xs@?,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?}%
+ \SearchList{defff}{%
+ \ifdef
+ \deffalse
+ \IgnorePrefix{xs@@}\expandafter\DefineMacro\expandafter{\csname##1\endcsname}%
+ \textcolor{red}{\char`\\##1}%
+ \else
+ ##1%
+ \fi}{xs@@?}%
+ \SearchList*{nodeff}{\ifdef\deffalse\char`\\##1\else##1\fi}
+ {xs@temp,xs@next,xs@String,xs@cs,xs@Phrase,xs@Sign,xs@TempWord,%
+ xs@templist,xs@@String,xs@WhatNext,xs@NoReplace,xs@Delimiters,xs@Stack,%
+ xs@ParseState,xs@TempNum,xs@TempDef,xs@Finalstring,xs@TempAffix,xs@@temp}%
+ \SearchList!*{def}{\makedef}{?def,let}%
+ \SearchOrder{F!Sp;S!p;p;}%
+ \SortByLength{p}%
+ \SearchOnlyOne{p}%
+ }
+
+\RenewExample[continuous]{code}%
+ {\ttfamily\small#}{}%
+ {%
+ \begin{parcolumns}[colwidths={1=10cm},distance=1.2cm]{2}%
+ \parindent0pt%
+ \colchunk{\Comment}%
+ \codesearch
+ \colchunk{\vskip-2\baselineskip\strut\par\CodeInput}%
+ \end{parcolumns}%
+ \gdef\Comment{}%
+ }
+\LineNumber{code}{\rmfamily\scriptsize}{0pt}
+
+\catcode`\13
+\long\def#1{\def\Comment{\noindent#1}}
+\ShortCode/
+\def\mac#1{\texttt{\bslash#1}}
+
+
+
+\subsection{First things first}
+
+%
+First we look for XeTeX.
+
+/
+\ifx\csname XeTeXrevision\endcsname\relax
+ \errmessage{You need XeTeX to run xesearch. It won't be loaded.}
+ \expandafter\endinput
+\else
+ \expandafter\ifx\csname xs@ChangeCatcodes\endcsname\relax
+ \else
+ \expandafter\expandafter\expandafter\endinput
+ \fi
+\fi
+/
+
+%
+These will be used to keep a constant punctuation
+in spite of catcode-changing packages like \texttt{babel}.
+
+/
+\catcode`@=11
+\def\xs@ChangeCatcodes{%
+ \chardef\xs@questioncode=\catcode`\?%
+ \chardef\xs@exclamationcode=\catcode`\!%
+ \chardef\xs@commacode=\catcode`\,%
+ \chardef\xs@starcode=\catcode`\*%
+ \chardef\xs@semicoloncode=\catcode`\;%
+ \catcode`\?12
+ \catcode`\!12
+ \catcode`\,12
+ \catcode`\*12
+ \catcode`\;12
+ }
+\def\xs@RestoreCatcodes{%
+ \catcode`\?\xs@questioncode
+ \catcode`\!\xs@exclamationcode
+ \catcode`\,\xs@commacode
+ \catcode`\*\xs@starcode
+ \catcode`\;\xs@semicoloncode
+ }
+\xs@ChangeCatcodes
+/
+
+
+%
+We declare xesearch as a package in LaTeX.
+
+\CodeEscape!
+/
+\ifdefined\ProvidesPackage
+ \def\xs@err#1{\PackageError{xesearch}{#1}{}}
+ \ProvidesPackage{!FileName}[!FileDate!space !FileVersion!space Searching documents.]
+\else
+ \def\MessageBreak{^^J}
+ \def\xs@err#1{%
+ \bgroup
+ \newlinechar`\^^J%
+ \errorcontextlines=0
+ \errmessage{xsearch error: #1}%
+ \egroup
+ }
+\fi
+/
+\UndoCodeEscape
+
+%
+\mac{unexpanded}
+already exists in ConTeXt, and the meaning of the $\varepsilon$-TeX
+primitive is taken over by \mac{normalunexpanded}, so we have to
+make the proper adjustment (many thanks to Wolfgang Schuster, who
+signalled this to me).
+
+\mac{xs@contextmodule} is an empty
+command let to \mac{relax} when xesearch is loaded with ConTeXt.
+
+/
+\ifcsname xs@contextmodule\endcsname
+ \let\xs@unexpanded\normalunexpanded
+\else
+ \let\xs@unexpanded\unexpanded
+\fi
+/
+
+%
+Some keywords, indispensable macros,
+and a bunch of \mac{new} things.
+
+/
+\def\xs@end{\xs@end}
+\def\xs@empty{}
+\def\xs@star{*}
+\def\xs@exclamation{!}
+\def\xs@question{?}
+\def\xs@starexclam{*!}
+\def\xs@exclamstar{!*}
+\def\xs@words{words}
+\def\xs@prefixes{prefixes}
+\def\xs@suffixes{suffixes}
+\def\xs@gobble#1{}
+\def\xs@Lowercase#1#2{\lowercase{\def#2{#1}}}
+\let\xs@relax\relax
+\newcount\xs@TempCount
+\newcount\xs@CaseSensitive
+\newcount\xs@TempLength
+\newcount\xs@Length
+\newbox\xs@Box
+\newif\ifxs@Concatenate
+\newif\ifxs@String
+\newif\ifxs@Affix
+\newif\ifxs@Prefix
+\newif\ifxs@Suffix
+\newif\ifxs@BadWord
+\newif\ifxs@Star
+\newif\ifxs@Phrase
+\newif\ifxs@Match
+\newtoks\xs@DefToks
+\newtoks\xs@NoReplaceToks
+/
+
+\subsection{Character classes}
+
+%
+Basic classes: natural delimiters (spaces and
+primitives), left and right delimiters (set
+by \mac{MakeBoundary}) and the normal class,
+out of which letters and delimiters will be taken.
+
+/
+\chardef\xs@NatDel=\e@alloc@intercharclass@top
+\chardef\xs@lrDel=\numexpr\e@alloc@intercharclass@top-1\relax
+\chardef\xs@Classes=\numexpr\e@alloc@intercharclass@top-2\relax
+\chardef\xs@Classless=0
+\XeTeXinterchartoks\xs@lrDel\xs@Classless={\xs@LearnLetter}
+\XeTeXinterchartoks\xs@NatDel\xs@Classless={\xs@LearnLetter}
+\XeTeXinterchartoks\xs@NatDel\xs@lrDel{\xs@EndString}
+\xs@TempCount\xs@Classes
+/
+
+
+%
+This is how we make boundaries. Note that if
+the character has a character class of 8 or 9,
+we don't change it. The interchartoks will be
+modified, however.
+
+/
+\def\xs@Delimiters{}
+\def\xs@MakeDel#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \let\xs@next\xs@MakeDel
+ \unless\ifnum\the\XeTeXcharclass`#1=7
+ \unless\ifnum\the\XeTeXcharclass`#1=8
+ \XeTeXcharclass`#1=\xs@lrDel
+ \expandafter\def\expandafter\xs@Delimiters\expandafter{\xs@Delimiters#1}%
+ \fi
+ \fi
+ \fi\xs@next}
+\xs@MakeDel\{\}.,;:!?[()]-'`\xs@end
+\def\MakeBoundary#1{%
+ \xs@MakeDel#1\xs@end
+ }
+\def\UndoBoundary#1{%
+ \xs@UndoBoundary#1\xs@end
+ }
+\def\xs@UndoBoundary#1{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@end
+ \let\xs@next\relax
+ \else
+ \ifnum\the\XeTeXcharclass`#1=\xs@lrDel
+ \def\xs@RemoveFromDelimiters##1#1##2\xs@end{%
+ \def\xs@Delimiters{##1##2}%
+ }%
+ \expandafter\xs@RemoveFromDelimiters\xs@Delimiters\xs@end
+ \fi
+ \XeTeXcharclass`#1=0
+ \let\xs@next\xs@UndoBoundary
+ \fi\xs@next
+ }
+/
+
+%
+This is the macro that turn a letter into
+a letter recording itself. It is recursive.
+Each new letter is assigned a new character
+class (from 253 downward), then it is made
+to start the recording
+process after delimiters, to stop it before,
+and to add itself to \mac{xs@String} in both case
+or next to another letter. Before natural delimiters, however,
+if the word recorded up to now is part of a
+possible phrase, the process is not stopped.
+The \textsf{polyglossia} patch is needed when
+e.g. \texttt{?} is not turned into a \mac{xs@lrDel}
+but keeps its character class as defined by
+\textsf{polyglossia}.
+
+/
+\def\xs@Letters{}%
+\def\xs@CreateLetter#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \expandafter\def\expandafter\xs@Letters\expandafter{\xs@Letters#1}%
+ \XeTeXcharclass`#1=\xs@TempCount
+ \expandafter\def\csname\the\xs@TempCount @xstring@letter\endcsname{#1}%
+ \edef\xs@PolyglossiaPatch{%
+ \xs@unexpanded{\XeTeXinterchartoks\xs@TempCount7}{%
+ \xs@unexpanded{\xdef\xs@String{\xs@String#1}\xs@EndString}%
+ \the\XeTeXinterchartoks0 7}%
+ \xs@unexpanded{\XeTeXinterchartoks\xs@TempCount8}{%
+ \xs@unexpanded{\xdef\xs@String{\xs@String#1}\xs@EndString}%
+ \the\XeTeXinterchartoks0 8}%
+ \xs@unexpanded{\XeTeXinterchartoks8\xs@TempCount}{%
+ \the\XeTeXinterchartoks8 0 \xs@unexpanded{\xs@StartSring}}%
+ }%
+ \xs@PolyglossiaPatch
+ \XeTeXinterchartoks\xs@TempCount\xs@Classless{%
+ \xdef\xs@String{\xs@String#1}%
+ \xs@LearnLetter}%
+ \XeTeXinterchartoks\xs@lrDel\xs@TempCount{%
+ \xs@StopTracing
+ \xs@StartString
+ }%
+ \XeTeXinterchartoks\xs@NatDel\xs@TempCount{%
+ \xs@StopTracing
+ \xs@StartString
+ }%
+ \XeTeXinterchartoks\xs@TempCount\xs@lrDel{%
+ \xdef\xs@String{\xs@String#1}\xs@EndString}%
+ \XeTeXinterchartoks\xs@TempCount\xs@NatDel{%
+ \xdef\xs@String{\xs@String#1}%
+ \ifcsname\xs@String @xs@phrases@cs\endcsname
+ \XeTeXinterchartokenstate0
+ \xdef\xs@Stack{%
+ \xs@String\noexpand\xs@end\xs@unexpanded\expandafter{\xs@Stack}%
+ }%
+ \edef\xs@String{\xs@unexpanded\expandafter{\xs@String} }%
+ \XeTeXinterchartokenstate1
+ \else
+ \expandafter\xs@Lowercase\expandafter{\xs@String}\xs@lcString
+ \ifcsname\xs@lcString @xs@phrases@ncs\endcsname
+ \XeTeXinterchartokenstate0
+ \xdef\xs@Stack{%
+ \xs@String\noexpand\xs@end\xs@unexpanded\expandafter{\xs@Stack}%
+ }%
+ \edef\xs@String{\xs@unexpanded\expandafter{\xs@String} }%
+ \XeTeXinterchartokenstate1
+ \else
+ \expandafter\expandafter\expandafter\xs@EndString
+ \fi
+ \fi
+ }%
+ \xs@TempCount\xs@Classes
+ \xs@MakeInterCharToks#1%
+ \advance\xs@TempCount-1
+ \let\xs@next\xs@CreateLetter
+ \fi\xs@next
+ }
+/
+
+
+This is the recursive macro which creates the
+\mac{XeTeXinterchartoks} for the new letter and
+all existing letter.
+
+/
+\def\xs@MakeInterCharToks#1{%
+ \ifnum\xs@TempCount=\XeTeXcharclass`#1
+ \XeTeXinterchartoks\xs@TempCount\xs@TempCount{\xdef\xs@String{\xs@String#1}}%
+ \let\xs@next\relax
+ \else\let\xs@next\relax
+ \expandafter\expandafter\expandafter%
+ \xs@Xict\csname\the\xs@TempCount @xstring@letter\endcsname%
+ \xs@TempCount{\XeTeXcharclass`#1}%
+ \xs@Xict#1{\XeTeXcharclass`#1}\xs@TempCount
+ \advance\xs@TempCount-1
+ \def\xs@next{\xs@MakeInterCharToks#1}%
+ \fi\xs@next}
+\def\xs@Xict#1#2#3{%
+ \XeTeXinterchartoks#2#3{\xdef\xs@String{\xs@String#1}}%
+ }
+/
+
+
+%
+xesearch learns a letter when it encounters a character
+with character class 0. Since \mac{xs@CreateLetter}
+is local, and since it is often executed inside the
+word box (see \mac{xs@StartString}), we record the
+letters thus created in \mac{xs@PendingLetters} and
+create them for good after the group.
+
+/
+\def\xs@PendingLetters{}%
+\def\xs@LearnLetter#1{%
+ \xs@CreateLetter#1\xs@end
+ \ifxs@String
+ \xdef\xs@PendingLetters{\xs@PendingLetters#1}%
+ \fi
+ #1}
+/
+
+
+
+\subsection{Search lists}
+
+%
+First we define whether there's an \texttt{!}
+or a \texttt{*} or both.
+
+/
+\def\SearchList{%
+ \xs@ChangeCatcodes
+ \xs@StarOrExclam\xs@Search
+ }
+\def\xs@StarOrExclam#1#2#{%
+ \def\xs@temp{#2}%
+ \ifx\xs@temp\xs@star
+ \xs@CaseSensitive2
+ \xs@Concatenatefalse
+ \else
+ \ifx\xs@temp\xs@exclamation
+ \xs@CaseSensitive0
+ \xs@Concatenatetrue
+ \else
+ \ifx\xs@temp\xs@starexclam
+ \xs@CaseSensitive2
+ \xs@Concatenatetrue
+ \else
+ \ifx\xs@temp\xs@exclamstar
+ \xs@CaseSensitive2
+ \xs@Concatenatetrue
+ \else
+ \xs@CaseSensitive0
+ \xs@Concatenatefalse
+ \fi
+ \fi
+ \fi
+ \fi#1%
+ }
+/
+
+%
+Then, after a basic check on the name of
+the list, we record it and defined the macros
+associated with this list as the second
+argument; these macros are the normal and
+!-marked (`\texttt{noreplace}') versions
+(both are created because there might be an
+\mac{AddToList} of a different type). Finally we launch
+the word-maker on the list of words.
+\mac{AddToList} is equivalent with some
+adjustments.
+
+
+/
+\def\xs@Search#1#2#3{%
+ \ifcsname#1@xs@searchlist\endcsname
+ \xs@err{%
+ `#1' already exists.\MessageBreak
+ Use \string\AddToList{#1}{<words>} to add words to it%
+ }%
+ \else
+ \def\xs@ListName{#1}%
+ \expandafter\def\csname\xs@ListName @words\endcsname{}%
+ \expandafter\def\csname #1@xs@searchlist\endcsname##1{#2}%
+ \expandafter\def\csname #1@xs@searchlist@noreplace\endcsname##1{#2}%
+ \expandafter\xs@MakeWord#3,\xs@end,%
+ \xs@RestoreCatcodes
+ \fi
+ }
+\def\AddToList{%
+ \xs@ChangeCatcodes
+ \xs@StarOrExclam\xs@AddToList
+ }
+\def\xs@AddToList#1#2{%
+ \ifcsname#1@xs@searchlist\endcsname
+ \def\xs@ListName{#1}%
+ \expandafter\xs@MakeWord#2,\xs@end,%
+ \xs@RestoreCatcodes
+ \else
+ \xs@err{`#1' is not a list}%
+ \fi
+ \xs@RestoreCatcodes
+ }
+/
+
+%
+This takes each word one by one and checks
+and creates a few things.
+
+/
+\def\xs@MakeWord#1,{%
+ \def\xs@TempWord{#1}%
+ \ifx\xs@TempWord\xs@end
+ \let\xs@next\relax
+ \else
+ \ifcsname\ifnum\xs@CaseSensitive=2*\fi#1@\xs@ListName\endcsname
+ \xs@err{You have already specified `\ifnum\xs@CaseSensitive=2*\fi#1'%
+ in `\xs@ListName'. \MessageBreak You can't do it twice}%
+ \else
+ \csname#1@\xs@ListName\endcsname
+ \edef\xs@TempWord{#1}%
+ \chardef\xs@ParseState=0
+ \xs@BadWordfalse
+ \xs@Starfalse
+ \xs@Prefixfalse
+ \xs@Suffixfalse
+/
+
+%
+For instance, we parse the word, to find prefixes
+or suffixes or forbidden things, like control
+sequences. Then we suppress prefixes and suffixes.
+
+/
+ \xs@ParseWord#1\xs@end
+ \unless\ifxs@BadWord
+ \ifxs@Star
+ \xs@CaseSensitive1
+ \expandafter\xs@SuppressPrefix\xs@TempWord\xs@end
+ \fi
+ \ifxs@Prefix
+ \expandafter\xs@SuppressSuffix\xs@TempWord
+ \else
+ \ifxs@Suffix
+ \expandafter\xs@SuppressPrefix\xs@TempWord\xs@end
+ \fi
+ \fi
+/
+
+
+%
+Depending on case-sensitivity, we put the word
+in lowercase or not, and we define a keyword to
+record the case-sensitivity.
+
+/
+ \def\xs@Phrase{}%
+ \ifcase\xs@CaseSensitive
+ \expandafter\xs@Lowercase\expandafter{\xs@TempWord}\xs@TempWord
+ \def\xs@cs{ncs}%
+ \expandafter\xs@CheckSpaces\xs@TempWord\xs@end
+ \or
+ \def\xs@cs{cs}%
+ \expandafter\xs@CheckSpaces\xs@TempWord\xs@end
+ \xs@CaseSensitive0
+ \or
+ \def\xs@cs{cs}%
+ \expandafter\xs@CheckSpaces\xs@TempWord\xs@end
+ \fi
+/
+
+%
+Finally, we patch the replacement texts associated with
+this word or affix.
+
+/
+ \ifxs@Prefix
+ \xs@MakePrefix
+ \def\xs@WordType{prefixes}%
+ \expandafter\xs@PatchDef\csname\xs@ListName @xs@searchlist\endcsname
+ \else
+ \ifxs@Suffix
+ \xs@MakeSuffix
+ \def\xs@WordType{suffixes}%
+ \expandafter\xs@PatchDef\csname\xs@ListName @xs@searchlist\endcsname
+ \else
+ \def\xs@WordType{words}%
+ \expandafter\xs@PatchDef\csname\xs@ListName @xs@searchlist\endcsname
+ \fi
+ \fi
+ \fi
+ \fi
+ \let\xs@next\xs@MakeWord
+ \fi\xs@next
+ }
+/
+
+%
+This is a basic finite state automaton. It starts in
+state 0. A star brings it in state 1. In both 0 and 1,
+if it finds a letter or a \texttt{?} it goes in state 2.
+From there, only letters and a \texttt{?} at the very end of
+the word are allowed. Boundaries make it crash. The distinction
+between stage 0 and stage 1 is needed just in case the
+user defines the star as a boundary.
+
+/
+\def\xs@ParseWord#1{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@end
+ \let\xs@next\relax
+ \ifxs@Suffix
+ \ifnum\xs@ParseState=3
+ \xs@err{You can't have a prefix and a suffix in the same word.\MessageBreak
+ `\xs@unexpanded\expandafter{\xs@TempWord}' won't be searched}%
+ \xs@BadWordtrue
+ \fi
+ \fi
+ \else
+ \let\xs@next\xs@ParseWord
+ \expandafter\ifcat\noexpand#1\relax
+ \xs@BadChar#1{control sequences are forbidden}%
+ \else
+ \ifcase\xs@ParseState
+ \chardef\xs@TempNum=\XeTeXcharclass`#1 %
+ \ifx\xs@temp\xs@star
+ \xs@Startrue
+ \chardef\xs@ParseState=1
+ \let\xs@next\xs@ParseWord
+ \else
+ \ifx\xs@temp\xs@question
+ \xs@Suffixtrue
+ \chardef\xs@ParseState=2
+ \let\xs@next\xs@ParseWord
+ \else
+ \ifnum\xs@TempNum>\xs@Classes
+ \xs@BadChar#1{it's already a string delimiter}%
+ \else
+ \chardef\xs@ParseState=2
+ \ifnum\xs@TempNum=0
+ \xs@CreateLetter#1\xs@end
+ \let\xs@next\xs@ParseWord
+ \fi
+ \fi
+ \fi
+ \fi
+%
+ \or
+ \chardef\xs@ParseState=2
+ \chardef\xs@TempNum=\XeTeXcharclass`#1 %
+ \let\xs@next\xs@ParseWord
+ \ifx\xs@temp\xs@question
+ \xs@Suffixtrue
+ \else
+ \ifnum\xs@TempNum>\xs@Classes
+ \xs@BadChar#1{it's already a string delimiter}%
+ \else
+ \ifnum\xs@TempNum=0
+ \xs@CreateLetter#1\xs@end
+ \let\xs@next\xs@ParseWord
+ \fi
+ \fi
+ \fi
+%
+ \or
+ \let\xs@next\xs@ParseWord
+ \chardef\xs@TempNum=\XeTeXcharclass`#1 %
+ \ifx\xs@temp\xs@question
+ \xs@Prefixtrue
+ \chardef\xs@ParseState=3
+ \else
+ \ifnum\xs@TempNum>\xs@Classes
+ \xs@BadChar#1{it's already a string delimiter}%
+ \else
+ \let\xs@next\xs@ParseWord
+ \fi
+ \fi
+ \or
+ \xs@BadChar?{it's already a string delimiter}%
+ \fi
+ \fi
+ \fi\xs@next
+ }
+/
+
+%
+This is in case we find something we don't want in the word.
+
+/
+\def\xs@BadChar#1#2{%
+ \def\xs@next##1\xs@end{}%
+ \xs@BadWordtrue
+ \xs@err{%
+ You can't use `\noexpand#1' in `\xs@unexpanded\expandafter{\xs@TempWord}',\MessageBreak
+ #2.\MessageBreak
+ `\xs@unexpanded\expandafter{\xs@TempWord}' won't be searched
+ }%
+ }
+/
+
+%
+In case the word is a phrase, we have to know that,
+so we check spaces. In case there are some, we record
+\texttt{word1}, then \texttt{word1 word2}, then
+\texttt{word1 word2 word3}, etc., as strings that
+may lead to phrases and should be recognized as
+such when xesearch is searching.
+
+/
+\def\xs@CheckSpaces#1\xs@end{%
+ \xs@@CheckSpaces#1 \xs@end
+ }
+\def\xs@@CheckSpaces#1 #2\xs@end{%
+ \def\xs@temp{#2}%
+ \ifx\xs@temp\xs@empty
+ \let\xs@next\relax
+ \else
+ \expandafter\xs@MakePhrase\xs@Phrase\xs@end#1\xs@end
+ \def\xs@next{\xs@@CheckSpaces#2\xs@end}%
+ \fi\xs@next
+ }
+\def\xs@MakePhrase#1\xs@end#2\xs@end{%
+ \ifx\xs@Phrase\xs@empty
+ \expandafter\def\csname#2@xs@phrases@\xs@cs\endcsname{}%
+ \edef\xs@Phrase{#2}%
+ \else
+ \expandafter\def\csname#1 #2@xs@phrases@\xs@cs\endcsname{}%
+ \edef\xs@Phrase{#1 #2}%
+ \fi
+ }%
+/
+
+%
+In case the word was recognized as an affix, we add it
+to the list of affixes beginning (in the case of prefixes)
+or ending (in the case of suffixes) with a given letter
+(this is supposed to make xesearch faster: when xesearch scans
+a word, it searches e.g. prefixes if and only if there
+are prefixes with the same initial letter as the word
+under investigation, and it compares it to those words
+only). The affix is also added to the lists sorted by
+length in both orders.
+
+/
+\def\xs@GetFirstLetter#1#2\xs@end{%
+ \def\xs@FirstLetter{#1}%
+ }
+\def\xs@MakePrefix{%
+ \expandafter\ifx\csname\xs@TempWord @\xs@cs @xs@prefixes\endcsname\relax
+ \expandafter\xs@GetFirstLetter\xs@TempWord\xs@end
+ \ifcsname xs@prefixes@\xs@FirstLetter @\xs@cs\endcsname
+ \expandafter\edef\csname xs@prefixes@\xs@FirstLetter @\xs@cs\endcsname{%
+ \csname xs@prefixes@\xs@FirstLetter @\xs@cs\endcsname\xs@TempWord,}%
+ \def\xs@Sign{<}%
+ \xs@Insert{\xs@TempWord}{\csname xs@prefixes@\xs@FirstLetter @\xs@cs @longer\endcsname}%
+ \def\xs@Sign{>}%
+ \xs@Insert{\xs@TempWord}{\csname xs@prefixes@\xs@FirstLetter @\xs@cs @shorter\endcsname}%
+ \else
+ \expandafter\edef\csname xs@prefixes@\xs@FirstLetter @\xs@cs\endcsname{\xs@TempWord,}%
+ \expandafter\edef\csname xs@prefixes@\xs@FirstLetter @\xs@cs @longer\endcsname{\xs@TempWord,}%
+ \expandafter\edef\csname xs@prefixes@\xs@FirstLetter @\xs@cs @shorter\endcsname{\xs@TempWord,}%
+ \fi
+ \fi
+ }
+\def\xs@GetLastLetter#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \let\xs@next\xs@GetLastLetter
+ \def\xs@LastLetter{#1}%
+ \fi\xs@next
+ }
+\def\xs@MakeSuffix{%
+ \expandafter\ifx\csname\xs@TempWord @\xs@cs @xs@suffixes\endcsname\relax
+ \expandafter\xs@GetLastLetter\xs@TempWord\xs@end
+ \ifcsname xs@suffixes@\xs@LastLetter @\xs@cs\endcsname
+ \expandafter\edef\csname xs@suffixes@\xs@LastLetter @\xs@cs\endcsname{%
+ \csname xs@suffixes@\xs@LastLetter @\xs@cs\endcsname\xs@TempWord,}%
+ \def\xs@Sign{<}%
+ \xs@Insert{\xs@TempWord}{\csname xs@suffixes@\xs@LastLetter @\xs@cs @longer\endcsname}%
+ \def\xs@Sign{>}%
+ \xs@Insert{\xs@TempWord}{\csname xs@suffixes@\xs@LastLetter @\xs@cs @shorter\endcsname}%
+ \else
+ \expandafter\edef\csname xs@suffixes@\xs@LastLetter @\xs@cs\endcsname{\xs@TempWord,}%
+ \expandafter\edef\csname xs@suffixes@\xs@LastLetter @\xs@cs @longer\endcsname{\xs@TempWord,}%
+ \expandafter\edef\csname xs@suffixes@\xs@LastLetter @\xs@cs @shorter\endcsname{\xs@TempWord,}%
+ \fi
+ \fi
+ }
+/
+
+%
+These suppress the \texttt{?} at the beginning or the end
+of the word.
+
+/
+\def\xs@SuppressPrefix#1#2\xs@end{\def\xs@TempWord{#2}}
+\def\xs@SuppressSuffix#1?{\def\xs@TempWord{#1}}
+/
+
+%
+Here's how we sort the list: we check each affix, and
+we insert the affix to be added just before the the
+first affix that is shorter or longer, depending on
+the order.
+
+/
+\def\xs@CountLetter#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \advance\xs@Length1
+ \let\xs@next\xs@CountLetter
+ \fi\xs@next
+ }
+\def\xs@SortList#1,{%
+ \ifx#1\xs@end
+ \edef\xs@templist{\xs@templist\xs@TempAffix,}%
+ \let\xs@next\relax
+ \else
+ \xs@Length0
+ \xs@CountLetter#1\xs@end
+ \ifnum\xs@Length\xs@Sign\xs@AffixLength
+ \edef\xs@templist{\xs@templist\xs@TempAffix,#1,}%
+ \let\xs@next\xs@EndList
+ \else
+ \edef\xs@templist{\xs@templist#1,}%
+ \let\xs@next\xs@SortList
+ \fi
+ \fi\xs@next
+ }
+\def\xs@EndList#1\xs@end,{%
+ \edef\xs@templist{\xs@templist#1}%
+ }
+\def\xs@Insert#1#2{%
+ \def\xs@TempAffix{#1}%
+ \xs@Length0
+ \expandafter\xs@CountLetter#1\xs@end
+ \chardef\xs@AffixLength\xs@Length
+ \def\xs@templist{}%
+ \expandafter\expandafter\expandafter\xs@SortList#2\xs@end,
+ \expandafter\let#2\xs@templist
+ }
+/
+
+%
+Finally, we make the definition of the word. First,
+we associate it with the word, so we'll know which
+words to modify in case of a \mac{StopList}, and to
+which type it belongs (case-sensitivity, affix or
+full word, \texttt{!}-marked or not). Then
+we make both the normal replacement text and the
+`no-repla\-cement' replacement text.
+
+/
+\def\xs@PatchDef#1{%
+ \expandafter\edef\csname\xs@ListName @words\endcsname{%
+ \csname\xs@ListName @words\endcsname
+ \xs@TempWord:::\xs@cs:::\xs@WordType:::\ifxs@Concatenate!\fi:::%
+ }%
+ \expandafter\ifx\csname\xs@TempWord @\xs@cs @xs@\xs@WordType\endcsname\relax%
+ \xs@DefToks{\xs@FinalString}%
+ \else
+ \xs@DefToks\expandafter\expandafter\expandafter{%
+ \csname\xs@TempWord @\xs@cs @xs@\xs@WordType\endcsname}%
+ \fi
+ \expandafter\ifx\csname\xs@TempWord @\xs@cs @xs@\xs@WordType @noreplace\endcsname\relax
+ \xs@NoReplaceToks{}%
+ \else
+ \xs@NoReplaceToks\expandafter\expandafter\expandafter{%
+ \csname\xs@TempWord @\xs@cs @xs@\xs@WordType @noreplace\endcsname}%
+ \fi
+ \ifxs@Concatenate
+ \expandafter\edef\csname\xs@TempWord @\xs@cs @xs@\xs@WordType\endcsname{\the\xs@DefToks}%
+ \expandafter\edef\csname\xs@TempWord @\xs@cs @xs@\xs@WordType @noreplace\endcsname{%
+ \the\xs@NoReplaceToks
+ \xs@unexpanded{\expandafter#1\expandafter{\xs@String}}%
+ }%
+ \else
+ \expandafter\edef\csname\xs@TempWord @\xs@cs @xs@\xs@WordType\endcsname{%
+ \noexpand\expandafter\noexpand#1\noexpand\expandafter{\the\xs@DefToks}%
+ }%
+ \fi
+ }
+/
+
+
+%
+Stopping a list is a delicate process:
+we have to extract the definition associated
+with the list from the words where it appears,
+and it is nested in case it is not \texttt{!}-marked.
+
+/
+\def\StopList{%
+ \xs@ChangeCatcodes
+ \xs@StopList
+ }
+\def\xs@StopList#1{%
+ \xs@@StopList#1,\xs@end,%
+ \xs@RestoreCatcodes
+ }
+\def\xs@@StopList#1,{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@end
+ \let\xs@next\relax
+ \else
+ \ifcsname#1@xs@searchlist\endcsname
+ \unless\ifcsname#1@xs@stoppedlist\endcsname
+ \csname#1@xs@stoppedlist\endcsname
+ \expandafter\def\expandafter\xs@ToRemove\expandafter{%
+ \csname#1@xs@searchlist\endcsname
+ }%
+ \expandafter\expandafter\expandafter%
+ \xs@PatchWords\csname #1@words\endcsname\xs@end::::::::::::%
+ \fi
+ \else
+ \xs@err{`#1' is not a list}%
+ \fi
+ \let\xs@next\xs@@StopList
+ \fi\xs@next
+ }
+/
+
+%
+We modify the adequate replacement text: no-replace
+or normal.
+
+/
+\def\xs@PatchWords#1:::#2:::#3:::#4:::{%
+ \def\xs@TempWord{#1}%
+ \ifx\xs@TempWord\xs@end
+ \let\xs@next\relax
+ \else
+ \def\xs@temp{#4}%
+ \ifx\xs@temp\xs@exclamation
+ \expandafter\expandafter\expandafter%
+ \xs@RemoveFromNoReplace\expandafter\xs@ToRemove\csname#1@#2@xs@#3@noreplace\endcsname
+ \fi
+ \def\xs@cs{#2}%
+ \def\xs@WordType{#3}%
+ \expandafter\xs@RemoveFromDef\csname#1@#2@xs@#3\endcsname
+ \let\xs@next\xs@PatchWords
+ \fi\xs@next
+ }
+/
+
+%
+Removing from no-replace is rather easy, since it's
+nothing more than:
+\par\noindent
+\mac{expandafter}\mac{\ttslant{<list1-macro>}}\mac{expandafter}\{\mac{xs@String}\}
+\par\noindent
+\mac{expandafter}\mac{\ttslant{<list2-macro>}}\mac{expandafter}\{\mac{xs@String}\}
+\par\noindent
+\mac{expandafter}\mac{\ttslant{<list3-macro>}}\mac{expandafter}\{\mac{xs@String}\}
+\par\noindent
+So we define a macro on the fly to find the definition
+we want to remove. If there's nothing left, we let
+this no-replace to \mac{relax}, so this word might
+be removed altogether when we evaluate what we find.
+
+/
+\def\xs@RemoveFromNoReplace#1#2{%
+ \def\xs@Erase##1\expandafter#1\expandafter##2##3\xs@end{%
+ \def#2{##1##3}%
+ \ifx#2\xs@empty
+ \let#2\relax
+ \fi
+ }%
+ \expandafter\xs@Erase#2\xs@end
+ }
+/
+
+%
+Normal replacement texts have the following structure:
+\par\noindent
+\mac{expandafter}\mac{\ttslant{<list1-macro>}}\mac{expandafter}\{\par\noindent
+\strut{} \strut{} \mac{expandafter}\mac{\ttslant{<list2-macro>}}\mac{expandafter}\{\par\noindent
+\strut{} \strut{} \strut{} \strut{} ...\par\noindent
+\strut{} \strut{} \strut{} \strut{}\strut{} \strut{} \mac{xs@FinalString}\par\noindent
+\strut{} \strut{} \strut{} \strut{} ...\par\noindent
+\strut{} \strut{} \}\}
+\par\noindent
+So we scan this recursively and rebuild it piecewise,
+removing the list that was stopped. If in the end
+there remains \mac{xs@FinalString} only, then
+there's no replacement text anymore, and if moreover
+the no-replace part is equal to \mac{relax}, then
+there's nothing left for that word and it shouldn't
+be tested anymore. So we let the definition associated
+with this word to \mac{relax} or we remove it from
+affixes.
+
+/
+\def\xs@final{\xs@FinalString}
+\def\xs@TempDef{}
+\def\xs@RemoveFromDef#1{%
+ \def\xs@TempDef{}%
+ \def\xs@Def{\xs@FinalString}%
+ \unless\ifx#1\xs@final
+ \expandafter\xs@Extract#1%
+ \fi
+ \let#1\xs@Def
+ \ifx#1\xs@final
+ \expandafter\ifx\csname\expandafter\xs@gobble\string#1@noreplace\endcsname\relax
+ \ifx\xs@WordType\xs@words
+ \let#1\relax
+ \else
+ \xs@RemoveFromAffixes
+ \fi
+ \fi
+ \fi
+ }
+\def\xs@Extract\expandafter#1\expandafter#2{%
+ \def\xs@temp{#1}%
+ \unless\ifx\xs@temp\xs@ToRemove
+ \edef\xs@TempDef{%
+ \noexpand#1,%
+ \xs@unexpanded\expandafter{\xs@TempDef}%
+ }%
+ \fi
+ \def\xs@temp{#2}%
+ \ifx\xs@temp\xs@final
+ \def\xs@next{%
+ \expandafter\xs@Rebuild\xs@TempDef\xs@end,%
+ }%
+ \else
+ \def\xs@next{%
+ \xs@Extract#2%
+ }%
+ \fi\xs@next
+ }
+\def\xs@Rebuild#1,{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \let\xs@next\xs@Rebuild
+ \edef\xs@Def{%
+ \xs@unexpanded{\expandafter#1\expandafter}%
+ \noexpand{%
+ \xs@unexpanded\expandafter{\xs@Def}%
+ \noexpand}%
+ }%
+ \fi\xs@next
+ }%
+/
+
+%
+Removing an affix from a list is easy:
+we scan each word and rebuild the list,
+removing the affix we want to deactivate.
+
+/
+\def\xs@RemoveFromAffixes{%
+ \ifx\xs@WordType\xs@prefixes
+ \expandafter\xs@GetFirstLetter\xs@TempWord\xs@end
+ \let\xs@Letter\xs@FirstLetter
+ \else
+ \expandafter\xs@GetLastLetter\xs@TempWord\xs@end
+ \let\xs@Letter\xs@LastLetter
+ \fi
+ \def\xs@templist{}%
+ \expandafter\expandafter\expandafter%
+ \xs@CleanList\csname xs@\xs@WordType @\xs@Letter @\xs@cs\endcsname\xs@end,%
+ \expandafter\let\csname xs@\xs@WordType @\xs@Letter @\xs@cs\endcsname\xs@templist
+ \def\xs@templist{}%
+ \expandafter\expandafter\expandafter%
+ \xs@CleanList\csname xs@\xs@WordType @\xs@Letter @\xs@cs @shorter\endcsname\xs@end,%
+ \expandafter\let\csname xs@\xs@WordType @\xs@Letter @\xs@cs @shorter\endcsname\xs@templist
+ \def\xs@templist{}%
+ \expandafter\expandafter\expandafter%
+ \xs@CleanList\csname xs@\xs@WordType @\xs@Letter @\xs@cs @longer\endcsname\xs@end,%
+ \expandafter\let\csname xs@\xs@WordType @\xs@Letter @\xs@cs @longer\endcsname\xs@templist
+ \expandafter\let\csname\xs@TempWord @\xs@cs @xs@\xs@WordType\endcsname\relax
+ }
+\def\xs@CleanList#1,{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@end
+ \let\xs@next\relax
+ \else
+ \let\xs@next\xs@CleanList
+ \unless\ifx\xs@temp\xs@TempWord
+ \edef\xs@templist{\xs@templist#1,}%
+ \fi
+ \fi\xs@next
+ }
+/
+
+\subsection{Testing words}
+
+%
+Here comes the big part: collecting words and
+testing them. When a letter follows a delimiter,
+we reset some values and start collecting the
+letters in a box...
+
+/
+\def\xs@Stack{}
+\def\xs@Remainder{}
+\def\xs@StartString{%
+ \xs@Stringtrue
+ \let\xs@StartString\relax
+ \def\xs@String{}%
+ \def\PrefixFound{}%
+ \def\SuffixFound{}%
+ \def\AffixFound{}%
+ \def\xs@Stack{}%
+ \def\xs@Remainder{}%
+ \xs@Phrasefalse
+ \setbox\xs@Box=\hbox\bgroup
+ }
+\let\xs@@StartString\xs@StartString
+/
+
+%
+\noindent ...and when a delimiter shows up
+again, unless we're tracking a phrase, we
+close the box, create the unknown
+letters that we've found in it, evaluate the
+word and finally output the result of this
+evaluation.
+
+/
+\def\xs@EndString{%
+ \ifxs@String
+ \egroup
+ \xs@Stringfalse
+ \expandafter\xs@CreateLetter\xs@PendingLetters\xs@end
+ \gdef\xs@PendingLetters{}%
+ \xs@Evaluate
+ \xs@Restore
+ \xs@StartTracing
+ \expandafter\xs@Remainder
+ \fi
+ }
+/
+
+%
+And here are the tests. The \texttt{F} test is for
+case-sensitive full words and just checks whether there is
+a definition for this word in this case. If it finds anything,
+it puts it around the string that already exists, i.e.
+either the bare word or the word alreay surrounded by
+replacement texts. Hence The bunch of \mac{expandafter}s.
+If there's a no-replace, we also add it to the existing
+ones. \mac{xs@relax} is just a placeholder to add the
+inhibitions defined with \mac{SearchOrder}.
+
+/
+\def\xs@@F@Test{%
+ \expandafter\unless\expandafter\ifx\csname\xs@String @cs@xs@words\endcsname\relax
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \def%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \xs@FinalString%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter{%
+ \csname\xs@String @cs@xs@words\endcsname}%
+ \expandafter\unless\expandafter\ifx\csname\xs@String @cs@xs@words@noreplace\endcsname\relax
+ \edef\xs@NoReplace{%
+ \xs@unexpanded\expandafter{\xs@NoReplace}%
+ \xs@unexpanded\expandafter{\csname\xs@String @cs@xs@words@noreplace\endcsname}%
+ }%
+ \fi
+ \xs@Matchtrue
+ \xs@relax
+ \xs@relax
+ \fi
+ }
+/
+
+%
+The \texttt{f} does the same thing, except it
+puts the word in lowercase before hand.
+
+\begin{code*}
+\def\xs@@f@Test{%
+ \expandafter\xs@Lowercase\expandafter{\xs@String}\xs@lcString
+ \expandafter\unless\expandafter\ifx\csname\xs@lcString @ncs@xs@words\endcsname\relax
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \def%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \xs@FinalString%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter{%
+ \csname\xs@lcString @ncs@xs@words\endcsname}%
+ \expandafter\unless\expandafter\ifx\csname\xs@lcString @ncs@xs@words@noreplace\endcsname\relax
+ \edef\xs@NoReplace{%
+ \xs@unexpanded\expandafter{\xs@NoReplace}%
+ \xs@unexpanded\expandafter{\csname\xs@lcString @ncs@xs@words@noreplace\endcsname}%
+ }%
+ \fi
+ \xs@Matchtrue
+ \xs@relax
+ \xs@relax
+ \fi
+ }
+\end{code*}
+
+%
+Tests on prefixes check whether there exists a
+prefix list beginning with the same letter as
+the word at stake, and in this case run the
+\mac{xs@CheckPrefixes} test.
+
+/
+\def\xs@@p@Test{%
+ \xs@Affixfalse
+ \expandafter\xs@GetFirstLetter\xs@lcString\xs@end
+ \ifcsname xs@prefixes@\xs@FirstLetter @ncs\endcsname
+ \let\xs@@String\xs@lcString
+ \def\xs@cs{ncs}%
+ \let\xs@WhatNext\xs@p@WhatNext
+ \expandafter\expandafter\expandafter%
+ \xs@CheckPrefixes\csname xs@prefixes@\xs@FirstLetter @ncs\p@order\endcsname\xs@end,%
+ \fi
+ \ifxs@Affix
+ \xs@Affixfalse
+ \xs@Matchtrue
+ \xs@relax
+ \xs@relax
+ \fi
+ }
+\def\xs@@P@Test{%
+ \xs@Affixfalse
+ \expandafter\xs@GetFirstLetter\xs@String\xs@end
+ \ifcsname xs@prefixes@\xs@FirstLetter @cs\endcsname
+ \let\xs@@String\xs@String
+ \def\xs@cs{cs}%
+ \let\xs@WhatNext\xs@P@WhatNext
+ \expandafter\expandafter\expandafter%
+ \xs@CheckPrefixes\csname xs@prefixes@\xs@FirstLetter @cs\P@order\endcsname\xs@end,%
+ \fi
+ \ifxs@Affix
+ \xs@Affixfalse
+ \xs@Matchtrue
+ \xs@relax
+ \xs@relax
+ \fi
+ }
+/
+
+%
+Prefixes are tested one by one by creating a
+macro on the fly where one delimiter is the prefix.
+Then we put the word at stake before it and execute
+the macro, and if there's no first argument, then
+the word matches the prefix. For instance, if
+the word is \texttt{democracy} and the prefix
+is \texttt{demo} then we test\par\noindent
+\mac{xs@TestPrefix democracydemo}
+\par\noindent and obviously the first argument
+is empty, since \texttt{demo} is a delimiter.
+
+/
+\def\xs@CheckPrefixes#1,{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@end
+ \let\xs@next\relax
+ \else
+ \def\xs@TestPrefix##1#1##2\xs@end{%
+ \def\xs@temp{##1}%
+ \ifx\xs@temp\xs@empty
+ \xs@Affixtrue
+ \def\PrefixFound{#1}%
+ \def\AffixFound{#1}%
+ \let\xs@next\xs@WhatNext
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \def%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \xs@FinalString%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter{%
+ \csname#1@\xs@cs @xs@prefixes\endcsname}%
+ \expandafter\unless\expandafter\ifx\csname#1@\xs@cs @xs@prefixes@noreplace\endcsname\relax
+ \edef\xs@NoReplace{%
+ \xs@unexpanded\expandafter{\xs@NoReplace}%
+ \xs@unexpanded\expandafter{\csname#1@\xs@cs @xs@prefixes@noreplace\endcsname}%
+ }%
+ \fi
+ \else
+ \let\xs@next\xs@CheckPrefixes
+ \fi
+ }%
+ \expandafter\xs@TestPrefix\xs@@String#1\xs@end
+ \fi\xs@next
+ }
+/
+
+%
+The tests for suffixes work along the same lines
+as those for prefixes.
+
+/
+\def\xs@@S@Test{%
+ \xs@Affixfalse
+ \expandafter\xs@GetLastLetter\xs@String\xs@end
+ \ifcsname xs@suffixes@\xs@LastLetter @cs\endcsname
+ \let\xs@@String\xs@String
+ \def\xs@cs{cs}%
+ \let\xs@WhatNext\xs@S@WhatNext
+ \expandafter\expandafter\expandafter%
+ \xs@CheckSuffixes\csname xs@suffixes@\xs@LastLetter @cs\S@order\endcsname\xs@end,%
+ \fi
+ \ifxs@Affix
+ \xs@Affixfalse
+ \xs@Matchtrue
+ \xs@relax
+ \xs@relax
+ \fi
+ }
+\def\xs@@s@Test{%
+ \xs@Affixfalse
+ \expandafter\xs@GetLastLetter\xs@lcString\xs@end
+ \ifcsname xs@suffixes@\xs@LastLetter @ncs\endcsname
+ \let\xs@@String\xs@lcString
+ \def\xs@cs{ncs}%
+ \let\xs@WhatNext\xs@s@WhatNext
+ \expandafter\expandafter\expandafter%
+ \xs@CheckSuffixes\csname xs@suffixes@\xs@LastLetter @ncs\s@order\endcsname\xs@end,%
+ \fi
+ \ifxs@Affix
+ \xs@Affixfalse
+ \xs@Matchtrue
+ \xs@relax
+ \xs@relax
+ \fi
+ }
+\def\xs@CheckSuffixes#1,{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@end
+ \let\xs@next\relax
+ \else
+ \def\xs@TestSuffix##1#1##2\xs@end{%
+ \def\xs@@temp{##2}%
+ \ifx\xs@temp\xs@@temp
+ \xs@Affixtrue
+ \def\SuffixFound{#1}%
+ \def\AffixFound{#1}%
+ \let\xs@next\xs@WhatNext
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \def%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ \xs@FinalString%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter%
+ {%
+ \csname#1@\xs@cs @xs@suffixes\endcsname}%
+ \expandafter\unless\expandafter\ifx\csname#1@\xs@cs @xs@suffixes@noreplace\endcsname\relax
+ \edef\xs@NoReplace{%
+ \xs@unexpanded\expandafter{\xs@NoReplace}%
+ \xs@unexpanded\expandafter{\csname#1@\xs@cs @xs@suffixes@noreplace\endcsname}%
+ }%
+ \fi
+ \else%
+ \let\xs@next\xs@CheckSuffixes
+ \fi
+ }%
+ \expandafter\xs@TestSuffix\xs@@String#1\xs@end
+ \fi\xs@next
+ }
+/
+
+\subsection{Search order}
+
+%
+\mac{SearchOrder} actually defines \mac{xs@Evaluate}.
+First it adds inhibitions to the tests, e.g. `\texttt{F!f;}'
+adds \mac{let}\mac{xs@f@Test}\mac{relax} to the \texttt{F}
+test in case it is positive, then it adds the tests
+themselves, in the specified order, to \mac{xs@Evaluate}.
+
+/
+\def\SearchOrder{%
+ \xs@ChangeCatcodes
+ \xs@SearchOrder
+ }
+\def\xs@SearchOrder#1{%
+ \def\xs@Order{}%
+ \xs@@SearchOrder#1\xs@end;%
+ \edef\xs@Evaluate{%
+ \xs@unexpanded{%
+ \XeTeXinterchartokenstate=0
+ \def\xs@NoReplace{}%
+ \let\xs@FinalString\xs@String
+ \expandafter\xs@Lowercase\expandafter{\xs@String}\xs@lcString
+ }%
+ \xs@unexpanded\expandafter{%
+ \xs@Order
+ \ifxs@Match
+ \def\xs@next{%
+ \xs@FinalString
+ }%
+ \else
+/
+
+%
+If the stack is not empty, it means we're
+dealing with a phrase; so the evaluation is
+not over in case no test has succeded. We first
+have to test the phrase minus the last word, then
+the phrase minus the last two words, etc.
+
+/
+ \unless\ifx\xs@Stack\xs@empty
+ \xs@Phrasetrue
+ \expandafter\xs@PopStack\xs@Stack\xs@@end
+ \let\xs@next\xs@Evaluate
+ \else
+ \ifxs@Phrase
+ \def\xs@Stack{}%
+ \def\xs@next{\xs@String\xs@Restore}%
+ \else
+/
+
+%
+If the word was not a phrase, and no test was
+successful, we simply put the box that contains it
+back into the stream.
+
+/
+ \def\xs@next{\unhbox\xs@Box\xs@Restore}%
+ \fi
+ \fi
+ \fi\xs@next
+ }%
+ }%
+/
+
+%
+We initialize the tests.
+
+/
+ \let\xs@f@Test\xs@@f@Test
+ \let\xs@F@Test\xs@@F@Test
+ \let\xs@p@Test\xs@@p@Test
+ \let\xs@P@Test\xs@@P@Test
+ \let\xs@s@Test\xs@@s@Test
+ \let\xs@S@Test\xs@@S@Test
+ \xs@RestoreCatcodes
+ }
+/
+
+%
+This treats each specification in \mac{SearchOrder}
+and the inhibitions, if any.
+
+/
+\def\xs@@SearchOrder#1#2;{%
+ \def\xs@temp{#1#2}%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \def\xs@Inhibit{}%
+ \xs@MakeInhibit#2\xs@end
+ \expandafter\expandafter\expandafter\xs@PatchTest\csname xs@@#1@Test\endcsname#1%
+ \edef\xs@Order{%
+ \xs@unexpanded\expandafter{\xs@Order}%
+ \xs@unexpanded\expandafter{\csname xs@#1@Test\endcsname}}%
+ \let\xs@next\xs@@SearchOrder
+ \fi\xs@next
+ }
+\def\xs@MakeInhibit#1{%
+ \def\xs@temp{#1}%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \let\xs@next\xs@MakeInhibit
+ \unless\ifx\xs@temp\xs@exclamation%
+ \edef\xs@Inhibit{%
+ \xs@unexpanded\expandafter{\xs@Inhibit
+ \expandafter\let\csname xs@#1@Test\endcsname\relax}%
+ }%
+ \fi
+ \fi\xs@next
+ }
+\def\xs@PatchTest#1\xs@relax#2\xs@relax#3#4{%
+ \expandafter\edef\csname xs@@#4@Test\endcsname{%
+ \xs@unexpanded{#1}%
+ \xs@unexpanded\expandafter{\expandafter\xs@relax\xs@Inhibit\xs@relax\fi}%
+ }%
+ }
+/
+
+%
+The evaluation ends in any case with the restoration
+of the tests, in case they were inhibited. the remainder
+is the right part of a discarded phrase. For instance, if
+xesearch searches for \texttt{page layout} it will investigate
+\texttt{page properties} if it finds it, and the remainder
+is \texttt{properties}.
+
+/
+\def\xs@Restore{%
+ \xs@Matchfalse
+ \let\xs@f@Test\xs@@f@Test
+ \let\xs@F@Test\xs@@F@Test
+ \let\xs@p@Test\xs@@p@Test
+ \let\xs@P@Test\xs@@P@Test
+ \let\xs@s@Test\xs@@s@Test
+ \let\xs@S@Test\xs@@S@Test
+ \let\xs@StartString\xs@@StartString
+ \edef\xs@Remainder{%
+ \xs@unexpanded\expandafter{\xs@NoReplace}%
+ \xs@unexpanded\expandafter{\xs@Remainder}%
+ }%
+ \XeTeXinterchartokenstate=1
+ }
+/
+
+%
+This is used to test phrases minus the last
+word on each iteration. The stack itself is
+built when the beginning of a phrase is found
+before a natural delimiter.
+
+/
+\def\xs@PopWord#1\xs@end#2\xs@end{%
+ \def\xs@String{#2}%
+ \def\xs@@PopWord#2##1\xs@end{%
+ \edef\xs@Remainder{##1\xs@unexpanded\expandafter{\xs@Remainder}%
+ }%
+ }%
+ \xs@@PopWord#1\xs@end
+ }
+\def\xs@PopStack#1\xs@end#2\xs@@end{%
+ \def\xs@Stack{#2}%
+ \expandafter\xs@PopWord\xs@String\xs@end#1\xs@end
+ }
+/
+
+%
+To search affixes in a given order, we simply
+define the list to be used in tests to be the
+one with this order.
+
+/
+\def\SortByLength#1{%
+ \def\xs@temp{#1}%
+ \ifx\xs@temp\xs@star
+ \def\xs@AffixOrder{@shorter}%
+ \let\xs@next\xs@SortByLength
+ \else
+ \def\xs@AffixOrder{@longer}%
+ \def\xs@next{\xs@@SortByLength#1\xs@end}%
+ \fi
+ \xs@next}%
+\def\xs@SortByLength#1{%
+ \xs@@SortByLength#1\xs@end
+ }
+\def\xs@@SortByLength#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \expandafter\let\csname #1@order\endcsname\xs@AffixOrder
+ \let\xs@next\xs@@SortByLength
+ \fi\xs@next
+ }
+\def\DoNotSort{%
+ \def\xs@AffixOrder{}%
+ \xs@SortByLength
+ }
+/
+
+%
+Searching all affixes is done by
+setting the \mac{xs@WhatNext} macro to
+\mac{xs@\ttslant{<affix>}@WhatNext}, depending
+on the text being performed.
+
+/
+\def\SearchAll#1{%
+ \xs@SearchAll#1\xs@end
+ }
+\def\xs@SearchAll#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else\let\xs@next\xs@SearchAll
+ \if#1p%
+ \let\xs@p@WhatNext\xs@CheckPrefixes
+ \else
+ \if#1P
+ \let\xs@P@WhatNext\xs@CheckPrefixes
+ \else
+ \if#1s
+ \let\xs@s@WhatNext\xs@CheckSuffixes
+ \else
+ \let\xs@S@WhatNext\xs@CheckSuffixes
+ \fi
+ \fi
+ \fi
+ \fi\xs@next
+ }
+\def\SearchOnlyOne#1{%
+ \xs@SearchOne#1\xs@end
+ }
+/
+
+%
+Searching only one affix is simply gobbling the
+remaining ones in case of a successful test.
+
+/
+\def\xs@SearchOne#1{%
+ \ifx#1\xs@end
+ \let\xs@next\relax
+ \else
+ \let\xs@next\xs@SearchOne
+ \expandafter\def\csname xs@#1@WhatNext\endcsname##1\xs@end,{}%
+ \fi\xs@next
+ }
+/
+
+
+\subsection{Miscellanea}
+
+%
+For the moment, starting and stopping the search
+is quite brutal.
+
+/
+\def\StopSearching{%
+ \let\xs@StartString\relax
+ }
+\def\StartSearching{%
+ \let\xs@StartString\xs@@StartString
+ }
+/
+
+%
+Patching the output very simple too.
+
+/
+\let\xs@OldOutput\relax
+\def\PatchOutput{%
+ \ifx\xs@OldOutput\relax
+ \edef\xs@PatchOutput{%
+ \noexpand\def\noexpand\xs@OldOutput{%
+ \the\output
+ }%
+ \noexpand\output{%
+ \noexpand\StopSearching
+ \the\output
+ \noexpand\StartSearching
+ }%
+ }%
+ \expandafter\xs@PatchOutput
+ \else
+ \xs@err{Output already patched}%
+ \fi
+ }
+\def\NormalOutput{%
+ \ifx\xs@OldOutput\relax
+ \xs@err{Output has not been patched}%
+ \else
+ \expandafter\output\expandafter{%
+ \xs@OldOutput
+ }%
+ \let\xs@OldOutput\relax
+ \fi
+ }
+/
+
+%
+As is patching the tracing.
+
+/
+\def\PatchTracing{%
+ \def\xs@StopTracing{%
+ \chardef\xs@tracingcommands\tracingcommands
+ \chardef\xs@tracingmacros\tracingmacros
+ \tracingcommands0 \tracingmacros0\relax
+ }%
+ \def\xs@StartTracing{%
+ \tracingcommands\xs@tracingcommands
+ \tracingmacros\xs@tracingmacros
+ }%
+ }
+\def\NormalTracing{%
+ \let\xs@StopTracing\relax
+ \let\xs@StartTracing\relax
+ }
+\NormalTracing
+/
+
+%
+finally we set everything back to normal,
+set some default values and say goodbye.
+
+/
+\xs@RestoreCatcodes \catcode`@=12
+\SearchOrder{
+ F!fPpSs;
+ f!PpSs;
+ P!pSs;
+ p!Ss;
+ S!s;
+ s;
+ }
+\DoNotSort{pPsS}
+\SearchAll{pPsS}
+\XeTeXinterchartokenstate1
+\endinput
+/
+
+\subsection{A third party file for ConTeXt}
+\ProduceFile{t-xesearch.tex}[t-xesearch][v.0.1][\the\year.\month.\day]
+\CodeEscape!
+
+This file is mostly due to Wolfgang Schuster.
+
+\mac{xs@contextmodule}
+is used when the main file is loaded to set the meaning of \mac{xs@unexpanded}.
+(ConTeXt commands have meaningful names, so I didn't want to rely on them as tests for ConTeXt,
+because there might exist commands with the same names in other formats.)
+
+\begin{code}
+%D \module
+%D [ file=!FileName,
+%D version=!FileDate,
+%D title=\CONTEXT\ User Module,
+%D subtitle=XeSearch,
+%D author=Paul Isambert,
+%D date=\currentdate,
+%D copyright=Paul Isambert,
+%D email=zappathustra@free.fr,
+%D license=LaTeX Project Public License]
+
+\writestatus{loading}{ConTeXt User Module / XeSearch}
+\csname xs@contextmodule\endcsname
+\input xesearch.sty
+\endinput
+\end{code}
+\UndoCodeEscape
+
+\StopSearching
+
+\framebreak
+
+\renewenvironment{theindex}{%
+ \section{Index}}{}
+\def\item{\par\noindent}
+\printindex
+
+\end{document}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/macros/xetex/generic/xetexko/ChangeLog b/macros/xetex/generic/xetexko/ChangeLog
new file mode 100644
index 0000000000..239b61d141
--- /dev/null
+++ b/macros/xetex/generic/xetexko/ChangeLog
@@ -0,0 +1,184 @@
+2018-08-08 Dohyun Kim <nomos at ktug org>
+
+ Version 2.21
+
+ * xetexko-font.sty: protect \{rm,sf,tt}family
+
+2018-08-02 Dohyun Kim <nomos at ktug org>
+
+ Version 2.20
+
+ * xetexko-font.sty: adapt to the fontspec v2.6h
+
+2018-04-19 Dohyun Kim <nomos at ktug org>
+
+ Version 2.19
+
+ * xetexko-space.sty: address a conflict with ulem package:
+ see http://www.ktug.org/xe/index.php?document_srl=229398
+
+2018-04-06 Dohyun Kim <nomos at ktug org>
+
+ Version 2.18
+
+ * step copyright year
+ * xetexko-space.sty: synchronize \XKskipstetchshrink with luatexko;
+ suppress glue stretching/shrinking under \disablehangulspacing;
+ \xetexkohu is now 0.05em by default
+ * xetexko-font.sty: use glueexpr
+ * xetexko-vertical.sty: minor bug fix
+
+2017-09-29 Dohyun Kim <nomos at ktug org>
+
+ Version 2.17
+
+ * xetexko-font.sty: zf@enc -> f@encoding
+
+2017-02-06 Dohyun Kim <nomos at ktug org>
+
+ Version 2.16
+
+ * xetexko-font.sty: patching {rm,sf,tt}family of fontspec 2017
+
+2016-04-04 Dohyun Kim <nomos at ktug org>
+
+ Version 2.15
+
+ * xetexko-space.sty: update for xetex 0.99994 or later
+ * xetexko-Josa.sty: fix automatic selection of josa
+
+2016-02-01 Dohyun Kim <nomos at ktug org>
+
+ Version 2.14
+
+ * xetexko-space.sty: updates for latex 2016
+ * xetexko-space.sty: do not compress already narrow cjk parentheses
+ * xetexko-space.sty: assign U+FF62, U+FF63 to cjkopening/closing resp.
+
+2015-06-16 Dohyun Kim <nomos at ktug org>
+
+ Version 2.13
+
+ * xetexko-space.sty: address issue #3 (glue after whatsit)
+ * xetexko-vertical.sty: new environment `horizontal'
+
+2015-03-26 Dohyun Kim <nomos at ktug org>
+
+ Version 2.12
+
+ * xetexko-space.sty: assign catcode 12 to Hangul Jamo
+ * xetexko.sty, xetexko-space.sty, xetexko-font.sty: fix bug #2
+ regarding amsart.cls.
+
+2015-01-18 Dohyun Kim <nomos at ktug org>
+
+ Version 2.11
+
+ * xetexko-space.sty: fix a bug regarding xoblivoir and ulem
+
+2015-01-16 Dohyun Kim <nomos at ktug org>
+
+ Version 2.10
+
+ * xetexko.sty, xetexko-font.sty: package option [unfonts] is removed
+ * *.sty: minor fixes and updated copyright year
+
+2014-08-04 Dohyun Kim <nomos at ktug org>
+
+ Version 2.9
+
+ * xetexko-font.sty: Nanum Truetype fonts, if available, will be used
+ as default hangul/hanja fonts if no hangul/hanja font is specified by
+ users.
+
+2014-07-27 Dohyun Kim <nomos at ktug org>
+
+ Version 2.8
+
+ * xetexko-space.sty: adapt to recent update of unicode-letters.tex.
+ Hangul syllables were of catcode 12 traditionally, and this is deeply
+ interwined with Automatic Josa Selection. So, recent change of
+ unicode-letters.tex, assigning catcode 11 to Hangul, is hereby
+ reverted.
+ * xetexko-font.sty: allow font option only once, as per future release
+ of fontspec
+
+2014-06-17 Dohyun Kim <nomos at ktug org>
+
+ Version 2.7
+
+ * xetexko-font.sty: Ligatures=TeX is now default option for main/sans
+ hangul/hanja fonts. Requires fontspec v2.4
+ * xetexko-font.sty: new macros \defaulthangulfontfeatures and
+ \defaulthanjafontfeatures
+
+2014-05-11 Dohyun Kim <nomos at ktug org>
+
+ Version 2.6
+
+ * xetexko-space.sty: assign U+FE00 block to IVS char as per
+ unicode 6.3
+ * xetexko-font.sty: font option YetHangul is still there, but
+ YetHangul=Off has been removed
+ * xetexko-font.sty: use latex3 syntax for defining font commands;
+ remove dependency on xkeyval package
+
+2014-03-28 Dohyun Kim <nomos at ktug org>
+
+ Version 2.5
+
+ * xetexko-font.sty: fixed a bug wrt hangul in preamble
+ * xetexko-vertical.sty: fixed a bug wrt 'charraise' of CJK symbols
+
+2014-02-02 Dohyun Kim <nomos at ktug org>
+
+ Version 2.4
+
+ * xetexko-space.sty: support Ideographic Variation Selector.
+ * xetexko-font.sty: fix a conflict with everysel.sty, reported by
+ Hoze Yi & Juho Lee
+ * xetexko-font.sty, xetexko-space.sty: fix conflicts with realscripts
+ and xypic packages, reported at
+ http://www.ktug.org/xe/index.php?document_srl=180038 and
+ http://www.ktug.org/xe/index.php?document_srl=180107 respectively.
+
+2013-12-14 Dohyun Kim <nomos at ktug org>
+
+ Version 2.3
+
+ * xetexko-space.sty xetexko.sty: previous release introduced a bug
+ related to ulem package, reported by Insung Cho.
+ * xetexko-space.sty: font-switching had sometimes been confused by
+ everyhangul/everyhanja.
+
+2013-12-06 Dohyun Kim <nomos at ktug org>
+
+ Version 2.2
+
+ * xetexko-space.sty: \latinhyphens is now the default
+ * xetexko-hanging.sty: \hangingpunctuations is not needed any more
+ * xetexko-space.sty: assign missing kana chars including U+30FC to
+ smallkana class
+ * xetexko-space.sty: assign compatibility jamo chars to hangulsyllable
+ class
+ * xetexko-space.sty: new macros \everyhangul and \everyhanja
+ * xetexko-space.sty: same stretch/shrink value for inter-hangul and
+ inter-hanja skip
+ * xetexko-font.sty xetexko-space.sty: new font option `charraise'
+ * xetexko-space.sty: \fallbackhanjafont as a final fallback font
+ * xetexko-josa.sty: fix a bug regarding non-BMP chars
+
+2013-07-03 Dohyun Kim <nomos at ktug org>
+
+ Version 2.1
+
+ * xetexko.sty: move Hangul caption setting to AtBeginDocument
+ * xetexko-space.sty: new macro \disablejamoautojosa, needed for teckit
+ mapping of Jamos.
+ * xetexko-vertical.sty: \verticaltypesetting for plain tex was
+ missing.
+
+2013-03-27 Dohyun Kim <nomos at ktug org>
+
+ Initial release to CTAN. Version 2.0
+
diff --git a/macros/xetex/generic/xetexko/README b/macros/xetex/generic/xetexko/README
new file mode 100644
index 0000000000..d50dbd3676
--- /dev/null
+++ b/macros/xetex/generic/xetexko/README
@@ -0,0 +1,137 @@
+XeTeX-ko Package version 2.21 (2018/08/08)
+=========================================
+
+XeTeX-ko is a macro package for Xe(La)TeX which supports typesetting
+Korean documents including Old Hangul texts. Though XeTeX itself
+already has basic facility to typeset Korean texts, this package
+provides some enhanced features for quality products adapted to
+Korean culture.
+
+This package requires cjk-ko package for its full functionality.
+
+
+License
+-------
+This package is licensed under LPPL (LaTeX Project Public License).
+
+See each file for details.
+
+
+Author
+------
+Please report any errors or suggestions to
+ Dohyun Kim <nomos at ktug org>
+or leave messages in the issue tracker at:
+ <http://github.com/dohyunkim/xetexko>
+
+
+Files
+-----
+
+### TeXinputs
+
+ xetexko.sty -> tex/xetex/xetexko/
+ xetexko-font.sty -> tex/xetex/xetexko/
+ xetexko-hanging.sty -> tex/xetex/xetexko/
+ xetexko-josa.sty -> tex/xetex/xetexko/
+ xetexko-space.sty -> tex/xetex/xetexko/
+ xetexko-vertical.sty -> tex/xetex/xetexko/
+ hanja_hangul.tab -> tex/xetex/xetexko/
+ hanjacom_hangul.tab -> tex/xetex/xetexko/
+ hanjaexa_hangul.tab -> tex/xetex/xetexko/
+
+### Documents
+
+ xetexko-doc.pdf -> doc/xetex/xetexko/
+ xetexko-doc.tex -> doc/xetex/xetexko/
+ README (this file) -> doc/xetex/xetexko/
+ ChangeLog -> doc/xetex/xetexko/
+
+
+Loading
+-------
+If you are a LaTeX user, declaring
+
+ \usepackage{xetexko}
+or
+
+ \usepackage{kotex}
+is sufficient to load the package. Notice that kotex.sty is a file
+provided by cjk-ko package.
+
+Under plain TeX:
+
+ \input xetexko.sty
+
+
+Package Options
+---------------
+
+ [hangul]
+Load Hangul captions. Besides, this option also adjusts interline
+spacing.
+
+ [hanja]
+Load Hanja captions. Also adjusts spacing as [hangul] option does.
+
+Note that [unfonts] option is removed starting with v2.10, and so
+Nanum TrueType will be used when no Hangul/Hanja font is declared.
+
+
+Hangul Font Commands
+--------------------
+
+ \setmainhangulfont
+ \setsanshangulfont
+ \setmonohangulfont
+Same as \setmainfont etc. provided by fontspec package, except that
+these affect only Hangul characters and related symbols.
+
+ \setmainhanjafont
+ \setsanshanjafont
+ \setmonohanjafont
+Same as \setmainfont etc. except that these affect only Hanja
+characters.
+
+In like manner, these commands are available as well:
+
+ \hangulfontspec \hanjafontspec
+ \newhangulfontfamily \newhanjafontfamily
+ \addhangulfontfeature \addhanjafontfeature
+
+If \fallbackhanjafont is defined, it is used as a final fallback font.
+
+
+Hangul Font Options
+-------------------
+
+ [InterLatinCJK=<dimen>]
+Set spacing between Hangul/Hanja and Latin characters.
+
+ [InterHangul=<dimen>]
+Set spacing between Hangul characters.
+
+ [PunctRaise=<dimen>]
+Raise Latin fullstop after Hangul character.
+
+See xetexko-doc.pdf for more options.
+
+
+Other User Commands
+-------------------
+
+ \dotemph{...}
+Emphasise Hangul or Hanja by putting dot above.
+
+ \begin{vertical}{<dimen>}
+ \end{vertical}
+This environment makes a vbox vertically typeset. <dimen> is an
+argument to indicate the box height. For vertical typesetting
+of entire document, use the command \verticaltypesetting instead.
+
+ \은 \는 \이 \가 \을 \를 \와 \과 \로 \으로 \라 \이라
+Commands for automatic Josa selection. Unlike those of cjk-ko
+package, these commands work correctly even after Hangul or Hanja.
+
+
+*END of README*
diff --git a/macros/xetex/generic/xetexko/hanja_hangul.tab b/macros/xetex/generic/xetexko/hanja_hangul.tab
new file mode 100644
index 0000000000..157b71bdae
--- /dev/null
+++ b/macros/xetex/generic/xetexko/hanja_hangul.tab
@@ -0,0 +1,20902 @@
+51068
+51221
+44368
+52832
+49345
+54616
+47732
+47564
+51109
+49340
+49345
+54616
+44592
+48512
+50668
+47732
+44060
+52629
+52629
+51204
+52264
+48708
+49464
+49464
+44396
+48337
+50629
+52509
+46041
+49324
+49849
+51452
+44396
+47049
+51452
+50976
+47049
+50628
+48337
+49345
+44260
+44396
+44060
+50500
+51109
+51473
+44537
+44060
+48393
+44288
+44278
+52268
+51076
+52265
+51452
+54616
+54872
+45800
+50948
+51452
+51221
+47140
+44144
+48324
+48520
+51060
+50696
+45236
+50724
+44396
+44396
+53441
+50836
+51032
+54840
+51648
+50724
+49324
+54840
+54605
+50501
+51020
+48337
+54273
+44368
+54840
+44340
+49849
+49849
+51012
+51008
+50556
+47616
+44396
+44152
+50556
+49845
+54693
+44060
+44508
+54624
+54848
+49436
+46168
+49884
+44228
+45229
+44040
+44152
+46028
+47904
+50732
+47588
+46976
+52272
+50976
+49444
+50684
+48380
+49332
+45208
+44148
+49556
+50620
+51460
+51096
+44148
+52824
+44396
+44148
+45212
+47536
+51032
+44432
+50836
+47560
+50668
+51137
+49324
+49324
+51060
+52489
+50864
+50864
+50872
+50868
+54840
+44592
+50724
+51221
+49324
+49464
+44557
+44557
+50500
+49324
+50500
+51228
+50500
+44537
+46160
+47581
+54637
+45824
+44368
+54644
+50669
+49328
+54805
+47924
+46976
+54693
+44221
+51221
+50577
+54693
+44221
+50556
+52828
+48149
+50864
+49444
+45800
+47156
+53440
+48120
+51064
+51064
+51665
+46972
+47581
+50613
+49901
+51064
+47477
+51221
+52769
+48512
+48512
+44396
+54036
+51109
+44552
+44060
+48729
+51081
+51333
+48520
+49328
+47452
+50612
+52285
+51088
+49324
+53440
+51109
+48512
+49440
+54732
+53441
+54861
+46041
+51064
+52380
+54620
+55128
+51089
+45824
+50689
+51060
+52488
+51109
+49340
+49345
+51032
+47924
+47928
+51064
+44032
+52488
+50521
+44160
+51473
+48708
+50900
+50724
+44148
+44060
+50836
+48393
+52285
+51076
+50773
+48712
+51200
+48169
+51333
+44592
+54056
+50668
+51312
+46024
+47928
+50669
+49900
+54637
+51060
+44553
+50528
+50724
+44592
+48373
+48268
+55092
+44540
+48176
+52840
+48512
+45432
+51473
+50864
+54868
+54924
+44396
+49772
+51204
+49328
+50948
+51204
+44144
+50500
+54788
+49345
+52285
+47452
+52285
+49692
+49888
+50948
+51200
+53469
+54788
+45432
+48177
+44256
+45768
+53441
+49444
+48152
+54785
+47161
+51452
+49888
+51200
+49324
+54077
+49324
+44032
+48708
+51060
+49324
+51060
+51221
+51204
+44048
+47588
+45800
+51200
+54252
+44396
+54588
+49548
+52264
+50948
+51200
+51452
+51340
+50864
+50521
+48516
+51216
+54616
+54596
+53440
+49324
+50668
+51068
+48520
+51089
+44396
+45397
+53825
+45768
+54732
+44144
+50857
+50752
+52392
+49437
+52852
+54252
+54056
+54924
+44033
+47308
+54637
+54633
+50577
+48177
+48277
+47749
+44032
+51060
+48337
+44600
+54620
+44292
+44452
+51204
+51312
+44368
+52264
+51068
+49324
+54805
+49888
+53441
+44036
+51656
+54644
+45236
+51060
+52824
+44284
+44305
+50696
+51020
+49884
+48120
+51452
+54785
+50976
+50504
+47456
+47784
+51060
+47452
+46041
+52264
+52825
+49692
+44277
+51452
+51032
+50668
+52380
+54801
+44032
+51116
+47140
+44256
+50836
+51221
+52769
+44368
+53132
+51228
+45397
+45453
+51652
+47784
+54980
+44400
+51221
+51652
+51340
+52628
+52840
+47140
+44397
+46160
+51221
+49900
+53448
+48156
+45224
+54952
+48320
+53748
+50864
+44228
+52489
+50500
+44396
+49436
+44305
+44257
+50724
+51456
+51021
+48372
+47049
+51312
+49548
+47532
+50857
+55124
+44221
+54788
+49340
+48176
+49549
+48512
+55148
+47532
+47732
+48729
+48372
+50976
+49324
+54801
+49888
+49688
+50724
+51228
+44144
+51452
+51648
+50628
+47049
+47140
+47000
+47532
+44160
+49688
+48512
+54868
+44396
+54952
+48176
+52380
+54364
+49689
+48708
+48393
+50500
+50628
+48708
+51453
+55124
+48708
+52824
+52285
+51648
+48337
+44396
+54952
+49772
+47049
+50896
+47000
+52285
+51333
+44060
+44288
+48176
+51204
+49689
+49689
+47928
+46020
+45812
+44404
+49688
+54665
+48533
+45817
+54980
+51032
+44592
+52377
+44036
+44221
+52264
+55092
+52285
+52393
+48169
+52824
+44277
+44428
+51333
+44144
+52380
+50696
+50980
+53441
+50780
+46972
+49569
+47497
+54844
+46041
+49324
+48516
+47924
+44396
+45768
+52292
+44160
+52292
+50556
+52824
+49324
+44221
+52393
+50689
+52845
+51204
+50616
+45212
+46041
+51456
+44032
+44172
+50948
+50864
+48337
+50556
+51228
+50808
+54200
+50504
+54413
+53461
+50501
+50501
+54644
+52264
+49457
+44036
+51228
+51452
+49341
+51221
+48176
+50685
+54889
+50836
+45812
+52488
+50684
+50976
+44148
+49436
+52264
+52264
+48512
+54605
+52824
+52509
+47732
+51665
+51032
+49444
+49692
+49884
+45800
+52769
+51221
+50864
+53804
+53804
+48708
+52272
+47336
+52393
+50948
+48516
+49345
+44340
+49688
+52824
+49548
+54624
+48512
+50896
+50857
+47456
+45433
+50896
+44053
+47560
+48169
+51204
+45817
+54840
+44152
+54812
+49440
+44216
+44033
+52285
+52629
+49328
+48708
+54952
+50857
+50836
+53457
+49324
+50521
+48268
+48337
+44032
+53468
+51116
+45817
+44264
+48712
+51200
+45208
+52280
+47280
+52572
+50857
+51312
+52509
+48533
+51333
+50724
+51204
+44396
+52292
+52377
+49345
+49345
+44221
+51228
+49324
+54620
+51109
+44221
+50616
+51228
+49444
+47336
+48708
+54364
+44540
+47144
+47449
+47564
+52392
+49440
+53456
+50885
+46041
+49440
+49345
+49440
+44368
+44400
+53748
+51456
+48373
+55148
+47196
+52285
+44305
+50836
+44592
+46321
+51092
+50948
+44592
+48264
+54812
+52380
+52280
+53444
+50836
+52628
+49849
+48516
+54620
+44208
+50501
+52488
+52280
+46041
+47536
+48513
+44256
+49440
+49549
+54620
+44053
+48124
+50685
+44552
+44032
+52488
+48317
+54413
+52628
+50528
+49324
+51032
+51456
+45453
+52380
+50613
+45817
+44221
+54788
+53132
+44160
+52488
+45812
+44368
+49324
+51116
+52268
+48712
+50517
+50976
+45824
+51452
+51228
+46988
+51032
+51652
+44204
+47609
+47924
+45397
+44221
+51060
+49345
+47157
+47280
+47140
+44305
+54252
+50977
+54364
+52268
+51656
+49324
+50864
+54840
+52828
+52772
+47141
+46321
+50948
+47217
+51200
+52280
+49689
+49689
+55092
+47140
+46972
+52268
+45208
+45817
+50628
+47000
+45229
+51064
+50732
+50980
+51104
+50896
+54805
+52649
+51312
+55113
+49440
+44305
+53468
+44537
+53468
+47732
+53664
+51109
+50500
+53468
+50500
+52840
+53664
+49884
+50672
+50672
+49884
+49901
+45817
+52380
+46160
+48516
+47784
+49888
+46160
+48177
+44557
+47532
+54889
+51077
+47581
+45236
+51204
+50577
+50976
+54036
+44277
+50977
+54812
+54620
+46976
+44277
+52380
+49548
+55141
+48337
+44592
+44396
+51204
+51088
+49104
+50577
+44216
+49688
+44592
+50696
+44592
+52380
+44221
+47784
+50684
+45236
+50644
+47896
+44053
+50684
+52293
+44221
+52293
+51116
+44284
+44221
+47784
+51452
+47784
+44396
+54980
+47732
+47729
+50857
+50976
+49324
+44048
+44400
+45453
+51032
+48120
+49437
+44288
+47805
+52509
+52712
+50896
+47749
+44396
+47548
+48512
+49324
+47729
+48729
+46041
+53468
+44053
+54413
+48729
+54840
+52649
+44208
+54840
+54889
+50556
+45257
+48152
+48520
+48124
+46041
+49849
+47148
+54801
+52392
+51221
+49688
+47588
+46020
+52376
+44256
+51456
+49569
+51221
+50577
+52397
+51312
+45733
+46041
+44552
+44048
+51064
+51452
+51032
+47456
+52285
+47749
+51456
+52572
+49884
+53441
+44552
+47492
+45728
+51025
+55148
+46021
+44452
+48276
+48276
+48276
+48393
+44144
+52376
+44452
+54413
+47785
+51648
+48512
+54413
+48729
+54413
+44060
+54889
+44060
+44048
+46321
+48729
+44048
+55113
+44340
+52384
+50836
+52636
+44201
+45817
+54632
+54632
+52265
+46020
+51312
+46020
+51064
+51064
+52285
+48516
+51208
+50696
+44592
+44036
+52380
+52492
+52628
+47928
+44592
+45800
+54805
+54868
+50756
+44208
+47532
+50900
+50676
+47448
+52825
+44053
+52285
+48520
+52488
+52376
+51312
+49328
+48124
+47161
+51333
+54032
+48324
+44161
+44161
+54252
+51060
+49328
+48324
+51092
+44221
+44292
+44557
+46020
+52285
+44508
+44256
+53440
+51060
+51228
+49604
+44428
+52272
+51088
+44033
+44161
+54924
+51088
+44480
+44060
+53440
+51228
+52404
+44221
+46160
+46972
+52825
+50672
+51340
+49325
+44537
+46980
+51204
+52272
+52285
+44284
+44160
+52265
+47532
+52377
+48708
+48512
+51092
+44592
+52285
+49324
+44053
+50756
+48149
+44592
+52384
+44221
+49452
+53441
+44160
+51228
+48149
+50628
+44537
+44341
+51081
+51204
+53441
+45800
+50725
+44284
+48512
+51081
+44160
+54624
+45813
+44060
+52285
+52380
+49328
+51204
+47449
+47532
+48512
+49340
+54364
+44396
+52488
+44292
+52488
+44452
+54925
+52264
+53441
+47156
+44537
+48317
+50976
+54924
+52488
+44480
+44160
+44160
+45817
+54869
+51228
+44160
+51032
+44160
+51656
+52280
+52268
+47560
+47532
+52489
+50669
+50508
+44428
+54032
+44277
+44032
+47924
+47588
+50676
+44540
+44081
+54801
+51648
+46041
+51312
+45432
+44161
+44396
+52488
+51068
+51200
+47561
+47140
+44221
+47196
+47196
+44428
+44396
+50577
+50780
+54952
+47924
+44305
+54624
+47148
+54645
+54645
+44537
+44221
+44256
+48156
+48124
+52825
+46993
+50857
+50857
+47732
+44537
+54984
+44428
+44221
+47449
+48512
+47609
+47000
+45713
+44060
+47732
+46041
+50865
+50865
+44048
+47924
+50696
+54984
+50745
+49849
+45432
+47784
+47449
+54364
+49464
+51201
+44540
+44053
+52488
+44428
+50577
+50696
+44089
+48264
+44428
+46041
+44144
+45800
+54801
+47588
+54984
+54984
+47140
+50668
+52384
+50577
+44428
+54252
+51089
+44512
+44396
+47928
+44396
+47932
+44512
+47928
+45236
+44060
+44060
+54252
+52509
+49437
+55113
+54217
+44397
+46020
+54633
+54252
+50517
+54252
+48373
+44417
+45813
+44396
+44417
+48708
+54868
+48513
+45516
+49884
+48169
+44396
+51060
+51105
+51109
+44053
+51109
+44305
+54848
+44049
+44257
+48320
+44452
+54801
+51109
+44305
+48708
+54848
+50976
+44452
+44452
+54924
+45800
+44452
+47156
+47156
+49328
+46021
+44396
+44144
+54812
+54596
+44396
+51032
+50516
+50616
+54200
+51061
+44396
+49901
+49888
+52380
+51077
+49341
+51320
+49849
+50724
+55036
+48152
+49464
+49901
+47564
+54868
+54801
+47564
+48708
+51320
+53441
+54801
+45800
+47588
+45224
+45800
+51665
+48149
+49556
+48373
+44288
+48320
+44228
+51216
+51105
+47196
+50976
+47196
+49436
+44312
+50752
+49444
+51208
+51208
+50948
+50521
+44277
+52824
+47896
+51064
+50948
+49548
+51593
+44033
+45212
+52824
+44428
+49324
+55100
+44540
+44033
+50732
+51593
+50501
+44221
+49836
+49328
+50628
+52392
+50529
+52397
+47141
+52293
+50628
+47140
+50500
+50517
+50684
+49324
+51648
+52264
+47217
+50547
+44049
+50528
+51656
+52769
+48169
+51228
+47532
+49324
+54980
+52397
+49688
+51312
+48708
+50896
+52769
+50896
+49345
+50684
+47141
+44432
+54616
+51204
+51452
+44396
+44540
+50724
+44452
+50684
+49884
+47141
+52285
+44048
+47140
+50628
+50684
+50896
+49324
+44361
+47536
+44396
+44144
+44144
+47728
+47336
+51452
+54788
+51204
+52280
+52280
+52280
+52280
+52280
+50528
+52404
+50864
+52264
+44553
+50864
+49933
+48152
+49688
+53132
+48156
+48156
+50557
+49324
+49689
+52384
+52712
+49688
+48320
+49436
+44032
+48152
+49688
+44256
+50948
+49688
+52393
+50696
+52509
+44396
+44256
+44396
+47161
+44312
+46020
+44256
+51648
+44508
+49548
+54036
+51221
+44032
+53468
+51656
+49324
+50864
+44396
+54028
+54801
+54840
+49324
+50864
+52377
+47141
+51312
+44592
+47308
+54861
+47560
+50864
+47581
+55128
+44033
+55012
+50836
+51088
+54633
+44600
+51201
+52492
+46041
+47749
+54980
+51060
+53664
+54693
+53440
+54785
+50556
+47140
+50500
+47560
+50864
+54868
+51032
+44400
+52628
+51064
+53444
+51020
+54224
+54596
+49900
+49900
+44060
+48512
+48512
+54028
+46164
+48516
+50752
+54632
+51008
+54637
+51204
+44228
+54945
+51648
+49888
+50724
+50724
+52488
+45580
+54792
+55137
+52712
+46160
+47928
+54980
+54980
+50724
+44256
+54616
+44512
+50668
+50528
+44201
+47588
+47588
+44228
+51221
+50724
+44256
+48512
+44508
+54980
+52377
+49849
+45580
+53444
+47924
+50696
+53468
+44396
+47141
+54056
+50896
+44312
+44592
+52285
+50724
+50529
+49884
+54788
+48376
+47928
+45768
+47924
+47161
+50684
+50976
+51200
+51452
+44592
+51452
+52393
+55148
+50696
+44592
+54217
+51088
+44256
+51088
+48120
+44396
+44032
+45432
+54633
+48708
+51068
+54952
+49888
+54840
+47749
+45804
+44144
+51200
+44048
+51105
+53440
+46028
+48512
+54252
+54596
+48520
+50521
+54868
+49324
+54868
+54644
+44396
+50689
+48512
+53440
+51452
+50752
+51105
+44256
+44032
+51340
+54252
+47217
+46041
+45397
+53440
+49324
+54788
+54925
+51665
+51060
+50501
+44361
+53440
+55148
+51060
+47148
+51088
+48120
+48120
+51648
+44368
+44600
+51452
+44033
+49692
+52272
+49548
+54644
+54924
+44284
+49884
+46020
+54632
+50508
+55012
+55092
+44312
+50676
+47196
+51060
+50528
+54408
+49888
+46041
+54861
+55113
+52824
+50752
+54633
+51116
+50977
+51648
+44256
+54693
+50528
+44540
+44305
+50500
+45804
+54952
+54596
+54896
+45380
+54868
+54665
+53132
+53440
+49104
+51228
+45453
+47784
+50557
+54840
+50896
+47217
+53804
+48169
+44032
+50500
+54616
+52488
+47532
+45208
+51313
+54616
+44257
+54952
+54788
+47196
+48156
+52384
+52272
+47049
+54036
+47560
+47148
+49632
+48512
+54252
+54620
+54805
+44221
+49444
+44032
+50976
+50616
+44257
+44257
+54056
+54632
+49324
+51652
+51021
+50528
+44217
+46020
+45800
+50756
+47532
+55148
+45817
+49436
+51452
+52264
+50724
+51312
+50500
+46160
+44228
+51201
+52840
+47560
+47568
+54861
+46160
+44163
+47196
+47049
+49604
+51312
+54872
+47021
+49324
+51593
+51200
+50752
+48393
+44552
+54840
+44592
+49688
+50976
+49584
+52285
+50528
+47140
+44053
+50516
+52264
+50977
+51216
+50612
+51204
+47000
+49341
+49437
+53440
+54848
+50528
+51312
+45572
+49845
+53441
+53441
+49345
+51201
+54665
+46988
+50500
+44368
+44053
+53668
+50724
+47928
+52544
+51105
+54848
+44228
+44228
+46020
+45812
+45812
+50756
+51088
+48708
+52544
+52384
+54868
+50500
+44228
+52384
+48176
+47049
+54632
+48708
+49324
+46989
+52293
+51221
+44312
+48149
+51088
+49353
+51204
+44368
+44341
+46972
+50516
+51201
+44428
+53444
+54028
+51221
+46993
+49548
+44144
+45817
+49884
+51228
+50516
+52628
+45812
+44061
+50745
+50948
+45224
+49440
+50977
+52384
+45208
+44060
+54980
+54632
+52393
+51452
+51116
+44312
+50556
+50865
+51020
+51104
+50836
+50501
+47732
+54840
+50868
+52380
+55036
+54872
+54872
+55148
+44040
+51593
+50948
+51333
+50948
+49341
+54980
+54889
+46020
+45393
+55012
+47049
+50976
+49345
+45181
+44368
+50616
+45800
+48516
+49885
+47532
+50557
+49324
+50948
+47896
+50689
+48516
+54271
+44508
+44228
+50976
+44553
+47336
+44257
+49548
+54617
+51228
+50836
+54617
+49324
+54980
+52285
+49353
+50745
+49548
+54861
+54801
+51061
+49325
+47560
+52264
+54624
+54633
+53457
+49345
+51652
+50837
+49688
+50760
+44228
+48169
+50724
+44216
+44592
+44201
+51088
+52264
+46973
+50745
+50732
+49324
+52824
+54840
+49353
+47452
+54644
+49604
+51652
+49453
+54616
+51667
+49604
+51008
+44060
+45208
+45796
+50528
+44053
+53685
+54596
+50724
+50724
+47144
+52572
+52264
+47561
+49688
+51452
+53456
+51201
+51105
+44368
+52649
+44368
+44060
+53444
+49340
+51312
+44032
+50528
+54952
+54364
+47336
+50508
+54616
+44368
+54840
+54812
+44341
+44396
+50616
+52293
+49345
+54728
+54028
+46301
+47560
+47560
+44257
+47477
+46020
+50508
+45817
+50556
+48533
+50549
+49324
+44368
+48128
+49548
+54868
+47588
+50672
+52572
+54077
+47196
+49548
+44592
+52489
+51312
+44480
+52712
+54952
+49884
+54840
+47924
+47308
+44368
+55148
+52629
+53444
+45812
+47925
+49552
+50724
+51456
+48264
+45181
+50948
+52280
+45817
+52629
+45812
+50984
+53668
+51137
+52488
+50676
+55137
+44592
+54840
+47144
+54728
+46321
+50948
+51020
+48149
+44432
+44552
+49900
+44368
+47196
+49324
+50628
+51025
+45804
+52392
+50724
+51452
+44552
+45453
+54896
+54896
+44592
+50501
+51312
+55148
+49436
+44368
+50672
+50528
+50745
+44089
+53132
+50864
+48516
+46020
+44040
+55136
+53668
+45817
+49888
+49352
+48317
+48708
+51020
+52712
+45397
+51201
+46988
+53457
+54925
+50976
+54952
+54616
+50685
+46028
+48708
+51452
+51228
+51652
+54840
+52404
+49345
+54984
+47560
+52272
+52404
+47196
+54812
+48149
+50864
+44368
+51008
+54617
+47925
+54945
+52384
+47532
+47448
+54812
+45229
+54952
+47560
+50672
+47141
+47196
+47217
+48512
+45812
+52828
+48712
+48708
+54693
+54617
+47560
+55148
+53440
+44257
+50628
+52280
+50549
+50577
+51216
+46972
+49688
+54952
+51089
+52384
+55012
+54925
+51204
+49453
+54952
+51105
+47532
+52380
+52292
+47140
+50696
+46972
+45229
+52268
+49548
+55148
+51613
+44036
+51096
+52489
+46976
+49444
+45229
+46988
+46972
+44397
+54924
+51064
+49688
+49324
+51064
+44148
+54924
+49888
+51064
+45785
+45800
+45800
+46024
+44053
+50672
+44221
+54200
+50868
+52285
+54848
+54924
+50756
+50752
+44397
+44260
+52285
+50948
+46020
+50948
+47452
+44397
+44512
+51068
+50689
+44256
+44397
+53468
+44397
+46020
+50976
+44397
+51008
+54844
+54252
+50612
+54632
+50896
+47452
+44428
+50612
+52397
+44397
+52380
+50948
+50896
+44428
+44256
+54252
+50896
+50896
+50517
+49436
+46020
+46020
+45800
+47029
+44452
+50669
+50896
+46976
+46976
+53664
+50508
+53664
+51221
+44264
+48149
+47197
+51077
+50517
+51116
+50864
+51012
+50724
+50724
+44508
+48708
+51060
+51648
+52380
+52380
+49688
+51089
+53461
+44217
+54616
+49328
+44305
+51109
+44592
+45384
+47792
+44553
+44040
+51648
+51648
+54032
+54984
+50669
+44552
+47588
+44512
+44081
+46164
+48169
+48516
+48516
+45812
+44048
+48176
+51340
+44081
+48708
+54805
+51648
+44221
+44592
+44340
+51648
+44221
+44204
+45800
+47141
+54028
+50724
+48516
+52628
+54028
+48152
+45817
+44260
+51200
+53444
+52377
+51060
+44048
+54217
+51216
+44284
+45768
+45824
+48176
+44221
+50521
+48520
+50836
+47449
+44396
+47785
+44032
+44396
+54792
+48156
+51648
+53441
+47161
+51200
+48512
+54840
+52824
+49688
+46980
+47217
+47217
+47196
+50836
+45824
+54252
+48124
+54805
+46041
+44172
+44201
+47456
+51088
+52824
+47336
+54644
+51064
+54980
+53748
+51312
+48373
+44305
+50836
+53440
+53440
+44452
+53440
+50577
+51008
+48268
+44396
+50896
+51656
+54801
+51008
+49345
+49688
+50501
+48337
+51216
+54861
+50500
+44284
+45804
+50836
+45817
+44060
+54665
+45516
+50504
+49457
+54788
+50756
+48169
+48512
+54028
+50669
+51008
+54620
+49436
+49688
+51104
+44221
+50528
+48393
+48169
+44033
+50857
+51456
+54801
+51648
+47588
+46993
+54788
+49457
+50672
+52840
+52384
+46980
+46980
+54252
+51221
+54868
+48372
+49884
+54984
+44284
+44221
+50556
+45392
+51228
+50669
+48512
+50724
+44428
+49604
+48708
+51221
+50756
+44396
+47452
+51221
+44277
+52509
+46041
+53468
+45768
+50516
+52292
+49689
+48393
+44048
+49885
+53440
+50696
+51665
+50669
+48176
+44592
+51456
+44592
+49548
+52628
+45812
+44404
+44284
+45817
+44260
+50696
+44204
+53748
+44540
+44053
+50977
+50501
+48533
+44256
+53664
+47497
+48169
+50528
+52280
+44260
+50504
+49900
+53440
+45516
+46028
+49849
+51064
+54844
+48317
+47144
+44284
+52393
+51204
+54980
+48372
+48372
+50864
+51228
+47924
+44228
+50672
+50508
+44557
+44048
+51333
+50976
+54889
+50501
+50836
+50616
+48372
+51600
+48120
+51109
+46020
+53440
+50516
+54413
+51333
+44228
+51652
+54665
+44053
+52632
+44048
+48337
+47336
+54637
+54889
+48169
+45800
+47564
+49440
+44592
+52377
+44340
+50689
+53457
+49849
+50857
+44060
+49548
+49548
+49884
+47729
+53457
+50745
+51088
+46020
+45817
+44256
+52509
+47456
+48393
+48169
+49352
+51109
+53748
+51204
+50724
+51221
+54984
+44061
+51652
+50528
+44277
+50684
+44048
+51204
+50896
+50728
+49324
+47448
+54644
+46993
+51109
+48393
+48533
+51652
+47197
+47196
+50864
+52280
+47588
+47561
+51204
+49345
+49689
+47336
+51648
+47564
+54364
+44221
+52377
+49436
+52404
+51109
+44048
+50857
+51216
+52280
+52377
+44592
+44285
+51109
+44540
+51201
+49345
+47896
+52572
+50616
+53457
+51613
+44148
+51109
+47049
+50948
+52628
+50836
+51613
+54728
+49440
+49440
+48156
+48373
+44340
+46041
+48264
+44033
+47925
+46024
+46024
+51456
+51648
+49457
+53440
+53440
+45812
+46321
+47924
+48516
+54889
+45812
+45804
+54868
+51200
+44036
+50724
+51109
+44201
+44368
+44036
+50669
+48708
+48317
+51204
+44053
+50556
+50745
+54617
+45800
+46988
+44144
+44340
+45817
+50577
+52280
+54984
+54632
+49352
+54617
+50528
+50517
+46020
+54840
+50672
+51652
+45572
+44305
+47196
+50684
+45812
+50976
+44340
+45453
+47217
+50696
+47141
+47536
+50577
+51204
+54984
+50516
+47280
+54028
+47564
+49324
+51076
+49328
+51109
+51109
+49457
+51068
+47588
+44033
+51452
+51109
+54840
+54840
+44260
+51068
+54840
+49436
+44260
+49688
+47581
+51456
+49688
+51068
+52824
+44256
+52376
+44053
+48393
+48708
+51116
+48320
+49632
+51456
+47497
+48373
+51340
+54616
+54805
+49453
+45432
+54616
+44592
+49437
+50808
+50896
+50896
+49689
+45796
+45796
+50556
+52397
+50827
+44396
+44396
+44592
+47805
+47805
+51064
+44284
+52840
+45824
+45384
+52380
+53468
+48512
+53132
+50836
+50521
+54637
+54840
+49892
+46020
+53468
+46160
+50684
+48708
+51060
+44284
+54801
+53448
+54868
+52380
+50868
+54801
+54028
+47581
+47156
+54872
+51200
+50628
+54252
+44428
+44592
+45236
+48393
+54792
+44053
+51216
+50577
+44508
+51452
+54872
+44228
+44060
+52264
+48516
+54785
+51109
+53804
+51109
+48516
+54644
+54889
+48708
+51312
+49692
+44557
+51204
+50724
+49324
+50549
+48152
+50724
+47924
+50724
+51109
+47156
+53448
+50980
+51109
+49437
+48516
+54876
+48708
+47144
+52264
+50668
+45432
+51221
+45236
+52380
+44036
+51200
+44396
+45212
+53440
+54840
+49440
+48264
+44592
+51089
+50668
+48708
+47581
+54861
+51109
+48512
+47560
+45812
+51076
+48512
+51221
+50672
+54644
+47928
+51333
+54028
+53804
+44592
+44081
+51473
+50836
+44552
+50868
+47896
+48176
+52824
+44208
+51109
+45684
+50504
+45225
+55124
+48516
+48708
+50668
+53440
+48393
+50756
+48169
+47924
+44396
+44508
+53804
+48156
+45768
+52629
+51089
+52488
+45804
+45768
+50896
+51452
+54788
+51656
+50500
+47588
+47568
+52376
+54596
+49888
+52393
+50500
+54868
+54980
+54605
+51221
+48124
+48152
+47784
+48512
+47161
+51088
+51088
+49884
+50684
+49328
+50521
+45812
+51200
+44256
+49324
+49457
+50948
+51088
+44144
+49328
+54217
+51076
+50836
+46041
+44053
+51452
+44600
+54644
+54693
+54876
+50672
+44368
+44396
+47784
+44036
+44036
+51060
+45380
+51656
+51652
+55148
+54744
+54637
+44305
+49692
+44284
+50504
+47749
+47148
+54056
+50517
+50976
+50672
+52264
+49888
+51064
+51228
+44452
+51204
+51088
+50997
+50948
+54861
+50780
+47336
+50500
+50836
+44368
+47144
+48729
+54788
+49548
+47532
+49457
+54792
+47581
+48512
+49324
+47784
+48120
+44537
+52265
+52265
+51221
+45229
+54805
+45224
+50724
+45208
+48512
+45516
+50672
+49888
+51648
+54632
+51228
+51109
+50500
+48712
+53468
+54620
+47564
+50724
+50672
+47924
+50528
+50616
+50724
+49324
+50724
+50780
+47532
+54620
+52628
+52712
+49688
+44592
+54788
+52524
+46041
+52285
+47197
+50528
+50500
+50500
+47336
+47732
+51333
+48512
+44397
+54028
+52292
+47497
+50756
+54364
+54952
+49689
+44592
+55092
+48152
+50752
+50976
+45812
+48708
+48708
+52393
+52392
+50696
+44428
+51221
+54844
+44221
+44036
+51204
+54665
+44256
+50756
+47000
+48708
+51064
+51452
+51089
+48512
+51221
+47200
+50504
+46988
+54844
+51020
+50500
+44144
+47140
+51204
+54788
+54868
+54925
+50689
+49440
+49900
+51221
+53461
+50836
+47924
+45224
+50556
+44032
+50976
+49436
+50864
+50948
+51228
+50976
+48120
+45812
+45576
+52828
+55064
+50725
+51204
+52632
+47896
+48512
+51200
+45800
+51060
+51473
+47588
+54889
+47732
+50516
+50689
+55012
+44060
+50948
+48120
+50896
+51221
+52628
+51228
+49444
+53440
+47144
+47784
+50684
+49884
+54200
+50948
+50780
+50976
+54840
+50724
+52393
+48372
+49688
+50976
+44508
+52628
+50836
+48708
+49885
+50896
+51081
+50857
+50837
+52824
+47448
+48120
+48152
+50728
+47560
+44396
+44340
+51652
+44032
+49688
+51652
+50896
+52264
+50857
+47749
+50549
+51656
+49548
+45544
+54800
+46020
+48169
+46993
+45544
+50836
+50528
+48708
+48712
+50696
+54364
+44396
+47336
+49440
+47564
+50696
+51109
+44053
+50857
+45769
+47532
+51201
+44508
+50616
+44540
+51204
+54637
+52293
+54620
+45576
+47196
+47784
+49436
+54840
+54840
+50724
+45576
+51109
+47560
+48324
+44256
+47924
+52488
+53440
+49440
+47896
+54620
+54620
+47925
+47308
+47144
+54925
+44508
+46321
+51649
+49688
+51068
+54868
+44553
+44452
+50836
+55148
+50672
+49440
+44368
+48120
+48152
+48264
+49452
+51032
+54924
+44368
+48152
+49437
+54224
+49440
+49688
+51109
+47156
+54788
+55136
+45544
+46041
+51032
+52280
+50528
+50577
+45397
+47560
+51312
+49688
+51652
+51088
+50668
+48712
+50689
+50976
+45236
+50684
+45824
+50689
+52280
+45544
+54869
+50689
+47732
+48708
+47560
+49900
+55141
+45769
+46021
+47448
+50672
+46976
+50672
+49345
+47161
+44368
+50577
+46976
+49452
+50689
+49933
+55092
+44428
+48120
+47532
+47144
+50628
+52489
+46976
+51088
+54792
+44432
+44432
+44277
+51081
+51088
+51088
+51316
+49552
+48512
+54056
+51088
+54952
+49888
+47609
+49324
+53468
+54252
+44228
+44256
+45432
+54617
+50976
+51204
+54644
+49328
+49552
+50948
+47736
+51333
+44036
+49689
+51092
+50500
+51088
+51032
+48512
+51088
+47532
+54617
+48317
+50976
+45236
+50620
+50620
+50689
+49328
+47732
+51200
+50857
+53440
+44480
+53469
+44417
+50864
+49688
+50504
+44032
+49569
+50756
+50977
+50836
+44361
+51032
+51221
+51456
+48373
+51452
+53461
+54945
+51333
+44288
+51452
+51221
+50756
+51032
+48372
+49892
+49892
+52509
+49900
+44061
+49440
+49892
+50976
+54872
+51060
+51312
+49884
+54732
+44417
+49457
+44400
+44417
+54952
+51116
+51088
+54252
+54644
+50672
+49548
+44032
+49900
+49888
+50857
+54889
+48128
+44396
+44288
+48712
+49689
+52292
+51104
+51201
+50896
+44592
+51064
+48128
+44396
+44148
+52628
+51221
+44148
+48512
+45397
+48337
+54872
+47588
+52840
+54620
+50864
+49885
+45397
+52840
+45397
+52824
+50976
+48372
+44288
+45397
+52840
+47561
+52272
+44396
+44284
+52840
+54848
+50724
+50836
+49892
+50689
+52292
+49900
+50948
+49324
+44288
+54812
+50836
+51456
+54872
+50696
+51032
+48372
+52828
+52509
+48372
+54413
+52492
+45824
+49324
+49900
+46020
+47456
+45824
+49688
+54028
+48393
+48512
+48512
+49324
+44537
+51109
+51109
+51204
+50948
+51316
+49900
+51452
+45824
+46020
+49548
+51208
+49548
+51060
+51060
+51060
+49548
+52392
+49689
+51652
+49345
+49345
+47560
+44032
+49345
+47308
+49440
+49440
+44260
+50773
+50773
+50864
+47308
+47308
+50836
+48169
+50773
+50773
+50773
+44060
+50836
+53440
+44480
+51333
+52712
+44048
+44264
+52628
+53748
+44048
+52628
+49884
+50980
+52377
+44256
+45768
+51652
+48120
+50836
+44397
+48708
+52789
+55148
+48708
+44144
+44228
+51204
+44404
+52404
+44228
+50725
+52488
+49884
+49884
+48337
+44537
+49444
+51652
+55148
+45768
+51204
+49436
+52492
+47564
+50500
+47336
+48337
+52404
+48708
+49549
+49453
+46020
+47336
+45572
+49324
+52789
+51060
+44396
+49453
+44396
+44368
+47308
+44368
+49549
+55148
+51340
+46164
+50669
+49328
+51221
+49440
+47141
+50508
+46020
+54924
+54861
+55128
+44592
+51064
+50732
+54620
+49888
+49436
+52636
+49464
+44592
+51064
+50900
+54032
+50836
+50521
+54616
+47932
+51208
+50517
+44553
+44204
+48516
+50756
+44592
+51104
+44216
+44592
+52264
+44060
+44396
+44053
+54788
+50724
+46988
+46020
+54028
+51089
+51089
+50521
+44144
+44053
+44032
+44396
+54792
+54028
+47549
+52488
+51200
+50516
+48520
+49688
+44049
+47161
+53440
+48708
+50976
+45824
+54637
+50501
+44396
+54840
+48177
+48124
+50504
+52488
+47161
+51648
+54217
+46041
+51216
+44508
+49688
+47896
+46041
+54617
+50669
+48320
+54633
+54633
+46973
+50529
+48512
+49692
+51656
+47456
+51008
+51060
+54644
+51204
+46041
+51060
+47784
+44053
+50504
+50948
+54872
+52824
+48128
+47532
+44228
+46041
+50808
+50864
+49345
+54801
+47532
+50836
+44368
+51137
+47564
+44368
+50500
+50500
+50837
+49324
+54252
+52488
+44512
+48393
+48393
+45432
+47532
+50976
+54788
+54945
+46020
+49888
+49457
+46020
+44221
+51456
+54840
+54801
+51008
+50612
+46993
+44048
+47196
+47000
+54744
+44033
+44277
+49709
+54868
+45813
+47548
+54868
+44144
+47000
+44592
+48124
+44260
+44260
+51460
+44256
+52572
+50528
+50528
+44053
+47452
+50980
+47497
+44404
+53440
+51137
+44285
+51020
+46041
+51137
+51137
+50948
+54952
+48708
+50628
+49709
+52393
+48533
+51460
+44404
+46041
+52280
+44256
+51020
+52824
+51593
+54889
+50976
+50808
+50577
+48393
+52628
+46024
+52404
+51060
+52824
+49884
+51116
+50836
+50501
+51452
+44048
+47456
+50616
+48120
+44048
+54812
+54812
+50756
+51221
+49849
+48120
+44048
+47924
+50864
+51333
+45224
+44040
+50516
+50516
+50808
+51333
+49324
+49464
+50689
+44284
+44552
+50976
+44592
+47336
+46020
+53748
+44228
+50745
+52285
+45817
+54805
+44152
+50528
+47448
+50724
+49709
+44256
+51088
+50808
+54077
+51204
+52264
+44216
+50857
+50620
+52264
+52377
+49884
+50557
+51333
+51333
+44053
+44368
+44053
+49328
+52404
+52280
+51221
+46020
+47336
+51109
+52280
+52280
+50724
+51312
+44396
+51109
+52712
+52280
+46020
+46020
+49845
+50948
+48176
+47469
+49345
+51613
+54028
+44552
+52488
+50628
+47196
+51092
+47536
+47308
+47308
+52840
+46321
+53440
+51456
+44368
+44432
+50836
+52488
+50836
+44432
+52392
+50669
+54617
+45453
+50629
+50629
+51032
+50508
+54744
+51665
+54644
+44040
+49688
+51648
+50724
+51396
+48120
+51032
+50689
+46020
+50689
+51208
+49436
+50501
+51008
+49688
+52272
+47140
+55092
+47217
+47217
+51204
+50689
+55148
+44397
+52280
+50689
+44508
+50516
+50808
+45432
+44428
+52488
+52268
+47564
+51204
+51204
+50620
+50516
+50516
+54732
+45432
+54732
+52380
+44340
+52380
+51452
+54889
+44221
+49692
+49548
+49548
+47157
+44277
+51340
+44368
+44144
+44277
+44145
+47924
+48512
+48512
+52264
+44396
+44396
+44592
+51060
+49324
+54028
+52824
+49548
+54637
+51060
+44540
+49552
+44428
+54047
+49552
+44148
+48520
+51105
+51105
+49884
+54252
+51221
+49688
+48276
+45393
+49324
+48516
+54028
+51648
+55148
+54840
+45812
+50948
+51109
+53461
+45824
+47568
+54588
+47568
+52393
+48520
+47156
+51656
+52628
+48177
+52824
+51228
+47589
+50669
+50696
+48337
+44049
+44428
+45376
+49688
+45824
+51221
+49464
+52488
+51652
+49324
+44400
+49437
+48169
+45824
+44480
+51452
+48337
+51109
+51204
+50756
+45824
+50976
+49345
+49341
+44592
+52293
+44341
+47784
+46020
+54980
+51221
+49688
+47729
+50948
+50501
+54253
+44060
+48169
+48337
+45393
+44277
+48152
+54889
+46020
+47729
+44032
+46321
+55064
+51333
+49340
+47564
+47561
+54364
+44341
+52293
+47561
+48169
+51109
+44221
+52380
+48373
+52824
+47924
+48264
+45817
+54224
+54224
+51109
+47729
+51312
+52392
+48516
+47805
+48169
+51452
+47736
+51452
+51208
+54732
+46976
+44036
+54217
+50672
+44204
+48337
+48337
+54665
+44036
+50836
+54872
+50976
+50976
+44592
+50628
+48708
+52397
+52769
+44305
+51109
+51200
+44221
+48708
+44552
+46024
+49345
+44592
+50500
+55124
+44060
+49436
+47140
+47924
+50517
+44256
+51025
+51200
+54252
+51216
+50517
+47896
+44221
+51088
+48512
+46041
+48169
+54224
+49345
+51032
+51656
+51312
+52824
+55092
+46020
+51340
+54952
+46020
+44592
+44256
+48169
+51221
+50976
+54252
+48337
+47497
+47000
+48708
+51201
+50516
+49436
+44053
+50857
+53441
+49569
+49436
+44221
+50864
+50976
+47896
+49688
+52769
+49345
+54224
+44396
+54633
+50808
+47448
+54616
+50684
+45229
+49688
+52824
+48512
+44221
+44396
+44396
+44540
+50724
+44285
+47336
+51020
+47308
+45824
+47197
+51060
+51452
+51204
+46020
+49884
+55136
+47896
+52285
+47924
+54224
+44305
+44275
+44340
+48317
+51109
+54644
+47492
+47492
+47308
+50668
+51201
+50689
+49440
+52397
+50745
+47140
+52397
+51064
+49692
+50672
+51221
+51201
+48149
+44148
+54924
+45236
+54924
+44277
+51077
+44060
+48320
+51060
+44592
+45453
+48516
+44144
+44048
+54785
+51109
+54224
+51061
+51068
+51060
+49340
+49885
+51060
+49884
+49884
+44417
+51312
+51064
+54840
+48520
+54861
+50724
+53748
+51060
+44053
+54028
+49888
+51228
+51109
+44404
+46020
+48512
+51200
+48120
+54788
+54840
+52488
+45432
+44221
+51652
+51060
+48120
+54872
+47564
+49548
+50557
+54788
+44221
+46024
+51109
+44053
+44053
+48533
+53444
+44053
+54596
+54596
+49453
+53444
+44148
+44396
+44032
+48156
+54596
+44396
+51204
+48324
+49548
+53444
+54869
+44053
+54945
+48120
+54869
+47564
+54869
+44228
+44228
+44480
+45817
+47197
+47197
+45800
+54812
+52404
+55064
+55064
+51060
+51060
+51060
+51060
+54869
+54869
+49340
+54805
+47928
+46041
+50616
+50616
+50865
+47532
+52292
+54364
+51312
+48712
+54077
+50857
+54364
+52285
+50689
+47532
+52377
+48149
+53440
+44553
+48169
+49569
+50669
+50773
+52384
+54588
+51648
+47161
+48520
+50773
+51221
+51312
+50773
+44221
+45824
+49436
+49692
+55124
+50577
+54924
+50984
+54980
+47456
+51221
+52377
+49436
+44221
+46020
+51333
+51333
+47000
+51333
+46301
+48176
+49324
+47144
+44592
+49345
+52824
+51333
+51452
+47000
+50612
+49453
+52264
+44148
+49884
+44032
+54200
+54889
+48373
+49692
+50948
+48169
+50836
+48120
+54812
+51221
+54364
+51228
+45909
+51669
+51669
+48324
+45909
+51333
+52384
+50836
+50808
+50836
+55064
+48120
+47329
+50577
+54252
+44396
+49900
+49900
+54596
+50613
+47477
+51064
+46020
+51221
+44060
+44592
+51064
+51064
+52380
+53456
+53945
+53945
+44036
+55128
+53468
+52492
+51648
+47581
+47581
+54812
+48276
+51025
+52392
+48124
+48124
+52649
+52649
+50724
+44553
+50724
+55148
+44060
+50864
+50756
+52509
+51333
+53132
+50668
+48320
+44592
+51648
+52684
+52840
+53468
+46024
+44160
+50684
+54844
+55113
+45684
+50773
+54744
+55124
+44053
+54848
+55176
+48516
+48512
+53468
+51333
+47924
+50864
+52285
+52285
+44144
+50696
+54252
+52488
+48124
+48708
+51089
+51608
+50521
+44396
+48152
+45432
+45432
+51221
+54028
+54252
+52393
+44256
+54840
+51200
+45804
+50689
+49324
+51452
+51228
+53468
+51060
+46028
+50864
+48512
+44553
+54217
+49457
+50896
+45768
+44340
+48520
+55148
+54596
+50976
+44161
+54788
+52509
+48337
+54889
+50900
+52636
+54588
+52636
+49892
+53444
+50689
+52509
+45824
+47568
+44592
+50669
+52824
+51076
+49692
+49884
+55184
+47196
+54637
+44305
+47784
+51648
+54801
+47144
+51312
+54889
+51656
+54840
+44277
+44452
+54637
+49436
+44368
+49436
+49324
+44284
+44508
+50577
+50640
+54924
+52825
+44292
+51060
+55113
+44340
+47536
+54924
+51088
+55100
+52824
+49345
+45685
+54620
+51008
+44033
+53685
+45392
+44277
+51204
+49885
+55137
+50676
+48337
+44036
+45909
+54812
+50501
+44508
+53685
+50684
+44060
+52769
+45516
+50868
+47581
+50857
+50857
+50672
+48708
+44260
+52488
+50676
+50668
+49436
+44228
+49892
+52384
+47536
+51228
+54620
+54840
+54801
+52377
+54252
+51021
+44204
+54924
+55148
+54056
+47928
+50696
+54805
+49569
+51204
+51221
+47532
+50724
+50724
+50976
+47532
+47049
+54872
+52509
+50613
+50676
+47532
+45768
+45516
+50501
+44033
+54788
+44036
+50724
+48124
+51333
+48708
+48708
+45909
+52684
+52285
+48124
+47140
+44228
+44288
+44288
+54665
+46020
+52376
+44277
+52392
+47200
+49437
+44048
+44260
+45377
+51221
+52628
+46024
+44284
+52392
+47049
+50756
+50896
+44552
+44592
+46988
+52285
+54841
+54868
+44428
+45812
+52377
+52377
+45393
+47581
+52384
+54848
+54844
+49437
+52285
+55124
+50976
+54812
+50501
+49604
+52509
+54788
+49688
+51216
+44396
+52280
+51669
+45909
+48708
+54801
+52280
+53444
+44288
+53440
+45516
+50868
+49345
+52684
+52393
+54889
+51456
+44221
+50556
+49457
+52769
+54200
+54844
+49688
+51228
+52488
+49688
+48156
+49440
+50808
+44201
+44148
+50948
+50976
+50976
+54605
+55012
+54872
+48124
+54085
+51032
+47732
+50857
+44172
+49345
+51020
+50501
+49900
+47924
+44032
+44033
+50864
+50528
+54801
+50616
+50672
+44048
+50728
+52509
+49352
+47497
+48516
+50689
+44452
+44340
+44033
+44277
+50868
+49548
+49548
+44592
+50836
+49569
+54889
+51656
+44264
+44396
+52285
+45769
+54801
+44060
+51221
+50857
+52488
+49552
+49888
+48149
+44060
+50896
+54644
+55124
+50857
+50521
+50984
+49548
+46020
+51008
+51088
+55093
+44216
+53468
+54889
+50728
+49888
+47749
+44277
+49453
+51333
+54364
+47784
+47784
+44341
+52825
+52280
+52280
+52280
+52572
+48124
+53945
+51109
+53685
+50724
+49345
+47564
+44288
+44033
+51312
+44396
+54812
+44060
+47144
+50864
+51333
+44540
+51008
+47140
+49345
+50948
+45800
+47564
+44036
+49845
+50857
+44221
+44053
+51228
+51665
+47336
+44428
+52377
+52377
+50837
+48729
+47308
+52509
+50864
+50857
+52824
+53685
+45817
+44172
+54728
+54077
+48708
+48324
+49692
+44368
+51613
+51228
+50672
+48729
+44452
+54812
+52488
+51669
+51008
+51008
+55148
+55148
+53444
+45812
+53440
+45824
+45824
+49549
+44432
+52293
+54952
+48152
+48516
+47196
+47196
+46041
+44048
+44172
+54620
+48124
+44221
+47308
+47924
+52280
+55100
+52628
+54732
+49900
+49849
+48317
+50613
+52488
+49452
+45516
+45812
+53444
+44221
+49569
+44048
+50836
+50808
+54872
+46041
+44540
+44540
+44144
+51312
+44036
+54644
+51025
+50724
+47924
+50669
+47492
+49353
+51456
+54924
+47928
+46972
+50528
+47492
+50684
+44292
+54616
+52404
+50668
+51008
+45824
+47805
+50528
+47805
+45824
+51228
+47560
+46988
+47928
+51452
+52824
+45208
+45208
+50684
+50577
+48149
+52824
+44305
+44305
+50864
+48512
+47448
+47736
+51669
+54812
+52280
+47805
+45208
+54924
+54788
+50577
+52280
+44592
+44396
+54872
+49453
+51032
+50672
+45212
+47560
+45817
+54869
+45817
+45817
+45817
+44284
+50900
+47924
+51092
+49696
+49688
+50997
+55148
+49457
+50500
+44228
+44032
+51092
+51109
+54841
+52285
+51204
+46041
+52377
+50508
+51656
+51201
+50508
+44537
+49884
+44048
+51665
+44508
+44060
+46321
+51204
+52285
+44032
+51204
+51208
+50669
+51204
+51064
+50977
+55148
+51204
+55148
+55148
+52265
+45824
+44396
+54840
+54840
+54840
+50529
+49324
+53468
+47896
+54840
+47140
+48169
+49548
+54200
+51216
+44221
+49345
+51060
+51032
+49440
+54840
+48708
+50684
+49688
+49688
+51116
+52272
+44396
+47477
+48373
+48176
+53440
+51081
+48520
+51077
+51116
+53441
+51109
+51089
+44053
+50864
+50864
+54620
+49888
+52264
+53440
+55128
+44396
+50732
+46024
+52380
+51665
+51064
+54869
+47928
+49548
+50577
+45684
+48516
+52264
+50864
+44553
+44552
+48152
+44040
+50612
+48512
+50724
+49437
+48708
+51648
+51088
+50529
+46024
+51312
+49849
+44592
+50672
+44305
+48320
+52488
+44396
+47928
+44264
+50900
+44208
+54028
+52840
+52840
+49849
+50868
+50756
+45580
+50613
+49436
+51312
+48512
+53804
+46160
+54637
+51208
+48512
+47924
+54252
+48156
+50836
+53469
+45800
+44396
+47452
+52285
+44512
+54840
+48372
+48337
+51648
+54217
+50684
+54252
+54588
+53468
+50976
+51652
+51200
+50521
+54252
+54616
+45768
+49444
+51200
+51656
+48708
+51105
+47568
+47588
+49888
+50517
+52628
+44161
+48124
+52629
+44032
+48520
+51092
+51452
+45800
+53441
+47924
+45392
+45225
+48512
+54252
+48152
+48149
+47161
+45208
+44340
+44216
+44144
+52377
+48156
+53440
+53440
+50836
+44396
+51320
+48320
+52488
+48176
+48176
+51200
+51032
+44144
+54869
+47217
+44036
+51105
+50745
+46976
+45397
+48156
+53469
+52380
+55124
+44292
+49885
+44600
+51613
+45784
+44277
+44277
+44428
+51204
+51316
+52272
+44256
+52824
+54801
+52293
+54924
+54217
+50696
+49845
+45208
+48317
+51648
+44312
+51656
+54869
+53440
+53440
+51648
+49444
+50504
+47217
+51652
+44201
+44368
+44256
+46041
+45208
+46020
+47148
+52264
+47140
+51217
+50508
+44208
+47148
+44144
+51648
+47144
+50500
+44284
+45804
+54801
+50836
+45817
+44368
+51137
+51228
+54844
+51104
+50864
+50528
+49464
+45208
+51340
+48156
+44221
+52404
+51652
+51221
+49324
+49324
+44221
+47588
+47217
+44397
+48169
+44204
+51021
+51221
+50672
+45516
+47564
+54801
+49341
+48393
+44260
+50724
+44400
+44396
+53685
+44260
+54785
+46020
+52265
+48512
+46980
+54036
+54620
+49548
+45216
+50672
+52769
+49569
+50556
+44033
+54252
+50756
+52377
+51456
+50696
+51116
+47140
+49688
+53448
+47196
+49552
+48337
+44160
+54872
+46020
+48120
+50756
+44552
+48393
+49324
+47148
+48124
+47928
+48512
+54056
+44144
+46020
+50752
+50528
+44428
+50501
+52509
+51204
+52628
+52393
+53468
+48516
+45216
+50684
+45516
+51320
+50508
+49436
+55124
+51137
+51216
+49548
+47452
+52397
+44053
+52384
+49688
+46020
+48512
+51200
+51109
+54844
+44592
+46020
+44217
+44592
+48176
+49689
+44204
+47497
+50529
+50500
+44404
+51137
+47049
+44312
+50696
+54841
+49452
+51221
+50557
+52292
+53456
+52404
+48533
+51217
+52377
+44277
+52628
+50628
+51312
+52628
+44397
+52392
+44204
+44557
+48176
+49688
+44172
+47196
+44341
+47749
+44221
+52377
+53444
+47609
+49452
+49548
+44288
+54077
+50672
+45209
+44036
+51221
+52628
+51204
+50976
+50672
+44508
+45224
+54945
+50976
+48317
+50808
+49884
+51452
+49440
+47896
+51228
+50676
+49341
+49884
+52509
+52840
+51021
+49692
+54889
+54200
+50577
+54872
+50628
+51104
+50516
+49436
+50508
+50501
+44061
+52684
+51593
+52404
+46980
+46980
+51221
+44060
+52628
+52628
+46028
+44172
+55064
+44557
+52649
+49325
+49444
+49444
+50896
+44148
+50556
+49341
+49324
+48176
+50836
+47736
+52380
+46988
+50728
+55136
+52280
+44033
+47336
+52509
+44557
+44368
+44396
+44552
+50857
+44033
+52628
+52404
+51204
+49552
+49552
+48149
+55093
+50857
+48169
+52264
+49548
+44049
+50836
+46020
+51648
+45433
+46989
+47156
+49688
+44396
+44256
+54732
+49325
+49345
+51652
+47736
+50529
+52628
+45769
+49440
+53457
+44152
+45817
+48152
+48152
+53457
+47456
+46020
+44264
+52824
+50752
+54624
+44148
+50728
+52285
+51204
+51652
+44201
+55092
+45769
+44428
+52264
+52265
+44201
+50724
+51008
+49453
+44053
+49453
+53552
+54028
+50836
+48712
+49688
+53444
+49332
+49328
+49689
+44508
+50857
+52285
+44341
+48337
+48393
+49556
+51228
+52404
+49688
+51201
+47144
+45817
+47532
+44288
+47197
+46972
+47336
+52509
+44060
+54840
+49324
+52285
+53461
+54868
+52572
+45236
+47560
+51109
+44508
+50689
+52377
+50724
+51648
+52404
+47564
+52280
+44396
+51200
+49353
+45800
+52488
+47784
+47784
+51217
+49452
+44221
+54364
+44053
+51020
+44396
+44204
+47029
+44201
+50689
+44452
+45236
+48324
+47196
+46024
+54620
+50672
+44480
+51104
+51032
+51104
+53489
+53489
+49332
+50836
+54945
+49436
+44048
+44305
+53457
+51456
+50672
+47536
+51613
+55064
+45817
+44368
+44537
+49452
+53456
+53444
+52384
+48156
+52264
+51208
+52488
+47308
+48516
+47924
+54952
+54028
+52524
+52265
+52268
+53440
+48149
+55136
+46024
+47144
+54925
+55184
+47196
+44368
+52268
+45804
+44048
+44368
+44284
+44160
+44036
+50745
+47280
+45229
+45432
+52380
+52265
+53469
+48149
+52265
+44201
+45817
+49353
+51312
+44221
+44221
+54872
+51217
+44552
+54924
+45812
+55092
+44040
+48317
+48317
+50724
+44144
+50685
+50508
+47609
+49688
+48120
+51228
+45824
+53441
+46020
+54805
+46988
+52272
+44144
+50556
+50976
+50685
+50685
+51032
+54868
+51208
+48712
+45397
+44033
+52377
+51600
+54869
+47560
+51204
+55184
+47157
+53444
+54028
+49688
+47196
+47141
+50836
+51201
+48152
+50577
+47280
+52272
+53552
+52268
+47144
+54732
+44400
+54869
+47141
+46980
+54872
+50689
+47196
+47217
+44148
+44144
+52268
+44148
+46976
+49452
+50689
+48120
+50577
+52280
+50689
+52268
+55092
+49453
+46972
+44400
+48120
+47532
+52268
+47144
+53444
+52524
+47140
+51204
+50752
+45817
+44368
+54869
+46988
+46972
+45229
+51648
+44592
+44452
+44592
+49900
+48373
+48373
+49688
+44256
+50976
+44060
+51060
+44277
+44036
+48152
+48169
+51221
+48149
+52392
+44396
+48124
+47924
+44256
+44049
+52293
+54952
+48120
+52629
+44201
+54876
+49436
+44368
+48124
+51652
+44396
+49888
+53448
+50612
+52825
+50724
+54056
+49436
+44368
+53448
+47156
+45393
+54224
+52285
+51204
+52384
+51060
+44048
+49328
+44284
+50684
+46024
+44592
+53804
+54952
+52384
+44368
+44221
+50577
+54633
+48124
+49688
+50528
+44256
+50528
+51221
+51201
+51652
+48512
+49688
+47308
+44396
+54788
+54924
+44368
+49440
+44368
+53441
+46160
+47156
+54224
+53468
+54952
+54952
+47928
+54617
+51228
+51228
+51116
+48712
+44033
+51116
+47049
+48708
+48152
+48152
+46976
+50976
+46976
+48120
+46160
+49849
+50836
+44032
+44257
+49324
+44032
+50976
+51664
+44033
+50508
+51452
+52629
+44540
+52377
+51008
+48512
+51109
+52280
+44396
+51089
+52280
+45800
+52265
+49324
+49888
+51089
+52265
+44540
+47536
+52265
+52489
+45800
+52489
+48169
+44060
+54637
+50612
+49884
+54056
+50976
+47728
+48169
+44592
+51204
+47784
+50668
+54056
+54588
+47448
+48512
+48169
+49440
+51221
+51221
+45768
+51313
+51312
+51032
+47448
+49548
+44148
+50631
+51032
+44592
+52824
+48264
+54364
+48264
+51204
+44340
+49688
+50668
+47924
+44592
+44592
+44592
+54868
+51068
+45800
+44396
+51648
+51312
+54801
+46020
+49692
+50865
+50865
+46972
+44036
+54620
+45824
+51201
+50864
+52280
+49884
+44305
+50577
+49884
+50773
+48124
+48124
+46024
+52632
+50724
+50980
+54056
+50521
+52769
+54032
+44161
+44260
+49849
+54840
+48169
+54840
+44228
+52285
+55012
+47749
+54844
+48516
+44552
+47932
+50669
+49437
+55124
+50672
+52769
+48169
+50837
+49888
+44144
+50577
+51104
+48337
+49457
+50689
+54788
+48520
+51652
+47161
+52632
+54840
+47588
+51089
+47568
+48320
+44396
+54844
+49548
+51333
+49884
+54616
+50865
+48708
+51656
+47896
+45769
+52285
+50728
+46041
+50528
+48337
+50521
+51452
+47217
+54788
+44305
+51312
+51312
+49884
+54889
+54889
+55012
+44340
+44284
+44368
+51652
+51656
+51652
+49345
+46041
+54861
+50504
+54644
+54693
+49604
+54952
+50685
+54984
+55064
+54632
+54620
+51456
+47564
+54788
+44260
+51452
+55148
+49457
+49457
+54252
+51208
+51208
+50724
+54872
+54924
+54840
+49888
+47564
+51204
+53441
+49688
+51452
+48372
+44221
+49437
+49452
+50696
+49437
+52397
+44228
+51221
+44480
+51221
+50669
+51648
+50516
+50896
+47548
+47049
+52285
+50773
+54952
+51104
+48708
+55012
+54872
+51060
+44032
+54984
+55064
+48512
+48124
+44508
+44040
+50689
+46020
+50948
+49436
+52397
+47924
+45224
+44036
+45212
+50516
+50577
+52632
+50836
+52264
+48372
+47749
+44368
+44060
+44256
+50745
+52285
+44592
+54840
+50504
+47141
+50528
+44592
+44228
+47928
+51104
+49444
+54840
+47784
+47561
+51333
+45769
+51109
+54812
+54253
+54620
+49440
+51204
+47308
+49452
+53444
+44221
+48324
+47536
+46024
+55148
+50640
+44592
+54889
+53468
+50685
+50685
+50669
+45812
+46041
+54952
+48708
+45812
+51312
+54840
+50669
+54693
+49457
+49340
+44368
+54252
+44221
+50684
+50528
+50685
+50976
+49436
+47805
+54984
+50836
+54253
+47140
+49888
+44305
+52393
+47308
+50672
+54869
+47140
+55148
+50997
+47217
+45229
+46972
+46976
+49604
+45817
+50628
+52489
+50760
+50517
+44257
+50696
+44221
+50696
+54848
+44040
+49436
+51312
+51312
+52380
+47564
+51613
+51613
+52404
+52572
+52280
+50865
+54924
+51064
+44152
+48516
+48708
+50900
+50976
+50896
+48533
+48152
+48373
+47161
+44404
+44396
+49464
+45685
+51312
+49325
+51664
+46993
+45229
+51204
+47749
+54889
+47581
+46024
+51312
+44592
+44592
+50689
+51333
+47581
+46041
+46993
+47196
+47805
+47217
+47785
+48712
+48120
+47568
+48376
+52272
+52636
+52636
+47792
+51452
+51064
+54036
+48149
+53440
+53440
+46020
+47141
+44396
+44452
+44508
+48708
+54980
+51221
+51088
+49332
+51077
+51105
+44428
+52380
+50864
+44036
+50724
+52264
+49340
+49692
+48276
+50732
+51088
+51060
+54665
+51116
+52492
+51064
+54364
+53441
+52404
+51109
+47581
+52824
+51061
+44264
+44417
+46160
+51060
+44592
+49549
+44053
+51312
+47785
+49328
+54924
+47000
+44396
+47581
+50577
+47560
+52488
+51648
+50896
+54637
+54224
+48176
+44152
+46041
+44256
+47896
+54744
+51200
+52632
+54028
+49688
+54868
+49900
+50976
+51200
+52632
+49569
+54032
+49569
+44161
+50900
+51652
+44396
+44228
+47784
+48708
+48708
+50773
+50521
+48169
+48516
+50696
+48512
+45224
+49437
+54840
+50556
+46160
+49900
+52840
+50836
+51076
+50696
+50752
+47588
+51312
+44284
+51648
+51333
+50868
+54868
+49849
+52628
+51312
+44204
+47141
+54840
+44204
+51221
+49569
+52285
+54413
+45800
+54952
+52840
+44256
+54217
+51060
+49884
+51648
+44312
+54952
+44032
+44032
+44396
+54252
+47568
+49444
+50685
+50685
+49884
+50620
+54588
+53440
+51060
+47161
+48337
+45768
+46989
+54868
+48152
+48276
+51333
+45824
+49324
+50689
+48512
+48177
+47784
+44048
+52832
+50684
+50976
+47924
+49548
+49569
+51088
+54633
+50976
+49888
+44144
+53441
+51089
+45224
+51200
+50689
+51200
+51656
+49324
+49324
+45800
+44256
+54252
+44396
+50836
+48520
+44036
+48156
+46028
+44032
+45236
+51452
+48708
+50976
+49884
+52293
+49324
+52629
+48176
+49884
+44312
+49324
+50836
+51221
+51221
+49884
+52824
+47448
+47784
+54924
+50689
+52293
+51312
+54364
+51092
+51600
+47217
+46041
+47196
+49373
+47141
+46976
+50689
+49688
+49692
+51204
+44228
+51221
+49436
+50984
+52404
+54637
+51664
+47140
+49353
+44292
+44036
+48337
+51076
+44368
+48177
+51076
+54413
+51088
+49688
+50696
+52264
+54728
+51452
+52380
+51228
+51060
+51060
+50865
+48268
+44277
+44256
+47196
+51204
+47148
+54645
+50577
+54645
+44540
+51648
+49885
+44201
+51116
+46976
+48373
+44152
+54637
+44228
+46020
+44305
+50808
+44305
+50668
+50504
+50504
+44428
+51060
+53441
+44256
+51656
+44277
+46041
+49345
+49345
+54872
+44600
+44396
+54792
+53440
+53748
+50864
+52272
+49345
+50549
+49849
+49437
+51092
+50500
+50836
+51221
+45817
+44592
+44368
+54868
+54924
+51109
+51109
+49900
+49324
+49324
+51652
+48176
+51221
+44292
+44221
+48156
+48516
+48512
+50976
+53685
+44033
+55148
+46993
+47448
+48393
+52832
+50728
+44400
+44036
+49549
+50577
+44396
+51221
+50976
+47588
+48169
+47217
+54077
+51109
+51228
+54788
+46020
+51312
+50836
+44257
+54224
+51201
+54632
+51116
+52824
+51064
+54056
+44221
+44204
+54872
+47564
+45208
+54801
+51312
+44592
+54952
+47140
+50756
+52488
+49900
+48516
+49569
+47805
+50724
+51060
+47532
+46160
+52840
+50689
+49324
+44397
+51228
+44228
+44260
+53448
+49548
+52380
+48276
+48120
+51221
+47532
+48712
+47197
+48520
+46020
+51648
+47000
+47144
+44160
+51208
+47161
+47532
+44592
+48337
+47452
+52509
+52380
+47732
+44592
+44592
+52292
+44260
+49452
+46301
+48708
+54056
+48393
+48512
+54844
+51333
+51221
+51312
+44537
+47140
+48533
+50977
+50612
+44256
+44260
+46041
+45817
+44053
+47581
+52404
+49437
+48264
+51137
+51092
+44228
+50672
+50684
+50669
+44428
+50669
+49340
+51076
+52628
+47497
+49436
+51208
+48373
+44284
+47000
+52628
+52628
+46020
+44288
+48516
+48516
+47548
+44221
+50696
+50756
+44285
+47197
+54840
+51217
+51032
+51452
+44396
+44397
+49849
+51320
+47049
+44053
+49885
+52628
+50500
+44144
+48708
+52488
+53441
+52824
+48712
+48533
+51221
+52488
+52285
+47477
+54868
+44160
+44508
+49901
+46021
+52280
+46020
+44480
+51204
+46972
+51648
+44428
+47749
+48512
+44221
+48337
+51204
+51032
+53440
+49340
+53440
+50556
+48373
+55064
+50808
+45800
+44032
+51333
+44048
+51060
+52840
+48372
+50616
+50672
+50672
+51204
+52632
+50864
+44201
+49324
+50501
+54200
+48373
+50836
+54868
+49436
+50557
+50577
+46980
+50504
+48376
+55064
+44508
+44228
+44508
+49324
+54413
+49444
+53440
+51600
+44148
+47785
+47924
+52488
+44256
+54840
+47144
+47497
+51221
+45224
+50976
+50976
+48120
+49569
+50896
+55012
+50689
+51221
+54200
+51217
+51609
+44040
+50629
+51200
+49692
+50976
+51452
+50948
+47588
+52404
+44537
+51208
+54644
+52628
+50689
+50976
+54889
+47336
+50501
+52380
+54693
+54408
+49892
+44060
+54744
+46988
+50728
+50976
+52828
+47140
+44144
+49888
+52628
+48708
+49444
+44032
+51061
+51204
+48512
+45400
+54596
+46993
+50857
+44257
+51652
+44396
+45813
+50836
+51652
+48169
+49332
+50896
+51116
+47749
+49548
+44032
+50836
+44152
+54889
+44036
+48708
+51088
+44148
+47560
+49692
+50896
+49324
+50689
+49884
+51648
+52572
+50728
+51221
+47448
+50857
+45817
+44368
+52292
+49324
+49849
+53457
+54633
+54812
+44264
+44592
+44256
+44256
+49552
+48152
+46020
+46020
+49692
+51204
+45572
+51656
+49325
+44396
+53748
+52285
+52264
+44216
+44340
+47588
+55093
+44277
+44256
+53441
+53441
+44368
+50577
+51204
+44032
+54632
+52712
+46020
+47217
+48712
+51200
+49345
+49845
+44592
+47144
+54812
+50857
+52280
+44285
+44060
+44060
+45800
+54868
+49353
+49340
+52572
+48393
+50976
+44257
+51109
+54840
+54872
+44480
+50620
+50696
+44256
+44053
+44508
+44508
+51312
+47564
+44540
+51201
+51109
+50501
+46993
+51652
+51333
+47532
+49688
+44221
+49345
+48264
+53685
+44288
+51201
+52636
+47448
+47196
+47049
+48128
+45572
+49548
+49549
+44032
+51200
+53489
+54364
+47197
+44508
+51088
+49324
+52628
+51109
+47564
+47784
+51312
+50577
+51312
+48393
+51452
+49332
+49436
+44428
+54945
+44204
+52509
+44592
+50672
+51109
+49444
+50549
+51060
+49900
+51649
+52488
+52572
+52509
+48149
+49688
+54868
+44452
+51652
+51456
+50900
+51204
+54812
+52632
+51316
+48268
+44048
+47784
+47924
+52712
+50836
+47536
+47448
+44368
+54620
+50980
+48264
+51204
+53441
+47308
+50868
+49692
+46024
+53489
+53489
+47609
+44516
+46321
+49689
+44432
+44432
+45812
+54812
+44592
+45208
+49345
+53440
+45397
+50696
+51200
+46041
+51613
+48516
+44221
+50672
+54945
+49900
+44256
+47448
+47196
+44256
+51452
+55148
+49849
+51088
+49328
+44537
+46160
+51221
+47196
+54620
+52628
+50672
+45804
+49688
+44053
+45800
+47492
+45453
+51008
+44201
+49464
+49340
+52712
+49440
+51221
+44036
+44397
+51396
+50613
+44552
+48149
+52392
+47280
+54413
+55036
+45817
+44228
+49688
+48317
+48317
+51221
+52488
+44284
+54924
+51609
+54644
+44032
+44221
+49437
+44160
+51109
+46020
+51032
+54364
+49569
+50577
+47492
+47141
+52272
+47805
+51008
+46020
+45824
+47732
+44592
+45800
+48712
+54869
+44228
+50684
+45768
+45397
+51032
+44256
+54632
+51008
+45572
+44221
+50684
+44592
+48128
+46020
+44452
+52632
+51228
+44340
+54028
+46321
+51452
+44033
+47732
+50864
+51656
+54889
+52380
+47336
+47280
+52272
+45432
+47168
+52268
+47140
+47736
+54812
+50864
+47140
+51600
+44256
+46021
+50672
+47141
+54224
+51200
+49688
+47144
+51204
+51452
+44221
+51200
+47196
+50684
+47141
+51200
+52828
+44152
+50501
+49548
+54924
+50620
+50668
+47217
+47280
+52488
+54732
+44480
+44144
+49548
+47161
+50549
+52392
+51008
+50976
+50689
+50577
+45453
+48149
+52280
+45212
+44144
+49933
+49453
+52712
+52509
+44428
+44396
+51109
+44396
+50872
+46972
+47140
+52268
+46976
+45817
+44285
+50628
+46988
+46976
+52489
+47448
+47168
+54028
+45229
+50872
+47161
+44288
+55136
+52264
+54872
+55124
+50668
+50984
+54632
+44396
+44396
+52488
+52636
+44201
+54644
+51064
+44432
+55184
+49696
+54633
+50837
+44340
+46993
+44288
+49688
+55148
+50528
+51032
+44592
+54988
+52572
+55136
+44288
+44048
+44288
+44048
+52380
+49341
+44284
+51064
+55136
+54736
+50976
+44216
+54952
+51060
+44032
+50724
+53444
+44540
+44396
+54840
+51201
+54872
+54728
+48516
+55148
+49548
+54988
+55137
+49440
+44048
+52489
+50669
+51021
+50668
+52384
+54872
+51648
+51221
+52264
+48372
+47924
+44592
+48372
+48372
+50780
+44144
+51204
+52824
+49353
+52824
+49341
+51333
+49464
+49464
+47141
+49353
+50864
+50669
+44480
+50508
+50508
+49324
+49452
+47792
+47792
+47792
+50836
+47792
+51312
+50521
+51652
+49373
+53468
+49345
+54785
+49692
+49688
+51092
+44221
+54364
+44217
+44396
+49549
+44557
+50868
+50684
+51060
+48512
+49885
+50629
+51092
+54844
+53444
+44537
+50685
+51652
+50868
+50728
+52628
+48712
+52404
+44540
+49345
+51064
+51312
+52629
+44452
+52268
+50640
+53444
+46160
+44053
+50684
+48712
+46021
+49452
+49452
+49688
+44396
+45800
+51452
+51008
+49457
+50696
+49332
+44033
+44033
+54952
+51456
+51204
+55036
+55036
+44257
+44033
+44201
+51032
+44396
+55036
+45800
+51032
+54952
+47924
+44288
+47784
+47588
+47588
+50528
+51088
+46021
+50977
+48708
+54596
+48708
+48708
+48708
+54224
+52280
+47784
+49548
+49340
+48708
+47784
+44032
+51204
+49884
+47785
+53440
+49692
+51060
+50997
+49440
+44397
+47784
+54840
+44396
+46160
+47784
+45812
+48176
+44397
+53448
+52712
+48708
+49328
+52280
+47784
+49884
+50976
+50976
+53440
+44040
+44148
+53457
+49328
+47336
+47784
+47532
+46041
+50857
+52285
+48169
+47196
+51204
+49548
+51204
+47805
+47196
+44396
+52393
+50472
+51200
+48124
+44432
+47609
+44592
+54588
+45236
+44592
+46020
+49440
+52380
+48516
+50577
+45236
+48337
+48520
+49888
+46041
+44221
+44592
+51064
+49436
+54644
+50577
+50504
+50500
+44537
+44221
+50500
+46041
+45812
+47197
+52397
+50577
+50728
+50728
+49688
+49688
+49849
+48729
+50689
+45817
+49688
+47477
+45769
+53444
+48276
+44452
+51221
+51609
+44396
+54036
+52769
+47732
+53444
+55064
+51312
+54620
+52264
+51089
+52380
+54872
+48276
+45824
+49437
+53441
+47581
+49688
+55128
+49328
+54028
+54620
+52380
+50724
+50724
+49888
+49324
+50668
+54861
+44053
+51648
+50724
+53664
+44396
+53461
+51648
+51648
+44204
+44264
+44264
+50773
+51221
+51221
+50696
+44512
+44361
+53468
+44204
+44553
+48320
+54032
+44048
+47928
+51333
+48169
+55113
+44208
+50724
+50864
+44592
+48516
+49436
+49436
+49900
+44592
+50725
+50868
+50896
+54637
+50672
+52840
+52840
+53456
+50864
+46024
+54840
+54868
+51208
+47785
+45684
+47792
+45813
+47732
+47932
+52649
+52392
+48708
+49324
+51648
+54056
+48152
+52628
+51105
+44396
+51312
+47792
+53469
+54413
+44396
+47141
+47452
+52285
+54413
+44508
+54840
+47568
+47588
+49696
+51200
+49437
+53441
+53440
+53440
+54616
+47140
+47140
+49884
+48156
+48708
+50976
+51204
+52824
+49548
+44256
+52392
+50672
+49324
+54889
+54805
+44396
+49444
+49688
+51068
+44032
+51333
+52380
+48149
+55064
+48708
+48516
+49353
+52636
+47477
+50976
+44256
+54861
+44048
+48277
+47896
+49324
+54840
+54217
+51088
+48276
+51648
+49548
+51200
+51221
+47161
+54252
+54028
+51021
+49324
+51060
+44397
+50900
+51452
+49373
+47336
+54788
+54792
+48512
+48152
+48124
+53468
+50521
+51228
+50689
+44288
+48729
+54805
+47217
+47196
+45800
+46973
+49324
+48156
+53469
+44221
+51008
+51452
+44600
+50557
+54924
+54924
+51116
+49849
+51064
+50948
+54980
+52380
+50577
+47148
+49324
+44228
+51060
+54665
+48372
+49464
+49353
+51648
+51064
+50724
+49464
+44256
+49688
+54861
+45209
+47029
+50504
+46041
+51060
+47784
+47280
+51060
+48120
+52380
+51652
+48177
+50976
+54952
+49444
+54861
+54785
+49549
+44305
+46020
+44208
+44144
+51060
+51452
+50668
+48337
+49692
+55113
+51656
+44305
+50896
+47749
+54876
+50752
+55137
+54028
+50724
+44257
+50976
+51068
+54801
+51221
+52380
+51109
+50836
+51221
+49324
+53441
+52769
+48268
+54924
+51228
+47448
+49328
+54844
+54728
+45453
+49900
+51652
+47148
+44396
+48120
+51208
+51456
+54632
+48712
+48169
+52265
+50976
+55148
+48156
+46160
+50756
+44361
+51021
+54252
+50689
+46988
+54840
+45229
+54620
+47532
+44221
+48512
+50724
+47532
+49692
+48393
+51061
+50837
+46041
+47196
+54644
+52840
+54801
+52649
+54805
+47588
+49688
+51201
+54056
+44204
+49340
+46020
+44260
+48729
+50676
+44036
+44221
+49548
+49453
+45380
+46021
+50857
+54952
+50672
+51221
+50500
+49549
+44400
+50672
+51104
+52404
+47532
+49464
+49324
+47336
+49464
+46020
+46021
+47196
+47000
+47144
+50948
+50752
+50868
+54872
+52377
+54805
+50980
+44036
+52285
+49341
+48512
+44288
+54665
+49688
+49604
+50528
+52384
+50529
+50529
+44277
+50756
+54632
+53440
+46041
+54980
+50752
+44144
+49324
+47049
+54844
+45813
+53441
+51221
+52393
+46301
+44428
+52824
+49437
+54952
+44592
+44404
+44284
+54632
+51076
+52285
+51452
+48393
+54840
+52285
+49689
+52376
+48169
+52825
+47449
+45544
+44397
+46020
+51333
+45572
+51228
+48729
+48708
+49569
+51204
+48708
+45812
+50669
+50696
+50612
+47197
+44048
+48128
+51221
+47497
+50980
+51020
+49772
+44144
+54924
+50977
+49900
+49900
+54364
+49692
+50732
+50672
+47000
+54844
+52397
+50628
+52380
+52392
+47896
+51648
+51020
+47729
+48516
+50672
+47928
+50557
+48708
+52397
+50672
+44040
+51228
+49453
+50672
+49341
+47197
+51648
+46021
+44592
+51216
+48124
+48708
+48512
+50612
+50672
+49900
+49340
+50976
+54872
+51200
+44048
+45212
+53804
+52628
+51221
+44144
+46020
+54413
+49324
+48156
+50501
+50752
+51228
+50808
+50728
+50976
+49444
+52769
+50948
+44032
+54637
+50628
+54861
+49440
+48120
+44040
+47896
+50689
+50672
+50976
+44361
+47896
+49457
+48120
+51116
+54844
+45236
+44508
+47549
+50501
+48176
+48120
+47144
+51021
+51021
+47588
+52392
+51452
+50948
+52268
+45800
+47732
+54924
+48177
+49436
+51609
+48516
+51204
+44148
+54840
+48393
+49345
+50669
+51064
+45812
+49885
+44060
+51221
+54889
+53444
+50864
+48317
+48124
+49884
+46028
+49373
+50857
+44201
+46041
+45800
+52628
+52628
+52628
+51064
+53461
+47469
+54925
+50896
+45224
+48164
+50976
+52380
+52632
+47049
+51204
+48372
+49692
+50676
+52824
+47564
+49845
+47564
+50689
+51088
+44452
+48393
+52380
+49436
+47336
+44508
+44060
+44032
+50689
+48156
+51652
+50672
+45817
+50896
+49604
+50896
+47156
+50836
+47805
+51456
+49849
+54633
+53468
+45813
+50752
+50976
+44396
+49548
+47749
+51088
+49884
+51068
+47200
+47560
+48512
+48120
+47456
+51116
+50724
+44228
+50728
+44053
+51649
+49324
+49548
+44592
+51652
+49688
+50868
+52628
+51008
+50857
+54844
+49548
+49325
+51061
+53457
+49845
+50837
+50808
+48152
+52629
+51200
+48169
+50745
+52285
+47736
+44201
+51204
+54840
+54889
+54736
+51088
+52377
+52824
+54805
+48512
+44152
+54876
+44032
+51116
+46020
+46321
+49688
+54596
+44368
+54924
+44260
+51228
+44256
+47217
+52404
+50684
+49453
+47564
+54805
+49692
+47140
+46988
+46976
+54952
+48712
+53444
+50668
+49688
+54840
+54596
+54364
+52404
+44221
+44396
+49340
+49345
+51201
+48128
+50724
+47196
+54840
+54840
+50976
+49328
+48276
+50857
+44260
+47564
+44221
+50612
+54364
+51201
+50528
+49548
+52832
+49324
+51228
+47197
+47336
+50997
+44540
+44341
+52509
+45572
+52841
+44060
+44053
+47532
+50672
+51312
+44368
+52509
+49692
+45800
+44396
+46321
+50556
+49845
+47729
+45817
+47561
+49345
+54620
+50672
+46988
+50752
+49884
+44148
+48393
+49440
+51032
+47564
+51648
+47581
+44053
+53457
+48533
+49688
+52285
+51109
+52649
+49436
+54872
+44285
+51216
+50616
+49345
+47448
+52572
+51228
+50577
+51109
+51333
+50689
+54861
+49692
+49688
+44288
+54805
+49548
+52509
+44260
+49436
+47156
+51656
+50976
+48324
+50984
+52488
+48156
+49345
+54812
+44208
+47924
+54028
+51665
+48152
+44508
+49689
+51104
+51104
+55137
+47196
+49437
+49552
+46024
+54889
+48124
+50980
+49549
+47308
+51613
+52509
+51060
+51648
+47564
+45800
+45812
+51312
+49900
+44452
+50676
+49548
+46020
+51200
+49328
+55121
+54596
+49328
+51092
+51092
+49436
+46041
+48372
+47536
+50948
+49341
+49341
+51669
+44221
+51669
+54896
+50836
+47196
+52384
+44048
+52492
+54945
+49884
+51452
+54077
+54632
+50868
+47448
+54861
+48373
+54840
+54868
+54620
+44036
+49328
+49437
+50724
+47196
+46976
+45397
+50864
+47492
+48124
+51312
+45817
+54620
+53469
+54644
+50668
+47168
+49436
+54617
+47161
+47564
+51088
+50745
+54924
+52268
+47156
+51204
+50629
+50724
+54872
+52828
+51204
+47564
+45812
+45812
+50613
+49688
+48317
+44144
+45804
+44552
+44201
+53441
+47156
+45453
+44284
+52840
+48516
+49353
+51609
+49688
+50696
+52488
+45813
+52509
+51221
+49836
+51200
+47280
+48712
+47156
+45768
+49845
+49436
+47729
+45397
+50689
+50689
+47805
+51652
+44592
+48708
+51228
+54840
+50976
+52712
+50508
+46020
+51064
+51008
+45824
+51088
+54840
+51221
+45224
+51456
+50528
+48373
+53441
+50976
+48712
+44257
+51104
+50689
+48712
+54876
+47564
+52285
+47925
+52380
+50976
+46973
+52268
+50668
+47168
+50864
+50577
+47196
+49324
+51600
+54805
+46021
+50773
+55064
+49324
+48152
+49900
+54364
+51204
+47568
+47448
+52392
+54253
+49353
+51669
+44257
+48712
+44285
+54732
+47196
+52828
+54620
+50689
+50997
+47141
+51221
+49548
+54805
+49688
+50976
+54644
+54924
+54840
+51200
+47217
+47280
+45824
+48264
+44257
+47280
+49688
+47548
+50689
+48120
+44228
+47156
+52380
+50689
+48516
+47548
+51061
+52392
+50557
+52280
+45824
+50577
+44148
+46976
+48264
+49345
+50672
+52265
+54413
+49453
+47448
+46988
+52509
+44396
+50745
+52392
+48277
+44288
+44432
+50684
+54840
+54805
+49604
+52268
+46976
+50684
+46972
+48120
+49440
+53444
+45817
+44368
+52380
+50689
+54840
+54028
+52489
+46988
+46976
+45229
+47564
+46976
+52380
+54788
+50684
+44277
+50684
+50872
+54868
+54868
+47736
+44305
+51221
+54924
+54952
+54952
+55064
+54861
+47161
+51312
+49440
+44396
+53440
+49324
+51201
+51089
+51116
+51116
+52268
+50577
+44592
+51333
+48516
+45684
+44221
+47928
+48149
+50669
+47196
+52712
+48176
+44060
+48152
+50684
+44060
+48169
+47785
+52488
+47308
+44208
+54637
+46024
+44305
+55124
+51088
+44305
+44305
+50948
+52285
+48320
+45804
+50517
+51221
+52636
+44032
+49548
+48520
+48156
+53440
+53440
+47161
+51320
+54788
+44144
+53444
+54252
+54805
+54252
+53468
+53468
+48337
+50521
+46041
+49452
+51452
+51089
+51216
+50948
+49437
+47144
+52824
+54889
+51452
+54840
+49325
+46976
+44221
+44368
+55100
+54665
+51204
+50676
+54872
+50577
+55092
+55092
+49440
+51020
+50724
+51452
+50836
+49885
+44228
+46041
+54792
+51116
+44060
+54861
+45209
+54633
+52489
+55012
+51613
+48149
+50672
+44340
+44305
+53469
+54924
+44256
+49888
+48264
+49548
+50685
+54924
+44288
+53461
+49888
+50676
+47148
+55148
+48512
+44221
+52384
+48372
+44221
+51089
+51221
+50756
+54924
+54077
+46993
+50672
+54988
+48393
+51201
+47469
+44257
+55148
+49689
+54785
+54984
+44257
+44208
+49548
+55148
+50616
+54620
+51109
+51456
+51228
+52384
+44592
+50724
+44260
+47140
+54632
+50684
+54872
+48124
+44397
+46020
+48176
+48516
+47536
+54844
+54844
+46024
+49437
+49772
+47924
+54861
+52488
+48512
+50508
+52488
+52509
+48393
+48533
+44417
+49444
+49437
+44221
+55124
+51089
+50684
+54785
+50556
+51089
+50977
+44053
+50672
+48708
+44256
+47581
+49849
+52285
+49548
+47749
+45392
+44221
+44404
+49900
+54785
+44508
+51333
+45800
+54616
+55064
+54413
+50672
+55012
+49457
+54889
+52488
+51204
+54589
+50689
+51088
+50948
+45800
+51216
+55148
+45212
+45212
+48520
+50672
+44221
+44221
+50865
+48120
+49332
+50948
+51105
+55124
+44221
+50976
+47588
+54872
+54980
+51312
+50808
+48264
+52628
+49688
+50577
+47148
+51088
+44060
+44256
+44284
+48372
+54840
+50728
+45224
+49885
+47049
+54200
+44396
+53748
+45817
+52628
+49440
+51008
+48149
+50685
+54801
+55148
+47924
+49885
+50728
+54633
+54952
+55148
+50868
+50885
+45236
+49452
+44417
+50836
+54984
+47749
+47156
+54805
+50724
+50857
+44277
+46020
+52285
+47448
+55148
+54596
+54364
+52509
+47197
+44204
+49689
+49845
+47336
+48393
+52572
+51061
+53685
+51089
+51333
+50948
+54840
+51060
+51088
+50724
+50948
+47308
+49440
+44396
+50676
+44221
+47564
+44260
+51201
+52268
+51613
+51104
+55148
+55148
+55137
+51061
+49548
+52824
+54889
+52380
+50685
+52392
+50672
+50684
+49452
+44368
+51316
+46321
+46024
+49888
+52488
+48516
+49324
+50836
+50984
+51064
+46041
+49548
+48516
+48264
+50672
+49900
+46976
+48124
+53461
+51068
+44221
+48124
+44221
+52488
+50689
+50865
+50669
+54364
+46988
+53468
+51312
+52268
+49688
+55148
+44201
+52509
+47156
+55036
+52489
+49453
+47161
+50528
+51032
+54801
+51312
+54924
+45804
+45453
+46988
+50976
+55148
+44256
+54984
+49888
+51452
+46020
+50836
+54785
+46988
+54364
+50689
+47148
+47925
+54253
+49444
+47140
+46989
+50724
+54984
+44305
+49325
+47308
+47141
+45432
+51089
+47308
+49452
+55148
+49453
+47329
+50685
+52268
+50577
+50557
+45212
+52509
+51089
+52649
+44288
+44396
+52384
+48120
+45817
+46976
+52489
+46988
+47161
+52268
+50872
+51312
+51312
+54028
+51137
+54252
+52845
+50896
+50528
+50948
+47308
+54869
+51089
+48512
+50556
+54028
+45796
+50556
+54952
+51312
+49345
+51060
+51109
+49345
+44032
+51109
+52393
+51109
+50857
+51109
+54200
+54032
+48152
+49548
+51204
+54056
+46021
+52285
+53804
+49341
+54200
+52393
+48169
+48149
+52285
+50976
+50857
+46021
+50500
+53489
+50864
+50864
+48712
+44396
+47784
+53440
+47784
+45516
+51064
+47581
+48169
+47784
+47785
+44053
+47932
+50616
+44032
+54056
+49324
+52380
+44256
+50976
+44032
+49373
+47924
+51200
+44204
+44428
+51204
+51088
+53945
+55148
+48169
+44221
+44204
+50724
+44257
+49436
+47532
+47532
+48512
+51032
+44053
+51649
+48516
+44428
+49692
+46021
+44396
+44032
+44148
+48393
+54200
+44284
+44201
+54840
+52628
+55148
+48708
+46973
+44060
+47560
+49340
+50948
+47532
+46024
+46041
+44368
+44053
+55148
+47168
+46021
+47157
+54588
+54364
+48149
+55148
+51452
+50948
+44508
+51452
+44204
+44204
+48156
+48276
+44396
+54872
+49884
+51089
+50504
+55184
+49345
+44305
+47560
+50864
+44053
+54056
+54980
+50500
+51008
+48320
+49345
+50980
+44305
+45684
+51201
+44221
+51473
+47785
+54056
+48708
+44201
+51032
+49457
+54252
+50517
+51060
+54840
+47161
+48708
+54588
+45768
+50836
+50976
+44396
+50900
+51200
+45804
+48149
+44256
+49440
+50689
+55012
+54620
+44368
+54617
+51312
+44600
+49692
+49328
+53457
+50997
+49688
+46041
+47196
+46021
+54801
+49324
+54924
+51137
+50725
+49552
+50668
+54224
+48169
+55148
+44204
+47532
+54801
+51008
+49328
+45229
+54056
+51228
+50672
+49324
+47532
+54620
+54744
+44221
+48176
+48708
+54952
+54056
+44592
+50696
+54364
+51008
+47000
+51089
+44204
+44053
+44260
+50684
+44284
+51333
+48120
+52285
+51032
+51228
+51137
+50528
+47609
+49884
+51320
+49324
+47157
+51204
+46972
+54840
+51333
+54980
+50808
+54413
+50752
+50896
+49457
+51200
+47896
+50948
+52380
+54732
+45800
+50508
+45432
+54840
+44032
+54980
+54200
+50976
+50976
+48120
+49324
+50836
+49552
+48149
+47749
+54876
+50896
+49688
+47560
+50896
+50528
+50725
+49324
+54840
+44053
+51061
+51652
+52285
+54840
+47564
+44221
+51109
+47784
+51109
+52280
+50724
+50724
+54840
+52572
+48516
+44432
+54224
+54224
+54889
+48373
+47536
+55100
+46041
+44368
+47308
+49325
+54952
+49688
+46024
+44201
+44040
+44204
+46021
+50696
+54924
+54744
+54644
+46980
+49440
+54984
+50689
+48712
+54925
+45572
+47805
+50685
+50864
+44305
+49688
+47196
+45804
+54732
+48120
+50577
+54872
+45432
+46972
+54744
+44592
+54869
+54788
+47896
+51088
+49556
+47196
+50725
+49689
+50773
+44508
+44032
+51221
+47477
+54036
+44592
+44053
+51201
+52380
+44036
+44396
+50864
+44592
+50668
+52285
+47560
+44053
+50724
+48512
+48124
+44060
+50500
+48516
+48320
+48169
+47784
+44208
+50980
+44033
+50756
+44048
+47588
+45800
+48712
+50948
+48176
+54788
+52285
+50689
+45824
+50696
+44048
+54217
+51216
+48512
+54788
+49352
+54028
+51088
+44396
+44049
+49548
+48149
+51088
+44032
+50684
+49373
+49888
+51060
+51312
+44032
+48124
+49328
+47448
+54596
+51652
+51652
+44033
+48277
+47217
+51652
+44368
+52380
+47140
+44305
+49440
+51452
+44277
+50672
+54980
+50577
+54980
+45209
+49689
+51452
+44552
+51008
+49692
+48372
+51060
+54693
+50836
+54633
+54805
+44508
+52649
+49696
+48152
+54056
+47196
+45817
+47280
+54844
+47928
+50500
+51221
+51228
+47924
+50724
+49457
+44400
+47588
+54056
+51221
+54788
+52265
+54632
+49440
+50616
+44396
+54788
+46993
+51060
+49688
+48512
+50976
+50556
+55148
+47497
+47532
+51652
+47144
+49604
+49548
+48393
+50756
+51221
+48337
+51092
+49772
+48124
+50669
+44144
+52840
+47000
+48124
+47581
+50976
+51204
+49689
+53441
+48176
+51137
+54840
+44592
+50501
+44260
+52285
+44592
+48393
+50756
+47197
+51333
+44288
+50684
+51312
+48176
+47548
+44552
+48708
+54028
+44053
+53441
+44552
+48277
+44552
+44221
+46020
+44060
+54844
+50864
+47784
+48120
+52632
+49440
+51228
+49457
+45824
+50976
+48124
+44048
+50948
+50672
+54872
+54644
+52380
+51204
+51204
+52285
+47144
+51204
+54616
+45800
+50896
+50556
+45432
+54840
+50689
+50976
+54889
+49436
+49836
+47448
+49324
+50857
+49604
+50836
+50728
+50724
+51652
+51652
+54805
+47560
+46020
+47448
+45817
+47456
+46993
+44340
+51204
+52285
+52264
+44257
+51312
+50836
+50528
+48712
+49436
+49345
+44260
+51204
+51333
+44540
+50696
+52572
+52509
+44592
+47532
+50689
+49548
+44396
+49440
+50724
+50672
+47928
+51109
+51064
+54868
+50689
+52404
+47196
+47924
+46321
+49688
+51613
+49900
+44144
+53461
+51064
+47308
+44221
+49689
+54889
+44340
+48149
+44221
+48264
+51652
+47448
+44592
+54812
+44221
+50528
+48317
+52268
+44144
+51312
+45817
+44368
+44260
+45800
+54924
+54872
+49836
+49688
+51204
+52488
+50668
+49888
+48512
+48712
+49689
+47928
+52712
+46988
+49352
+51228
+49440
+50672
+54869
+44060
+47280
+46021
+47141
+51656
+50976
+47140
+52268
+44221
+51201
+44340
+49688
+46980
+47217
+47196
+47141
+52268
+46976
+50689
+49352
+50577
+55092
+44288
+46020
+52268
+54872
+44284
+54252
+51656
+48149
+54840
+51665
+54364
+54032
+50577
+47168
+50752
+49901
+44053
+52380
+54032
+48516
+48169
+45812
+50745
+44396
+48516
+47784
+53668
+54840
+47161
+51060
+48337
+51088
+48177
+44204
+51109
+52824
+47532
+45817
+47609
+48512
+52628
+48337
+48320
+52628
+44204
+47532
+51088
+50549
+44228
+54632
+47336
+51201
+44396
+47609
+51204
+54077
+47536
+51613
+47924
+48317
+45812
+50745
+50549
+50616
+44048
+45824
+49900
+52392
+52392
+44048
+49345
+49373
+52397
+49888
+49328
+49328
+50976
+49373
+49548
+49340
+50857
+49556
+47197
+48372
+50857
+48393
+47805
+45397
+51204
+50976
+44049
+49888
+49341
+51204
+48520
+45224
+51204
+48337
+51221
+54868
+51221
+44204
+52824
+47609
+48708
+48708
+44396
+49692
+47448
+52285
+47896
+44512
+54032
+48512
+44221
+51204
+44228
+44228
+44204
+50808
+48373
+51204
+47896
+45813
+48152
+44053
+50752
+48373
+45224
+50976
+48516
+51652
+52629
+47924
+47924
+52769
+51204
+54644
+54596
+45813
+52824
+50557
+55092
+47029
+48264
+51032
+48264
+54868
+50668
+50668
+47924
+51456
+51060
+47448
+50668
+52393
+51452
+54868
+45817
+52384
+44592
+50896
+44053
+49849
+52285
+53668
+47280
+44592
+51105
+47448
+52393
+53444
+47536
+44053
+44053
+51452
+48317
+52393
+52393
+54596
+49453
+45800
+49548
+49548
+52404
+51032
+45377
+45236
+51221
+48708
+51208
+47308
+44277
+55128
+44396
+51452
+54616
+49328
+54980
+54617
+47140
+50577
+51652
+50864
+54028
+44060
+54792
+51200
+50500
+52684
+48708
+50669
+47141
+51333
+52285
+54413
+51452
+54252
+54588
+44048
+50500
+51088
+49444
+51200
+45804
+51652
+48277
+51648
+46041
+51200
+51656
+48708
+44396
+51216
+44032
+54788
+51088
+48337
+45776
+51613
+50745
+44221
+51204
+52649
+53685
+51060
+54644
+50976
+54924
+53440
+50577
+52824
+52824
+55124
+50500
+47588
+46160
+44221
+54952
+53685
+46021
+47581
+48708
+49548
+49328
+48512
+51060
+51648
+51340
+53448
+50724
+49324
+47196
+49688
+53444
+44036
+50669
+48533
+51109
+44288
+45812
+48708
+47560
+47548
+52824
+44228
+51204
+50516
+52404
+48708
+48708
+48124
+44256
+53748
+50500
+50948
+50612
+52684
+50500
+52489
+52488
+45800
+52280
+51333
+44228
+50976
+54980
+54413
+46980
+50577
+49900
+46020
+50976
+44284
+50728
+53444
+44256
+54616
+51020
+50696
+47336
+49548
+44432
+44228
+49885
+44288
+50696
+50728
+52377
+52285
+48152
+50808
+47448
+52292
+49688
+54617
+51204
+53457
+48324
+53444
+51109
+54364
+52280
+51313
+46972
+50696
+51333
+52628
+51109
+52292
+49688
+49353
+44032
+51312
+47336
+47336
+47561
+44540
+51008
+50689
+54889
+48373
+50836
+47469
+52488
+47448
+47196
+44036
+54224
+45800
+51020
+54617
+50516
+48152
+44036
+54872
+44340
+45453
+50976
+48120
+50613
+50745
+48317
+47280
+47140
+49436
+45812
+47492
+51204
+47492
+46972
+48324
+51228
+52824
+50577
+49440
+51208
+51669
+47925
+47141
+44285
+45208
+51201
+51204
+49440
+50689
+51008
+44396
+50745
+53444
+51204
+47336
+47144
+46976
+48156
+44036
+44228
+48156
+48156
+46321
+48156
+48177
+48177
+44032
+44553
+51312
+51312
+47784
+51201
+54028
+44060
+54889
+44480
+52404
+47161
+44256
+47568
+51593
+44368
+54077
+44256
+50528
+50500
+54840
+54620
+48317
+54872
+51452
+52380
+49437
+50528
+54952
+54840
+54889
+54840
+52293
+52572
+54840
+54952
+50685
+54028
+54840
+44368
+50528
+49457
+54889
+47141
+54364
+54617
+51089
+54588
+44036
+54252
+52628
+44400
+44396
+51456
+51089
+49324
+44256
+44400
+44400
+52628
+49324
+51068
+51204
+46021
+47749
+44592
+50689
+50864
+48176
+51312
+52649
+48516
+54633
+50689
+54868
+51061
+48156
+50756
+54633
+50521
+51092
+50684
+44048
+54633
+50864
+54924
+48276
+44060
+46020
+48152
+48372
+44396
+49457
+46020
+47197
+51092
+47609
+47532
+51652
+54785
+44048
+48152
+44288
+50516
+45432
+49688
+51452
+53461
+50516
+44256
+47140
+47785
+51221
+44036
+50864
+47609
+47581
+51649
+44592
+50896
+51204
+49345
+49692
+55124
+54812
+48152
+48393
+49692
+48124
+47749
+49457
+49884
+50868
+47732
+54032
+48169
+47896
+53456
+48120
+47784
+44036
+54788
+44396
+49884
+50521
+51221
+50976
+49888
+54876
+45813
+51652
+54889
+44396
+49888
+51060
+49373
+47588
+47568
+51200
+51652
+51652
+47732
+51200
+50896
+51656
+51060
+51088
+51088
+52488
+51105
+54788
+48337
+48120
+47329
+55092
+46041
+48120
+51656
+51060
+51060
+47749
+49692
+52824
+44305
+44428
+47784
+51652
+51312
+50577
+50504
+47589
+51473
+47589
+52265
+51221
+48120
+51456
+52488
+54872
+54872
+51228
+51221
+51340
+44204
+50500
+47564
+54788
+55148
+44260
+47000
+44160
+49452
+51204
+44260
+50756
+47497
+49437
+44221
+47148
+50528
+51221
+51221
+47532
+47000
+49688
+44428
+49688
+49688
+46021
+48708
+48708
+47785
+54844
+50696
+47197
+50669
+52393
+52292
+52628
+50976
+54844
+47568
+54616
+49457
+55092
+44260
+51116
+52632
+44148
+48120
+46020
+54980
+55012
+51228
+44508
+44256
+50696
+47924
+54785
+48268
+50732
+47896
+52628
+44480
+48120
+50745
+44396
+45817
+51652
+44049
+49688
+54624
+44221
+47561
+47749
+47564
+54984
+52293
+51109
+50696
+51312
+44396
+47561
+49692
+51333
+47336
+47532
+47564
+54364
+45817
+44508
+47805
+54872
+49692
+48324
+55148
+52488
+48149
+52489
+51669
+49900
+49692
+47308
+52384
+44036
+44048
+50685
+55100
+46041
+47924
+47536
+44480
+54620
+50685
+50528
+54924
+52392
+44160
+44256
+51312
+44396
+48120
+52628
+49548
+45397
+54984
+50836
+54869
+47805
+47732
+48712
+47732
+47140
+44305
+54869
+54788
+47732
+54617
+47196
+47805
+47329
+44288
+47564
+47532
+52489
+45817
+44048
+52489
+47784
+44557
+44557
+50984
+49325
+49353
+54869
+49884
+51032
+49888
+51648
+54980
+49888
+50689
+44396
+51452
+44368
+51340
+45800
+50780
+44368
+51613
+54869
+54056
+49437
+51221
+52404
+44592
+51088
+50504
+50732
+53441
+44264
+44053
+49437
+48152
+44305
+53461
+47560
+49324
+45800
+44208
+47168
+48512
+48124
+45208
+54925
+44053
+51648
+52404
+44048
+44060
+48516
+50517
+50500
+48708
+52384
+50672
+49604
+51204
+52264
+46024
+50752
+50672
+44552
+54413
+44161
+47568
+49324
+51200
+50725
+46972
+53440
+53440
+51648
+52292
+52840
+50529
+54224
+47784
+51452
+47549
+54212
+45432
+48729
+54077
+47161
+54252
+47141
+54028
+48156
+48149
+49888
+51105
+50528
+47140
+47217
+46041
+50857
+47141
+44305
+52636
+44081
+51204
+51452
+44305
+44508
+50517
+45544
+54624
+47456
+50948
+50528
+46973
+44036
+54805
+50672
+46041
+54077
+49436
+47196
+54861
+49437
+54801
+44368
+54924
+50528
+44368
+50669
+44081
+52488
+44257
+52380
+46993
+44361
+50668
+54952
+54801
+47581
+47217
+50857
+52264
+52377
+50500
+50976
+44221
+47581
+54617
+50672
+49324
+44260
+44257
+51201
+54868
+45544
+51104
+54744
+54617
+49709
+53441
+44081
+48533
+50628
+52628
+44277
+51137
+44592
+51333
+52397
+47548
+44512
+54028
+51221
+48124
+51312
+51204
+54616
+45433
+50528
+49604
+51089
+47497
+48708
+51020
+45824
+47924
+44592
+47200
+50756
+51204
+44053
+48176
+51201
+52280
+50672
+50516
+49444
+51221
+46021
+53440
+44040
+50689
+54200
+44061
+48317
+50808
+49437
+52840
+45800
+54616
+53461
+51228
+45516
+54077
+44048
+51228
+53444
+49324
+51221
+44228
+49692
+54413
+49440
+54869
+54869
+47560
+44277
+45380
+49556
+50529
+51088
+47448
+49324
+45817
+48169
+54876
+48708
+50808
+49345
+45516
+52264
+51204
+54624
+44228
+47156
+48152
+50528
+50868
+53748
+52293
+44060
+46989
+48512
+50836
+44260
+51204
+52280
+52404
+50724
+54077
+47449
+45544
+44048
+52285
+52280
+51008
+47280
+54364
+51201
+47560
+52377
+52572
+51333
+44221
+49692
+47452
+44592
+49440
+47196
+44144
+51613
+46321
+44036
+49437
+47536
+51221
+51216
+44305
+48152
+51105
+44368
+51228
+47141
+44036
+52488
+55148
+51109
+44368
+46024
+54744
+50865
+52628
+44368
+44201
+53469
+47280
+44040
+52488
+44553
+44033
+45817
+51032
+44053
+48317
+48317
+50668
+48712
+44553
+50528
+44060
+44048
+50668
+50672
+47805
+54252
+51088
+48149
+50577
+47568
+52272
+54788
+44305
+47280
+47280
+51656
+50668
+47141
+48152
+54869
+54252
+50689
+47141
+47217
+47217
+47560
+48149
+49345
+44288
+46988
+52272
+50516
+49884
+49884
+47168
+51081
+49324
+50557
+49324
+44592
+50556
+47560
+44060
+50836
+52380
+44592
+44592
+51648
+54077
+45824
+52649
+51076
+51032
+49437
+50864
+51656
+52488
+48520
+48512
+48708
+51312
+51648
+49328
+48120
+51312
+44144
+54840
+52629
+49888
+49688
+49324
+49884
+45768
+47140
+50864
+49345
+50724
+51312
+54364
+51452
+44452
+54801
+51648
+51228
+44256
+51221
+44256
+49464
+52840
+49888
+44060
+44260
+52404
+46020
+54868
+46020
+44592
+44256
+44288
+52544
+47497
+45433
+54408
+44552
+46020
+49885
+47197
+49440
+48708
+51200
+55064
+50976
+44228
+51064
+51088
+54868
+51221
+48373
+50896
+50864
+49440
+50577
+51228
+51032
+47588
+49324
+52404
+48176
+51089
+51652
+50689
+51649
+44256
+45817
+49324
+47560
+53457
+48512
+55012
+44592
+50612
+55148
+44592
+49324
+49440
+45812
+54924
+49688
+50696
+45453
+45768
+46020
+47140
+50577
+50557
+51228
+52268
+47448
+50976
+50864
+50745
+47532
+49444
+44552
+54868
+46021
+49688
+49324
+51064
+46021
+51088
+53440
+44036
+50696
+49440
+48337
+50672
+52628
+52628
+52649
+48516
+47784
+50868
+44284
+52488
+51648
+44081
+48708
+51648
+50612
+48708
+44256
+48152
+54588
+45768
+47141
+50976
+51312
+48708
+48156
+47161
+47568
+52845
+51216
+51652
+50521
+51089
+51656
+51648
+52636
+44144
+51088
+54876
+51201
+52845
+46041
+52824
+54876
+54633
+51064
+51088
+51656
+44040
+51076
+53804
+51060
+51452
+50696
+45453
+48512
+55148
+44256
+46993
+48512
+52769
+49464
+47140
+44260
+44036
+44081
+51228
+51221
+46020
+52488
+49464
+50500
+47452
+47449
+44256
+51089
+51076
+51456
+48169
+54056
+44592
+51649
+52824
+44512
+45733
+54077
+44284
+54408
+51312
+51320
+50865
+49548
+49688
+54693
+51032
+49444
+48320
+44592
+48373
+48317
+45208
+44060
+51333
+51333
+49436
+52845
+46020
+51008
+47156
+51088
+50865
+51649
+52629
+51652
+52824
+46020
+44032
+44228
+44256
+44256
+44257
+50857
+49688
+50857
+51228
+44053
+47785
+49340
+48120
+52824
+44592
+47449
+49548
+51201
+50689
+51008
+52628
+49353
+51312
+51061
+54889
+52393
+44592
+49688
+54952
+48373
+44368
+52265
+46041
+52572
+47140
+49688
+45453
+49353
+50696
+50577
+45208
+50668
+48712
+51228
+53748
+50728
+52845
+54869
+44305
+47140
+54364
+49353
+50577
+51089
+47532
+52268
+54792
+50508
+44396
+44417
+49437
+44417
+44277
+50864
+49340
+51221
+50836
+52380
+46164
+46028
+47196
+51208
+52265
+50836
+54212
+48149
+50836
+48337
+50752
+51460
+44368
+44508
+51312
+50724
+44508
+50836
+51656
+52285
+50836
+51312
+44368
+52285
+44400
+54952
+49457
+44396
+52268
+50752
+45812
+44404
+44284
+52524
+54925
+49556
+44288
+44508
+46160
+53441
+51020
+50752
+50752
+50508
+50976
+44396
+44417
+50836
+50836
+51312
+47308
+50976
+51204
+51312
+44396
+47308
+49892
+50724
+44508
+52285
+49548
+44288
+44288
+47469
+53489
+52712
+47308
+51312
+52268
+44508
+44417
+46160
+51312
+47217
+51208
+51077
+52376
+49901
+48512
+52380
+52489
+54945
+44592
+47784
+49849
+48516
+49688
+47896
+44396
+52280
+51200
+47161
+47329
+48337
+44221
+44221
+51109
+48177
+49324
+51456
+44361
+46041
+49569
+51221
+51312
+51032
+49688
+51221
+44396
+44040
+48337
+45800
+47532
+51204
+51613
+46321
+51456
+54868
+44221
+44048
+44221
+51453
+52629
+47477
+48393
+50864
+51648
+44036
+47581
+52629
+54872
+46021
+44228
+54952
+54028
+49328
+44553
+49888
+51312
+49692
+50500
+52404
+50896
+54848
+54637
+49548
+44552
+48708
+54596
+44204
+51060
+46041
+51216
+49373
+44049
+51201
+51460
+45225
+53468
+44256
+51077
+52264
+48124
+54252
+49548
+49324
+48512
+52293
+48516
+54056
+45804
+51088
+51228
+47161
+52265
+45432
+48520
+44396
+48264
+44032
+44032
+48276
+49884
+47896
+54028
+49464
+51204
+44277
+47217
+47749
+48320
+46973
+44228
+44257
+51648
+51064
+50836
+49440
+54596
+44277
+44292
+46321
+54952
+44540
+51204
+49692
+50668
+48268
+44305
+52629
+53685
+44228
+45813
+54665
+52293
+51473
+44396
+47280
+54596
+49324
+45817
+51137
+52293
+48512
+44512
+46020
+54028
+47532
+46993
+44144
+44288
+44204
+54632
+53685
+44049
+51648
+49457
+49328
+49436
+51200
+51089
+49548
+49548
+51221
+54801
+50672
+44256
+53132
+44036
+51452
+44305
+44053
+50868
+50724
+52392
+49548
+44036
+48512
+47000
+52628
+48708
+54224
+48708
+44060
+51648
+44340
+50612
+51204
+51312
+44256
+54840
+51137
+51221
+49341
+52628
+47197
+48149
+44592
+47548
+49328
+44512
+48373
+52264
+44256
+44277
+44216
+44428
+44512
+52628
+44288
+50896
+52293
+51320
+54028
+52293
+54801
+53441
+46972
+45800
+49548
+50557
+51204
+55012
+54200
+49692
+49345
+49440
+48337
+51104
+49457
+54840
+51060
+51200
+50557
+51456
+47456
+50725
+46041
+49548
+49341
+51208
+54889
+49457
+48120
+48276
+52380
+51204
+54200
+48393
+52629
+54861
+54801
+54980
+52628
+47896
+44048
+44256
+44452
+49885
+47336
+50868
+54633
+45817
+54869
+52628
+44256
+48708
+50557
+51613
+44396
+45384
+52380
+49548
+52268
+44277
+48169
+46021
+47456
+48708
+52265
+51200
+49324
+51648
+52629
+52285
+47217
+46988
+51204
+48512
+47532
+49688
+54596
+51201
+52509
+50616
+48393
+51104
+52268
+54056
+54364
+46160
+50612
+47736
+51204
+52293
+49324
+44452
+51060
+54840
+49328
+44396
+51313
+48337
+52628
+44592
+44452
+49549
+47336
+52265
+47197
+45380
+49324
+52268
+51312
+49324
+47477
+45800
+47049
+49548
+48149
+47729
+49884
+53461
+47308
+45800
+51216
+48372
+44036
+48124
+44452
+45824
+44368
+46321
+54889
+49692
+47196
+51104
+49548
+47196
+49436
+51104
+44592
+54056
+44592
+48708
+44036
+44144
+47196
+47197
+52392
+54028
+45817
+49352
+44284
+44396
+52392
+50684
+48512
+51452
+47280
+49885
+46988
+44452
+50668
+54869
+54840
+51652
+45824
+51201
+49453
+51452
+51201
+51032
+44592
+46321
+52268
+51452
+48264
+49688
+52628
+52392
+44285
+46321
+47197
+47196
+51204
+53441
+50689
+50612
+47280
+45453
+52392
+47156
+46976
+52392
+50557
+51333
+44144
+47156
+48320
+45800
+52268
+47532
+49324
+46972
+50689
+54869
+52265
+50976
+48120
+51201
+49901
+49888
+52293
+49888
+50668
+55128
+47448
+49440
+51088
+51064
+52492
+51109
+52380
+44396
+48708
+54032
+47932
+49324
+44053
+45684
+48516
+48708
+49688
+51064
+47784
+52377
+53468
+54840
+54028
+51077
+44048
+44144
+48149
+47568
+51312
+51216
+51452
+47532
+49689
+51312
+47140
+49436
+49549
+54861
+46041
+51088
+52293
+50900
+51453
+47536
+51109
+48177
+45432
+48516
+51060
+44257
+54633
+47049
+44036
+48512
+47049
+52268
+44081
+47532
+50900
+47197
+44397
+44592
+49688
+54056
+51109
+47536
+51333
+51221
+44284
+54868
+49340
+49340
+45817
+48320
+50976
+47732
+54980
+49436
+51333
+54840
+51204
+52272
+51088
+47532
+49444
+48512
+45769
+48708
+44257
+49688
+44256
+45817
+44396
+44032
+51312
+51109
+45817
+48120
+49340
+48516
+51312
+44053
+44053
+47784
+49340
+49328
+45208
+52824
+50577
+44053
+44340
+48317
+54872
+49436
+51333
+54632
+45208
+45800
+50620
+47140
+52265
+51201
+50620
+51312
+46976
+47729
+47729
+44508
+44228
+44277
+51221
+44508
+44277
+44592
+52264
+51452
+49692
+50557
+54861
+50864
+55128
+54872
+51064
+47928
+47928
+44396
+45225
+52824
+46160
+50976
+48512
+44228
+49436
+49692
+48708
+51652
+49324
+44361
+51648
+44553
+48516
+50868
+51076
+45812
+44552
+49548
+48169
+49353
+52572
+44508
+52272
+54028
+44596
+48512
+51656
+52376
+51088
+51452
+54945
+52272
+45572
+49464
+48520
+49444
+49888
+54588
+51200
+44144
+47161
+51452
+49548
+44048
+50521
+48520
+53440
+51652
+53468
+52636
+49884
+51333
+54788
+51312
+44221
+48152
+44396
+47589
+49696
+48376
+44305
+44221
+51076
+54665
+49444
+44208
+51452
+49688
+44312
+48177
+51208
+44305
+54848
+52264
+54872
+44557
+51312
+54792
+44256
+44368
+51204
+44060
+46973
+54788
+48337
+49440
+48373
+44553
+46041
+50997
+51312
+51064
+47448
+49444
+44428
+49436
+54644
+51656
+53685
+49324
+44053
+49345
+54924
+51208
+51665
+44204
+44204
+52824
+47928
+51652
+47140
+49457
+44396
+49548
+48169
+53685
+52488
+54872
+52840
+44221
+49688
+51228
+49688
+54801
+44361
+44201
+48156
+51221
+49688
+53468
+44260
+48512
+44221
+54840
+51648
+50672
+44221
+48393
+44228
+49549
+51060
+51333
+52840
+53440
+47140
+45433
+47049
+51452
+44428
+49548
+44592
+44592
+51456
+44592
+50896
+52380
+49440
+49688
+50976
+44228
+46020
+44288
+44053
+47581
+48533
+52384
+52292
+44284
+52572
+47452
+47448
+44592
+53444
+48317
+51089
+45733
+47732
+52376
+52393
+45812
+51333
+44260
+52628
+49437
+52824
+54665
+47049
+44596
+48708
+50976
+48124
+50669
+52509
+48264
+47197
+49436
+50689
+49345
+51088
+49436
+49345
+54632
+44201
+49440
+50672
+47732
+51665
+45800
+51333
+52404
+48124
+47896
+50672
+49444
+48372
+49884
+52628
+54200
+50756
+44557
+52509
+47732
+50948
+48512
+50948
+53804
+44396
+47896
+54792
+50672
+51333
+54200
+54844
+51064
+51228
+50780
+52824
+50728
+51221
+51204
+53468
+54616
+50672
+52509
+49436
+49849
+50948
+44557
+49440
+50689
+51652
+50529
+52628
+50669
+48169
+44264
+48152
+52628
+44216
+52265
+51204
+49345
+50728
+54624
+52572
+44228
+50857
+46020
+48149
+50868
+51652
+54840
+50837
+44257
+51116
+46321
+54788
+49548
+51652
+51333
+51312
+54889
+52292
+54596
+48393
+52629
+47532
+52629
+50672
+49604
+51333
+47448
+44204
+44204
+47564
+51665
+45572
+47561
+54364
+47144
+48120
+49440
+52509
+51201
+49340
+49604
+48264
+47456
+48533
+50696
+49548
+47924
+50836
+44053
+54844
+49452
+44228
+47532
+49688
+50672
+49440
+49464
+44368
+51613
+52524
+51649
+49440
+49328
+47536
+50984
+48264
+47308
+51089
+51456
+44036
+50836
+52380
+50696
+49688
+44452
+54925
+52268
+55148
+44053
+50868
+45804
+49849
+54924
+44228
+49353
+44204
+44053
+54788
+51312
+52509
+54644
+44201
+48317
+45800
+50613
+45453
+49688
+50669
+50724
+49688
+44228
+48712
+44204
+46988
+48373
+54984
+52268
+51088
+48393
+50557
+47925
+47280
+55184
+52268
+44305
+50864
+49549
+47448
+49452
+51204
+44368
+47196
+51204
+50689
+51116
+50577
+49452
+49688
+52268
+46972
+47532
+46021
+46988
+47448
+47144
+47729
+44508
+50864
+54861
+51452
+49452
+55128
+50557
+44553
+54872
+44305
+44592
+51064
+50948
+50868
+44361
+49692
+48708
+49324
+47581
+45225
+51076
+51333
+47452
+48516
+51648
+47928
+48169
+51200
+51652
+45684
+49436
+49440
+44048
+49444
+48520
+47144
+51312
+49888
+49464
+51649
+51333
+52628
+48152
+48520
+52636
+49548
+50669
+44221
+53468
+48169
+50997
+44208
+44256
+50836
+51656
+54665
+54924
+44553
+54788
+44053
+46973
+51208
+44368
+53685
+44221
+52488
+44204
+49688
+44201
+49688
+51312
+44228
+51228
+51201
+49436
+47497
+50689
+49549
+44592
+48708
+51089
+49345
+44260
+49849
+50976
+47732
+49688
+48533
+51452
+46020
+47448
+44428
+51333
+53444
+44288
+47197
+52384
+52824
+44201
+49345
+54632
+47732
+46988
+51228
+47896
+51665
+50728
+44452
+49884
+49688
+45800
+54200
+49440
+44396
+52628
+50756
+52404
+47336
+54200
+48124
+50672
+51652
+48149
+50837
+51652
+48393
+52572
+54840
+51204
+47532
+50529
+44216
+48712
+54364
+47564
+47448
+50689
+52629
+47924
+49548
+55184
+47308
+49440
+51613
+44053
+44204
+51312
+54788
+44201
+52268
+48512
+49324
+54637
+48512
+44208
+48512
+44208
+48156
+48337
+54637
+51312
+54637
+50549
+50549
+44221
+54616
+44288
+51456
+45812
+51109
+44228
+50745
+50549
+47280
+45812
+47196
+44288
+47581
+47581
+47581
+47581
+54620
+46972
+46972
+48512
+48120
+48268
+44256
+51452
+51200
+47784
+44256
+48124
+44053
+54028
+44312
+51228
+44204
+48512
+49340
+50628
+51312
+51396
+44312
+52384
+50669
+52824
+50516
+48268
+45224
+49436
+49884
+48708
+47588
+47448
+54028
+48268
+51060
+51312
+50948
+54596
+44228
+51613
+46041
+47448
+44592
+44204
+47729
+51312
+45208
+48708
+44592
+44592
+46976
+50577
+48120
+44053
+45804
+48120
+50577
+50976
+50976
+48516
+54028
+44256
+50577
+44256
+44053
+51109
+44256
+50689
+51032
+51200
+51200
+49688
+44036
+51060
+51060
+50997
+44400
+44400
+44036
+54872
+52572
+49440
+51032
+47049
+44053
+44216
+50976
+44081
+44040
+53444
+50756
+55148
+48264
+51204
+48516
+51204
+47156
+47532
+44081
+45572
+50521
+52268
+50864
+44277
+50696
+52649
+50745
+48516
+44361
+49884
+49884
+52712
+48520
+54633
+48516
+51061
+46989
+51061
+54588
+47161
+47308
+51656
+44396
+49845
+55184
+49345
+55137
+55137
+44144
+44368
+54896
+55064
+49548
+49341
+44361
+44053
+51201
+52712
+48708
+50864
+49341
+49884
+51200
+51204
+55012
+49884
+54200
+51333
+50756
+55064
+54980
+54645
+54617
+54620
+44256
+54364
+50696
+47144
+54980
+44256
+47536
+48516
+44368
+44256
+48264
+51061
+54896
+54788
+46020
+50836
+45432
+47196
+44256
+47784
+51088
+44592
+44396
+44396
+44396
+51656
+51656
+51060
+49324
+50672
+45236
+45236
+45800
+47280
+51221
+51088
+44221
+52488
+47784
+50868
+54028
+54588
+52824
+49324
+52376
+44032
+44144
+54633
+49436
+47196
+47452
+51201
+45817
+50864
+47336
+45572
+44053
+48169
+52272
+47336
+44592
+47196
+54869
+50864
+47560
+54924
+51060
+52393
+51221
+50556
+53457
+50857
+44552
+50868
+52824
+45812
+53456
+44361
+44221
+51649
+48516
+49453
+45812
+51652
+52384
+50689
+51221
+50976
+50760
+47308
+47217
+51649
+45397
+51312
+51060
+50508
+51217
+44292
+49436
+47144
+54840
+49457
+47157
+48729
+51221
+52712
+48708
+51200
+44341
+47928
+49436
+48337
+52509
+51221
+50500
+51221
+44396
+52509
+44508
+47144
+50808
+52509
+47144
+50745
+44480
+47144
+50672
+52509
+50724
+49457
+50857
+52397
+50808
+49453
+51649
+45812
+45397
+51208
+51201
+52397
+52397
+45453
+50984
+49324
+51312
+49324
+49689
+51060
+49689
+49324
+51312
+51312
+50977
+50613
+45713
+44592
+44396
+44557
+51312
+55128
+51201
+54872
+54889
+51060
+51064
+52488
+50668
+51452
+50672
+46160
+54637
+50997
+44036
+52264
+50724
+51109
+44256
+51648
+44552
+48512
+48708
+48516
+48176
+48169
+44204
+48169
+49692
+50864
+45580
+54637
+44557
+50672
+44361
+50977
+47928
+54952
+44592
+48708
+55100
+55184
+55184
+54224
+44557
+51221
+53468
+49888
+51333
+52285
+54801
+49888
+50948
+51452
+51656
+45800
+54596
+48156
+48149
+44396
+51216
+48176
+44256
+53468
+51088
+44404
+51648
+45768
+54217
+51088
+48512
+48152
+51652
+54788
+51312
+48176
+44049
+49457
+51648
+54252
+47924
+44144
+54840
+44032
+51060
+50980
+49436
+50521
+47217
+46041
+52852
+47140
+44221
+45432
+50672
+48169
+44256
+51060
+44305
+54644
+44033
+46041
+52824
+54952
+55113
+55113
+51060
+50508
+54665
+48320
+45733
+51088
+44508
+49849
+51312
+51648
+52712
+47588
+54801
+52712
+54801
+47589
+47589
+52377
+54801
+45380
+54924
+49332
+51109
+51228
+45516
+48120
+45453
+47144
+47564
+48156
+47928
+50756
+44396
+44033
+44221
+50976
+54805
+51340
+47148
+51204
+51221
+47588
+49692
+49888
+54801
+53945
+52572
+52489
+49688
+55124
+53448
+54252
+51221
+53748
+54252
+46160
+53448
+45544
+45516
+48708
+50724
+46972
+47532
+44160
+52285
+49688
+52393
+47049
+49688
+48708
+54364
+47452
+48320
+44284
+44480
+49688
+45812
+51204
+45516
+51221
+44060
+49437
+50529
+50628
+51076
+49888
+52384
+48512
+48512
+44144
+48708
+44053
+50756
+46041
+48708
+44341
+51333
+51221
+50501
+47588
+48512
+51204
+51656
+51452
+46972
+50864
+51228
+50516
+49457
+45516
+49688
+52380
+45224
+50868
+51333
+50976
+50501
+49884
+46028
+50836
+44148
+50808
+44033
+50976
+44032
+45800
+54589
+51109
+48373
+49440
+45768
+47732
+50732
+46321
+53748
+48169
+44216
+47140
+50732
+49688
+45817
+49548
+52628
+44201
+51061
+48149
+47308
+52377
+48708
+54644
+44256
+47140
+48712
+44396
+51109
+47197
+44341
+48169
+52572
+54364
+44053
+48512
+45817
+47561
+49836
+51204
+47456
+44368
+51081
+47336
+51656
+49444
+46976
+47144
+46041
+54077
+45768
+49884
+47308
+52712
+44340
+54952
+46321
+48264
+51649
+52488
+49440
+47924
+52684
+50980
+54693
+49688
+48516
+51025
+51204
+44284
+45812
+54924
+45453
+46164
+47156
+48708
+50745
+44089
+52489
+50613
+51204
+46989
+44160
+51312
+46164
+44256
+51228
+52712
+48712
+54984
+45432
+54869
+51109
+54788
+54364
+55141
+44260
+45225
+50672
+47140
+54869
+51104
+46972
+44396
+51109
+47144
+45768
+51104
+49888
+54788
+50752
+44305
+51109
+51076
+44305
+51088
+44368
+50620
+52712
+44592
+44256
+52712
+47732
+50620
+51648
+52824
+44201
+52380
+51656
+51652
+49688
+45824
+51652
+44396
+54632
+50976
+49341
+50836
+50668
+50857
+49437
+49437
+44396
+50668
+50668
+55141
+44144
+44396
+55124
+49444
+49324
+49324
+44396
+51648
+45812
+49436
+51648
+52392
+45812
+54252
+54252
+44288
+54868
+52392
+52380
+49692
+54624
+47924
+51452
+46020
+44053
+49328
+52264
+48276
+54028
+53468
+48276
+54032
+49440
+54637
+48169
+48152
+48708
+54840
+51473
+54632
+52285
+47161
+52629
+52293
+53440
+48149
+54788
+44032
+49440
+44049
+47196
+44277
+48169
+49436
+44284
+48512
+51312
+48393
+47532
+49548
+50668
+46993
+51221
+47448
+48120
+48149
+47609
+45392
+44144
+54889
+49688
+51333
+54200
+47784
+51217
+46020
+48169
+52264
+51061
+49548
+52285
+51312
+47336
+45824
+49444
+50836
+46041
+46321
+45817
+51109
+47196
+51032
+51665
+54632
+54869
+47805
+51228
+47196
+47196
+52280
+49933
+44036
+50577
+44036
+44036
+49353
+50684
+48520
+48337
+50684
+50684
+52488
+52488
+50696
+47477
+51221
+44396
+50528
+51081
+52488
+44508
+51208
+48393
+54872
+51061
+52264
+47732
+48120
+44036
+52380
+50864
+50864
+51089
+44417
+53664
+54616
+44592
+47581
+51088
+55036
+50976
+52824
+54693
+48708
+48512
+46164
+49692
+47924
+51648
+44152
+49340
+47928
+44160
+51064
+48512
+44508
+44060
+54840
+49436
+44553
+44552
+44592
+50896
+48516
+54028
+50696
+49900
+44592
+54868
+54868
+48169
+54848
+44208
+44396
+51648
+50868
+44540
+50836
+52628
+47784
+50500
+48708
+51081
+54637
+51333
+51020
+50864
+48320
+50696
+51208
+50948
+47141
+54596
+50529
+54788
+51109
+52285
+51200
+49548
+51228
+50896
+50684
+47161
+53468
+52488
+51201
+47896
+44221
+47549
+50857
+44032
+47785
+54056
+54252
+44396
+48124
+51060
+51060
+44144
+48708
+50557
+44256
+51200
+45768
+48177
+48337
+51216
+49688
+50836
+49440
+48516
+54861
+50689
+51089
+46041
+51200
+51656
+45216
+44048
+54840
+54217
+47588
+48512
+49373
+44256
+54596
+48120
+48520
+51460
+47924
+48276
+44032
+47784
+47896
+48156
+51088
+47568
+51088
+51200
+52824
+44537
+44221
+47217
+52509
+51312
+50896
+54792
+53664
+44221
+44033
+47749
+47140
+50997
+51064
+44036
+52380
+52292
+49888
+50984
+55092
+51088
+47148
+50724
+45796
+44508
+52293
+52649
+51088
+44396
+44305
+47581
+52824
+44368
+52488
+48373
+50976
+49688
+51088
+44053
+54924
+51064
+45796
+54056
+50857
+50668
+52649
+47581
+46041
+51473
+44204
+52629
+49692
+54872
+44284
+51204
+54644
+45813
+54805
+54665
+52380
+52488
+54805
+51060
+50504
+44368
+52824
+51076
+52380
+51060
+54889
+48337
+47140
+44540
+48176
+49696
+51109
+45804
+54801
+50836
+54596
+51593
+44368
+54924
+51228
+53461
+50864
+49569
+54984
+54805
+46973
+54805
+45812
+49888
+49552
+51020
+47588
+54861
+51312
+50557
+46160
+48120
+47532
+46160
+48512
+51064
+51020
+54616
+48156
+52488
+50980
+51201
+46020
+50976
+49688
+49457
+49888
+47924
+48324
+55148
+44221
+47532
+48372
+51312
+47792
+47532
+51109
+51089
+53448
+52636
+49324
+49324
+52840
+48393
+44144
+47588
+47609
+54665
+44221
+52264
+49888
+44400
+50672
+51221
+51312
+51340
+50756
+54632
+50976
+52265
+54801
+47581
+49689
+45684
+49548
+54788
+46993
+48512
+50500
+47561
+47732
+51593
+45224
+47785
+44048
+47000
+47144
+49884
+50752
+53664
+47156
+54925
+50976
+50725
+50549
+45734
+49692
+47581
+47581
+51088
+50872
+52397
+51201
+44144
+46041
+44288
+52628
+44256
+46989
+45433
+44397
+48120
+44512
+51076
+44260
+54616
+48373
+52824
+44256
+44284
+48373
+47200
+52285
+51452
+49709
+49688
+51092
+47928
+52292
+48156
+47532
+46020
+54028
+54632
+54252
+44596
+44428
+49437
+44540
+51200
+51217
+48372
+53461
+44540
+52488
+53468
+44221
+54868
+44256
+45733
+48708
+44552
+50516
+47581
+48393
+52628
+50612
+51200
+44204
+47492
+45812
+49689
+52392
+46020
+54840
+44592
+54868
+52684
+46020
+52632
+48708
+51109
+54872
+48708
+47000
+52376
+47609
+54217
+50948
+45812
+49341
+52628
+50616
+51032
+52488
+51228
+50756
+52293
+45236
+52840
+53441
+44396
+52393
+46972
+48708
+54872
+48533
+48149
+54252
+51221
+54805
+50689
+50689
+49548
+49332
+52628
+44284
+54693
+47564
+50864
+50976
+48512
+47144
+55012
+55012
+45224
+51593
+50752
+52632
+49548
+50976
+54200
+47784
+50516
+50501
+45209
+50689
+54876
+44292
+44053
+47732
+51201
+51452
+51200
+48372
+50976
+49884
+50685
+50516
+44396
+44036
+48373
+47456
+51204
+48516
+54413
+54861
+54861
+54980
+50672
+46028
+51200
+52824
+49345
+49900
+44040
+44228
+44221
+48120
+54889
+49340
+54252
+44060
+46041
+51312
+51204
+50948
+48156
+50808
+54028
+44228
+54840
+51109
+44032
+45800
+50557
+51456
+52509
+52380
+50948
+52840
+44508
+51221
+54984
+49324
+49884
+51609
+46988
+51333
+50836
+50896
+48120
+50728
+49696
+52404
+51204
+44288
+50684
+44277
+52380
+44060
+44340
+44275
+51109
+47336
+50948
+54028
+50976
+49688
+51008
+49324
+49692
+49884
+50728
+51652
+46993
+45208
+47805
+47141
+44208
+49328
+50896
+47532
+44396
+49885
+48169
+51228
+49436
+46020
+47448
+54869
+51216
+52380
+51312
+48149
+52264
+50896
+52628
+50977
+44340
+48152
+54252
+54252
+45225
+49325
+54812
+48516
+50868
+51613
+44216
+51656
+50557
+52285
+51008
+48120
+54840
+49552
+51652
+47749
+49688
+52629
+47448
+49437
+44264
+46993
+50857
+50745
+44060
+51340
+49884
+45817
+46972
+50837
+49324
+54620
+48176
+50836
+44228
+48708
+51333
+44260
+51340
+49688
+52293
+48176
+46988
+46020
+44228
+47532
+49340
+46993
+50668
+47497
+54805
+47589
+51312
+49688
+47784
+53685
+52629
+48393
+50516
+50672
+52509
+49324
+54217
+44396
+44540
+49692
+52393
+50976
+53748
+51312
+50612
+50696
+51665
+50836
+54596
+47196
+49689
+48512
+51109
+47448
+44053
+47564
+50672
+47497
+44592
+54364
+44260
+54620
+51201
+49549
+47197
+49444
+49345
+51201
+47736
+54984
+47564
+48373
+52404
+52264
+51088
+49340
+49440
+50872
+44257
+50724
+48120
+47336
+51452
+51333
+52292
+54028
+51109
+48128
+52509
+51312
+49464
+44428
+51064
+51216
+50616
+49548
+51020
+44452
+51652
+54840
+49332
+44396
+52380
+47560
+51109
+52293
+51109
+46160
+47156
+47536
+44396
+50528
+54224
+47532
+50948
+44537
+45812
+49849
+48264
+47609
+50864
+52380
+51204
+49900
+52488
+50696
+50696
+47448
+50976
+44368
+51200
+54868
+44036
+47588
+50868
+48372
+50976
+44144
+47196
+50836
+54812
+50501
+51228
+48708
+51208
+52404
+54224
+50668
+48516
+44340
+49692
+50976
+50500
+49688
+48373
+44432
+53461
+47924
+46041
+49324
+49548
+49437
+47469
+50728
+52488
+44592
+44036
+50728
+49552
+47161
+50668
+54616
+50745
+51609
+54861
+49324
+45453
+47280
+55012
+50728
+50865
+44201
+54840
+48149
+54840
+50528
+48120
+54924
+50696
+44228
+51088
+54693
+50756
+47736
+51032
+47497
+44053
+52268
+49340
+51109
+47156
+44284
+50896
+45804
+52824
+53461
+49444
+48317
+45812
+49552
+47156
+48264
+51221
+54644
+44256
+54644
+52489
+52380
+44256
+55001
+49332
+49888
+54984
+50557
+48708
+49688
+49436
+54984
+45824
+48712
+50896
+45397
+51452
+47588
+50976
+54364
+45824
+51228
+51312
+51652
+51652
+51060
+51032
+54805
+44256
+52509
+54840
+44592
+48268
+44148
+49436
+44508
+51088
+48320
+51312
+48128
+45224
+49888
+51109
+47896
+44221
+44152
+49440
+47308
+50864
+49328
+49549
+47140
+51032
+49549
+49324
+47140
+50696
+50557
+47448
+54952
+51201
+52824
+54588
+46321
+50557
+47560
+54872
+54364
+48264
+49688
+45812
+53748
+44417
+52488
+50948
+47448
+54924
+52628
+44256
+50728
+48372
+47141
+51200
+51200
+50528
+51064
+51312
+55012
+52828
+47280
+44285
+53441
+50724
+50696
+50696
+44592
+54805
+45432
+49548
+53748
+47581
+50728
+48712
+50612
+54984
+44592
+44221
+55012
+47560
+44396
+50612
+46041
+48393
+50620
+48317
+50577
+50696
+49440
+50977
+44397
+47156
+47156
+51008
+51109
+50689
+47217
+53804
+50948
+50557
+47161
+44144
+50836
+48264
+48120
+46988
+44480
+45212
+44228
+53461
+47564
+47448
+47448
+55092
+54413
+51649
+50948
+44592
+51104
+54924
+47532
+44228
+48120
+47448
+44340
+45208
+51228
+44592
+47196
+52392
+49332
+46321
+47448
+44428
+54952
+50669
+46976
+47928
+48324
+54840
+54840
+47196
+54617
+54596
+49324
+54952
+44148
+52376
+54840
+54728
+52264
+48373
+54728
+54728
+45432
+54840
+50864
+54840
+44368
+44144
+44341
+54252
+54788
+51092
+51092
+55092
+48152
+54785
+49689
+55036
+44508
+46020
+44592
+44508
+51221
+49836
+48373
+44404
+52293
+49324
+50864
+44036
+51088
+54861
+55036
+47609
+55128
+49688
+54616
+52292
+49885
+51032
+47560
+54693
+48169
+50529
+54028
+52377
+44204
+47928
+47928
+50696
+48169
+48708
+50900
+50900
+44512
+44592
+46041
+51064
+44592
+52380
+50896
+44208
+54924
+44552
+44592
+51473
+50500
+51088
+47785
+50773
+48516
+48516
+54637
+44277
+51312
+48372
+50684
+44060
+48512
+52824
+46160
+54252
+54788
+45768
+53945
+44396
+50976
+52293
+54217
+51648
+50976
+44032
+44048
+44144
+47141
+48512
+50684
+52272
+44396
+48708
+54028
+54788
+51452
+51312
+48324
+48337
+44256
+51216
+51200
+49324
+52384
+47161
+44256
+45800
+44256
+54805
+47140
+51221
+44257
+47784
+44201
+51088
+54924
+54924
+48169
+48512
+50577
+50752
+47148
+51452
+51060
+54620
+54876
+44368
+47140
+51061
+48337
+44600
+54633
+49444
+51060
+47581
+47589
+44277
+44208
+44452
+44277
+51656
+47564
+45432
+52841
+54801
+50836
+49324
+51228
+54805
+47148
+44396
+49548
+50857
+54801
+49464
+52264
+54056
+50500
+54632
+52489
+49440
+48393
+49888
+51652
+54252
+54788
+52384
+50724
+48512
+47532
+46993
+54224
+49436
+50672
+50976
+44161
+45800
+50672
+51221
+51204
+53468
+54924
+50752
+51648
+49569
+48708
+44144
+48128
+44592
+44592
+50977
+44400
+49324
+47609
+44053
+49324
+49437
+47452
+47140
+51217
+51312
+46020
+44260
+54632
+54632
+50669
+48169
+48708
+48708
+50948
+50980
+52377
+50672
+49556
+44428
+44204
+50696
+50696
+52397
+50976
+47049
+44284
+50896
+46041
+50501
+54032
+52404
+47581
+51104
+50577
+49849
+44341
+49440
+51221
+46989
+44284
+51593
+44040
+51221
+47784
+49436
+47732
+50976
+44060
+49885
+55012
+54889
+50616
+54200
+50976
+50948
+48512
+50672
+48120
+50948
+48373
+50980
+54792
+50976
+50976
+47784
+54616
+50689
+49836
+51473
+53461
+51200
+51333
+51228
+48373
+50896
+44508
+47609
+46980
+46021
+54840
+52628
+51217
+47141
+50752
+50868
+44396
+45224
+47336
+52632
+50689
+49849
+51109
+53748
+46993
+48169
+49324
+49892
+51088
+54812
+50896
+50745
+47156
+49688
+48152
+50997
+50997
+51656
+50724
+54980
+54620
+51652
+51060
+48708
+54876
+45817
+51032
+46160
+45236
+54624
+44257
+54924
+47560
+47749
+51032
+47928
+54805
+46321
+50976
+52285
+49548
+44592
+47564
+51312
+49345
+49437
+51312
+47532
+52404
+50724
+47197
+50948
+51656
+45817
+51652
+54364
+44144
+48708
+50976
+51216
+45208
+47336
+44540
+51333
+51064
+51109
+49556
+47928
+44368
+47564
+52841
+51088
+47560
+47560
+44341
+47308
+47784
+49892
+52509
+47532
+47564
+49548
+49345
+51109
+47581
+49345
+47925
+51452
+49324
+52628
+53945
+51649
+54077
+54077
+44368
+44144
+48324
+47308
+48152
+50948
+55148
+44592
+51204
+54889
+48708
+47196
+44432
+44432
+54812
+45812
+49440
+52488
+49440
+50836
+49548
+47784
+52649
+49900
+49324
+51452
+51221
+45817
+47140
+54644
+49440
+51032
+44221
+45804
+49452
+44228
+51088
+54693
+49453
+46972
+44552
+49849
+52292
+47140
+51201
+54788
+47156
+52489
+53469
+44040
+47581
+54644
+51228
+50689
+44204
+47805
+54840
+50672
+54869
+53441
+51208
+48712
+54617
+47736
+48264
+47280
+51208
+45225
+48128
+47140
+51456
+47140
+52628
+50620
+47196
+46160
+49548
+51200
+47217
+47532
+47329
+48393
+50676
+48708
+49345
+44256
+44204
+50689
+49436
+55092
+51104
+44396
+44428
+46160
+51104
+47564
+44396
+51208
+52489
+52272
+54792
+54889
+45685
+48176
+45685
+55124
+51473
+47589
+51060
+44061
+47736
+54785
+54665
+50672
+44036
+50896
+44144
+47161
+54788
+49696
+54632
+46041
+54637
+44032
+54632
+50500
+54840
+50948
+46020
+52649
+50948
+46020
+49692
+54805
+44396
+51032
+51032
+48372
+44036
+50864
+54364
+52264
+51060
+49340
+52828
+48512
+44260
+48516
+49632
+44161
+45225
+51333
+45812
+51068
+51473
+52649
+44060
+44592
+49324
+50684
+51648
+51076
+44552
+44552
+44512
+50896
+47756
+51228
+50724
+45544
+50948
+45800
+44032
+53440
+47161
+45824
+54252
+54252
+50836
+51340
+54596
+49548
+45800
+51200
+54616
+49696
+49688
+51652
+51060
+54028
+48156
+51200
+47568
+48512
+44260
+51656
+51656
+50684
+48264
+50696
+47924
+53441
+44404
+44396
+54788
+51216
+44144
+54588
+50977
+49845
+52824
+48156
+47924
+48373
+51060
+52824
+44256
+51076
+44053
+44161
+51316
+47568
+44208
+51060
+44033
+45376
+51452
+44508
+51064
+51116
+50676
+47217
+54665
+51109
+45817
+54792
+44260
+44036
+45544
+49688
+44217
+44260
+51221
+51060
+44204
+49888
+48512
+44537
+50696
+50976
+51652
+47448
+44396
+44400
+51228
+51021
+48372
+51109
+49464
+49324
+44400
+51060
+47144
+52392
+44256
+44036
+54252
+52392
+48708
+44260
+46020
+50672
+47497
+52824
+52285
+51452
+52384
+54364
+47049
+49345
+48176
+48176
+48708
+44428
+45208
+44284
+50516
+46021
+49437
+51228
+44144
+44592
+44592
+52377
+44312
+44557
+52376
+52404
+51228
+48373
+51473
+49444
+54200
+51217
+44260
+45800
+50976
+50976
+44040
+50896
+54252
+48372
+48512
+50976
+45800
+50616
+50948
+48176
+51200
+47336
+54252
+45800
+50728
+45813
+44396
+45813
+54924
+50857
+50896
+50837
+45236
+44221
+52264
+48152
+53748
+52824
+49345
+45544
+54805
+49437
+44148
+54924
+44256
+47144
+46988
+47532
+49845
+49884
+47336
+50696
+52393
+49444
+49440
+50948
+54364
+51312
+51201
+44053
+49340
+54252
+50577
+54596
+48373
+44036
+49440
+44036
+52524
+44537
+45800
+51105
+48264
+48156
+49345
+49900
+48324
+50836
+47564
+46976
+50724
+53441
+44340
+51312
+49688
+45453
+52392
+52392
+48317
+44552
+45817
+52489
+45800
+48708
+45224
+48373
+50976
+52824
+45824
+52489
+47568
+49437
+54588
+55184
+48149
+52828
+47280
+47217
+49845
+49452
+46976
+51217
+45824
+44144
+52268
+49884
+44204
+48152
+50696
+46976
+50500
+49436
+50500
+50836
+48393
+45812
+48373
+47896
+48373
+54056
+54645
+44592
+44592
+44204
+44288
+48320
+50628
+44508
+44033
+54200
+47784
+47729
+47729
+48324
+49884
+49324
+51216
+46972
+44033
+47589
+51312
+47156
+50836
+51648
+44512
+44201
+49452
+50948
+54785
+51204
+50976
+46988
+50501
+46020
+52828
+48169
+44592
+47749
+50689
+44396
+52376
+52280
+44540
+44288
+46321
+54620
+46972
+52376
+44036
+48120
+44033
+52376
+46972
+46988
+49900
+51201
+44288
+44204
+44288
+50628
+44508
+47729
+49884
+51216
+46988
+44033
+44592
+44201
+51201
+51204
+50976
+44396
+44540
+52376
+44033
+44396
+44540
+52628
+44208
+51648
+52488
+44553
+44256
+45800
+51088
+51200
+49345
+54644
+44428
+44201
+49436
+54644
+44452
+44361
+52489
+54644
+54844
+44396
+49457
+49549
+50696
+44592
+47197
+52824
+45796
+54596
+49457
+44257
+49345
+44361
+52824
+54617
+52489
+55092
+51032
+47141
+44208
+55092
+50672
+55092
+50616
+50616
+51221
+48512
+44396
+44396
+44508
+44361
+44228
+48276
+49888
+51312
+54861
+52264
+53664
+50864
+50508
+51060
+51064
+54984
+51008
+49328
+55128
+53441
+44592
+49888
+51008
+50752
+48516
+50500
+50836
+49569
+49888
+51020
+55124
+44208
+54952
+45580
+50864
+50864
+51648
+55113
+48169
+49888
+52488
+49444
+54788
+49324
+51456
+54728
+50613
+50669
+49548
+52824
+44032
+49888
+54868
+49688
+51652
+51452
+51221
+44396
+51088
+51088
+52280
+44256
+48512
+44204
+51656
+47161
+51200
+50521
+47532
+45432
+48152
+51452
+44048
+50696
+44144
+50836
+49324
+51060
+51060
+44144
+51312
+54217
+54588
+54805
+44404
+48156
+45804
+51200
+46020
+51200
+49324
+49453
+50689
+54980
+49692
+50696
+54889
+54633
+49884
+52272
+54952
+49884
+54788
+53440
+44396
+44452
+51204
+54924
+55184
+54868
+54644
+49345
+50808
+49440
+49688
+46041
+48120
+52392
+47749
+50529
+54924
+54788
+55113
+44312
+51060
+48337
+51312
+52824
+47280
+51452
+44305
+44284
+47924
+50696
+46321
+44592
+51648
+51064
+49549
+46993
+50500
+44305
+55148
+49436
+51221
+53444
+54056
+51216
+50976
+44221
+52488
+52840
+49324
+50516
+50612
+54952
+49457
+44228
+54788
+47924
+50724
+44256
+49569
+54252
+54924
+44221
+49444
+51652
+49444
+46021
+54868
+52285
+49688
+52393
+44284
+44404
+51333
+54952
+49688
+47581
+54788
+48708
+52824
+45813
+51032
+45208
+51008
+51312
+48708
+52384
+52392
+52840
+49692
+44592
+44592
+45812
+52628
+50948
+44397
+52397
+46041
+51137
+52293
+52628
+44148
+52265
+50577
+51204
+49689
+54616
+45436
+49900
+54364
+54924
+48276
+50976
+52393
+49436
+54200
+49884
+55012
+49884
+50896
+44284
+50501
+51333
+52404
+54644
+48373
+48372
+51221
+44036
+44228
+50976
+51088
+51204
+49884
+55064
+51064
+50516
+54632
+45224
+49900
+54413
+51228
+50577
+50616
+54889
+55012
+44201
+45209
+51665
+47784
+50508
+50948
+49457
+46321
+52488
+49440
+44148
+54252
+44340
+54889
+54925
+44032
+50689
+48120
+49548
+48128
+54812
+52285
+51652
+54617
+51228
+49549
+48169
+51648
+44216
+51061
+44053
+50896
+49324
+54617
+46020
+50836
+50836
+54925
+50864
+54364
+52509
+44221
+47532
+47784
+47784
+49345
+51201
+47448
+51204
+52293
+51312
+47144
+47336
+52280
+44396
+44260
+49845
+51089
+50724
+50724
+44540
+51665
+51060
+54840
+44053
+47564
+51312
+54632
+54868
+52380
+54980
+51613
+49341
+55148
+52264
+45824
+51613
+45544
+46976
+50752
+51025
+55100
+44592
+51456
+44368
+54028
+54812
+49440
+47924
+52280
+51105
+49885
+52488
+45812
+52280
+48372
+49849
+54788
+51312
+53444
+45817
+49688
+54744
+44201
+44368
+44221
+51104
+45572
+51032
+50528
+49452
+48708
+55036
+54868
+50669
+51032
+49440
+50577
+45572
+44204
+45824
+45813
+54840
+51452
+54840
+51032
+50549
+44048
+50696
+51204
+54812
+46021
+51201
+54788
+52268
+47280
+49900
+50948
+52392
+47141
+50976
+48320
+49453
+50672
+50501
+49688
+50948
+49688
+50836
+52280
+50577
+51008
+46976
+52280
+54925
+49453
+54872
+52268
+50696
+45817
+49452
+50616
+46021
+50616
+44228
+51221
+48512
+51064
+44592
+50508
+54861
+53664
+50577
+49328
+55128
+53441
+54984
+51032
+49888
+44592
+51064
+44053
+55064
+44396
+44144
+50500
+45580
+54728
+50752
+47200
+55113
+49569
+54413
+49444
+48169
+44208
+51221
+44256
+44032
+54217
+51200
+49888
+54805
+49324
+49548
+51652
+51200
+52488
+49324
+44404
+51312
+54588
+50669
+51060
+44305
+47280
+49884
+44312
+49884
+55184
+54924
+49457
+51452
+49440
+54868
+53444
+44396
+51204
+44452
+49692
+50696
+51137
+54644
+49345
+53440
+50896
+54980
+51452
+44228
+47924
+50612
+52488
+50724
+44256
+50976
+54924
+44305
+49444
+49569
+55148
+52397
+51228
+52628
+45209
+46021
+52265
+48708
+44284
+50948
+50976
+49688
+49900
+51312
+52392
+47049
+49692
+49688
+45812
+49900
+51032
+47784
+49900
+52393
+54889
+44036
+54644
+54617
+50508
+50948
+50501
+50976
+55012
+52280
+51088
+50516
+50616
+52404
+48120
+54200
+49436
+47784
+45817
+49549
+49324
+50836
+48169
+51061
+44216
+48128
+44540
+47564
+51201
+51204
+47448
+45812
+52280
+52488
+46976
+48372
+55100
+50616
+44204
+49452
+52280
+44257
+52380
+54945
+54616
+44089
+54861
+54632
+54861
+44228
+54812
+54876
+47308
+54632
+46021
+47217
+46160
+44053
+44592
+49884
+54413
+46321
+50756
+48708
+49688
+54632
+54413
+51656
+51656
+50684
+50684
+49884
+52629
+54924
+46024
+51032
+46024
+50669
+44204
+54028
+54980
+50529
+51200
+49345
+54872
+44204
+44036
+54644
+44144
+48512
+55148
+48712
+54840
+50696
+51200
+44032
+48516
+54812
+54841
+50728
+50896
+48712
+51201
+51333
+48516
+55148
+52824
+54364
+49884
+54620
+48708
+45468
+48708
+44396
+45468
+50976
+52488
+47589
+49324
+55092
+55012
+44036
+54617
+47589
+47589
+54620
+47784
+47532
+50696
+54588
+50976
+44032
+45800
+47896
+48708
+55092
+50529
+47336
+47589
+52628
+45800
+54872
+54869
+54056
+51221
+50896
+48512
+51116
+44277
+53945
+51060
+54637
+50756
+48712
+54868
+54032
+53456
+44288
+52293
+51656
+51060
+51200
+49464
+54588
+51088
+51060
+44480
+54200
+54212
+47588
+45824
+49373
+54889
+48708
+52393
+51060
+51648
+47924
+54616
+48516
+45516
+51076
+54924
+54644
+48320
+51088
+44032
+55100
+51201
+44368
+54644
+51109
+52380
+50689
+49692
+51652
+49324
+48712
+48712
+44396
+49324
+44288
+51109
+51452
+47280
+52268
+49324
+52840
+49345
+51204
+48176
+44081
+54788
+47588
+52380
+49688
+48512
+53456
+51333
+51333
+51656
+51116
+51109
+46020
+49888
+54805
+52632
+50868
+48372
+51116
+47280
+48393
+52285
+51116
+51081
+50528
+51104
+48512
+44396
+49352
+49353
+47308
+50948
+54056
+49340
+50756
+51648
+52712
+54364
+50980
+51613
+45812
+52268
+50504
+48373
+49452
+47564
+50689
+49888
+44048
+54788
+51109
+48708
+46021
+49549
+50504
+49345
+54788
+47329
+44277
+51109
+54056
+51221
+48512
+50896
+44277
+51116
+52293
+54788
+54056
+51109
+54868
+51656
+54032
+53456
+48712
+54212
+44396
+51200
+44288
+51060
+52380
+48516
+49464
+52393
+44480
+54889
+45824
+47924
+48708
+54616
+51060
+51201
+51648
+44032
+54924
+51088
+51076
+47280
+51109
+51088
+54644
+49888
+44396
+51652
+47280
+49324
+48512
+46020
+51116
+49549
+49345
+49324
+48708
+51452
+44081
+48176
+53456
+47280
+48393
+52684
+48512
+51104
+49352
+49353
+50504
+52268
+50980
+51613
+49452
+50689
+44277
+51201
+54785
+49324
+45212
+46041
+54785
+51221
+54785
+51221
+51088
+54616
+45817
+51452
+51452
+47141
+44508
+48512
+51312
+44036
+44592
+49328
+44221
+44552
+49440
+51088
+44208
+44540
+51648
+51088
+51652
+51652
+51208
+51200
+52488
+51200
+49901
+51104
+44404
+50900
+52628
+44600
+52628
+51452
+54876
+54792
+51088
+51312
+53440
+47148
+44036
+51340
+52489
+54785
+51312
+49549
+51020
+44397
+44216
+51089
+51137
+52488
+50976
+47197
+52712
+53461
+52628
+51088
+51228
+52628
+52825
+54889
+44368
+44368
+52488
+51312
+51201
+51060
+52268
+52268
+51313
+54028
+48149
+50724
+55128
+46024
+44208
+48512
+52280
+44204
+48169
+51648
+49341
+50900
+54028
+44592
+50557
+52285
+53441
+53468
+50696
+51204
+47161
+47588
+48156
+51656
+44256
+53440
+44032
+52264
+54252
+44032
+51452
+44396
+51217
+52377
+48512
+48152
+51200
+49328
+54028
+45768
+44144
+47141
+44540
+51060
+51201
+45796
+49440
+44368
+53440
+51452
+51204
+44284
+49464
+44452
+44277
+44508
+54637
+52824
+45432
+48320
+52824
+44161
+46020
+49440
+52380
+45804
+44368
+54596
+49440
+53440
+51228
+44397
+44592
+49689
+46020
+52489
+44221
+49453
+49548
+48372
+50696
+51456
+47924
+49548
+47049
+50857
+44033
+51452
+44368
+48512
+45813
+52380
+44592
+50948
+50976
+53441
+52393
+51201
+45392
+44397
+49453
+47452
+47449
+47497
+44284
+44144
+51648
+50896
+44428
+52377
+48513
+51320
+52393
+44592
+52629
+51333
+52292
+51333
+48337
+44036
+51221
+51216
+52377
+50976
+53441
+46164
+51456
+50857
+51333
+51228
+52264
+52840
+45800
+44148
+44284
+53461
+50864
+48373
+51313
+51217
+54200
+50976
+45265
+51228
+49324
+53748
+44148
+46020
+52264
+54812
+45813
+52285
+51204
+51204
+51228
+52377
+49453
+47564
+47448
+51104
+54596
+50857
+47197
+47308
+52629
+45817
+45824
+52629
+49324
+44508
+51201
+52377
+51109
+52377
+47564
+51333
+47144
+48533
+51312
+50672
+48324
+53748
+44516
+46321
+52789
+49440
+48264
+51452
+51333
+51456
+48156
+52629
+52629
+44432
+44432
+47536
+45813
+44368
+44368
+48373
+47308
+46024
+52268
+44288
+51312
+45804
+48317
+48317
+52489
+44144
+51200
+44368
+46024
+51452
+51228
+47924
+50557
+45380
+47536
+47157
+52377
+47141
+51648
+51204
+51452
+45800
+50948
+47329
+47536
+49440
+50948
+52268
+46976
+49453
+50577
+49444
+49453
+45813
+44396
+51201
+52268
+52268
+49324
+44592
+44285
+47536
+49888
+44417
+53456
+48516
+44396
+52404
+53440
+53440
+44417
+46993
+51064
+46972
+50780
+44592
+44397
+45817
+44277
+51109
+50616
+48120
+44053
+44396
+47336
+47196
+53440
+51649
+50504
+52404
+46020
+51025
+50725
+52264
+50508
+44452
+44400
+49464
+50900
+49440
+45824
+54732
+48276
+51064
+49328
+44305
+49688
+46024
+51652
+45824
+50529
+45225
+44592
+47784
+50672
+51076
+44552
+51204
+44361
+54840
+44396
+54889
+51200
+47161
+53468
+50836
+51652
+48516
+44305
+50521
+54077
+48176
+44256
+44256
+54252
+51452
+50857
+50529
+48156
+52629
+51648
+52488
+44032
+51068
+44221
+49885
+48337
+51060
+44277
+44397
+44368
+44305
+47196
+54644
+51204
+51452
+51116
+51648
+50836
+47049
+50837
+49548
+50976
+50756
+44400
+52393
+47564
+48372
+44221
+51452
+50696
+47497
+52393
+51092
+47049
+52824
+55064
+47581
+52384
+44284
+44048
+51032
+54077
+52380
+44260
+50672
+48337
+44288
+48176
+50980
+48176
+47049
+50672
+50976
+51665
+50577
+54632
+52380
+51452
+49692
+44040
+50976
+54945
+49688
+48373
+52824
+48373
+50728
+48516
+51204
+50668
+50728
+44048
+44257
+51652
+54624
+50896
+47197
+44368
+52488
+51204
+49464
+50672
+49444
+52384
+44368
+51092
+48373
+47308
+48516
+48264
+47536
+44040
+49353
+44048
+54872
+51032
+44201
+45824
+51060
+50668
+54632
+44361
+47280
+48708
+50669
+47141
+47196
+47536
+52264
+50508
+44452
+54732
+45824
+51064
+51204
+50529
+47452
+50672
+44361
+44256
+44032
+47196
+52629
+51648
+51068
+54840
+51652
+47141
+52488
+44221
+49885
+51116
+51648
+44368
+51452
+51204
+47196
+44368
+52393
+48372
+47049
+47144
+48176
+55064
+44260
+47581
+47049
+52384
+52824
+51452
+48373
+51665
+50728
+49688
+48708
+50896
+54624
+51204
+47197
+52384
+47536
+49888
+44256
+49324
+49324
+54588
+51396
+48320
+46980
+46980
+49324
+49444
+54032
+54032
+48320
+48320
+49444
+48320
+48152
+49324
+48320
+48320
+51652
+50837
+45453
+45453
+51652
+52265
+52265
+51068
+51081
+48320
+48320
+49901
+51077
+47308
+52404
+52380
+44036
+52380
+50864
+50724
+55128
+49888
+51060
+44284
+47588
+49436
+51105
+44305
+46028
+46164
+50689
+52404
+50868
+44540
+54637
+50500
+48152
+50724
+52404
+50752
+54872
+51200
+51473
+51652
+50896
+50948
+47144
+51648
+52393
+45768
+52488
+47148
+51060
+54805
+44032
+51652
+53468
+51060
+51201
+48149
+50773
+51656
+52293
+46020
+49696
+51060
+44161
+44221
+54924
+46041
+50976
+48120
+48337
+51201
+45236
+51060
+44208
+52628
+47148
+51456
+53748
+49569
+44292
+46020
+48169
+54980
+50669
+46024
+54805
+49440
+49552
+54252
+50976
+49548
+51452
+53804
+52629
+44396
+52404
+52404
+46020
+44221
+51201
+46160
+51032
+51200
+53685
+44305
+50724
+49436
+47161
+49549
+51312
+51456
+48393
+50672
+49324
+54924
+47532
+44257
+47000
+48516
+52265
+44208
+48337
+54872
+52404
+47197
+50976
+51452
+51652
+50977
+53441
+44508
+50948
+51201
+51068
+45804
+50896
+46972
+54605
+45265
+50976
+53461
+49688
+46164
+49688
+50616
+52380
+51648
+52404
+50864
+49885
+51221
+50976
+50868
+50501
+54200
+44284
+50508
+54616
+54889
+51452
+46020
+45804
+50948
+45224
+50976
+44396
+50836
+52628
+47448
+49552
+45813
+52404
+51648
+50896
+49548
+53457
+44204
+55085
+50836
+44288
+51109
+50724
+51201
+49341
+52825
+49549
+51312
+52264
+46164
+52404
+47336
+51648
+51340
+47536
+51456
+50836
+52380
+49440
+55100
+50976
+50724
+50836
+44144
+49436
+54588
+50836
+47588
+54644
+49688
+54872
+51204
+46321
+51060
+47561
+48320
+48320
+46989
+47140
+50896
+50976
+45208
+47532
+51021
+51221
+46321
+44592
+50745
+49328
+54620
+50864
+47581
+50668
+44277
+49437
+44305
+48512
+54637
+48712
+48169
+54805
+45208
+55124
+49900
+48169
+50896
+52492
+54868
+49324
+48169
+44368
+44396
+50864
+44048
+53468
+44396
+54596
+48708
+48337
+49548
+54056
+50752
+51200
+52628
+50629
+47536
+44305
+44508
+51452
+49884
+44256
+50865
+44060
+54633
+44537
+51656
+44600
+49692
+54980
+54805
+44368
+54644
+44508
+45208
+45229
+44217
+54924
+51221
+46993
+50868
+50672
+49457
+46160
+52824
+47140
+48512
+50724
+48512
+44256
+54617
+46993
+44217
+44221
+44400
+50689
+48156
+44537
+54056
+47141
+50868
+48512
+54952
+52376
+48708
+52397
+44285
+51452
+45812
+52628
+48337
+47000
+50696
+52840
+50864
+48512
+54693
+45800
+44201
+50745
+44368
+51032
+46020
+50616
+48120
+50557
+54056
+50501
+50976
+44204
+50864
+50868
+54980
+44508
+54693
+54693
+49688
+45817
+47749
+49885
+50837
+52629
+51088
+52628
+44201
+50724
+54693
+50868
+54840
+50857
+48708
+47561
+49548
+48512
+47308
+51008
+51204
+54840
+44368
+50616
+51109
+47564
+44368
+54728
+46321
+54224
+49900
+48708
+51613
+50948
+51221
+47924
+49440
+47536
+54028
+45800
+47609
+50629
+51312
+54924
+54413
+47805
+52628
+44305
+47144
+52268
+51204
+50864
+44592
+50672
+52280
+52268
+47161
+54872
+55092
+54413
+52268
+47141
+50976
+51221
+52628
+51089
+48176
+51452
+51060
+54637
+50864
+51452
+50684
+52712
+47784
+53456
+54980
+46160
+51664
+48516
+50896
+48512
+50728
+53468
+52392
+44032
+53440
+52488
+44048
+44256
+49548
+48156
+49688
+51116
+47749
+45209
+52384
+49688
+50976
+46041
+51648
+49440
+51109
+51221
+50980
+46020
+54952
+47588
+54841
+49328
+47280
+54252
+52712
+54644
+50684
+49884
+50577
+50976
+47197
+47548
+50628
+46020
+48176
+51092
+49692
+45812
+52712
+52384
+52488
+44260
+51228
+54632
+46020
+54840
+49436
+49457
+53456
+52628
+49692
+50728
+48156
+44049
+49688
+48120
+52384
+52628
+52264
+50728
+50689
+50521
+51088
+54644
+45817
+51109
+54364
+52280
+50612
+47532
+51312
+47308
+51032
+51109
+48373
+52488
+54812
+45812
+48156
+45453
+50669
+50696
+44089
+50684
+51032
+50577
+50976
+54984
+49688
+50672
+47161
+48120
+48120
+50577
+55124
+51312
+49884
+48120
+50684
+48320
+52292
+49437
+50976
+49437
+49437
+51060
+51473
+50556
+50577
+47532
+44608
+44552
+44396
+51012
+51312
+46020
+49632
+51221
+48149
+44396
+55121
+48512
+52840
+52841
+54036
+46976
+48512
+45236
+51312
+49340
+52488
+44396
+52380
+44208
+48276
+50864
+54868
+54620
+44277
+51116
+47581
+51068
+52404
+49324
+55128
+51061
+52292
+49324
+53664
+49437
+45376
+52380
+54872
+51064
+48317
+50556
+44540
+54028
+48169
+52840
+44204
+46160
+50900
+50672
+48512
+48708
+45225
+49900
+50752
+44208
+46164
+44396
+51064
+44160
+54032
+49341
+51076
+52488
+45684
+48516
+50980
+51032
+44552
+48708
+44284
+54945
+51020
+44512
+51312
+50669
+51473
+45393
+44060
+51068
+54868
+53468
+54637
+50896
+54840
+50529
+47928
+53441
+51088
+45768
+46028
+49884
+48124
+44256
+50500
+50689
+48337
+49324
+44256
+48156
+54588
+50725
+49324
+51089
+54252
+50976
+51204
+44049
+51652
+49324
+49884
+52384
+44144
+52393
+49324
+49324
+54788
+52488
+54252
+54868
+54596
+49373
+49436
+49437
+48149
+51452
+52825
+51105
+54028
+46041
+44216
+48520
+51116
+47448
+50672
+48512
+47549
+50900
+48708
+50521
+48152
+48156
+44161
+44396
+49696
+51221
+47924
+45768
+45393
+52404
+44032
+47785
+45800
+49888
+51060
+49324
+44305
+44032
+48513
+44048
+46041
+54805
+54861
+44368
+52824
+51060
+46973
+48337
+49885
+47784
+54801
+51008
+44512
+51452
+52509
+54693
+46041
+48177
+47280
+44228
+50984
+49696
+51076
+51316
+51656
+44277
+52293
+52404
+49440
+44204
+51204
+54588
+52384
+49688
+54980
+47749
+44284
+51312
+49452
+54632
+55092
+44512
+52264
+47196
+44600
+48317
+50668
+48120
+51032
+51064
+44305
+50504
+51452
+50976
+49353
+44256
+51204
+46976
+49324
+50528
+51312
+54620
+50696
+49464
+44081
+44396
+49548
+49453
+49688
+51109
+51228
+51340
+44292
+54861
+51333
+46160
+47140
+47588
+46993
+47576
+51088
+50980
+54056
+50725
+49549
+50837
+50672
+51221
+48156
+54872
+54801
+54945
+51204
+48393
+52392
+47564
+51648
+49324
+54788
+50724
+50612
+51312
+44305
+52265
+47148
+54805
+52840
+49888
+54632
+47148
+50556
+49436
+51221
+44397
+54788
+52384
+47581
+54252
+47532
+48152
+50696
+49457
+44256
+47532
+53945
+48337
+51452
+44537
+46021
+47448
+52572
+44144
+52285
+50896
+44204
+44053
+51312
+46020
+49345
+47452
+44284
+47497
+54028
+45433
+47532
+52285
+48512
+44428
+48124
+52544
+54077
+50504
+48708
+54632
+50500
+52628
+47280
+50500
+44361
+53457
+44260
+46021
+52628
+52628
+52824
+51137
+48516
+45393
+51333
+49692
+45812
+51221
+44592
+51204
+52384
+44592
+50977
+44552
+44288
+47896
+52285
+51204
+49437
+46041
+51312
+44256
+52265
+49696
+51652
+47197
+47609
+47197
+54868
+54364
+50508
+47000
+44557
+48169
+47924
+45236
+47576
+52280
+54840
+46301
+55124
+44552
+54848
+44221
+48277
+47928
+44060
+50689
+49884
+50672
+44284
+49440
+46020
+46028
+50948
+51333
+48373
+50976
+51665
+50501
+44400
+52840
+51228
+52272
+54841
+50577
+45800
+54616
+50864
+44081
+49457
+44361
+50808
+48373
+52488
+49341
+44228
+49324
+44361
+44508
+52392
+47924
+52488
+52488
+54980
+50976
+52509
+54872
+49453
+48124
+44048
+45800
+44148
+49569
+44508
+54840
+49440
+53440
+44040
+52840
+54200
+51333
+52824
+49688
+50556
+48120
+54028
+50528
+44228
+51204
+48120
+52264
+45813
+48169
+54624
+44216
+49353
+44060
+47448
+50836
+53457
+45572
+50745
+50857
+45817
+49604
+51137
+47141
+49325
+52628
+48149
+48152
+49341
+48708
+49345
+44053
+51088
+50724
+54805
+54889
+51312
+47448
+44060
+51456
+49604
+49688
+47576
+54840
+51652
+51652
+46972
+51068
+50896
+45817
+50620
+49885
+44032
+44032
+47560
+51204
+49569
+51312
+49604
+54616
+48393
+50728
+45208
+47196
+49604
+50864
+51313
+45800
+49688
+44288
+49440
+47144
+49688
+50724
+47564
+47561
+46972
+54596
+50696
+47448
+51201
+49340
+52509
+51064
+50724
+50724
+44081
+51109
+52572
+52377
+49345
+45817
+47564
+50857
+49328
+48393
+44221
+54364
+49436
+47336
+49688
+52509
+47217
+52280
+51216
+51312
+47140
+54616
+49892
+44053
+49345
+48533
+51109
+44204
+51137
+47196
+54868
+51665
+48149
+54812
+44053
+48156
+47536
+52293
+49688
+49328
+51137
+44452
+49324
+47448
+45544
+54945
+48324
+49688
+48264
+44368
+51204
+50577
+53461
+49345
+55100
+52488
+51456
+47308
+44208
+47196
+45824
+49900
+51104
+44592
+44036
+51333
+46321
+50500
+50689
+45824
+44432
+45572
+52404
+48372
+52384
+44552
+51109
+51221
+49440
+44060
+44036
+48708
+49688
+47196
+51204
+54924
+50724
+47156
+51089
+51312
+52392
+53441
+47280
+48317
+52384
+54872
+50685
+53441
+44284
+45817
+44144
+48516
+45804
+54224
+51032
+50528
+48264
+54984
+51312
+51452
+54945
+52628
+51228
+45768
+53457
+54869
+44221
+48712
+50689
+44452
+45397
+50976
+44048
+44048
+44204
+52272
+51656
+47736
+47140
+47280
+44228
+52268
+44305
+49345
+48393
+46989
+46021
+49325
+52265
+47140
+54364
+54252
+45432
+54788
+44288
+47217
+50501
+47196
+55136
+44048
+46976
+48149
+52392
+50557
+52280
+50577
+44148
+55092
+44288
+51109
+49453
+47280
+52268
+44396
+48152
+46972
+52268
+46976
+52265
+50508
+44285
+45817
+52489
+46976
+44552
+44396
+51012
+52840
+51221
+49632
+48149
+51312
+53664
+52380
+52380
+49340
+49341
+48276
+51312
+47928
+45376
+50577
+52292
+44204
+44060
+48708
+53468
+44144
+46164
+52488
+51333
+45225
+54056
+44053
+54032
+44160
+50900
+55136
+44512
+50724
+44396
+54637
+48169
+54868
+46160
+45684
+54028
+50725
+51204
+51221
+44216
+44256
+48156
+50500
+54028
+54252
+48156
+50900
+52393
+47785
+45800
+44049
+51204
+50976
+52384
+48149
+47161
+49325
+50672
+47448
+54252
+49884
+54788
+49324
+54596
+45768
+54588
+53441
+54805
+44256
+47196
+51060
+47581
+50500
+50976
+49457
+54801
+50556
+45544
+51656
+45817
+46041
+47140
+51312
+51064
+44060
+52272
+49688
+49440
+51221
+51452
+49452
+54868
+51204
+49604
+54801
+51312
+46973
+47749
+51137
+49353
+44368
+51032
+49328
+52509
+53461
+50504
+51008
+50668
+51452
+47196
+54252
+50612
+47000
+53945
+47144
+44081
+49548
+49604
+47532
+51221
+49436
+44284
+44256
+52384
+49688
+51340
+47148
+48393
+51088
+47448
+44060
+44036
+50696
+51228
+46993
+52840
+44397
+50500
+52285
+53440
+52392
+52265
+47896
+48516
+44592
+46301
+44284
+44260
+52285
+49437
+44256
+46972
+52628
+52628
+44552
+51656
+55124
+44428
+54848
+48512
+45812
+51221
+44144
+44144
+47609
+52824
+44228
+50689
+44060
+51109
+49569
+50501
+49341
+52488
+51333
+45800
+49688
+44361
+54872
+50528
+46020
+48120
+47336
+51088
+48708
+48120
+47561
+51652
+48149
+47141
+49453
+45817
+51204
+50620
+45208
+47448
+54840
+48169
+51068
+44032
+48712
+50857
+54364
+45817
+47564
+46972
+48533
+50857
+44221
+51201
+51313
+49440
+47448
+49900
+44432
+47308
+48149
+45432
+45824
+46976
+48372
+52268
+44053
+46321
+54869
+47280
+54872
+53441
+47156
+51032
+52272
+54364
+46989
+52280
+50577
+51109
+51109
+44396
+50724
+51208
+44404
+47308
+48120
+51109
+47928
+47568
+49328
+49452
+54841
+47928
+50684
+54224
+54620
+54224
+49328
+44060
+54637
+54077
+44361
+50980
+49340
+54620
+54620
+44036
+48124
+54616
+49688
+46160
+44049
+45544
+52392
+54217
+54616
+47161
+48320
+48708
+50980
+50528
+44288
+44033
+54633
+48268
+52629
+54861
+44508
+48124
+49436
+44260
+46993
+50668
+51221
+49324
+44397
+50676
+50676
+52380
+44201
+47536
+52285
+49332
+44260
+50628
+47928
+50684
+50508
+54844
+50669
+47928
+54637
+54252
+54637
+44201
+50836
+47928
+48152
+50516
+50948
+51064
+54876
+44208
+46976
+46020
+52380
+54077
+51204
+50620
+53457
+44060
+54633
+44432
+53960
+44288
+53804
+44228
+44508
+45817
+44288
+54364
+54632
+55137
+44452
+52380
+48317
+45817
+54872
+45804
+50728
+50896
+47928
+49328
+49452
+50684
+54620
+54224
+47928
+53960
+50980
+50948
+54620
+44361
+44036
+48124
+54637
+48124
+44049
+45544
+44508
+47928
+45804
+48124
+47140
+44060
+48268
+44033
+50528
+44260
+44396
+50676
+46993
+46020
+50669
+50628
+52285
+54785
+47928
+54844
+50684
+50508
+52380
+46976
+44201
+44452
+54876
+44208
+54633
+51204
+53457
+44432
+54632
+54872
+48512
+48512
+47477
+45824
+49888
+52380
+50732
+44060
+52824
+51020
+50577
+46160
+50529
+49849
+54032
+48176
+44081
+50980
+50756
+51648
+48708
+51221
+48169
+50577
+51020
+51652
+44228
+51221
+50529
+44144
+51200
+51312
+51312
+51216
+47161
+50500
+53440
+53440
+54588
+48337
+48512
+51228
+47449
+47217
+51652
+54805
+52824
+45572
+47589
+44053
+49688
+53440
+54620
+51060
+44452
+50864
+54644
+54633
+51456
+52488
+54805
+49692
+48512
+54224
+54633
+49452
+49849
+52377
+54252
+46160
+50896
+51652
+51228
+54632
+46020
+45216
+50868
+54744
+48176
+48708
+52628
+44592
+53748
+47452
+51020
+44397
+49688
+51652
+48708
+45733
+46020
+54632
+50977
+49849
+54744
+51064
+51200
+50577
+51081
+54801
+51473
+50616
+51020
+50976
+51228
+50864
+50997
+50948
+50808
+50620
+45824
+49688
+50516
+54889
+44228
+49688
+51008
+44592
+50628
+55092
+44201
+50868
+50724
+50808
+50528
+44537
+45817
+51228
+51109
+46020
+50724
+44537
+51008
+49328
+50836
+51064
+53748
+46321
+48708
+49688
+49688
+50724
+54744
+48516
+45768
+51060
+51228
+46020
+49845
+51008
+52377
+55092
+47217
+55148
+51060
+47168
+50696
+52628
+44033
+52377
+51456
+51204
+45212
+51061
+51089
+50504
+44552
+44204
+50885
+50500
+51665
+44256
+54872
+52824
+44396
+51456
+51088
+50745
+51200
+52628
+54840
+51105
+46973
+50668
+49688
+51312
+49688
+54620
+54869
+49933
+44288
+52628
+51105
+50745
+44228
+55092
+49688
+47448
+51060
+45212
+54617
+51105
+51665
+51665
+50864
+50864
+49444
+45460
+48512
+49341
+47785
+47928
+48516
+48169
+50868
+47141
+47549
+50521
+50689
+45516
+50516
+48149
+47805
+51204
+53461
+54840
+47924
+51312
+49688
+51228
+47785
+52840
+49548
+49341
+51221
+51652
+54056
+47588
+47161
+52376
+51452
+44285
+49341
+48708
+54861
+51216
+51020
+50696
+51452
+46164
+47548
+47161
+46041
+50689
+47924
+47161
+49345
+47161
+54616
+54861
+51020
+47589
+47589
+50868
+47448
+47805
+48712
+47924
+50948
+54869
+51020
+49845
+51061
+50528
+45812
+46321
+49328
+55100
+45432
+47469
+52404
+51609
+48169
+50577
+54056
+48317
+48120
+54413
+55148
+51228
+47588
+47805
+47805
+47280
+47141
+54869
+50528
+48708
+52404
+47217
+50689
+50528
+54413
+47141
+48372
+51089
+51312
+54617
+48729
+52397
+52397
+51221
+52380
+51652
+51221
+51221
+51221
+51221
+51221
+51204
+51221
+52380
+48708
+48708
+44256
+48120
+47732
+47732
+54252
+50685
+51204
+54924
+50685
+54785
+51221
+52292
+44036
+51064
+51201
+46020
+50732
+51064
+44552
+44540
+54868
+45684
+54028
+51064
+49341
+45225
+47568
+51312
+45804
+48152
+50696
+50836
+46020
+54588
+44040
+44361
+54252
+50521
+48337
+51064
+54801
+46020
+44600
+54812
+50504
+50504
+55124
+44277
+54616
+45804
+44368
+51221
+47564
+44221
+49632
+51312
+52488
+54788
+44277
+48393
+53457
+51109
+48708
+44285
+44397
+46989
+49453
+50976
+48169
+50517
+52628
+52628
+44040
+52488
+47924
+44397
+44148
+54200
+51228
+52380
+50728
+46020
+44396
+53457
+48708
+54812
+48152
+44201
+54596
+44285
+45817
+47336
+44452
+44368
+54868
+44592
+52380
+44053
+52392
+45804
+54925
+54788
+52380
+46021
+47568
+52380
+46976
+50948
+51064
+48520
+47588
+44428
+44049
+50948
+52488
+54620
+54624
+46024
+50976
+50868
+49453
+50948
+50948
+48176
+46020
+44396
+50728
+44256
+54596
+50948
+54812
+46021
+47568
+46021
+50948
+51064
+48520
+54620
+50948
+50728
+46020
+44396
+44396
+44396
+54644
+49452
+51228
+51020
+51105
+50868
+49548
+47141
+48393
+54889
+50689
+50868
+48393
+50516
+51020
+54693
+54840
+54792
+51221
+44221
+44508
+54637
+49692
+50504
+49688
+51060
+50865
+50752
+49569
+44508
+44592
+54637
+50696
+50756
+48152
+46024
+51201
+51216
+48152
+54028
+50689
+52293
+44221
+47280
+54633
+44368
+50508
+50529
+50948
+55184
+44292
+49888
+51060
+51060
+54644
+53748
+54200
+48337
+47280
+48512
+54801
+46160
+54924
+44508
+54801
+46980
+51221
+51221
+50689
+44400
+54841
+50516
+44221
+53748
+53748
+48712
+47280
+53748
+51088
+51088
+52628
+51221
+47280
+45812
+54632
+44036
+44284
+52684
+44221
+44552
+51060
+49884
+51228
+50529
+50501
+50504
+50896
+54632
+50745
+51204
+50504
+54788
+49888
+51032
+50896
+49345
+51204
+51204
+44053
+44264
+50976
+47308
+54364
+51032
+47564
+52629
+54952
+54840
+52488
+44256
+49552
+50628
+55036
+51204
+50976
+55001
+48712
+54788
+48712
+47196
+46988
+49453
+44288
+54792
+51221
+44221
+50504
+54637
+49692
+49688
+50865
+50756
+44256
+46024
+44592
+48152
+49569
+54637
+50696
+47196
+47161
+54028
+44221
+55184
+54801
+51221
+54633
+50689
+44221
+54644
+51060
+48712
+54924
+53748
+50516
+50689
+50689
+44284
+51228
+50745
+50501
+51204
+50504
+50529
+49453
+47564
+51204
+49345
+54840
+47280
+51204
+50976
+48712
+44288
+54413
+54364
+54413
+48512
+54616
+51216
+48149
+49341
+53468
+53468
+47148
+44292
+49440
+49548
+44396
+54364
+49884
+50948
+50577
+50836
+49688
+44060
+49548
+48276
+47448
+49845
+47308
+54364
+54364
+47448
+54364
+54364
+54364
+47308
+54364
+49892
+54413
+55092
+54413
+50577
+51216
+48149
+49341
+44396
+49884
+49688
+50836
+47448
+54364
+54364
+54364
+48708
+48264
+48708
+48708
+49885
+49885
+49552
+44592
+51221
+49324
+53441
+51204
+49552
+54693
+46024
+51076
+50612
+44428
+52825
+51020
+48152
+48152
+49552
+51020
+51452
+51060
+51089
+54596
+51088
+46020
+47448
+51088
+52384
+49324
+54252
+49885
+46028
+54644
+51076
+52392
+44368
+54801
+48337
+50836
+46041
+51088
+54693
+50577
+44428
+51060
+50684
+46973
+51032
+52268
+48156
+45516
+50500
+54252
+51456
+46160
+49549
+50668
+55148
+54952
+54844
+44284
+49885
+51204
+52404
+48337
+54632
+48512
+50629
+45812
+48708
+51109
+50948
+44288
+50613
+45212
+50868
+54840
+54889
+52384
+55036
+51204
+54980
+50528
+45817
+48516
+50948
+44264
+49324
+49569
+45817
+48149
+44256
+55148
+44452
+47448
+49688
+46020
+50685
+50728
+47561
+45817
+47564
+54596
+50612
+49688
+44540
+49328
+44452
+52268
+49440
+55148
+45812
+51032
+44592
+50836
+51137
+50745
+46020
+50696
+54693
+51204
+48516
+54644
+47805
+50684
+47560
+52280
+50577
+46972
+52268
+45229
+49885
+51221
+44592
+53441
+45817
+46024
+55148
+51076
+50612
+52825
+48152
+51020
+51204
+49885
+54252
+49324
+46028
+51060
+51060
+50836
+54693
+54801
+46973
+44368
+51032
+48337
+48156
+46160
+50500
+50668
+45516
+51456
+44284
+54844
+54632
+44288
+49324
+44452
+44264
+49688
+52280
+50685
+47561
+48149
+47448
+49688
+44540
+47564
+49328
+52268
+50577
+49688
+44508
+44341
+54693
+48516
+48156
+45768
+54596
+48156
+46020
+54632
+48708
+51204
+50516
+50528
+48373
+54800
+50728
+54805
+48516
+48712
+55141
+47560
+50612
+54413
+44036
+51201
+53440
+53441
+52824
+49692
+51452
+51648
+54056
+44540
+51068
+49341
+50980
+47928
+52841
+45812
+47140
+50864
+48149
+48372
+44208
+53468
+50669
+44396
+47928
+44396
+44221
+54028
+51312
+50896
+54217
+52628
+44144
+51452
+45432
+44396
+48708
+51109
+44032
+47161
+51652
+53468
+48512
+50521
+49324
+54596
+53440
+53440
+49324
+47448
+47588
+48320
+51312
+52824
+50997
+46321
+46041
+49692
+51204
+49888
+44221
+51060
+54644
+48149
+51452
+51064
+45209
+51452
+45800
+54644
+47448
+44397
+49569
+52840
+48169
+46993
+54620
+46020
+54788
+53468
+51456
+50500
+48729
+49457
+50528
+47197
+52628
+51452
+49324
+48337
+44260
+46020
+47000
+51333
+44284
+44592
+44592
+54744
+48708
+49548
+54744
+44040
+50836
+47924
+54200
+52509
+54200
+51204
+48708
+54889
+44148
+54925
+50976
+51228
+51204
+54616
+51333
+51333
+50976
+49324
+50780
+53444
+44480
+49688
+44148
+49849
+51600
+47448
+54077
+46321
+54812
+52488
+46021
+50504
+50896
+52628
+49548
+49440
+47140
+52824
+49345
+47197
+49845
+46972
+51109
+47589
+50724
+52280
+54364
+52509
+44396
+54596
+51648
+50984
+54728
+54868
+48156
+49689
+54952
+47536
+51092
+46024
+47448
+53444
+51613
+45812
+44368
+52384
+54744
+46972
+45800
+44221
+50669
+50629
+53441
+48712
+52712
+50672
+47329
+47140
+46321
+50577
+44592
+49345
+44397
+55092
+54872
+50668
+54364
+47560
+50612
+53440
+49692
+52824
+44396
+51068
+48149
+47140
+51109
+49324
+49324
+48512
+44396
+52628
+51452
+53440
+45432
+44032
+50669
+53468
+54952
+47588
+51064
+44368
+54868
+46973
+54644
+48320
+54364
+47140
+48729
+54744
+49457
+52840
+51456
+44592
+44592
+44284
+52628
+51333
+49689
+52280
+54200
+51600
+51333
+49548
+47924
+50724
+47448
+44148
+49440
+54364
+46972
+52509
+51092
+52712
+44592
+49345
+50577
+44264
+50948
+50948
+50948
+50864
+54620
+51061
+54637
+53804
+44040
+48149
+54588
+51088
+52404
+51200
+44256
+54644
+44368
+54980
+44284
+44201
+53748
+44221
+48320
+48708
+44284
+44032
+50864
+49688
+47336
+48149
+54952
+48169
+48149
+51088
+44288
+48712
+47560
+47308
+47336
+54952
+52489
+51109
+49688
+52404
+48712
+44288
+47196
+44256
+44256
+44256
+44256
+44368
+47196
+51312
+54364
+44260
+44260
+52404
+48169
+55092
+50684
+47784
+45812
+44260
+48712
+48156
+52488
+48708
+51088
+48156
+50684
+52404
+54252
+54588
+47924
+48520
+51060
+50857
+44257
+44277
+55092
+44292
+44228
+48393
+51340
+49548
+49324
+52404
+47532
+48712
+51333
+52404
+48533
+49569
+51137
+44428
+51333
+49692
+51204
+52628
+54840
+46980
+52628
+44592
+47156
+51652
+48712
+48393
+47560
+49340
+47564
+47564
+49849
+49688
+47564
+44036
+44036
+45453
+54872
+44292
+45397
+48712
+47157
+50577
+46160
+53804
+47308
+54861
+54785
+53804
+54632
+53804
+53804
+44396
+52285
+50872
+50872
+44201
+44428
+48512
+49900
+44508
+51333
+47448
+44508
+49345
+51453
+44480
+47588
+44592
+44592
+44060
+44340
+54844
+48156
+48177
+47588
+54988
+50684
+49548
+47049
+50669
+52628
+44592
+47581
+47049
+50948
+44048
+47532
+54364
+54596
+47560
+44592
+54728
+49688
+50684
+52280
+50612
+46020
+51064
+44208
+51077
+54861
+53441
+51312
+44592
+49436
+54868
+44161
+49324
+54637
+46024
+47568
+44060
+49900
+48152
+50896
+48708
+45432
+47928
+54840
+47196
+49324
+48169
+48516
+45225
+50864
+54200
+47784
+44032
+54633
+54728
+54632
+48708
+47161
+53440
+48156
+49688
+54217
+48520
+54596
+51228
+48120
+44396
+51312
+48177
+50976
+44260
+54588
+51216
+49457
+53468
+54252
+48512
+51088
+44144
+44256
+49437
+46041
+45824
+53457
+44600
+49689
+54980
+49345
+51060
+50504
+50808
+51312
+51452
+51064
+47148
+46973
+46041
+51228
+51648
+48337
+50976
+44368
+48372
+54644
+49440
+54633
+54924
+47196
+48373
+44256
+55092
+53448
+44400
+51228
+47732
+49548
+51088
+49324
+52840
+50668
+45516
+52393
+44260
+44221
+49548
+50864
+44396
+49440
+54252
+54872
+51312
+47532
+49324
+49324
+44256
+47800
+49457
+47532
+51452
+55148
+50857
+49888
+52824
+44592
+52397
+49345
+45516
+49692
+44228
+51312
+52393
+44256
+52628
+46041
+47000
+48708
+50696
+50669
+44260
+47449
+44396
+52285
+44221
+47452
+47497
+52628
+47532
+47609
+51333
+51228
+50684
+54840
+50612
+51200
+49836
+49548
+54844
+51228
+54980
+49457
+45796
+46980
+51333
+51593
+54200
+54200
+54872
+52380
+51593
+50808
+50948
+50745
+52632
+50976
+51217
+54889
+47144
+50616
+52628
+52628
+44148
+48317
+50501
+50577
+48373
+49352
+54632
+54616
+53440
+54840
+49892
+50557
+49440
+50728
+44216
+54840
+50724
+48169
+49548
+47448
+47560
+49884
+49324
+54872
+51088
+46321
+53457
+50836
+50517
+50857
+44148
+44592
+50728
+50557
+49888
+47144
+50724
+47477
+55064
+48124
+51228
+51312
+44396
+44204
+49548
+47564
+49845
+49688
+54364
+51201
+44592
+52629
+51109
+52628
+51204
+50857
+51109
+44053
+49444
+48324
+50984
+44144
+49345
+48156
+44368
+49900
+49689
+54889
+51456
+49440
+49440
+48264
+44432
+51064
+49900
+47896
+55148
+51613
+54693
+48516
+54872
+54980
+54924
+51593
+49548
+51204
+44048
+44452
+49849
+47168
+49345
+47280
+49436
+50528
+50976
+51228
+49436
+54868
+49436
+47140
+47157
+47141
+47736
+52840
+49345
+50501
+47196
+44288
+47140
+49440
+50612
+46020
+44592
+50864
+46024
+47196
+48169
+54028
+44032
+48156
+54217
+51216
+47196
+50976
+51088
+48512
+48177
+54252
+54980
+54588
+53468
+54644
+44600
+44256
+50976
+51060
+46041
+51593
+54980
+54924
+51228
+44368
+49440
+51088
+49345
+49900
+44221
+47140
+47144
+44204
+47532
+49884
+51312
+44260
+49324
+54872
+44400
+51593
+50857
+52397
+47497
+44592
+52628
+48708
+44260
+52285
+44256
+50696
+50684
+51312
+44221
+49548
+49836
+52824
+48516
+51217
+48317
+49345
+51228
+50728
+50808
+49352
+50501
+52628
+48373
+54889
+52380
+51109
+54200
+49548
+50724
+44592
+53457
+54872
+50836
+48169
+44216
+47477
+54364
+49444
+48324
+47564
+48124
+50857
+50948
+49845
+44432
+49440
+47536
+51456
+54868
+44048
+47168
+51204
+44288
+51312
+51012
+48512
+47141
+44396
+48373
+50504
+48512
+46020
+44228
+48393
+51077
+44036
+49884
+48393
+47749
+48372
+50672
+51648
+54840
+44552
+48512
+48152
+47928
+44204
+49324
+50725
+48512
+50836
+44208
+44201
+54596
+54872
+51664
+48372
+50504
+50500
+51221
+48169
+48393
+47928
+44396
+53945
+44032
+45432
+47161
+47736
+54605
+53440
+48124
+47549
+48320
+52824
+44032
+50896
+51088
+44396
+54952
+52824
+45800
+51200
+50836
+44256
+51333
+50984
+50521
+50984
+50517
+51068
+50857
+51204
+54617
+53748
+50724
+51060
+44292
+50528
+51648
+50504
+54665
+44368
+50508
+47148
+51452
+50577
+51228
+54861
+46973
+50668
+47784
+54633
+51076
+44368
+55092
+51452
+52824
+44033
+54665
+45380
+47749
+46976
+44217
+44592
+46020
+54872
+53440
+54252
+47924
+44204
+50837
+48156
+51456
+51456
+44161
+55148
+44400
+44201
+46021
+44221
+51228
+50500
+50500
+44305
+44257
+47924
+49888
+47000
+44033
+54032
+47197
+48337
+49436
+48373
+50516
+53441
+48533
+44552
+44048
+54596
+51312
+47449
+51089
+44204
+44397
+53664
+50500
+50896
+44592
+47140
+50556
+52628
+44277
+53448
+44260
+49849
+44592
+44221
+50669
+50669
+52397
+52824
+47000
+46041
+52376
+49692
+44221
+44144
+44404
+51060
+51333
+44228
+49696
+54805
+52825
+47896
+50976
+50516
+52628
+51228
+54840
+51228
+50501
+44060
+47784
+48373
+52632
+46028
+50616
+44040
+50896
+54200
+44260
+48120
+54840
+50689
+45800
+47785
+44201
+44036
+52285
+48169
+54617
+50549
+50896
+44148
+50745
+49324
+54617
+52628
+45817
+54624
+50557
+47448
+52377
+44264
+44216
+51456
+54620
+51088
+51088
+51061
+50836
+50504
+44228
+47456
+51204
+44396
+52404
+52404
+50669
+46020
+47560
+44368
+44256
+51204
+49888
+44553
+45800
+51088
+50724
+50836
+50696
+44396
+52825
+51648
+47448
+50857
+47336
+54596
+49345
+51089
+50612
+47924
+44432
+51020
+45800
+49324
+52488
+51068
+54868
+48324
+50549
+49689
+54889
+48264
+44368
+47308
+50672
+44256
+52712
+54620
+54620
+46020
+47588
+51456
+55100
+51025
+45432
+45800
+54620
+54617
+51032
+48317
+52489
+46972
+44228
+51032
+44201
+53469
+50864
+51204
+50629
+50577
+48317
+45397
+54869
+49884
+50549
+47805
+51201
+50501
+50668
+47448
+48373
+47196
+54617
+47217
+49345
+50557
+50549
+44288
+44396
+47532
+45212
+51312
+44396
+44228
+50672
+47749
+49884
+44396
+50500
+52285
+48372
+51664
+44256
+46041
+47196
+50517
+54952
+50521
+47161
+52824
+44396
+50896
+54617
+53440
+49324
+51648
+51060
+44292
+55092
+54665
+51452
+54633
+46976
+54861
+47924
+48156
+47532
+44204
+44257
+50500
+50837
+54620
+51228
+47924
+51089
+47896
+50516
+44260
+54596
+48533
+44048
+49692
+44221
+50896
+49689
+54840
+44040
+50501
+44264
+52628
+51088
+48120
+47785
+50669
+50836
+50669
+49692
+52377
+51061
+44216
+54617
+50696
+50549
+51088
+47448
+47308
+52488
+52712
+55100
+47196
+54872
+51204
+51025
+54869
+47805
+44288
+49345
+47196
+44557
+47161
+44048
+54632
+52264
+44048
+44048
+50684
+52264
+45433
+50864
+52628
+44452
+54252
+52628
+54252
+51312
+44512
+51452
+44204
+48120
+48120
+50864
+47448
+49888
+44512
+47536
+50696
+44592
+47197
+44396
+44512
+44221
+50668
+54693
+50516
+44032
+48120
+47456
+49324
+51109
+51064
+44221
+51228
+47161
+50516
+52628
+47589
+47589
+55128
+52488
+48512
+47732
+47732
+48512
+54252
+44144
+44397
+47784
+48512
+54620
+47000
+44397
+47732
+47532
+54413
+48512
+48512
+47732
+47560
+47560
+47560
+55064
+47560
+52628
+54693
+48516
+54889
+54889
+44552
+44305
+52392
+51452
+54945
+44508
+44305
+54945
+49436
+50668
+51216
+47532
+55121
+55121
+51061
+44160
+45812
+44592
+46024
+47925
+47925
+44216
+45824
+52636
+50976
+51216
+51060
+55184
+50684
+52636
+47588
+50516
+44221
+50872
+47140
+45817
+46021
+52280
+50504
+50516
+50516
+45812
+50516
+51652
+45824
+52280
+50696
+48120
+45812
+50684
+46021
+47196
+52824
+48516
+48520
+48372
+48124
+48124
+50896
+52629
+44144
+51312
+50752
+51452
+51648
+47609
+50724
+48324
+53440
+48317
+50896
+51312
+53440
+51221
+47729
+45236
+51221
+51088
+44256
+44256
+46041
+48516
+46020
+50672
+48708
+52285
+44256
+52377
+50672
+45817
+46321
+49436
+49436
+48516
+54224
+47928
+48156
+52488
+53440
+51333
+44396
+49373
+49437
+50976
+49884
+51221
+50724
+45380
+51221
+54844
+44201
+50616
+46028
+49324
+54812
+44216
+50616
+47336
+48708
+44508
+44396
+54620
+50732
+50732
+54980
+55148
+50508
+49324
+54980
+50745
+52264
+45453
+45229
+51228
+51116
+51228
+51088
+51116
+51228
+51228
+51228
+52824
+52828
+52828
+55128
+50500
+51008
+44228
+54252
+49353
+49464
+51116
+52824
+50616
+51200
+52488
+47161
+47161
+52377
+44428
+49464
+44036
+49444
+44396
+44368
+52265
+44260
+50612
+49548
+44592
+50696
+49353
+52628
+50864
+50868
+50616
+50864
+50501
+50501
+51061
+52264
+52628
+51204
+52488
+44552
+50508
+52824
+52828
+55128
+51008
+51200
+47161
+54252
+52488
+51116
+44036
+50612
+52265
+50864
+50501
+50857
+47217
+44277
+48169
+50628
+47329
+47217
+44277
+44048
+45813
+47161
+45813
+47329
+44277
+44048
+44396
+52628
+48324
+44396
+50557
+52712
+54868
+47197
+54644
+50976
diff --git a/macros/xetex/generic/xetexko/hanjacom_hangul.tab b/macros/xetex/generic/xetexko/hanjacom_hangul.tab
new file mode 100644
index 0000000000..6477fd7f37
--- /dev/null
+++ b/macros/xetex/generic/xetexko/hanjacom_hangul.tab
@@ -0,0 +1,302 @@
+44060
+44081
+44144
+44256
+44264
+44288
+44480
+44480
+44512
+44544
+44552
+45208
+45208
+45208
+45208
+45208
+45208
+45208
+45208
+45208
+45209
+45209
+45209
+45209
+45209
+45209
+45209
+45212
+45212
+45212
+45212
+45212
+45212
+45224
+45224
+45224
+45224
+45225
+45225
+45225
+45229
+45229
+45229
+45229
+45229
+45236
+45257
+45432
+45432
+45432
+45432
+45432
+45432
+45432
+45432
+45432
+45432
+45432
+45432
+45433
+45433
+45433
+45433
+45433
+45433
+45436
+45453
+45453
+45453
+45453
+45516
+45516
+45516
+45516
+45572
+45572
+45572
+45572
+45572
+45572
+45572
+45572
+45713
+45713
+45728
+45733
+45733
+45733
+45733
+45733
+46160
+46972
+46973
+46973
+46976
+47161
+47196
+47456
+47532
+48176
+48264
+48320
+48512
+48520
+48708
+49325
+49325
+49340
+49353
+49373
+49453
+49464
+49604
+49888
+49900
+49901
+50556
+50557
+50557
+50577
+50577
+50577
+50577
+50577
+50577
+50577
+50577
+50668
+50668
+50668
+50668
+50668
+50668
+50668
+50668
+50668
+50668
+50668
+50669
+50669
+50669
+50669
+50672
+50672
+50672
+50672
+50672
+50672
+50672
+50672
+50672
+50672
+50672
+50672
+50672
+50672
+50676
+50676
+50676
+50676
+50676
+50676
+50684
+50684
+50684
+50684
+50684
+50685
+50689
+50689
+50689
+50689
+50689
+50689
+50689
+50689
+50689
+50689
+50689
+50689
+50689
+50696
+50696
+50696
+50696
+50724
+50836
+50836
+50836
+50836
+50836
+50836
+50836
+50836
+50836
+50836
+50857
+50868
+50896
+50976
+50976
+50976
+50976
+50976
+50976
+50976
+50976
+50976
+50976
+50977
+50977
+50977
+50980
+50980
+50980
+50980
+50984
+50984
+50984
+50984
+50997
+51060
+51060
+51060
+51060
+51060
+51060
+51060
+51060
+51060
+51060
+51060
+51060
+51060
+51060
+51061
+51061
+51064
+51064
+51064
+51064
+51064
+51064
+51064
+51076
+51076
+51076
+51077
+51077
+51077
+51109
+51201
+51648
+51665
+52264
+52377
+52404
+53441
+53441
+53461
+53469
+53685
+54252
+54253
+54637
+54637
+54788
+54869
+50732
+54841
+49933
+44257
+52509
+44592
+52397
+48512
+44144
+55148
+51200
+51061
+47168
+49888
+49345
+48373
+51221
+51221
+50864
+50508
+44396
+49373
+51228
+46160
+44553
+51068
+46020
+54952
+54665
+46020
+48152
+49324
+44288
+54617
diff --git a/macros/xetex/generic/xetexko/hanjaexa_hangul.tab b/macros/xetex/generic/xetexko/hanjaexa_hangul.tab
new file mode 100644
index 0000000000..d5c3e65562
--- /dev/null
+++ b/macros/xetex/generic/xetexko/hanjaexa_hangul.tab
@@ -0,0 +1,6582 @@
+44396
+52392
+52832
+47560
+44284
+50724
+51008
+44404
+46168
+51208
+49332
+53672
+51060
+51320
+44544
+50732
+45440
+46028
+51320
+44040
+44264
+50984
+54792
+45440
+49920
+46168
+50732
+50872
+44396
+44404
+44600
+44600
+50984
+50976
+46896
+44264
+44396
+49444
+44152
+51228
+49436
+54805
+52380
+55113
+47448
+47492
+50577
+50857
+49888
+51652
+45824
+50732
+48152
+50976
+49324
+47560
+55136
+55128
+51473
+45236
+49849
+54413
+50896
+44201
+53468
+52636
+48169
+50836
+47784
+51089
+51060
+52628
+46041
+49689
+50669
+44417
+50773
+47280
+45516
+51200
+49689
+51088
+52392
+51456
+49688
+49464
+51473
+49888
+44060
+51217
+45208
+49549
+51208
+47217
+51081
+54077
+44204
+51593
+44033
+46988
+47896
+51060
+47140
+44228
+50724
+46972
+51228
+45392
+44256
+48708
+54844
+49688
+55036
+50836
+45224
+52628
+52840
+51656
+55148
+53468
+50836
+54924
+51456
+47568
+47029
+45817
+50836
+49548
+51201
+50864
+52265
+51060
+50672
+44228
+55137
+47924
+44048
+52285
+49845
+49884
+44221
+47336
+49341
+54620
+49692
+54924
+48373
+45804
+46021
+50521
+50864
+45824
+49688
+47732
+51008
+51312
+50668
+47736
+51456
+45544
+54644
+50976
+50557
+51025
+49453
+54413
+47280
+47140
+49440
+46972
+49437
+44592
+50773
+44260
+49884
+50685
+51204
+47805
+51116
+47049
+44264
+47784
+44277
+55141
+49688
+51204
+47581
+47784
+47564
+44428
+49884
+47532
+48373
+47749
+44396
+53440
+52840
+51221
+47452
+50725
+48729
+54876
+46041
+44277
+51137
+52649
+52840
+44221
+47449
+54665
+52832
+45224
+49324
+47736
+54596
+44208
+49689
+55113
+44277
+44277
+50976
+54805
+44040
+54588
+51216
+48512
+46973
+44049
+44040
+45817
+48177
+54632
+51088
+55012
+46993
+45824
+44256
+49444
+51312
+47140
+54925
+46160
+54200
+51200
+50672
+50501
+44208
+51032
+52265
+52404
+44148
+44053
+52832
+49709
+49436
+52832
+47049
+46321
+47536
+51208
+49549
+49548
+51104
+48156
+48708
+52489
+51204
+44048
+52628
+52524
+49444
+47141
+52392
+52832
+55092
+44148
+44053
+44544
+44033
+48708
+52636
+48337
+44396
+54624
+48156
+47049
+44340
+49464
+54624
+48324
+51208
+47280
+49900
+54056
+50577
+47196
+48176
+50517
+47196
+51340
+53441
+49884
+45208
+49440
+54637
+50976
+44452
+44452
+51061
+49440
+44048
+47336
+52404
+47484
+49464
+48708
+49692
+50976
+51208
+51452
+51452
+44033
+51020
+44228
+51648
+44049
+54840
+46989
+51032
+44049
+48512
+44552
+50528
+53748
+50517
+51452
+49324
+51452
+51032
+51204
+52397
+54872
+49548
+50976
+52280
+51456
+51312
+50864
+49324
+44256
+49604
+44340
+49933
+54617
+44060
+50672
+44396
+51060
+54868
+55176
+48276
+48169
+45812
+48169
+44277
+50836
+48512
+45580
+54617
+50864
+54876
+55113
+52840
+47581
+51008
+48149
+47549
+48268
+54952
+53804
+55113
+49324
+49567
+54693
+47456
+47536
+50696
+54980
+51452
+49696
+44257
+51060
+45448
+44592
+49900
+44079
+44415
+46179
+44079
+45384
+50948
+44228
+51228
+54861
+53444
+50508
+50508
+51020
+51652
+44051
+48531
+44275
+44275
+45143
+44312
+49688
+45208
+50556
+51088
+53804
+54632
+44400
+46041
+54844
+47197
+52628
+54925
+47497
+49688
+52392
+47452
+46629
+46629
+48192
+50687
+50687
+54848
+44396
+50676
+49884
+44089
+48516
+52632
+45684
+47784
+52293
+50501
+49324
+50976
+50501
+49373
+47928
+47564
+54840
+44061
+54616
+47564
+47029
+51665
+54980
+51656
+51116
+44032
+50780
+44049
+48176
+50528
+52628
+44148
+44396
+45812
+54056
+48149
+52628
+47456
+49548
+54980
+44256
+54028
+51471
+48708
+51079
+46041
+51228
+52629
+44285
+47196
+51656
+54644
+49845
+54588
+51208
+52264
+49892
+47749
+51107
+51333
+51665
+54925
+53457
+50504
+54988
+48156
+49352
+50948
+52488
+48708
+44284
+50629
+54693
+54868
+54616
+51089
+50669
+51088
+50556
+47497
+54632
+45824
+50689
+51032
+51600
+51021
+54788
+44537
+51656
+54632
+46039
+54364
+47168
+50491
+46976
+49352
+46988
+50504
+44396
+48708
+50516
+54632
+44048
+49688
+45785
+51088
+52285
+48317
+54633
+50745
+49440
+50756
+50752
+44540
+49436
+44340
+48708
+47784
+51221
+48520
+50836
+52377
+51109
+51664
+45812
+44397
+44396
+51340
+54252
+44152
+50528
+51340
+51088
+48268
+51064
+44256
+51116
+50864
+45384
+44396
+47588
+53468
+48337
+54224
+48372
+54861
+52489
+54616
+51204
+51109
+44592
+49548
+52384
+50948
+48373
+53440
+50864
+50556
+44508
+50948
+44340
+50864
+50808
+50836
+47217
+49457
+48372
+45824
+54801
+50620
+46993
+50696
+51333
+47564
+51109
+54616
+44260
+49324
+47448
+44592
+47308
+50696
+51665
+51008
+44432
+45813
+50696
+54644
+54840
+50745
+44048
+52392
+45824
+45817
+52841
+48149
+47805
+44452
+51204
+47336
+49437
+44033
+55148
+55148
+44368
+45229
+50868
+52404
+47469
+48373
+51333
+52380
+44256
+54644
+51312
+44284
+44340
+45824
+54840
+53804
+47161
+49452
+47000
+45393
+48520
+44256
+51088
+48152
+44032
+44361
+54812
+50669
+49692
+49900
+52265
+54952
+44592
+45432
+44368
+51061
+50864
+55148
+50628
+49888
+50684
+54840
+49341
+44512
+50864
+45812
+49900
+48176
+44396
+52392
+50500
+54252
+46041
+49324
+45236
+49884
+47896
+51081
+44592
+54840
+44368
+54805
+54252
+52628
+54217
+50752
+44208
+51032
+51060
+53440
+51109
+44256
+49436
+53440
+51060
+47784
+54801
+47140
+44396
+49688
+52268
+46160
+52824
+48393
+50517
+49324
+51340
+48156
+49888
+50857
+49888
+50976
+54056
+47217
+54872
+54620
+50756
+49688
+50868
+47532
+53457
+46988
+47576
+44053
+52629
+50628
+49437
+47449
+49437
+49688
+47732
+54844
+50808
+48156
+50696
+45516
+52845
+53444
+44228
+49688
+48320
+50516
+44284
+49341
+49328
+54632
+45824
+49345
+49324
+48393
+47144
+49900
+52629
+48120
+51060
+47785
+50745
+51204
+51061
+45572
+45817
+54812
+50868
+49688
+54028
+50696
+45813
+44221
+47144
+51312
+52280
+52376
+47197
+49689
+45576
+50724
+50516
+52280
+44048
+52572
+51333
+47336
+50672
+45812
+47588
+49900
+50900
+45236
+50724
+49888
+48120
+52392
+45817
+46988
+55148
+50557
+51656
+50689
+54924
+47805
+45544
+48152
+48120
+50620
+44396
+52268
+47144
+51656
+51088
+54644
+49436
+54840
+44204
+51228
+47732
+49692
+45572
+55148
+49692
+47144
+51200
+49688
+47308
+44396
+49324
+51221
+44060
+50857
+48169
+44144
+54633
+50836
+45397
+51032
+47049
+50745
+51064
+50672
+49689
+49437
+47548
+50500
+47784
+47749
+52572
+50864
+50696
+44396
+48120
+51456
+50728
+50896
+44053
+51216
+47469
+54624
+49457
+52572
+44368
+47732
+47805
+52840
+45824
+50756
+50528
+46301
+49900
+48320
+45572
+47156
+44540
+50864
+49688
+51340
+54028
+54924
+50836
+53748
+44537
+50516
+46972
+44592
+50808
+48156
+52272
+49696
+51649
+51081
+54872
+54028
+52841
+44144
+48120
+54644
+44592
+49884
+49444
+52264
+44396
+46021
+45544
+52841
+44592
+53748
+52377
+49569
+51204
+47308
+51204
+51648
+48516
+51020
+51104
+44452
+54924
+51648
+46988
+45432
+51452
+44540
+45824
+50948
+44592
+54728
+52509
+50885
+46160
+51648
+46020
+48124
+50773
+48520
+44032
+51313
+54840
+49849
+50900
+45768
+44592
+47144
+50504
+47784
+49324
+49345
+50521
+54868
+51340
+44396
+47196
+48512
+53468
+47581
+46993
+53440
+54632
+47581
+48156
+44512
+44592
+54632
+46160
+47217
+48712
+51312
+52293
+44592
+51104
+48120
+48176
+51092
+54637
+44053
+44428
+44592
+49709
+47197
+52280
+50868
+50501
+45800
+48124
+50948
+52380
+49688
+48124
+46028
+50529
+47749
+50836
+50896
+47456
+50808
+44053
+50896
+45813
+44256
+47308
+47336
+52280
+50724
+54364
+50857
+47581
+46020
+52280
+50724
+51201
+49845
+48373
+45800
+52628
+50980
+46041
+54728
+50501
+44592
+51665
+51665
+54868
+44368
+51396
+54364
+47805
+48176
+50808
+51032
+50724
+49436
+54840
+45824
+54869
+51032
+52268
+51669
+47140
+47140
+45544
+54924
+47141
+50577
+47280
+54413
+48120
+50872
+54889
+44144
+48512
+48512
+51204
+48393
+51060
+44040
+44592
+48708
+47561
+51064
+54889
+48276
+44049
+48512
+44060
+49324
+55148
+49324
+46041
+50896
+51088
+54224
+44284
+47168
+54889
+49692
+45208
+54889
+52393
+47928
+54788
+55137
+50629
+47784
+48177
+49340
+50976
+51204
+51312
+51456
+44260
+47924
+50689
+51333
+52404
+47156
+48708
+44396
+54889
+49444
+48393
+47336
+51312
+51221
+51452
+47564
+47329
+50629
+51008
+48712
+51221
+52392
+46976
+45576
+50696
+44592
+44228
+44592
+53469
+50864
+44396
+54872
+51200
+46989
+47161
+51648
+48376
+49324
+51200
+45800
+47308
+50696
+51312
+54620
+52377
+51088
+52824
+50628
+46993
+46160
+47217
+51204
+50616
+53748
+53440
+51032
+52824
+50500
+50689
+51217
+53804
+50500
+49688
+52264
+51109
+51333
+50745
+48152
+44368
+47156
+44540
+47196
+50628
+44053
+49548
+51061
+51648
+54805
+51109
+54224
+44221
+51116
+46041
+44032
+44428
+54620
+51201
+50724
+49328
+54945
+46020
+51060
+46024
+54588
+47728
+49552
+47196
+49436
+54801
+54596
+49464
+54596
+49888
+54788
+50948
+48324
+51060
+44204
+54980
+51652
+48708
+50669
+50977
+44144
+51104
+48120
+51060
+49884
+44277
+49688
+45800
+49340
+53468
+47785
+51221
+48320
+50857
+51613
+52268
+51221
+45824
+53468
+54840
+44396
+51201
+53685
+54924
+54805
+49709
+53448
+44600
+46041
+51473
+51228
+49452
+52380
+52824
+50948
+50980
+44256
+47548
+50756
+51333
+51665
+51333
+45224
+49444
+49892
+49353
+48120
+47924
+54889
+45804
+45800
+45397
+50976
+51025
+49900
+50528
+51064
+49436
+52264
+51312
+47581
+52392
+44553
+48169
+54056
+50528
+54032
+50724
+49900
+44032
+54952
+48516
+44048
+44368
+44032
+46041
+52392
+50864
+44256
+48516
+48512
+51460
+51200
+53468
+52488
+51008
+54637
+51076
+55100
+52649
+53441
+44277
+47148
+47168
+50865
+54077
+50696
+54644
+47532
+54980
+44277
+44033
+50896
+45909
+50640
+44368
+44305
+44221
+51089
+48512
+54801
+48176
+52393
+51088
+48169
+54632
+54785
+44396
+54889
+47200
+44161
+51452
+53456
+50628
+49885
+45909
+53945
+48124
+47497
+49688
+53748
+51092
+52393
+48512
+48533
+51032
+44397
+44592
+47532
+51204
+50896
+50864
+52292
+44592
+50977
+47144
+51333
+48124
+44161
+52649
+50976
+44537
+50948
+48120
+49688
+55092
+49436
+52824
+52628
+54812
+44557
+50864
+54801
+49692
+49688
+53440
+47336
+46024
+48169
+53468
+52488
+51008
+49548
+48708
+51652
+50896
+51060
+55124
+49353
+54801
+48124
+48516
+54633
+52377
+51008
+52293
+45769
+50724
+48393
+47144
+49345
+49328
+47560
+52292
+54840
+47197
+50528
+51032
+54868
+52264
+52268
+50501
+54925
+49692
+45768
+44048
+47532
+50672
+50684
+47469
+47928
+44552
+44201
+50864
+48320
+50668
+54869
+47561
+51452
+47588
+45824
+46973
+51208
+50948
+51032
+54732
+54785
+52280
+46976
+51008
+49453
+52272
+46972
+47161
+51204
+54841
+52392
+50500
+51116
+51116
+44201
+51452
+50857
+50857
+44537
+50577
+50837
+49845
+49345
+50865
+51060
+54840
+44553
+44049
+51204
+44508
+44160
+46020
+44540
+47784
+51064
+50508
+48156
+54788
+47784
+48169
+50500
+44053
+49569
+55064
+50836
+44284
+44340
+47448
+50529
+51088
+51088
+48708
+50752
+46988
+51105
+44032
+48156
+54924
+51060
+54644
+51064
+51452
+52649
+49440
+54788
+49548
+44396
+54056
+44452
+50976
+44277
+44277
+54848
+47196
+47141
+45208
+49340
+51116
+50500
+48512
+44081
+53444
+54077
+53945
+45813
+53441
+54364
+44256
+54848
+52285
+48337
+51648
+46041
+53748
+51312
+50696
+47492
+54028
+51228
+48124
+53440
+52264
+44396
+48169
+50672
+53444
+48512
+51333
+44508
+47196
+54632
+50689
+52824
+52393
+49457
+54812
+49692
+49452
+44148
+49444
+49548
+44060
+47732
+54848
+54588
+50745
+54924
+45225
+49569
+48516
+52628
+52393
+54889
+46988
+50896
+54840
+46160
+54869
+44260
+50836
+52293
+44592
+44148
+51204
+46020
+44540
+47568
+51228
+47732
+52280
+47029
+48317
+50577
+44144
+44144
+44033
+49325
+44148
+49324
+52628
+52628
+54925
+50868
+55137
+49440
+49689
+48708
+52293
+50685
+47925
+46024
+49341
+44552
+55036
+46164
+47161
+44053
+55092
+51032
+49353
+47805
+45800
+46988
+54840
+52293
+51116
+50724
+46972
+47736
+55064
+48512
+49452
+55092
+48149
+54812
+44221
+55184
+51656
+55148
+54952
+44148
+54028
+52488
+51089
+44428
+49569
+44397
+50508
+45393
+44148
+52393
+52393
+48708
+44592
+51648
+44592
+52628
+44404
+50864
+44552
+44404
+44032
+48520
+44221
+51200
+49440
+44228
+44049
+44400
+54620
+53685
+48156
+49452
+48708
+47456
+50629
+50696
+51396
+49328
+51089
+47197
+53804
+47156
+44284
+49328
+52840
+52712
+47144
+47784
+46024
+44048
+44060
+49548
+44256
+54596
+51088
+51064
+55137
+49440
+49689
+49341
+50696
+53441
+47196
+47161
+44144
+51116
+54872
+46161
+46181
+54624
+48152
+44257
+46160
+51664
+47336
+44396
+44428
+44032
+49548
+44201
+51208
+51221
+45800
+51200
+50616
+48169
+44592
+48120
+50613
+50633
+50948
+51032
+51204
+51221
+50976
+55064
+50836
+50836
+51648
+44277
+44592
+44036
+44305
+51648
+54980
+48128
+48512
+47932
+44305
+45800
+51200
+46020
+50672
+48152
+46041
+44144
+48124
+52285
+47749
+53664
+54252
+50504
+52632
+50857
+54788
+49692
+49884
+51088
+47925
+46993
+45212
+54056
+49888
+54952
+48708
+51452
+44592
+52393
+49548
+49437
+44260
+51228
+47197
+49345
+50976
+49692
+51105
+50864
+45824
+52268
+47564
+48124
+54872
+50728
+45212
+54872
+54980
+44221
+48149
+54788
+47141
+51652
+54869
+47581
+54364
+54840
+50577
+44228
+45380
+49549
+50948
+52384
+55137
+51652
+49569
+44040
+48533
+49604
+47161
+55148
+45824
+44553
+54252
+54869
+54252
+54785
+54812
+52393
+50672
+44396
+51089
+45212
+47148
+50976
+52404
+52392
+50724
+54861
+44368
+54840
+44260
+46020
+51137
+44428
+54889
+48373
+51312
+51032
+46024
+49436
+51081
+52488
+44053
+51652
+49340
+45236
+50672
+44208
+54868
+49437
+48169
+47924
+52832
+44053
+55064
+47568
+47588
+49324
+48320
+47196
+44144
+45824
+50872
+54633
+51201
+47140
+54028
+50997
+44396
+47148
+44277
+49440
+49888
+54805
+47928
+51312
+48512
+53469
+48152
+50556
+47148
+48512
+51340
+51200
+54036
+52524
+52393
+52628
+44049
+44161
+54952
+44204
+51204
+48169
+45224
+46020
+54788
+50628
+45817
+45813
+51200
+44404
+50521
+44048
+54952
+44257
+50948
+48169
+52628
+50620
+52392
+45236
+54801
+47924
+50865
+47732
+51092
+48176
+45236
+49457
+52841
+50672
+44557
+52649
+51060
+44040
+44540
+47924
+50501
+47456
+49884
+51109
+54785
+51208
+45380
+50689
+44288
+54980
+44060
+49569
+48516
+49353
+50724
+51649
+49885
+44277
+54624
+50745
+54632
+44208
+54844
+48708
+49849
+52628
+51664
+49548
+51204
+49325
+44228
+49569
+52824
+48376
+51312
+49328
+48152
+46993
+54596
+49440
+48176
+45824
+52832
+51648
+54588
+49328
+54224
+49549
+51200
+55124
+44221
+52380
+51109
+45436
+54805
+53440
+53489
+47729
+53457
+52712
+49436
+51201
+54620
+44288
+52384
+45813
+54840
+52712
+47196
+44204
+47197
+44204
+54252
+51664
+48516
+47141
+51312
+44592
+52488
+50984
+51060
+47161
+44144
+47156
+47196
+52489
+44277
+52824
+54364
+44552
+44221
+50857
+46041
+51333
+48373
+51652
+54364
+54632
+48376
+44060
+48712
+51312
+47157
+47140
+46972
+49900
+47732
+51204
+51201
+48176
+49452
+47144
+51652
+49452
+48712
+44033
+47217
+52628
+44256
+53440
+49340
+54617
+46988
+49453
+55148
+46988
+52629
+51060
+45208
+47532
+50557
+51204
+51060
+52824
+44592
+54637
+54644
+44081
+51088
+54616
+54812
+44144
+54644
+55148
+54644
+50780
+52280
+49692
+54980
+49888
+46160
+54633
+49341
+50865
+50500
+48512
+51320
+44396
+51088
+44048
+54632
+54616
+51060
+49453
+50616
+44368
+54812
+52824
+49688
+44053
+51020
+55121
+51032
+55148
+49353
+44552
+50629
+50864
+44033
+52393
+46976
+44260
+51221
+47924
+49464
+44032
+47161
+49324
+44480
+52712
+55092
+50684
+54980
+51092
+52380
+52272
+49324
+51021
+54588
+44256
+49849
+46993
+53748
+49437
+47497
+44592
+50756
+47156
+46021
+54844
+46976
+50724
+45800
+44452
+50528
+51116
+54924
+51032
+47561
+51648
+48516
+54077
+51665
+48317
+47141
+47140
+46972
+54644
+44552
+44060
+44033
+51652
+44277
+51221
+44396
+44396
+44228
+47161
+46041
+49548
+44033
+50696
+52265
+45397
+51648
+47336
+54364
+44552
+49688
+54252
+49688
+49440
+47280
+49548
+48512
+44396
+49688
+49324
+51648
+45812
+50857
+49556
+50689
+47532
+45236
+48320
+49688
+49632
+45817
+54620
+49548
+50857
+53457
+46321
+48373
+52488
+45812
+53457
+46988
+45397
+47157
+52393
+51656
+51473
+49548
+47197
+45812
+55137
+44592
+51656
+45769
+50696
+51064
+50864
+50773
+44284
+52769
+50672
+49772
+50672
+47448
+53685
+47924
+54056
+50900
+50976
+44396
+50517
+54252
+48320
+49884
+52272
+51068
+48277
+50864
+45824
+46976
+51032
+52292
+52649
+50672
+55100
+50976
+55092
+50773
+52649
+44277
+45804
+44284
+44368
+47196
+49689
+47217
+44228
+52393
+52272
+45812
+48708
+45813
+49440
+50672
+45544
+49888
+44396
+50577
+53468
+44537
+48128
+44228
+50976
+54848
+54868
+50773
+50976
+52293
+54596
+48120
+44053
+49444
+48276
+50669
+45812
+47336
+50549
+49548
+52840
+49453
+51008
+51228
+50672
+49689
+44256
+49849
+45236
+50773
+47732
+49548
+50669
+49324
+51021
+51665
+48149
+50976
+47784
+49341
+49688
+52824
+54200
+47140
+46020
+54980
+54632
+54693
+51473
+51060
+51452
+52488
+44417
+49885
+51664
+50745
+50620
+44400
+49324
+50836
+49444
+51648
+45733
+49900
+49324
+47805
+52840
+48128
+44033
+53456
+49452
+48120
+47000
+51452
+49689
+49444
+48156
+51221
+51313
+54889
+49436
+49324
+54620
+53456
+54840
+52392
+54876
+47548
+45393
+47588
+49692
+47928
+44036
+52572
+44432
+54616
+48708
+49885
+49324
+49340
+45376
+48729
+47564
+52397
+48512
+49440
+45224
+50696
+49688
+48120
+44404
+48149
+47280
+44040
+49341
+48128
+49688
+44040
+48317
+50696
+49440
+51021
+50689
+51200
+49692
+48533
+49436
+54364
+47924
+47308
+51109
+52628
+52524
+48320
+50557
+47589
+48708
+55092
+49324
+47280
+51221
+54952
+44368
+44341
+54889
+47924
+50684
+54617
+51200
+54945
+50689
+44228
+55148
+50976
+47144
+49440
+54872
+51008
+51025
+47156
+49900
+51109
+48176
+44036
+49689
+48152
+51216
+50976
+54056
+50668
+50672
+51025
+45229
+47336
+50669
+54868
+44396
+51216
+52488
+44036
+49888
+45576
+48176
+52840
+48176
+47308
+47568
+50976
+49548
+47448
+54632
+48376
+50857
+49888
+52824
+51076
+45453
+49692
+54801
+54861
+52392
+48393
+50528
+44284
+54364
+48156
+44221
+53685
+49436
+52628
+54924
+52488
+48512
+54924
+50517
+50948
+48516
+50684
+48512
+47452
+50508
+50745
+55036
+50672
+50864
+52509
+50684
+52628
+51312
+55148
+45824
+51204
+51221
+48372
+54785
+46028
+54980
+53748
+47536
+44221
+52264
+49457
+54841
+51613
+54785
+50896
+48393
+55148
+51456
+44221
+47561
+48393
+51312
+48393
+47532
+50885
+46041
+50504
+47141
+47925
+48317
+51088
+50685
+46020
+50684
+47924
+50672
+49440
+44089
+54744
+45824
+54620
+49688
+51216
+51228
+51208
+44256
+52268
+52488
+49453
+46980
+48264
+44285
+55148
+49453
+48120
+50672
+52268
+51020
+46020
+44036
+54869
+51200
+46041
+47564
+52264
+47532
+49548
+44277
+54744
+51208
+51648
+51312
+49688
+48708
+50629
+54200
+52280
+54840
+44036
+44396
+50504
+49692
+44148
+54056
+54028
+48516
+44284
+53440
+53440
+51089
+47161
+49548
+44480
+50672
+49464
+54980
+47148
+49324
+49324
+48393
+54056
+51064
+46021
+51088
+47049
+44204
+48708
+51649
+52509
+55064
+44152
+47532
+50896
+50501
+49688
+49328
+51201
+47336
+44540
+49569
+49324
+48149
+50836
+44053
+54872
+54872
+46020
+50976
+50549
+50549
+50836
+51008
+49884
+51008
+44208
+46024
+54788
+44032
+51333
+44161
+51452
+52488
+50521
+50976
+44221
+49328
+51060
+49324
+50696
+47589
+55092
+44305
+51089
+54952
+50724
+44081
+44221
+51221
+55148
+47784
+44221
+53457
+50752
+44397
+52268
+54364
+53441
+54848
+45432
+44048
+44396
+50976
+54980
+51088
+49884
+52824
+54841
+50577
+50745
+54800
+48712
+50857
+47336
+51312
+49340
+44368
+51201
+55064
+48264
+54632
+52268
+51104
+49892
+45804
+51452
+45432
+54632
+50668
+53441
+50976
+47141
+54869
+55148
+49452
+52280
+47144
+54952
+49324
+49836
+48149
+44396
+44277
+51088
+50864
+47217
+49324
+51081
+45684
+47588
+48156
+44396
+46160
+49696
+54217
+48320
+47784
+48520
+49440
+48708
+54805
+51060
+50976
+44340
+48337
+44257
+48372
+54924
+50672
+51204
+54980
+48372
+47928
+46980
+46020
+50724
+49836
+47161
+51456
+44228
+50868
+52628
+52852
+44404
+45824
+48176
+48320
+50977
+48533
+50669
+51333
+46980
+48712
+49688
+46028
+49444
+49884
+49900
+44396
+50976
+50864
+53440
+50756
+44216
+51456
+54596
+46020
+49836
+52268
+46020
+50948
+48393
+47336
+47532
+47564
+51092
+54596
+44537
+51104
+54788
+47141
+46024
+45812
+49688
+50745
+52489
+45804
+51032
+50668
+47157
+44592
+44305
+54805
+44221
+46972
+51664
+46164
+44256
+50976
+47280
+48149
+45516
+54200
+47144
+53461
+47156
+50728
+45817
+47532
+51221
+50752
+52628
+44053
+54805
+50521
+50756
+54077
+48177
+53440
+49688
+51060
+48177
+44208
+44256
+44277
+46041
+54632
+49457
+54801
+44284
+54665
+51216
+52264
+46041
+48708
+51456
+47157
+49457
+50864
+51228
+50976
+51204
+50857
+44053
+45817
+51109
+54364
+52285
+47197
+46041
+51221
+47141
+49341
+48152
+49324
+46321
+45817
+54841
+51032
+54632
+49453
+46972
+47448
+44048
+45812
+55137
+54800
+45812
+49373
+49373
+50976
+50976
+45224
+47924
+44053
+50980
+52377
+44396
+50896
+47168
+47448
+47148
+54801
+48708
+50516
+50669
+44397
+50976
+49692
+51648
+52264
+52280
+51613
+50745
+48512
+50672
+49457
+55092
+49436
+44368
+44368
+54980
+51109
+51109
+44592
+49688
+49900
+48152
+44553
+51648
+51064
+44256
+50732
+44284
+44161
+49696
+54644
+53440
+46021
+51088
+52392
+47785
+48512
+47161
+49353
+47448
+49440
+45236
+50517
+50528
+47140
+45813
+50668
+50672
+47140
+49888
+47532
+47049
+44221
+55124
+49324
+52840
+54801
+52264
+50976
+48372
+44305
+44033
+47000
+44552
+44053
+52629
+48176
+44284
+51032
+44340
+49457
+54200
+54644
+52628
+54889
+54924
+54840
+54224
+50724
+51088
+49324
+44228
+44264
+49436
+44256
+49324
+47560
+51200
+53748
+52628
+54800
+46993
+48152
+44256
+52824
+52404
+50528
+49440
+44284
+49845
+50745
+53748
+52280
+49548
+54744
+44060
+48516
+44400
+52824
+50557
+51452
+54801
+47280
+50684
+47196
+53748
+50689
+48708
+46972
+47140
+48324
+54693
+47784
+48177
+44305
+46160
+50836
+54624
+52632
+54617
+45397
+51452
+47141
+45817
+54872
+48708
+54028
+52293
+50521
+45813
+50724
+49444
+51032
+52824
+45813
+50672
+48169
+52628
+47564
+45804
+48149
+44036
+50672
+54812
+51200
+50500
+48276
+50976
+50504
+53748
+47805
+49324
+51652
+44256
+44592
+44368
+44368
+50684
+51652
+44048
+47732
+54788
+49340
+50508
+52380
+54872
+51064
+51064
+52380
+44208
+44228
+52404
+50521
+47588
+47588
+48708
+46020
+48708
+44396
+51216
+49692
+48708
+47924
+49325
+44256
+54861
+54876
+46973
+54637
+44217
+51204
+54644
+54889
+48372
+44257
+48393
+47785
+46980
+50689
+49692
+47049
+44161
+51228
+49452
+52628
+48729
+51652
+50672
+46020
+52824
+51208
+47049
+54620
+54364
+54665
+47609
+50629
+48128
+44228
+44228
+50508
+54801
+50872
+44217
+51221
+50836
+50689
+50577
+51665
+51333
+55012
+48124
+47336
+44060
+50836
+50616
+49552
+44480
+54889
+50549
+49457
+52264
+47156
+49452
+49440
+49440
+51201
+45776
+52376
+47896
+54869
+50612
+52280
+54848
+52789
+54364
+51104
+55137
+54637
+50864
+47588
+47581
+51204
+54872
+44201
+44033
+45229
+48708
+49437
+49325
+47925
+47157
+47736
+47925
+55148
+52280
+44396
+52488
+54869
+54620
+44201
+45684
+46041
+54980
+50668
+50976
+52649
+48149
+52268
+51312
+51320
+51228
+44040
+44508
+54665
+55036
+49437
+44404
+52264
+49437
+54952
+50668
+48169
+53440
+49437
+44032
+49884
+51648
+46041
+51088
+48512
+48124
+51652
+51652
+52264
+50672
+44368
+54861
+44277
+44368
+47029
+44340
+46989
+50696
+44161
+51340
+50672
+44277
+44161
+44340
+44341
+49353
+50752
+51221
+45384
+46020
+47000
+45813
+52292
+50500
+44260
+44053
+44221
+51228
+44592
+47732
+44060
+48124
+51200
+50976
+51064
+45824
+52264
+49457
+46028
+48152
+54645
+44396
+54861
+47196
+50724
+48149
+44081
+47197
+52489
+47144
+50696
+44368
+49689
+49328
+49440
+51104
+44552
+55036
+49689
+45817
+46024
+47469
+44053
+45544
+45800
+45812
+50808
+44048
+45804
+47141
+52272
+49452
+48152
+46989
+51200
+45544
+44340
+50689
+49452
+46976
+47560
+54028
+48373
+44452
+48708
+48512
+54868
+50696
+47448
+50521
+51064
+44428
+54876
+51221
+46160
+50500
+51648
+50628
+52384
+51088
+44592
+50836
+44428
+54876
+51076
+54889
+44396
+49324
+49688
+50672
+54077
+47749
+51312
+47336
+47532
+52285
+51228
+52404
+49440
+52392
+51228
+46021
+47280
+47161
+47308
+51081
+50864
+51061
+52488
+44592
+51060
+45380
+48512
+44204
+50500
+48169
+45404
+49440
+50900
+45380
+54596
+49437
+48149
+52380
+51228
+46020
+52392
+49440
+50857
+50696
+47148
+50504
+54617
+44277
+47168
+44508
+52824
+49549
+50896
+50500
+51333
+47564
+44204
+51221
+50976
+48120
+44204
+50976
+47581
+44396
+52824
+44144
+50516
+50976
+47000
+54844
+44428
+52285
+53440
+44277
+45713
+49340
+51228
+49688
+52628
+54889
+51665
+44040
+47896
+50684
+54693
+51648
+44452
+49688
+50528
+48169
+52285
+45817
+51008
+50728
+44592
+52628
+49325
+51089
+45572
+46020
+49888
+47336
+54364
+47532
+47564
+54805
+51104
+54868
+47588
+44256
+47156
+46020
+49440
+51088
+51312
+48393
+52824
+54028
+48120
+52628
+50696
+47217
+49452
+48708
+44397
+51221
+44396
+50672
+52649
+50676
+44361
+50836
+50517
+50836
+46041
+53440
+50976
+54792
+50836
+54633
+54872
+46993
+50676
+49888
+52380
+52380
+45812
+50752
+45397
+47749
+54861
+52285
+50868
+54732
+52840
+52524
+50864
+45812
+44053
+49688
+51312
+51221
+52628
+54792
+51221
+52509
+48152
+44508
+44284
+44144
+46988
+50696
+50857
+49324
+44148
+49324
+55128
+48268
+46160
+47609
+49457
+47549
+44305
+54644
+52488
+52489
+51089
+53748
+47532
+48708
+44060
+49688
+46972
+49688
+50868
+51333
+54840
+51064
+48373
+51648
+44160
+52392
+44048
+44148
+51452
+51200
+44256
+45393
+50696
+52265
+50521
+52404
+44277
+50696
+52824
+44592
+52628
+47196
+51076
+50857
+51613
+46989
+54801
+51204
+49436
+51008
+44033
+48324
+51221
+44512
+46160
+48120
+51021
+51228
+50616
+52293
+49328
+47452
+48337
+49548
+54632
+54869
+45824
+51312
+48708
+49341
+47497
+45813
+51200
+47609
+50685
+48373
+44340
+44284
+45224
+44040
+44032
+49884
+44284
+49604
+51088
+51452
+53468
+44340
+52840
+49436
+46021
+52769
+50896
+52509
+49352
+51221
+44216
+44540
+51333
+50948
+54620
+44160
+44201
+45225
+54252
+49688
+44396
+51652
+49548
+46020
+48152
+53457
+44216
+50745
+50857
+46973
+44257
+49688
+51333
+54252
+47736
+44540
+52488
+47729
+49436
+47161
+47336
+51109
+47497
+51665
+51312
+49900
+49328
+44256
+48152
+48120
+49688
+44036
+45817
+54644
+44256
+47924
+48264
+46972
+52268
+51613
+47161
+51021
+49345
+50868
+47609
+50865
+52824
+51032
+45812
+54869
+48120
+45800
+49353
+49324
+49688
+52509
+52380
+47448
+51032
+44396
+47280
+47140
+54224
+47157
+47536
+54620
+54952
+50864
+48120
+49440
+50577
+52268
+49933
+50628
+48320
+47161
+54861
+44592
+47308
+48152
+48708
+54840
+54840
+49888
+49353
+54056
+44277
+47749
+44396
+54252
+47588
+49340
+48120
+51109
+48708
+47532
+44428
+49340
+54844
+54693
+51221
+49884
+50689
+44148
+45224
+54889
+51452
+50672
+53748
+49332
+45800
+49892
+51201
+47928
+55148
+47564
+51109
+54889
+45812
+49548
+50676
+48708
+46972
+48152
+47140
+52572
+52264
+46020
+51201
+44305
+51200
+49452
+49328
+48120
+44216
+44396
+51652
+52824
+50864
+49452
+54840
+44048
+52824
+44208
+47785
+48512
+54840
+44221
+54952
+47784
+47581
+50864
+54840
+52377
+45376
+54792
+51221
+48124
+44204
+50500
+53444
+51089
+50900
+48337
+49436
+52628
+48176
+51076
+50984
+44204
+52628
+51060
+51061
+48120
+44228
+50689
+47581
+44592
+48372
+49436
+48324
+48264
+50557
+47532
+48264
+44396
+48512
+50500
+50500
+51137
+52392
+50977
+44552
+44228
+44397
+47000
+49849
+48176
+45684
+50696
+49688
+47924
+49692
+54253
+52628
+45784
+51221
+48393
+51088
+50808
+44284
+50836
+50864
+52488
+44221
+45817
+44480
+49325
+53457
+44053
+50836
+45813
+52393
+44540
+47029
+48128
+47729
+44204
+47197
+48264
+50864
+48120
+51665
+47924
+48324
+54889
+49549
+50836
+50629
+44552
+47156
+48317
+44048
+52404
+47161
+52268
+49884
+51008
+46020
+51452
+52292
+47736
+50684
+46988
+51473
+52488
+49345
+44428
+45393
+46972
+54984
+49884
+46972
+52489
+52824
+51452
+44204
+44221
+51060
+51061
+53468
+52292
+45784
+54253
+46988
+49688
+50864
+50836
+51216
+47161
+51200
+45813
+48337
+51116
+44368
+49688
+48512
+48512
+52380
+47581
+54620
+54620
+48512
+50500
+54945
+51200
+54252
+54788
+48120
+47588
+46993
+44256
+51312
+45813
+50669
+51333
+47532
+47197
+47924
+47280
+51228
+47141
+47532
+51109
+48156
+50577
+47568
+53440
+54217
+51109
+51312
+44452
+51064
+49436
+50696
+44208
+50948
+51137
+46041
+50948
+48149
+51204
+54872
+49440
+51104
+47141
+50672
+54889
+55016
+54840
+54252
+50684
+52488
+48149
+47308
+51452
+50696
+55100
+46973
+44256
+52489
+48512
+45393
+54632
+52488
+47197
+51092
+45813
+48512
+54945
+51613
+44368
+49689
+48712
+54812
+44592
+54844
+51200
+51089
+51060
+51060
+45212
+44152
+49324
+44397
+44257
+50684
+48512
+50629
+52824
+45713
+52285
+54028
+51312
+52404
+54620
+51089
+54028
+51012
+50900
+44081
+48708
+51060
+51452
+50724
+47928
+51228
+51452
+47197
+47928
+44260
+52628
+46980
+51116
+49688
+47749
+51656
+52404
+51312
+54364
+47144
+49845
+47217
+49689
+55128
+50896
+54413
+54980
+44208
+51088
+54200
+44288
+45684
+51076
+51064
+44060
+54596
+53456
+47896
+49692
+44553
+51204
+47568
+48324
+44553
+49884
+54588
+51200
+49324
+53456
+52392
+52824
+53748
+54801
+51060
+55092
+47924
+51452
+54801
+51648
+51064
+44397
+51228
+51208
+49548
+47805
+54588
+54620
+50612
+54788
+48169
+45733
+51092
+48512
+48169
+44228
+44592
+46021
+47197
+44512
+54632
+55148
+52292
+49692
+51649
+52824
+54844
+52509
+51204
+52628
+51228
+51456
+52628
+51217
+52264
+50976
+48320
+51665
+55176
+51200
+44033
+44201
+51593
+45813
+51652
+49576
+50557
+44396
+54889
+51228
+52628
+49552
+52264
+50745
+44049
+54840
+44257
+44060
+51204
+51333
+51312
+52404
+49328
+47280
+49688
+52292
+51217
+50612
+44060
+54889
+51104
+45800
+54925
+49688
+45812
+44256
+54792
+47564
+53441
+50724
+48317
+50725
+50668
+47805
+48708
+47805
+50577
+51656
+48149
+50689
+50976
+50577
+46976
+50689
+52280
+44428
+51652
+48373
+51064
+45824
+48268
+49436
+52393
+53461
+52264
+45812
+52392
+51648
+53457
+44032
+49692
+54889
+47308
+52264
+50732
+52840
+44552
+50517
+44396
+48512
+53440
+44256
+50517
+54077
+46020
+51228
+53440
+51228
+48372
+50896
+46020
+47452
+44592
+47785
+52380
+44204
+51333
+49548
+48276
+50976
+52628
+53457
+52377
+49689
+48512
+49845
+51109
+51312
+48512
+46321
+52384
+48512
+48708
+47924
+54812
+50521
+47749
+48169
+47581
+49849
+47805
+52488
+51312
+44060
+48176
+49548
+49888
+44152
+49688
+49345
+49548
+54872
+50864
+54952
+52840
+45800
+48393
+51064
+50521
+50684
+51068
+47564
+48276
+44144
+49884
+54868
+48320
+45824
+47561
+46321
+48276
+54872
+44305
+51613
+52264
+53440
+50976
+54840
+52380
+44292
+54792
+47280
+44540
+44592
+44257
+47581
+51032
+47308
+44600
+46321
+50616
+51021
+51008
+44592
+51208
+54785
+50669
+50556
+50724
+51648
+51648
+54620
+52265
+48512
+49692
+54217
+44340
+51452
+54952
+50896
+44417
+52509
+44256
+44340
+49436
+44404
+51648
+47609
+47140
+51452
+45813
+51648
+44256
+47049
+54848
+46980
+51204
+44537
+48512
+51648
+50669
+44592
+53441
+52272
+47924
+46021
+51064
+49884
+50696
+54620
+50672
+48512
+46980
+54665
+44036
+51032
+48120
+44396
+47581
+44592
+49324
+54632
+50976
+47456
+51088
+51312
+50836
+44032
+47532
+44592
+44277
+47141
+48337
+49324
+44256
+47560
+49549
+52628
+51204
+49324
+48176
+54728
+44221
+54252
+47497
+49345
+51312
+51312
+49692
+44221
+45812
+51088
+47456
+51060
+49548
+50612
+54868
+47140
+54028
+49548
+47588
+47140
+50745
+49549
+49345
+49548
+51060
+45397
+49324
+44256
+48512
+51021
+46321
+50672
+52572
+44036
+51228
+44552
+54364
+49688
+49688
+46024
+49341
+50528
+50508
+51456
+44288
+48708
+50896
+51020
+51613
+49548
+46160
+54924
+52393
+53469
+45800
+45817
+52824
+50696
+48373
+50528
+48373
+49688
+44032
+52272
+54632
+47564
+49552
+48708
+47161
+51208
+44452
+54801
+52712
+52845
+46993
+55141
+54224
+47140
+51088
+54624
+44592
+45768
+50689
+54952
+46321
+47308
+53469
+44592
+44053
+49452
+44397
+54364
+48264
+46160
+47492
+48120
+52265
+54792
+54840
+48120
+54624
+51105
+52509
+47140
+50672
+52489
+50628
+54620
+54952
+50613
+46976
+50557
+50672
+47161
+50577
+50872
+54617
+54980
+50696
+54617
+50669
+44148
+54633
+52376
+51008
+47729
+55148
+45216
+54632
+52264
+54633
+50516
+46020
+51228
+50724
+49325
+51008
+52649
+51452
+47609
+50896
+45685
+47896
+51312
+50896
+47784
+44404
+45216
+49437
+54596
+51088
+48169
+44049
+44428
+54693
+44508
+54056
+44305
+49692
+52264
+50836
+44260
+54924
+55148
+50500
+50577
+51312
+47448
+44033
+47532
+50756
+47532
+51613
+44592
+54840
+51092
+48512
+51109
+44288
+44397
+47609
+52285
+45812
+47784
+49457
+47140
+50672
+49688
+49884
+49845
+48337
+52509
+54980
+50896
+52404
+44204
+44049
+54620
+48149
+49688
+47448
+51104
+51104
+50696
+49440
+50616
+51312
+44048
+50857
+51333
+48393
+44053
+50612
+52377
+51088
+47560
+48393
+54872
+49345
+51652
+44288
+48373
+47536
+46321
+51221
+44053
+46989
+50613
+50745
+51088
+50672
+51208
+54984
+50976
+54788
+45397
+48512
+51208
+51216
+47925
+51200
+45733
+54732
+47928
+47140
+51104
+47736
+51216
+45776
+52292
+47564
+55100
+45685
+47589
+52572
+44048
+44061
+54637
+54632
+55064
+49548
+50948
+51320
+44592
+44148
+51061
+47560
+51312
+48156
+48708
+51200
+51088
+52636
+44049
+45768
+50521
+44368
+49692
+52649
+45376
+50997
+51648
+49345
+52488
+49440
+50976
+52840
+44552
+51333
+47197
+54632
+48324
+50529
+49772
+53444
+50977
+50896
+50696
+44288
+44404
+54077
+51092
+51333
+53440
+51105
+50836
+44228
+50672
+54980
+49692
+45824
+49440
+44340
+48708
+54812
+48149
+44201
+52572
+52629
+54588
+44396
+51333
+48533
+52404
+52629
+51648
+45544
+44260
+48393
+49444
+46321
+50948
+44432
+44480
+51613
+49341
+53440
+47161
+47805
+54984
+44284
+47805
+48152
+44592
+50689
+44148
+44288
+52629
+47532
+52489
+49440
+54364
+49440
+44508
+45453
+46301
+46301
+51060
+47156
+51088
+49548
+54792
+49884
+48120
+52840
+52840
+54785
+50976
+47197
+47000
+50689
+49373
+44204
+44228
+44204
+50868
+44256
+51201
+52285
+47536
+51201
+47588
+45817
+49900
+48712
+47532
+49457
+44053
+54805
+55012
+49440
+44257
+48708
+51320
+45824
+45824
+54844
+49352
+52384
+51228
+50864
+50557
+52824
+47448
+48156
+44368
+54872
+54785
+47536
+55012
+51081
+54788
+48708
+49888
+49328
+52824
+50760
+46160
+52380
+54812
+54644
+48708
+50836
+50836
+45685
+54840
+51076
+51020
+48152
+50684
+51060
+50756
+50896
+54633
+51452
+50672
+49884
+47732
+54812
+51088
+54252
+48708
+54792
+45768
+49324
+48128
+48320
+44048
+45208
+50976
+50696
+44592
+51076
+55093
+47029
+54924
+49888
+45432
+54620
+44217
+53804
+54868
+46021
+48729
+52489
+55148
+49569
+48120
+49888
+50724
+44417
+51109
+46020
+54665
+44396
+44144
+54844
+51228
+47732
+50628
+44592
+49688
+47280
+50896
+51216
+54788
+44228
+50976
+55036
+49341
+49548
+44201
+45432
+54812
+44256
+53748
+51648
+50976
+47560
+44260
+52488
+52832
+51312
+54924
+47144
+47308
+47196
+53440
+49688
+50724
+50724
+49453
+49688
+47588
+45812
+55136
+44221
+50517
+45813
+52280
+50696
+45800
+51228
+52280
+51656
+50865
+54732
+55124
+44277
+45800
+49692
+45432
+54872
+50672
+44396
+54861
+49688
+50696
+47196
+44397
+54840
+47564
+47157
+46164
+52628
+49884
+54637
+52840
+47588
+49548
+52293
+49884
+47785
+50976
+51020
+49688
+47448
+47196
+49688
+51217
+49933
+54924
+54848
+54924
+50529
+47805
+49341
+51333
+44208
+44400
+45800
+47336
+49688
+52649
+52628
+47157
+54872
+51217
+51312
+55092
+51032
+52628
+45768
+54028
+49328
+51032
+54840
+49444
+54872
+47564
+47564
+44144
+47308
+54840
+51473
+48124
+54788
+51652
+49548
+51089
+51452
+44396
+54788
+51060
+52824
+54801
+49888
+51092
+51116
+54252
+47049
+51648
+44592
+50756
+44288
+44144
+52397
+50528
+48512
+44480
+54980
+50616
+50672
+52824
+54364
+51060
+49604
+51648
+44480
+51081
+50696
+52828
+52392
+52397
+52285
+49324
+52632
+54861
+46041
+51221
+48120
+50976
+49549
+52292
+44544
+51105
+44592
+50724
+48512
+50725
+48520
+48177
+52377
+45800
+51089
+52264
+44396
+50976
+44201
+54980
+44508
+55137
+51109
+50868
+53804
+51456
+46020
+48512
+52293
+54841
+50900
+48373
+51312
+52384
+52377
+44404
+48512
+54889
+52632
+50857
+52268
+49353
+52824
+44148
+52824
+52488
+47928
+52280
+52293
+51104
+54596
+44592
+51656
+52489
+44144
+51216
+44600
+48320
+52268
+47141
+47141
+50557
+44428
+51221
+48512
+52264
+51648
+49884
+54637
+51208
+44592
+48156
+45580
+53804
+51452
+52489
+50900
+51648
+51204
+52636
+48324
+47805
+48156
+51204
+48124
+44033
+48276
+51137
+44396
+51312
+48373
+44292
+54632
+51201
+52649
+50864
+51652
+44396
+51340
+52404
+44508
+47148
+54056
+46020
+47924
+49548
+52384
+47197
+52285
+51228
+52488
+47049
+51204
+44260
+51109
+44404
+46028
+54872
+48708
+48708
+45813
+54616
+50501
+44228
+44201
+44508
+54840
+52628
+49688
+52292
+51088
+55113
+54224
+48169
+50752
+50836
+50857
+54984
+52629
+52393
+52404
+52264
+47805
+49440
+53440
+48324
+51648
+51200
+52392
+44452
+45800
+51452
+46321
+47280
+46321
+50557
+44428
+52489
+47161
+52828
+52828
+48512
+49324
+51312
+44284
+54644
+47928
+44417
+49688
+54644
+49452
+50808
+51204
+47217
+44396
+47456
+44452
+52632
+50857
+50900
+44368
+44053
+48152
+44592
+44361
+48512
+47196
+44361
+53440
+48124
+51204
+44204
+44228
+51613
+44081
+44277
+51204
+46993
+47784
+50669
+47449
+50896
+44397
+48708
+44081
+54644
+54200
+54844
+51200
+50857
+49345
+50724
+52264
+51652
+49440
+48393
+47564
+49688
+51333
+52509
+44081
+51204
+49328
+49884
+52649
+49688
+48708
+44060
+47736
+51648
+50696
+48124
+47161
+52268
+50620
+47161
+55128
+50900
+47549
+50696
+49884
+49888
+50857
+50857
+54924
+45453
+50976
+44592
+48156
+48169
+44592
+46160
+51312
+51228
+44368
+50864
+54633
+55100
+50984
+44257
+49688
+54056
+44081
+54805
+44480
+50500
+49696
+50976
+49569
+49453
+52285
+50836
+49696
+50672
+49556
+47308
+51333
+50612
+44368
+49688
+52380
+49440
+47280
+47536
+51201
+46021
+50753
+44592
+52380
+50868
+48169
+45800
+51200
+44144
+52636
+49888
+44277
+54637
+49440
+50504
+44452
+50864
+47280
+49324
+46020
+49888
+54805
+44396
+54637
+49324
+45817
+52292
+51200
+50628
+52824
+44277
+50689
+51204
+44452
+47140
+49604
+47560
+47560
+44256
+45817
+48176
+47336
+52832
+52264
+46020
+50501
+51104
+51104
+51032
+51201
+45817
+44285
+48708
+47448
+51061
+49692
+51456
+48156
+47532
+44284
+51452
+48156
+52628
+44089
+54980
+48152
+49324
+54980
+51060
+44292
+51200
+50684
+48268
+44204
+54632
+47049
+51648
+47729
+50864
+50557
+49900
+47588
+51020
+47732
+53804
+44508
+49688
+54812
+48128
+50857
+50865
+52285
+47564
+44516
+48708
+51104
+50773
+44592
+47805
+51216
+54617
+54252
+44048
+52280
+47141
+47532
+44396
+46164
+44417
+50980
+52840
+51648
+50684
+48324
+54840
+44060
+44452
+50900
+54924
+48317
+53440
+53440
+52280
+49324
+49885
+49453
+54805
+54805
+49436
+51201
+50556
+54632
+48708
+50629
+50616
+52509
+49688
+44540
+53440
+49440
+44288
+46020
+44208
+52380
+54632
+47805
+50501
+51312
+44552
+44552
+49340
+47581
+50896
+52285
+54077
+51613
+51648
+49692
+50612
+47924
+47576
+44053
+44592
+49549
+48324
+51204
+44288
+52265
+49688
+52488
+44208
+54620
+50724
+44368
+50508
+52840
+52393
+47469
+52265
+48149
+47156
+49688
+49440
+47140
+48120
+54788
+52384
+48149
+51613
+52629
+54028
+47609
+49324
+44396
+50864
+51456
+54952
+47141
+52272
+48120
+49444
+50556
+47924
+47932
+48156
+49324
+47140
+50864
+48169
+49340
+51089
+47532
+49440
+44285
+44228
+52264
+49324
+45544
+50724
+52628
+50732
+44288
+54644
+51221
+54792
+53461
+52392
+45800
+54217
+54624
+54785
+54620
+55176
+44292
+51137
+50724
+54925
+50980
+50728
+49884
+54872
+54876
+48512
+52544
+54620
+44552
+54792
+46976
+47928
+54624
+50689
+44208
+54693
+52632
+52824
+44396
+50948
+50684
+54693
+50669
+48120
+51137
+50728
+50864
+49901
+51221
+51088
+44208
+49436
+50864
+51473
+44361
+54980
+51312
+51204
+44033
+51060
+54861
+51032
+49436
+47532
+44257
+54788
+49688
+44537
+54788
+48393
+44285
+51228
+47000
+51452
+45392
+50669
+51204
+48317
+51204
+47497
+54840
+48169
+45817
+52824
+47560
+54632
+51204
+50857
+44396
+51064
+48373
+54812
+50948
+51032
+50629
+44048
+52393
+54840
+48712
+52509
+54732
+52280
+54844
+44396
+44036
+51088
+51648
+51664
+44396
+50976
+44256
+51025
+50885
+54633
+44257
+52572
+49436
+51089
+51201
+47924
+52628
+50504
+50516
+47308
+48324
+49933
+48712
+50549
+50672
+54617
+48149
+50689
+54861
+51088
+55137
+51228
+50864
+47280
+48149
+50864
+51228
+48512
+49440
+51020
+54848
+49437
+48533
+52397
+50864
+50752
+50528
+54632
+45812
+48149
+51201
+54869
+48169
+51020
+52628
+47161
+47588
+47589
+46988
+49548
+49444
+51652
+48149
+48373
+45572
+55148
+45824
+45812
+50868
+49328
+51008
+49689
+53748
+48337
+54840
+48708
+48708
+51105
+48708
+48708
+54632
+49884
+51204
+51204
+51092
+51216
+54924
+48372
+50896
+47560
+52488
+47308
+44160
+47736
+54848
+44361
+50864
+44592
+53440
+50521
+49324
+54056
+51228
+54788
+51228
+54596
+51452
+54252
+52393
+51060
+51221
+44217
+51208
+46020
+54792
+45800
+51312
+54792
+52285
+50896
+44288
+47049
+48393
+44592
+47197
+44537
+51665
+50976
+46020
+49688
+54840
+50868
+51221
+48169
+50857
+50529
+50745
+54056
+48393
+50864
+51088
+48516
+44288
+48373
+44537
+46024
+54889
+52489
+52404
+48149
+44204
+47157
+47217
+50976
+52280
+46976
+49632
+45225
+48708
+53440
+51452
+51217
+48512
+44397
+48512
+54616
+50948
+48149
+45813
+48264
+52392
+54925
+51105
+48708
+51228
+51228
+51228
+51228
+48264
+54644
+54861
+51648
+48149
+51020
+44032
+44221
+48156
+50896
+52628
+50689
+51032
+44060
+50732
+50980
+52840
+50500
+51200
+44396
+48124
+48176
+44049
+48320
+51208
+54840
+51652
+49888
+44036
+48708
+45796
+51652
+53448
+49340
+49457
+50684
+51104
+47784
+48176
+53748
+48708
+48512
+52384
+44592
+47548
+51032
+47928
+50724
+44228
+51208
+52840
+54616
+54624
+49345
+44284
+54980
+50836
+48373
+54952
+50868
+48708
+50516
+49324
+54812
+47749
+50808
+44049
+44256
+50724
+49340
+49345
+47336
+52840
+54924
+49340
+51032
+47536
+50976
+54632
+46021
+44552
+47732
+48264
+50501
+52488
+54861
+54945
+50984
+54792
+54252
+54596
+52488
+50976
+51060
+50900
+49341
+55100
+54801
+47456
+50672
+53468
+54925
+49341
+47497
+54392
+54848
+44341
+48512
+50948
+50948
+49688
+50516
+50976
+44053
+54945
+50577
+54952
+50836
+48276
+54596
+47532
+54945
+46020
+47448
+48708
+51200
+46020
+55128
+52268
+51032
+46160
+50896
+44396
+51116
+48149
+51228
+50521
+46020
+51060
+45392
+49548
+48376
+44396
+48152
+47568
+50528
+50504
+49324
+52268
+51656
+50577
+51204
+50672
+49464
+51228
+48120
+49888
+51228
+51021
+51076
+49324
+44256
+45377
+50676
+44148
+49688
+50689
+54252
+54840
+54840
+50685
+54200
+50577
+47156
+49885
+50728
+53748
+51104
+51200
+50689
+50689
+52840
+45817
+45812
+47308
+54924
+50669
+50685
+44216
+51008
+45397
+51088
+44204
+50577
+48149
+48120
+49688
+47560
+47049
+44228
+44228
+49688
+48520
+48156
+48393
+48324
+51032
+50948
+54872
+48276
+44592
+47784
+48512
+50521
+50521
+48516
+44592
+44400
+53468
+51068
+48149
+48320
+48156
+44396
+54788
+49696
+48708
+50984
+52824
+47140
+51060
+47148
+55092
+45544
+55148
+50724
+44221
+47280
+54252
+53441
+52628
+52384
+52285
+50504
+50696
+50669
+47497
+48512
+49341
+54844
+51456
+49688
+48317
+54596
+49341
+49345
+54617
+47141
+44368
+54620
+51116
+44264
+49849
+47336
+47561
+47729
+47589
+50724
+51201
+52629
+54889
+48264
+46321
+46041
+51665
+46021
+50508
+50696
+51228
+46020
+47536
+54364
+48393
+44148
+49453
+46972
+49888
+50504
+44284
+49453
+51061
+44264
+50756
+50508
+44032
+48156
+44256
+47161
+44036
+44292
+54644
+44305
+54665
+44508
+52293
+51221
+46993
+54224
+54872
+48372
+50836
+50756
+52377
+49688
+44284
+45824
+50724
+44216
+47560
+44340
+44340
+50516
+47568
+44221
+44256
+44273
+44256
+54840
+45796
+49452
+45236
+49324
+44060
+48708
+54028
+49569
+51109
+50508
+47564
+49709
+52264
+49452
+44292
+44256
+51201
+48512
+51312
+51320
+50752
+48708
+52292
+48337
+49352
+49688
+50976
+44592
+52264
+48152
+48149
+47564
+52509
+55092
+44480
+51228
+46988
+49688
+47805
+47732
+48152
+47140
+52268
+44396
+47448
+51032
+47928
+47141
+47141
+51613
+51088
+54844
+49888
+52824
+54665
+47581
+46041
+50669
+48708
+54840
+47588
+52264
+47588
+52488
+44516
+50976
+51032
+51032
+50976
+47161
+50508
+51221
+44544
+51088
+47581
+48169
+44277
+51201
+44060
+50612
+51104
+54056
+54028
+53440
+50521
+44368
+50976
+51656
+44060
+47568
+49849
+49440
+51648
+51200
+48120
+44277
+51060
+44557
+44557
+46160
+48512
+49444
+50629
+51221
+51312
+47924
+47448
+52268
+47532
+49689
+47197
+54785
+51089
+54056
+45236
+44144
+51092
+44397
+51137
+51320
+54632
+51228
+52628
+49440
+51228
+47581
+54364
+46980
+49436
+44557
+50529
+47536
+46041
+51228
+50672
+51204
+44557
+50745
+46993
+50612
+49688
+52264
+54644
+54876
+51204
+52285
+47336
+52280
+51648
+50948
+49440
+52488
+48124
+44508
+49548
+49549
+47560
+49324
+53440
+51104
+44288
+46321
+45236
+47196
+47196
+51032
+54644
+50628
+44221
+48372
+51452
+54632
+44288
+51208
+47280
+47805
+50629
+52285
+47549
+51064
+52632
+52628
+46321
+50612
+51452
+44396
+45824
+46160
+54861
+49884
+54812
+44396
+51648
+49884
+50896
+44553
+50868
+48169
+44277
+54637
+51664
+51089
+50896
+47785
+44060
+48708
+44048
+54788
+49373
+49437
+44368
+51088
+51068
+48156
+51312
+50896
+51088
+51648
+48177
+47924
+48372
+46041
+48156
+46041
+44204
+44277
+44396
+44508
+52264
+50976
+50896
+47196
+44257
+48512
+45393
+50500
+50500
+54805
+44036
+50504
+46020
+48512
+48393
+47749
+49688
+52628
+44592
+50672
+48324
+51104
+49440
+54980
+54889
+50836
+51204
+44508
+50669
+51201
+47589
+51473
+48372
+47785
+51652
+49696
+45813
+52825
+44228
+51333
+47560
+44396
+50516
+52280
+44396
+54617
+46321
+50672
+46041
+50864
+49345
+45544
+49692
+48516
+48373
+47161
+50724
+54872
+51032
+54872
+47805
+50549
+47336
+50672
+48372
+52393
+47161
+49324
+44368
+47148
+52397
+44201
+52404
+48317
+44053
+49548
+54924
+52572
+51201
+54872
+50724
+47140
+48120
+54840
+49373
+44032
+51008
+50948
+50896
+54364
+47197
+47161
+51061
+51116
+49328
+54848
+49549
+53440
+47568
+54876
+52393
+48337
+48393
+54844
+48512
+44284
+48512
+47532
+51092
+48708
+52264
+47805
+49604
+51109
+51201
+44361
+54413
+50724
+47805
+49340
+44257
+46160
+46024
+50976
+54800
+46024
+45800
+47196
+52380
+45776
+45776
+47532
+46041
+44144
+44204
+48373
+49352
+52264
+46020
+44204
+45453
+50508
+44221
+44036
+51201
+44204
+47588
+45804
+44204
+50872
+49324
+51116
+47581
+47168
+44260
+54984
+45813
+51088
+50577
+53668
+49345
+54785
+51312
+54924
+51081
+52524
+44396
+50752
+52628
+51648
+51221
+49464
+49345
+51105
+48512
+52393
+45813
+45813
+54364
+54632
+48337
+44033
+52628
+51452
+48149
+47448
+45685
+55137
+54252
+51228
+54633
+52404
+50780
+51228
+51228
+51228
+52824
+54028
+44552
+44032
+47549
+44144
+44396
+46980
+44257
+54801
+44592
+54632
+54632
+49892
+54632
+50528
+54624
+52264
+52293
+50836
+52280
+51228
+52272
+50628
+44204
+50773
+50628
+44508
+52488
+46041
+50684
+50557
+52712
+51648
diff --git a/macros/xetex/generic/xetexko/xetexko-doc.pdf b/macros/xetex/generic/xetexko/xetexko-doc.pdf
new file mode 100644
index 0000000000..408ce290b7
--- /dev/null
+++ b/macros/xetex/generic/xetexko/xetexko-doc.pdf
Binary files differ
diff --git a/macros/xetex/generic/xetexko/xetexko-doc.tex b/macros/xetex/generic/xetexko/xetexko-doc.tex
new file mode 100644
index 0000000000..46fd76a4f9
--- /dev/null
+++ b/macros/xetex/generic/xetexko/xetexko-doc.tex
@@ -0,0 +1,626 @@
+%% !tex program = xelatex
+%%
+%% xetexko-doc.tex
+%%
+%% This file is in the public domain
+
+\documentclass[a4paper]{article}
+\usepackage[hmargin=3.8cm]{geometry}
+\usepackage[hangul]{xetexko}
+\setmainhangulfont{Noto Serif CJK KR}[
+ Script=Hangul, Language=Korean,
+ UprightFont=* Light,
+ BoldFont=* Bold,
+]
+\setsanshangulfont{Noto Sans CJK KR}[
+ Script=Hangul, Language=Korean,
+ UprightFont=* DemiLight,
+]
+\usepackage{xetexko-hanging, hologo, xcolor, ulem}
+\usepackage[bookmarksnumbered,hidelinks]{hyperref}
+
+\edef\verbatim{\unexpanded\expandafter{\verbatim
+ \linespread{1.1}\selectfont }}
+\def\logoko{\textsf{k}\kern-.2ex\textit{o}}
+\def\XeTeX{\hologo{XeTeX}}
+\def\xetexko{\XeTeX\kern-.1ex -\logoko}
+\def\kotex{\logoko\kern-.1ex .\kern-.1667em \hologo{TeX}}
+\pdfstringdefDisableCommands{\def\xetexko{XeTeX-ko}}
+\renewcommand*\descriptionlabel[1]{\hspace\labelsep\ttfamily\bfseries
+ \color{blue!50!black}#1}
+\def\grayhrule{{\color{white!80!black}\hrule height2pt}}
+\def\grayvrule{{\color{white!80!black}\vrule width 2pt}}
+\newenvironment{plaintex}
+ {\setbox0=\vbox\bgroup\hsize=\dimexpr\textwidth-12pt\relax
+ \hrule width0pt\kern5pt\par\small
+ \noindent}
+ {\par \vskip-\lastskip\kern5pt\hrule width0pt\egroup \par\medskip\par
+ \dimen0=\dimexpr\pagegoal-\pagetotal\relax
+ \ifdim\dimen0<2\baselineskip\relax \dimen0\maxdimen \fi
+ \ifdim\ht0<\dimen0
+ \hbox{\grayvrule\kern10pt\box0}%
+ \else
+ \setbox2=\vsplit0 to\dimen0
+ \lineskip0pt
+ \ifvoid2 \else\hbox{\grayvrule\kern10pt\box2}\fi
+ \ifvoid0 \else\hbox{\grayvrule\kern10pt\box0}\fi
+ \fi \par\medskip\par }
+\newenvironment{example}
+ {\hbox\bgroup\grayvrule
+ \vbox\bgroup\hsize\dimexpr\textwidth-4pt\relax
+ \grayhrule\kern1em\leftskip1em\rightskip1em
+ }{\par\kern1em\grayhrule\egroup\grayvrule\egroup}
+\def\cs#1{\texttt{\textbackslash #1}}
+\def\hemph#1{\textsf{\bfseries #1}}
+\def\hparen#1{{\small\hangulparens(#1)}}
+\def\hparens#1{\leavevmode\unskip---{\small #1}---\ignorespaces}
+
+\begin{document}
+\title{\xetexko\ 간단 매뉴얼}
+\author{Dohyun Kim \normalsize <\texttt{nomos at ktug org}> \and
+ \normalsize <\url{http://github.com/dohyunkim/xetexko}>}
+\date{Version 2.21\quad 2018/08/08}
+\maketitle
+
+\begin{quote}\small
+ For a summary introduction in English,
+ please see \verb+README+ file in this package.
+
+ \begin{itemize}\itemsep=0pt\linespread{1.2}\selectfont
+ \item[v2.0]---
+ \item \hyperref[sec:loading]
+ {플레인텍에서 xetexko.tex이 아니라 xetexko.sty를 불러야 한다.}
+ \item \hyperref[sec:symbolfont]
+ {CJK 기호문자를 \hparen{한자가 아니라} 한글 글꼴에서 찾는 것이
+ 기본값이 되었다.}
+ \item \hyperref[sec:fontopts]
+ {\texttt{interpunctskern} 글꼴 옵션을 없애고 \texttt{quoteraise}를
+ 추가했다.}
+ \item[v2.2]---
+ \item \hyperref[sec:fontopts]
+ {글꼴 옵션 \texttt{CharRaise}를 추가했다.}
+ \item \hyperref[sec:fontcmds]
+ {\cs{fallbackhanjafont} 명령을 인식한다.}
+ \item \hyperref[sec:etccmds]
+ {\cs{everyhangul}, \cs{everyhanja} 명령이 추가되었다.}
+ \item \hyperref[sec:symbolfont]
+ {하이픈 문자를 \hparen{직전 글꼴이 아니라} 라틴 글꼴에서 찾는
+ 것이 기본값이 되었다.}
+ \item[v2.4]---
+ \item Variation Selector를 이용한 한자 변형 글리프 접근을 허용한다.
+ \item[v2.7]---
+ \item \hyperref[sec:fontcmds]
+ {main/sans hangul/hanja 글꼴에는 디폴트 옵션
+ \texttt{Ligatures=TeX}이 주어진다.}
+ \item \hyperref[sec:fontopts]
+ {\cs{defaulthangulfontfeatures}와 \cs{defaulthanjafontfeatures}
+ 명령이 생겼다.}
+ \item[v2.9]---
+ \item \hyperref[sec:fontcmds]
+ {영문폰트에 한글·한자 자형이 없고 한글·한자 폰트도 따로 지시하지 않았다면
+ 나눔 트루타입을 한글·한자 글꼴의 기본값으로 사용한다.}
+ \item[v2.10]---
+ \item 패키지 옵션 \texttt{[unfonts]}를 더는 지원하지 않는다. 이 옵션을
+ 사용한 기존 문서는 기본 글꼴인 나눔 트루타입으로 식자될 것이다.
+ \item[v2.13]---
+ \item \hyperref[sec:verttype]
+ {\texttt{horizontal} 환경이 추가되었다.}
+ \end{itemize}
+\end{quote}
+
+\smallskip
+
+\section{입력 인코딩}
+입력은 원칙적으로 UTF-8으로 한다.
+BOM (Byte Order Mark)은 있어도 좋고 없어도 좋다.
+EUC-KR이나 CP949 입력도 지원하는데, 다음과 같은 선언이 있으면 된다.
+\begin{verbatim}
+ \XeTeXinputencoding="korean"
+ \XeTeXdefaultencoding="korean"
+\end{verbatim}
+
+\section{\XeTeX\ 자체 기능}
+\XeTeX 은 자체적으로 유니코드를 잘 지원하므로 \xetexko 를 사용하지
+않더라도 한글을 찍는 데 문제가 없다.
+\begin{verbatim}
+ \usepackage{fontspec}
+ \setmainfont{UnBatang}
+ \setsansfont{UnDotum}
+ \setmonofont{UnTaza}
+ \XeTeXlinebreaklocale="ko"
+ \XeTeXlinebreakpenalty=50
+ \XeTeXlinebreakskip=0pt plus.1ex minus.05ex
+\end{verbatim}
+하지만 이렇게 사용하면 영문자와 한글이 같은 글꼴로 식자될 뿐만 아니라,
+한글 사이 자간이나 영문자와 한글 사이 간격 따위의 \xetexko 가 제공하는
+기능을 포기해야 할 것이다.
+
+\section{\xetexko\ 부르기}\label{sec:loading}
+\xetexko\ 로드하기: \cs{usepackage\{xetexko\}} 혹은 \cs{usepackage\{kotex\}}.
+이 명령으로 fontspec 및 xunicode 패키지도 함께 불러들인다.
+fontspec에 옵션을 주려면 \xetexko를 부르기 전에 fontspec을 따로 로드하면 된다.
+
+\begin{plaintex}
+플레인텍이라면 \verb|\input xetexko.sty| 혹은 \verb|\input kotex.sty|.
+\end{plaintex}
+
+패키지 옵션:
+\begin{description}\hangulquotes
+\item[ hangul ] `제1장' `표' `차례' 등 한글 표제를 이용한다.
+ 절 제목 이하에는 한글 표제가 붙지 않고 숫자로만 표현된다.
+ 한글이 주된 언어라고 인식하여 줄간격 조정도 수행한다.
+\item[ hanja ] `第1章' `表' `目次' 등 한자 표제를 이용한다.
+ 절 제목 이하에는 한자 표제가 붙지 않고 숫자로만 표현된다.
+ 한글이 주된 언어라고 인식하여 줄간격 조정도 수행한다.
+\end{description}
+
+
+\section{글꼴 명령}\label{sec:fontcmds}
+\begin{verbatim}
+ \setmainfont {Linux Libertine}
+ \setmainhangulfont{NanumMyeongjo}
+ \setmainhanjafont {UnBatang}
+\end{verbatim}
+각 명령의 의미는 이름이 뜻하는 그대로이며, fontspec 매뉴얼에 따라
+설정한다. 마찬가지로 다음 명령들도 제공한다.
+\begin{verbatim}
+ \setsansfont \setsanshangulfont \setsanshanjafont
+ \setmonofont \setmonohangulfont \setmonohanjafont
+\end{verbatim}
+main/sans hangul/hanja 폰트에는 따로 \verb|Ligatures=TeX| 옵션을 지시하지
+않더라도 자동으로 주어진다.
+
+한글폰트를 따로 지정하지 않으면 영문폰트가 한글에도 사용된다.
+한자폰트를 따로 지정하지 않으면 한글폰트가 한자에도 적용된다.
+\LaTeX 에서는 영문폰트에 한글·한자 글리프가 없고 한글·한자 폰트도 따로
+지시하지 않았다면 \hemph{나눔 트루타입을 한글·한자 글꼴의 기본값}으로
+사용한다.\footnote{나눔 글꼴을 찾을 수 없다면 바탕/돋움 글꼴을 이용하고
+ 그마저도 없다면 한글·한자가 식자되지 않을 뿐, 에러를 발생시키지는 않는다.}
+
+\begin{plaintex}
+플레인텍이라면 다음처럼 한다.
+\begin{verbatim}
+ \font\tenrm="[lmroman10-regular]:mapping=tex-text" at 10pt
+ \hangulfont="[UnBatang]:mapping=tex-text" at 10pt
+ \hanjafont ="Naver Dictionary:mapping=tex-text" at 10pt
+\end{verbatim}
+\end{plaintex}
+
+\cs{fallbackhanjafont}를 정의해두면 \hemph{한자 글꼴에도 없는 한자}를
+이 글꼴에서 찾아 식자한다. \verb|\newfontfamily| 명령 등으로 정의한다.
+
+\section{글꼴 명령 (계속)}
+\begin{verbatim}
+ \hangulfontspec{NanumGothic}[Ligatures=TeX]
+ \hanjafontspec {UnGungseo}[Ligatures=TeX]
+\end{verbatim}
+임시로 사용할 한글·한자 글꼴을 지시한다.
+\cs{adhochangulfont}와 \cs{adhochanjafont}는 이들 명령의 다른 이름이다.
+
+\begin{verbatim}
+ \newhangulfontfamily\myhangul{NanumGothic}[Ligatures=TeX]
+ \newhanjafontfamily \myhanja {UnGungseo}[Ligatures=TeX]
+ \newhangulfontface \myhangul{NanumGothic Bold}[Ligatures=TeX]
+ \newhanjafontface \myhanja {UnDotumBold}[Ligatures=TeX]
+\end{verbatim}
+fontspec 패키지의 \verb+\setfontfamily+ \verb+\newfontface+ 명령에 해당한다.
+
+\begin{verbatim}
+ \addhangulfontfeature{Color=FF0000,InterHangul=-.1em}
+ \addhanjafontfeature {Color=00FF00}
+\end{verbatim}
+fontspec의 \verb+\addfontfeature+ 명령을 구현한 것이다.
+fontspec과 마찬가지로 각 명령의 끝에 `s'를 붙여도 된다.
+
+참고로, 한자와 한글을 같은 글꼴로 식자하고 싶을 때 글꼴 설정을
+번거롭게 두 번 할 필요 없이 한글 글꼴만 설정한 뒤 간단히
+\cs{hanjabyhangulfont}를 선언하면 된다.%
+\footnote{앞 절의 main/sans 글꼴 명령들과 달리 한글 폰트가 자동으로
+ 한자에도 적용되지 않는다는 말이다. 어쨌든 이미 한자 폰트가 지정돼 있는
+ 상태이기 때문이다.}
+
+
+\section{기호 글꼴 명령}\label{sec:symbolfont}
+라틴 문자나 CJK 기호를 어떤 폰트로 식자할 것인가를 사용자가 지정할 수 있다.
+\begin{verbatim}
+ \xetexkofontregime{hangul}[quotes=latin, puncts=prevfont]
+\end{verbatim}
+모든 라틴 문자와 CJK 기호들을 원칙적으로 한글 폰트로 식자하되,
+따옴표는 라틴 폰트로 찍고 마침표 따위는 현재 폰트를 따라간다는 의미이다.
+명령의 인자에는 latin, hangul, hanja, prevfont 중 하나가 올 수 있어서
+각각 라틴 폰트, 한글 폰트, 한자 폰트로 식자하라는 뜻이며
+마지막의 prevfont는 \hemph{현재 활성화된 폰트를 그대로 이어받도록} 지시한다.
+현재 폰트가 직전 문자의 폰트가 아닐 수 있음에 주의할 것.
+
+옵션 키의 종류와 의미는 다음과 같으며 각 키 값은 인자의 경우와 같다.
+\begin{description}\itemsep0pt\hangulparens
+\item[alphs] 라틴 알파벳 및 아래에 해당하지 않는 모든 라틴 문자
+\item[nums] 라틴 숫자 \hparen{수식 제외}
+\item[parens] 라틴 괄호, 중괄호, 대괄호, 꺽쇠
+\item[quotes] accent grave, apostrophy 및 이들의 리거쳐
+\item[colons] 라틴 콜론, 세미콜론, endash, emdash
+\item[hyphens] 하이픈, 하이픈으로 이루어지는 리거쳐, 슬래시
+\item[puncts] 마침표, 물음표, 느낌표, 쉼표
+\item[cjksymbols] CJK 구두점, 괄호 및 상징기호
+\end{description}
+기본값은 다음 명령을 준 것과 동일하다. \hemph{CJK 기호가 한글폰트}로,
+\hemph{하이픈은 라틴폰트}로
+식자되게 기본값이 변경되었음에 유의할 것.
+\begin{verbatim}
+ \xetexkofontregime {latin}%
+ [ puncts=prevfont, colons=prevfont, cjksymbols=hangul ]
+\end{verbatim}
+\begin{plaintex}
+플레인텍에서는 다음 명령을 사용한다. \LaTeX에서도 쓸 수 있다.
+\begin{verbatim}
+ \latinalphs \hangulalphs \hanjaalphs \prevfontalphs
+ \latinnums \hangulnums \hanjanums \prevfontnums
+ \latinparens \hangulparens \hanjaparens \prevfontparens
+ \latinquotes \hangulquotes \hanjaquotes \prevfontquotes
+ \latinhyphens \hangulhyphens \hanjahyphens \prevfonthyphens
+ \latincolons \hangulcolons \hanjacolons \prevfontcolons
+ \latinpuncts \hangulpuncts \hanjapuncts \prevfontpuncts
+ \latincjksymbols \hangulcjksymbols \hanjacjksymbols \prevfontcjksymbols
+\end{verbatim}
+다음 명령은 이상의 모든 라틴 문자를 식자할 폰트를 지시한다.
+\begin{verbatim}
+ \latinmarks \hangulmarks \hanjamarks \prevfontmarks
+\end{verbatim}
+\end{plaintex}
+
+\section{간격 조정 옵션}\label{sec:fontopts}
+\dotemph{고정폭 글꼴을 제외한} 한글·한자 글꼴 명령에 미세 간격 옵션을
+쓸 수 있다.
+\begin{verbatim}
+ \setsanshangulfont{NanumGothic}[InterHangul=-.04em]
+\end{verbatim}
+이 때 나눔고딕 글꼴에만 한글 마이너스 자간이 작동한다.
+허용되는 옵션은 다음과 같으며 기본값은 다른 언급이 없는 한 모두 0pt이다.
+\begin{description}\itemsep0pt
+\item[hu, InterLatinCJK]
+ 영문자와 한글 사이 간격을 지시한다.
+ 영문 괄호와 한글 사이 간격은 그 두 배이다. 기본값 0.05em.
+\item[interhchar, InterHangul]
+ {\addhangulfontfeature{interhchar=0.3em} 한글 자간을} 지시한다.%
+ \footnote{한자 자간 옵션은 제공하지 않는다.
+ 혹시 한자 자간을 조절하고 싶다면 \cs{XKinterhanjabreak}을 재정의하라.
+ 참고로 한글 자간을 조절하는 저수준 명령은 \cs{XKinterhangulbreak} 이다.}
+\item[charraise, CharRaise]
+ 글자의 {\addhangulfontfeature{charraise=.5ex}수직 위치}를 조절한다.
+ 다른 글꼴 관련 효과와 충돌할 수 있어 주의를 요한다.
+\item[lowerperiod, PunctRaise]
+ \verb+lowerperiod+는 CJK 문자 직후의 마침표를 아래로 끌어내리는
+ {\addhangulfontfeature{lowerperiod=.5ex}정도를 지시한다.
+ 반대로 \verb+PunctRaise+ 옵션은 끌어올리는 정도를 지시한다.}
+\item[lowerquestion]
+ CJK 문자 직후의 물음표를 아래로 끌어내리는 정도.
+\item[lowerexclamation]
+ CJK 문자 직후의 느낌표를 아래로 끌어내리는 정도.
+\item[lowercomma]
+ CJK 문자 직후의 쉼표를 아래로 끌어내리는 정도.
+\item[preperiodkern]
+ {\addhangulfontfeature{preperiodkern=1ex}CJK 문자 직후의 마침표 앞에
+ 들어가는 간격.}
+\item[postperiodkern]
+ {\addhangulfontfeature{postperiodkern=1ex}CJK 문자 직후의 마침표 뒤에
+ 들어가는 간격.}
+\item[prequestionkern]
+ CJK 문자 직후의 물음표 앞에 들어가는 간격.
+\item[postquestionkern]
+ CJK 문자 직후의 물음표 뒤에 들어가는 간격.
+\item[preexclamationkern]
+ CJK 문자 직후의 느낌표 앞에 들어가는 간격.
+\item[postexclamationkern]
+ CJK 문자 직후의 느낌표 뒤에 들어가는 간격.
+\item[precommakern]
+ CJK 문자 직후의 쉼표 앞에 들어가는 간격.
+\item[postcommakern]
+ CJK 문자 직후의 쉼표 뒤에 들어가는 간격.
+\item[quoteraise]
+ 영문 인용부호\hparens{아스키문자로 입력하는 것}를
+ 위로 끌어올리는 정도.
+\item[quotewidth]
+ 영문 인용부호의 폭. 기본값은 natural width.
+\item[postmathskip]
+ 수식과 CJK 문자 사이의 간격. 기본값은 위 hu 값의 두 배.
+\end{description}
+
+\begin{plaintex}
+플레인텍에서는 다음과 같은 방법으로 제어할 수 있다. 기본값은 \LaTeX에서와 같다.
+\begin{verbatim}
+ \def\xetexkohu{0.05em }
+ \def\xetexkointerhchar{-0.04em }
+ \def\xetexkocharraise{-0.1ex }
+ \def\xetexkolowerperiod{0.15ex }
+ \def\xetexkolowerquestion{0.15ex }
+ \def\xetexkolowerexclamation{0.15ex }
+ \def\xetexkolowercomma{0.15ex }
+ \def\xetexkopreperiodkern {-0.1em }
+ \def\xetexkopostperiodkern{}
+ \def\xetexkoprequestionkern {0.2em }
+ \def\xetexkopostquestionkern{0.2em }
+ \def\xetexkopreexclamationkern {0.1em }
+ \def\xetexkopostexclamationkern{0.1em }
+ \def\xetexkoprecommakern {0.1em }
+ \def\xetexkopostcommakern{0.1em }
+ \def\xetexkoquoteraise{0.1em }
+ \def\xetexkoquotewidth{0.33em }
+ \def\xetexkopostmathskip{0.2em }
+\end{verbatim}
+\end{plaintex}
+
+\LaTeX 에서는 한글·한자 글꼴의 기본 옵션을 지정할 수 있다.
+\begin{verbatim}
+ \defaulthangulfontfeatures {InterLatinCJK=.1em, InterHangul=-.1em}
+ \defaulthangulfontfeatures+{InterLatinCJK=.1em, InterHangul=-.1em}
+ \defaulthanjafontfeatures {InterLatinCJK=.1em}
+ \defaulthanjafontfeatures +{InterLatinCJK=.1em}
+\end{verbatim}
+fontspec 패키지의 \cs{defaultfontfeatures}에 상응하는 것이지만,
+오직 이 절에서 언급한 옵션들만 인식하며 나머지는 무시된다는 점을 유의하라.
+
+
+\section{그밖의 명령들}\label{sec:etccmds}
+\begin{description}
+ \item[\cs{everyhangul}, \cs{everyhanja}]
+ 한글 또는 한자에 대해 글자마다 지시한 명령을 수행한다. 예컨대
+ \verb|\everyhangul{\fbox{#1}}| 명령은 모든
+ {\everyhangul{\fbox{#1}}\fboxsep=1pt 한글 주위에 박스}를
+ 두른다. 다른 글꼴 옵션과 충돌할 수 있으므로
+ 주의를 요한다.
+
+ \item[\cs{disablekoreanfonts}]
+한글폰트를 따로 설정하지 않고 영문 폰트를 따라간다.
+이 때 \verb|\setmainfont| 따위가 한글과 한자에도 적용된다.
+
+ \item[\cs{disableautojosa}]
+혹시 있을지 모를 예기치 못한 기능간 충돌에 대비하여 자동조사 기능을
+끄는 명령을 제공한다.
+
+ \item[\cs{disablejamoautojosa}]
+옛한글 자모에 한해서 자동조사 기능을 끈다.
+옛한글 자모에 영향을 주는 \verb+Mapping+ 글꼴 옵션을 사용해야 한다면
+이 명령을 선언해두어야 정상 작동한다.
+
+ \item[\cs{disablecjksymbolspacing}]
+CJK 구두점의 폭을 0.5em으로 강제설정하는 것을 방지한다.
+\xetexko는 낡은 고정폭 한글 폰트들을 고려하여 이 기능을 구현하였으나
+현대적인 한글 폰트는 이러한 과잉친절이 오히려 성가실 경우가 있다.
+
+ \item[\cs{disablehangulspacing}]
+한글조판에 관련된 모든 미세간격을 영(zero)으로 돌린다. 한글 자간도,
+영문자와 한글 사이 간격도, 구두점 위치 조정도, 구두점 사이의 간격도
+모두 작동하지 않는다. 그러나 CJK 글자 사이의 줄바꿈 허용만은 유지된다.
+
+ \item[\cs{disablehangulspacingandlinebreak}]
+위 명령과 마찬가지로 모든 미세간격을 금지할 뿐만 아니라 CJK 글자 사이의
+줄바꿈까지도 먹지 않게 한다.
+일부 고급 오픈타입 기능을 사용하기 위해서 이 명령이 필요할 때가 있다.
+이를테면, 폰트가 지원하는 한글 리거쳐가 동작하지 않을 때 이 명령을
+선언하면 문제가 해결된다.\footnote{만약 사용자가
+ {\ttfamily\string\XeTeXlinebreaklocale}도 선언했다면
+ {\ttfamily\string\XeTeXlinebreaklocale""} 명령도 요구된다.
+ 이 원시명령은 그룹 내에서 쓰더라도 항상 전역적인 효과를 가짐을 유의하라}
+\end{description}
+
+\section{옛한글}
+
+옛한글을 사용하기 위해선 \verb|Script=Hangul| 옵션을 주는 것으로 족하다.
+옛한글 식자는 고급 오픈타입 기능을 이용하므로
+폰트가 이런 기능을 제공해야만 가능한 일이다.\footnote{%
+이런 기능을 제공하는 폰트로는 윈도즈~8에 번들된 맑은고딕이
+있으며 공개폰트로는 은바탕, 함초롬~LVT, Source Han Sans (본고딕),
+Noto Sans CJK, 나눔명조옛한글, 나눔바른고딕옛한글 등이 있다.}
+
+\begin{figure}
+ \begin{example}
+ \sffamily \obeylines\leftskip10em
+뎨 가ᄂᆞᆫ 뎌 각시 본 듯도 ᄒᆞᆫ뎌이고.
+天텬上상白ᄇᆡᆨ玉옥京경을 엇디ᄒᆞ야 離니別별ᄒᆞ고
+ᄒᆡ 다 져믄 날의 눌을 보라 가시ᄂᆞᆫ고
+\medbreak
+어와 네여이고 내 ᄉᆞ셜 드러보오.
+내 얼굴 이 거동이 님 괴얌즉 ᄒᆞᆫ가마ᄂᆞᆫ
+엇딘디 날 보시고 네로다 녀기실ᄉᆡ
+나도 님을 미더 군 ᄠᅥ디 전혀 업서
+이ᄅᆡ야 교ᄐᆡ야 어ᄌᆞ러이 구돗ᄯᅥᆫ디
+반기시ᄂᆞᆫ ᄂᆞᆺ비치 녜와 엇디 다ᄅᆞ신고.
+ \end{example}
+ \caption{옛한글 조판 보기}\label{fig:yethangul}
+\end{figure}
+
+\begin{verbatim}
+ \setmainhangulfont{Malgun Gothic}[ Script=Hangul ]
+\end{verbatim}
+\begin{plaintex}
+플레인텍이라면,
+\begin{verbatim}
+ \hangulfont="Malgun Gothic:script=hang" at 10pt
+\end{verbatim}
+\end{plaintex}
+
+\section{세로쓰기}\label{sec:verttype}
+
+세로쓰기를 위한 글꼴 지정은 다음과 같다.
+역시 고급 오픈타입 기능을 이용하는 것이므로
+폰트가 이를 지원해야 한다.%
+\footnote{만일 폰트의 세로쓰기 글자폭이 가로쓰기와 다르다면
+ \cs{verticalem=1.05em} 같은 선언을 미리 해두는 게 좋다.}
+\begin{verbatim}
+ \setmainhangulfont{Adobe Myungjo Std}[ Vertical=RotatedGlyphs ]
+\end{verbatim}
+문서 전체를 세로쓰기할 때 \cs{verticaltypesetting}을 선언하면
+면주는 그대로 두고 본문만 세로쓰기한다.\footnote{당연히 면주의 글꼴에는
+ \texttt{Vertical} 옵션이 없어야 할 것이다.
+ 면주 글꼴을 따로 지정하는 것은 사용자의 몫이다. }
+문서의 일부를 세로쓰기 하려면 vertical 환경을 이용한다.
+vertical 환경의 인자는 세로쓰기 박스의 세로 길이이다.
+보통 그 뒤에 세로쓰기에 사용할 글꼴 명령이 온다.
+\begin{figure}
+\begin{example}
+\hfil\begin{vertical}{16em}
+ \sffamily\addhangulfontfeatures{Vertical=RotatedGlyphs,CharRaise=.5ex,
+ RawFeature=vertical}
+ \hanjabyhangulfont \parindent-1em\leftskip1em
+ \noindent 님의 침묵 (The Silent Beloved)
+\smallbreak
+\hfil\hfil 한 용 운\hfil
+\bigbreak
+님은 갓슴니다 아아 사랑하는나의님은 갓슴니다\par
+푸른산빗을깨치고 단풍나무숩을향하야난 적은길을 거러서 참어떨치고 갓슴니다\par
+黃金의꽃가티 굿고빗나든 옛盟誓는 차듸찬띠끌이되야서 한숨의 微風에 나러갓슴니다\par
+날카로은 첫〈키쓰〉의追憶은 나의運命의指針을 돌너노코 뒷거름처서 사러젓슴니다\par
+\hellipsis\par
+아아 님은갓지마는 나는 님을보내지 아니하얏슴니다\par
+제곡조를못이기는 사랑의노래는 님의沈默을 휩싸고돔니다\par
+\end{vertical}\hfil
+\end{example}
+\caption{세로쓰기 보기}\label{fig:vertical}
+\end{figure}
+
+\begin{verbatim}
+ \begin{vertical}{12em}
+ \hangulfontspec{Adobe Myungjo Std}[ Vertical=RotatedGlyphs ]
+ 세로쓰기로 식자할 부분
+ \end{vertical}
+\end{verbatim}
+혹시 세로로 식자되지 않는 라틴문자 부분이 있다면
+베이스라인이 한글과 어울리지 않을 수 있다. 이를 교정하려면
+\verb|CharRaise| 옵션을 한글 폰트에 준다.\footnote{%
+ 이 방법이 여의치 않으면 라틴문자 부분을 \cs{vertlatin} 명령으로 감쌀 수도
+ 있는데, 이때 인자가 박스로 처리되어 그 안에서 줄바꿈이 일어나지 않는다.}
+\medbreak
+\begin{plaintex}
+플레인텍이라면,
+\begin{verbatim}
+ \vertical{16em}\hangulfont="Adobe Myungjo Std:vertical"
+ 세로쓰기로 식자할 부분
+ \endvertical
+\end{verbatim}
+\end{plaintex}
+세로쓰기 도중에 문서의 일부를 가로쓰기하려면 horizontal 환경을 이용하라.
+horizontal 환경에는 가로쓰기 박스의 너비를 인자로 주어야 한다.
+가로쓰기 영역의 폰트 설정은 사용자의 몫이다.
+
+\section{고문헌·일본어·중국어}
+
+띄어쓰기가 없는 옛문헌이나 일본어 단락 따위를 삽입할 때
+japanese 혹은 chinese 환경을 선언하는 것이 좋다.
+들여쓰기\footnote {들여쓰기 기본값은 japanese는 1em 이고 chinese는 2em 이다.}
+및 자간 조절이 자동으로 이루어지며
+사용자가 입력한 불필요한 공백도 없애준다.
+Schinese 환경은 chinese의 다른 이름이다.
+Tchinese도 제공하는데 중국어 번체 글꼴을 사용한다면 이 환경을 이용하라.
+일반적으로 우리 고문헌 조판에는 japanese 환경이 더 적합하다.
+
+\begin{figure}
+ \begin{example}\linespread{1.3}
+ \sffamily\japanese
+子曰:「學而時習之,不亦說乎?有朋自遠方來,不亦樂乎?人不知而不慍,不亦君子乎?」\par
+有子曰:「其爲人也孝弟,而好犯上者,鮮矣!不好犯上,而好作亂者,未之有也!君子務本,本立而道生;孝弟也者,其爲仁之本與?」\par
+子曰:「巧言令色,鮮矣仁!」\par
+曾子曰:「吾日三省吾身:爲人謀,而不忠乎?與朋友交,而不信乎?傳,不習乎?」\par
+子曰:「道千乘之國,敬事而信,節用而愛人,使民以時。」\par
+子曰:「弟子入則孝,出則弟;謹而信,汎愛衆;而親仁,行有餘力,則以學文。」
+ \end{example}
+\caption{고문헌 조판 보기. japanese 환경을 이용했다.}\label{fig:ancientdoc}
+\end{figure}
+
+\cs{inhibitglue} 명령은 일본어 등 환경에서 가끔 유용한데,
+해당 지점에 자동 삽입되는 공백을 영(zero)으로
+만들어준다.
+
+\section{매달린 구두점}
+마침표, 쉼표, 인용부호를 판면 바깥에 식자하여 행 끝에 매달리게 만든다.
+\begin{verbatim}
+ \usepackage{xetexko-hanging}
+\end{verbatim}
+\cs{hangingpunctuation} 명령은 버전 2.2 이후 불필요해졌다.
+글자 내밀기 기본값에 차이가 좀 있긴 하지만,
+microtype 패키지를 로드하는 것으로도 유사한 결과를 얻을 수 있다.
+
+%\begin{figure}
+%\Large
+%\hangingpunctuation
+%\setbox0\hbox{줄 끝에 매달린 구두점}
+%\vbox{\hfil\hbox{\vrule\vbox{\hsize\wd0
+% 줄 끝에 매달린 구두점.
+% 줄 끝에 매달린 구두점,
+% ``줄 끝에 매달린 구두점''
+% `줄 끝에 매달린 구두점'
+% “줄 끝에 매달린 구두점”
+% ‘줄 끝에 매달린 구두점’
+% 줄 끝에 매달린 구두점、
+% 줄 끝에 매달린 구두점。
+% 줄 끝에 매달린 구두점
+% }\vrule}\hfil}
+%\caption{매달린 구두점 보기}\label{fig:hanging}
+%\end{figure}
+
+\section{수식 한글}
+수식 모드에서도 한글을 \hparens{hbox로 감싸지 않고} 직접 입력할 수 있다.
+\begin{quote}
+ \verb|$가^{나^다}$|\quad$\Rightarrow\quad가^{나^다}$
+\end{quote}
+수식 한글은 따로 설정하지 않으면 문서의 기본 글꼴을 따라가지만
+굳이 설정하려면 다음과 같이 한다. 이 명령은 플레인텍에서도 쓸 수 있다.
+\begin{verbatim}
+ \setmathhangulfont{NanumGothic}
+\end{verbatim}
+현재 한글만 쓸 수 있게 설정되어 있다.
+한자도 수식에 직접 입력하려면 사용자는
+\begin{verbatim}
+ \setmathhangulblock{4E00}{9FC3}
+\end{verbatim}
+명령으로 유니코드 블럭을 추가 지정해야 한다.
+
+\section{자동조사}
+자동조사는 \kotex 의 경우와 기본적으로 동일하게 동작한다.
+게다가 문장 중에서도 동작하고
+플레인텍에서까지 사용할 수 있다.
+그럼에도 불구하고 사용자가 임의로 제어할 필요가 생긴다면
+\cs{jong} \cs{jung} \cs{rieul} 중 하나를
+미리 선언해 둘 수 있다. 이를테면,
+\begin{verbatim}
+ \def\mypage{페이지\jung}
+ \def\mypage{쪽\jong}
+ \def\mystar{별\rieul}
+\end{verbatim}
+
+\section{드러냄표}
+\dotemph{드러냄표} 강조도 \kotex 과 대동소이하다.
+기본은 글자 위에 점을 찍는 형태이나 다음 명령을 이용해 개인적으로 선호하는
+기호를 드러냄표로 쓸 수 있다.
+\begin{verbatim}
+ \def\dotemphraise{0.4em }
+ \def\dotemphchar{\bfseries ^^^^02d9}
+\end{verbatim}
+전자는 드러냄표를 피강조 글자 위로 끌어올리는 길이를,
+후자는 드러냄표 기호 자체를 정의한다.
+\verb|^^^^02d9|는 유니코드 코드포인트를 뜻하는 16진수이고
+숫자 대신 직접 문자를 입력해도 된다.
+플레인텍에서도 드러냄표 강조를 사용할 수 있다.
+
+\section{고아글자 문제}
+어느 정도는 고아글자가 생기지 않게 만들어 두었으나,
+\XeTeX 에서는 고아글자를 자동으로 완전히 회피하기는 어렵다.
+필요하다면 사용자가 적당한 곳에 \verb|\nobreak| 명령을 삽입해야 한다.
+
+\section{한국어 번호}
+항목 번호를 한국어 기호로 붙일 수 있다. \kotex과 마찬가지로
+\verb|\jaso| \verb|\gana| \verb|\ojaso| \verb|\ogana| \verb|\pjaso|
+\verb|\pgana| \verb|\onum| \verb|\pnum| \verb|\oeng| \verb|\peng|
+\verb|\hnum| \verb|\Hnum| \verb|\hroman| \verb|\hRoman| \verb|\hNum|
+\verb|\hanjanum|
+따위를 사용한다.
+
+\section{밑줄긋기}
+\LaTeX에서는 \uline{ulem 패키지}를 로드하는 것만으로 자동 지원된다.
+\begin{plaintex}
+플레인텍에서는 패키지 로드 후 사용자가 \cs{xetexkoulemsupport}
+명령을 내려주어야 한다.
+\end{plaintex}
+%\hfill \fboxsep=-\fboxrule \fbox{\vbox to1em{\hbox to1em{\hss}\vss}}
+
+
+\end{document}
diff --git a/macros/xetex/generic/xetexko/xetexko-font.sty b/macros/xetex/generic/xetexko/xetexko-font.sty
new file mode 100644
index 0000000000..8227485991
--- /dev/null
+++ b/macros/xetex/generic/xetexko/xetexko-font.sty
@@ -0,0 +1,597 @@
+% xetexko-font.sty
+%
+% Copyright (c) 2013-2018 Dohyun Kim <nomos at ktug org>
+%
+% This work 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
+% version 2006/05/20 or later.
+
+\ProvidesPackage{xetexko-font}[2018/08/08 v2.21 LaTeX Font commands for XeTeX-ko]
+
+\let\xetexko@f@size\f@size
+\RequirePackage{fontspec}[2018/07/30]
+\let\f@size\xetexko@f@size
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% for old hangul rendering
+\newfontfeature{YetHangul}{script=hang}
+
+\ExplSyntaxOn
+%%%%%%%%%%%%%%%%%%%%%
+% hangul font options
+\tl_new:N \l_xtxko_font_opts_tl
+\tl_new:N \l_xtxko_font_opts_init_tl
+\tl_set:Nn \l_xtxko_font_opts_init_tl
+ {
+ \tl_clear:N \xetexkointerhchar
+ \tl_clear:N \xetexkolowerexclamation
+ \tl_clear:N \xetexkolowerperiod
+ \tl_clear:N \xetexkolowercomma
+ \tl_clear:N \xetexkolowerquestion
+ \tl_clear:N \xetexkopostexclamationkern
+ \tl_clear:N \xetexkopostperiodkern
+ \tl_clear:N \xetexkopostcommakern
+ \tl_clear:N \xetexkopostquestionkern
+ \tl_clear:N \xetexkopreexclamationkern
+ \tl_clear:N \xetexkopreperiodkern
+ \tl_clear:N \xetexkoprecommakern
+ \tl_clear:N \xetexkoprequestionkern
+ \tl_clear:N \xetexkoquoteraise
+ \tl_clear:N \xetexkoquotewidth
+ \tl_clear:N \xetexkocharraise
+ \tl_set:Nn \xetexkohu {0.05em}
+ \tl_set:Nn \xetexkopostmathskip {\dim_eval:n {\xetexkohu*2}}
+ }
+\cs_new:Nn \__xtxko_add_font_opt:Nn
+ {
+ \tl_put_right:Nn \l_xtxko_font_opts_tl { \tl_set:Nn #1 {#2} }
+ }
+\keys_define:nn { xtxko-font }
+ {
+ hu .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkohu {#1} } ,
+ interhchar .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkointerhchar {#1} } ,
+ lowerexclamation .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkolowerexclamation {#1} } ,
+ lowerperiod .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkolowerperiod {#1} } ,
+ lowercomma .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkolowercomma {#1} } ,
+ lowerquestion .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkolowerquestion {#1} } ,
+ postexclamationkern .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkopostexclamationkern {#1} } ,
+ postmathskip .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkopostmathskip {#1} } ,
+ postperiodkern .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkopostperiodkern {#1} } ,
+ postcommakern .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkopostcommakern {#1} } ,
+ postquestionkern .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkopostquestionkern {#1} } ,
+ preexclamationkern .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkopreexclamationkern {#1} } ,
+ preperiodkern .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkopreperiodkern {#1} } ,
+ precommakern .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkoprecommakern {#1} } ,
+ prequestionkern .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkoprequestionkern {#1} } ,
+ quoteraise .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkoquoteraise {#1} } ,
+ quotewidth .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkoquotewidth {#1} } ,
+ charraise .code:n =
+ { \__xtxko_add_font_opt:Nn \xetexkocharraise {#1} } ,
+ InterLatinCJK .meta:n = { hu = {#1} } ,
+ InterHangul .meta:n = { interhchar = {#1} } ,
+ PunctRaise .meta:n = { lowerperiod = { \dim_eval:n {-#1} } } ,
+ CharRaise .meta:n = { charraise = {#1} } ,
+ }
+\tl_new:N \l_xtxko_rem_tl
+\tl_set_eq:NN \l_xtxko_hangul_font_opts_init_tl \l_xtxko_font_opts_init_tl
+\cs_new:Nn \__xtxko_hangul_assign_font_opts:n
+ {
+ \tl_set_eq:NN \l_xtxko_font_opts_tl \l_xtxko_hangul_font_opts_init_tl
+ \keys_set_known:nxN { xtxko-font } {#1} \l_xtxko_rem_tl
+ }
+\tl_set_eq:NN \l_xtxko_hanja_font_opts_init_tl \l_xtxko_font_opts_init_tl
+\cs_new:Nn \__xtxko_hanja_assign_font_opts:n
+ {
+ \tl_set_eq:NN \l_xtxko_font_opts_tl \l_xtxko_hanja_font_opts_init_tl
+ \keys_set_known:nxN { xtxko-font } {#1} \l_xtxko_rem_tl
+ }
+\cs_new:Nn \__xtxko_def_XKhan__fonts:nnn
+ {
+ \tl_if_eq:NNF #1 \relax
+ {
+ \tl_if_eq:ccT \familydefault #2
+ {
+ \tl_if_eq:NNTF \XKhangulfont #1
+ {
+ \tl_set:Nn #1
+ {
+ \XK@storeltnfont
+ \chardef\XKcurrentfont \c_one #3
+ \XK@storecjkfont
+ }
+ }
+ {
+ \tl_set:Nn #1
+ {
+ \XK@storeltnfont
+ \chardef\XKcurrentfont \c_two #3
+ \XK@storecjkfont
+ }
+ }
+ }
+ }
+ }
+%%%%%%%%%%%%%%%%%%%%
+% user font commands
+\DeclareDocumentCommand \setmainhangulfont { O{} m O{} }
+ {
+ \__xtxko_hangul_assign_font_opts:n {#1,#3}
+ \setfontfamily \kormainfont [\l_xtxko_rem_tl] {#2}
+ \tl_put_right:NV \kormainfont \l_xtxko_font_opts_tl
+ \__xtxko_def_XKhan__fonts:nnn \XKhangulfont \rmdefault \kormainfont
+ \ignorespaces
+ }
+\DeclareDocumentCommand \setsanshangulfont { O{} m O{} }
+ {
+ \__xtxko_hangul_assign_font_opts:n {#1,#3}
+ \setfontfamily \korsansfont [\l_xtxko_rem_tl] {#2}
+ \tl_put_right:NV \korsansfont \l_xtxko_font_opts_tl
+ \__xtxko_def_XKhan__fonts:nnn \XKhangulfont \sfdefault \korsansfont
+ \ignorespaces
+ }
+\DeclareDocumentCommand \setmonohangulfont { O{} m O{} }
+ {
+ \setfontfamily \kormonofont [#1,#3] {#2}
+ \__xtxko_def_XKhan__fonts:nnn \XKhangulfont \ttdefault \kormonofont
+ \ignorespaces
+ }
+\DeclareDocumentCommand \setmainhanjafont { O{} m O{} }
+ {
+ \__xtxko_hanja_assign_font_opts:n {#1,#3}
+ \setfontfamily \hnjmainfont [\l_xtxko_rem_tl] {#2}
+ \tl_put_right:NV \hnjmainfont \l_xtxko_font_opts_tl
+ \__xtxko_def_XKhan__fonts:nnn \XKhanjafont \rmdefault \hnjmainfont
+ \ignorespaces
+ }
+\DeclareDocumentCommand \setsanshanjafont { O{} m O{} }
+ {
+ \__xtxko_hanja_assign_font_opts:n {#1,#3}
+ \setfontfamily \hnjsansfont [\l_xtxko_rem_tl] {#2}
+ \tl_put_right:NV \hnjsansfont \l_xtxko_font_opts_tl
+ \__xtxko_def_XKhan__fonts:nnn \XKhanjafont \sfdefault \hnjsansfont
+ \ignorespaces
+ }
+\DeclareDocumentCommand \setmonohanjafont { O{} m O{} }
+ {
+ \setfontfamily \hnjmonofont [#1,#3] {#2}
+ \__xtxko_def_XKhan__fonts:nnn \XKhanjafont \ttdefault \hnjmonofont
+ \ignorespaces
+ }
+%% {hangul,hanja}fontspec = adhoc{hangul,hanja}font
+\DeclareDocumentCommand \adhochangulfont { O{} m O{} }
+ {
+ \__xtxko_hangul_assign_font_opts:n {#1,#3}
+ \setfontfamily \XK@adhoc@hangul@font [\l_xtxko_rem_tl] {#2}
+ \tl_put_right:NV \XK@adhoc@hangul@font \l_xtxko_font_opts_tl
+ \tl_set:Nn \XKhangulfont
+ {
+ \XK@storeltnfont
+ \tl_set_eq:NN \XKcurrentfont \c_one
+ \XK@adhoc@hangul@font
+ \XK@storecjkfont
+ }
+ \ignorespaces
+ }
+\cs_set_eq:NN \hangulfontspec \adhochangulfont
+\DeclareDocumentCommand \adhochanjafont { O{} m O{} }
+ {
+ \__xtxko_hanja_assign_font_opts:n {#1,#3}
+ \setfontfamily \XK@adhoc@hanja@font [\l_xtxko_rem_tl] {#2}
+ \tl_put_right:NV \XK@adhoc@hanja@font \l_xtxko_font_opts_tl
+ \tl_set:Nn \XKhanjafont
+ {
+ \XK@storeltnfont
+ \tl_set_eq:NN \XKcurrentfont \c_two
+ \XK@adhoc@hanja@font
+ \XK@storecjkfont
+ }
+ \ignorespaces
+ }
+\cs_set_eq:NN \hanjafontspec \adhochanjafont
+%% new{hangul,hanja}font{family,face}
+\DeclareDocumentCommand \newhangulfontfamily { m O{} m O{} }
+ {
+ \__xtxko_hangul_assign_font_opts:n {#2,#4}
+ \exp_args:Nc \setfontfamily { XK@newfont@family \token_to_str:N #1 }
+ [\l_xtxko_rem_tl] {#3}
+ \tl_put_right:cV { XK@newfont@family \token_to_str:N #1 }
+ \l_xtxko_font_opts_tl
+ \DeclareRobustCommand #1
+ {
+ \tl_set:Nn \XKhangulfont
+ {
+ \XK@storeltnfont
+ \tl_set_eq:NN \XKcurrentfont \c_one
+ \use:c { XK@newfont@family \token_to_str:N #1 }
+ \XK@storecjkfont
+ }
+ }
+ }
+\DeclareDocumentCommand \newhanjafontfamily { m O{} m O{} }
+ {
+ \__xtxko_hanja_assign_font_opts:n {#2,#4}
+ \exp_args:Nc \setfontfamily { XK@newfont@family \token_to_str:N #1 }
+ [\l_xtxko_rem_tl] {#3}
+ \tl_put_right:cV { XK@newfont@family \token_to_str:N #1 }
+ \l_xtxko_font_opts_tl
+ \DeclareRobustCommand #1
+ {
+ \tl_set:Nn \XKhanjafont
+ {
+ \XK@storeltnfont
+ \tl_set_eq:NN \XKcurrentfont \c_two
+ \use:c { XK@newfont@family \token_to_str:N #1 }
+ \XK@storecjkfont
+ }
+ }
+ }
+\DeclareDocumentCommand \newhangulfontface { m O{} m O{} }
+ {
+ \__xtxko_hangul_assign_font_opts:n {#2,#4}
+ \exp_args:Nc \newfontface { XK@newfont@family \token_to_str:N #1 }
+ [\l_xtxko_rem_tl] {#3}
+ \tl_put_right:cV { XK@newfont@family \token_to_str:N #1 }
+ \l_xtxko_font_opts_tl
+ \DeclareRobustCommand #1
+ {
+ \tl_set:Nn \XKhangulfont
+ {
+ \XK@storeltnfont
+ \tl_set_eq:NN \XKcurrentfont \c_one
+ \use:c { XK@newfont@family \token_to_str:N #1 }
+ \XK@storecjkfont
+ }
+ }
+ }
+\DeclareDocumentCommand \newhanjafontface { m O{} m O{} }
+ {
+ \__xtxko_hanja_assign_font_opts:n {#2,#4}
+ \exp_args:Nc \newfontface { XK@newfont@family \token_to_str:N #1 }
+ [\l_xtxko_rem_tl] {#3}
+ \tl_put_right:cV { XK@newfont@family \token_to_str:N #1 }
+ \l_xtxko_font_opts_tl
+ \DeclareRobustCommand #1
+ {
+ \tl_set:Nn \XKhanjafont
+ {
+ \XK@storeltnfont
+ \tl_set_eq:NN \XKcurrentfont \c_two
+ \use:c { XK@newfont@family \token_to_str:N #1 }
+ \XK@storecjkfont
+ }
+ }
+ }
+%% add{hangul,hanja}fontfeature[s]
+\DeclareDocumentCommand \addhangulfontfeature { m }
+ {
+ \group_begin:
+ \XKhangulfont
+ \tl_clear:N \l_xtxko_font_opts_tl
+ \keys_set_known:nxN { xtxko-font } {#1} \l_xtxko_rem_tl
+ \addfontfeature {\l_xtxko_rem_tl}
+ \use:x
+ {
+ \group_end:
+ \exp_not:N \tl_set:Nn \exp_not:N \XKhangulfont
+ {
+ \exp_not:V \XKhangulfont
+ \exp_not:N \fontfamily { \f@family } \exp_not:N \selectfont
+ \exp_not:V \l_xtxko_font_opts_tl
+ \exp_not:N \XK@storecjkfont
+ }
+ }
+ \ignorespaces
+ }
+\cs_set_eq:NN \addhangulfontfeatures \addhangulfontfeature
+\DeclareDocumentCommand \addhanjafontfeature { m }
+ {
+ \group_begin:
+ \XKhanjafont
+ \tl_clear:N \l_xtxko_font_opts_tl
+ \keys_set_known:nxN { xtxko-font } {#1} \l_xtxko_rem_tl
+ \addfontfeature {\l_xtxko_rem_tl}
+ \use:x
+ {
+ \group_end:
+ \exp_not:N \tl_set:Nn \exp_not:N \XKhanjafont
+ {
+ \exp_not:V \XKhanjafont
+ \exp_not:N \fontfamily { \f@family } \exp_not:N \selectfont
+ \exp_not:V \l_xtxko_font_opts_tl
+ \exp_not:N \XK@storecjkfont
+ }
+ }
+ \ignorespaces
+ }
+\cs_set_eq:NN \addhanjafontfeatures \addhanjafontfeature
+%% default font features
+\defaultfontfeatures
+ [
+ \kormainfont, \korsansfont, \hnjmainfont, \hnjsansfont,
+ ]
+ {Ligatures=TeX}
+\DeclareDocumentCommand \defaulthangulfontfeatures { t+ o m } % o is ignored
+ {
+ \IfBooleanTF {#1}
+ {
+ \tl_set_eq:NN \l_xtxko_font_opts_tl \l_xtxko_hangul_font_opts_init_tl
+ }
+ {
+ \tl_set_eq:NN \l_xtxko_font_opts_tl \l_xtxko_font_opts_init_tl
+ }
+ \keys_set_known:nxN { xtxko-font } {#3} \l_xtxko_rem_tl % rem_tl ignored
+ \tl_set_eq:NN \l_xtxko_hangul_font_opts_init_tl \l_xtxko_font_opts_tl
+ }
+\DeclareDocumentCommand \defaulthanjafontfeatures { t+ o m } % o is ignored
+ {
+ \IfBooleanTF {#1}
+ {
+ \tl_set_eq:NN \l_xtxko_font_opts_tl \l_xtxko_hanja_font_opts_init_tl
+ }
+ {
+ \tl_set_eq:NN \l_xtxko_font_opts_tl \l_xtxko_font_opts_init_tl
+ }
+ \keys_set_known:nxN { xtxko-font } {#3} \l_xtxko_rem_tl % rem_tl ignored
+ \tl_set_eq:NN \l_xtxko_hanja_font_opts_init_tl \l_xtxko_font_opts_tl
+ }
+%% math hangul font
+\DeclareDocumentCommand \setmathhangulfont { O{} m O{} }
+ {
+ \fontspec_set_family:Nnn \xetexko@math@hangul@family {#1,#3} {#2}
+ }
+%%%%%%%%%%%%%%%%%%%%
+%% xetexkofontregime
+\keys_define:nn { xtxko-char }
+ {
+ alphs .code:n = \use:c { #1alphs } ,
+ nums .code:n = \use:c { #1nums } ,
+ parens .code:n = \use:c { #1parens } ,
+ quotes .code:n = \use:c { #1quotes } ,
+ puncts .code:n = \use:c { #1puncts } ,
+ colons .code:n = \use:c { #1colons } ,
+ hyphens .code:n = \use:c { #1hyphens } ,
+ cjksymbols .code:n = \use:c { #1cjksymbols } ,
+ }
+\DeclareDocumentCommand \xetexkofontregime { O{} m O{} }
+ {
+ \use:c { #2marks }
+ \keys_set:nn { xtxko-char } { #1,#3 }
+ }
+%% fontspec 2018
+\RenewDocumentCommand \setmainfont { O{} m O{} }
+ {
+ \__fontspec_main_setmainfont:nn {#1,#3} {#2}
+ \protected\edef\rmfamily{\unexpanded\expandafter{\rmfamily\XK@rm@korean@font}}
+ \ignorespaces
+ }
+\RenewDocumentCommand \setsansfont { O{} m O{} }
+ {
+ \__fontspec_main_setsansfont:nn {#1,#3} {#2}
+ \protected\edef\sffamily{\unexpanded\expandafter{\sffamily\XK@sf@korean@font}}
+ \ignorespaces
+ }
+\RenewDocumentCommand \setmonofont { O{} m O{} }
+ {
+ \__fontspec_main_setmonofont:nn {#1,#3} {#2}
+ \protected\edef\ttfamily{\unexpanded\expandafter{\ttfamily\XK@tt@korean@font
+ \disablehangulspacing}}
+ \ignorespaces
+ }
+\cs_set_eq:NN \setromanfont \setmainfont
+\ExplSyntaxOff
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+% font switching for latex
+\def\XKstoreprevfont{%
+ \ifx\f@family\XKcjkprevfont\let\f@family\XKltnprevfont\fi
+}
+\def\XK@storeltnfont{%
+ \ifx\f@family\XKcjkprevfont\else\let\XKltnprevfont\f@family\fi
+}
+\def\XK@storecjkfont{%
+ \let\XKcjkprevfont\f@family
+ \edef\XKplaincjkprevfont{\the\font}%
+}
+\edef\XKlatinfont{\unexpanded\expandafter{\XKstoreprevfont
+ \chardef\XKcurrentfont\z@
+ \edef\XK@plain@curr@font{\the\font}%
+ \ifx\XK@plain@curr@font\XKplaincjkprevfont
+ \selectfont
+ \fi
+}}
+
+\def\XK@rm@korean@font{%
+ \ifx\XKhangulfont\relax\else
+ \def\XKhangulfont{%
+ \XK@storeltnfont
+ \chardef\XKcurrentfont\@ne\kormainfont
+ \XK@storecjkfont
+ }%
+ \fi
+ \ifx\XKhanjafont\relax\else
+ \def\XKhanjafont {%
+ \XK@storeltnfont
+ \chardef\XKcurrentfont\tw@\hnjmainfont
+ \XK@storecjkfont
+ }%
+ \fi
+}
+\def\XK@sf@korean@font{%
+ \ifx\XKhangulfont\relax\else
+ \def\XKhangulfont{%
+ \XK@storeltnfont
+ \chardef\XKcurrentfont\@ne\korsansfont
+ \XK@storecjkfont
+ }%
+ \fi
+ \ifx\XKhanjafont\relax\else
+ \def\XKhanjafont {%
+ \XK@storeltnfont
+ \chardef\XKcurrentfont\tw@\hnjsansfont
+ \XK@storecjkfont
+ }%
+ \fi
+}
+\def\XK@tt@korean@font{%
+ \ifx\XKhangulfont\relax\else
+ \def\XKhangulfont{%
+ \XK@storeltnfont
+ \chardef\XKcurrentfont\@ne\kormonofont
+ \XK@storecjkfont
+ }%
+ \fi
+ \ifx\XKhanjafont\relax\else
+ \def\XKhanjafont {%
+ \XK@storeltnfont
+ \chardef\XKcurrentfont\tw@\hnjmonofont
+ \XK@storecjkfont
+ }%
+ \fi
+}
+
+\protected\edef\rmfamily{\unexpanded\expandafter{\rmfamily\XK@rm@korean@font}}
+\protected\edef\sffamily{\unexpanded\expandafter{\sffamily\XK@sf@korean@font}}
+\protected\edef\ttfamily{\unexpanded\expandafter{\ttfamily
+ \XK@tt@korean@font\disablehangulspacing
+}}
+\edef\verbatim@font{\unexpanded\expandafter{\verbatim@font
+ \disablehangulspacingandlinebreak
+ \let\XKstoreprevfont\XKlatinfont
+}}
+
+% for default font loading
+\def\XKiffontisaccessible#1#2#3{%
+ \begingroup
+ \suppressfontnotfounderror\@ne
+ \font\x="#1" at 10pt
+ \expandafter
+ \endgroup
+ \ifx\x\nullfont #3\else #2\fi
+}
+\def\XKiffonthasunichar#1#2#3#4{%
+ \begingroup #1\expandafter\endgroup
+ \iffontchar\font"#2\relax #3\else #4\fi
+}
+
+\AtBeginDocument{%
+ %%%%%%%%%%%%%%%%%%%%%%%%%%
+ % default main hangul: nanummyeongjo, batang if absent
+ \ifdefined\kormainfont\else
+ \XKiffonthasunichar{\fontfamily\rmdefault\selectfont}{AC00}
+ {\let\kormainfont\relax}
+ {\XKiffontisaccessible{NanumMyeongjoExtraBold}
+ {\setmainhangulfont{NanumMyeongjo}[Renderer=OpenType,BoldFont=*ExtraBold]}
+ {\XKiffontisaccessible{NanumMyeongjo}
+ {\setmainhangulfont{NanumMyeongjo}[Renderer=OpenType]}
+ {\XKiffontisaccessible{Batang}
+ {\setmainhangulfont{Batang}[AutoFakeBold]}
+ {\let\kormainfont\relax}%
+ }%
+ }%
+ }%
+ \fi
+ % default main hanja: nanumgothic, batang if absent
+ \ifdefined\hnjmainfont\else
+ \XKiffonthasunichar{\kormainfont}{4E00}
+ {\let\hnjmainfont\kormainfont}
+ {\XKiffontisaccessible{NanumGothic}
+ {\setmainhanjafont{NanumGothic}[Renderer=OpenType]}
+ {\XKiffontisaccessible{Batang}
+ {\setmainhanjafont{Batang}[AutoFakeBold]}
+ {\let\hnjmainfont\kormainfont}%
+ }%
+ }%
+ \fi
+ % default sans hangul: nanumgothic, dotum if absent
+ \ifdefined\korsansfont\else
+ \XKiffonthasunichar{\fontfamily\sfdefault\selectfont}{AC00}
+ {\let\korsansfont\relax}
+ {\XKiffontisaccessible{NanumGothic}
+ {\setsanshangulfont{NanumGothic}[Renderer=OpenType]}
+ {\XKiffontisaccessible{Dotum}
+ {\setsanshangulfont{Dotum}[AutoFakeBold]}
+ {\let\korsansfont\relax}%
+ }%
+ }%
+ \fi
+ % default sans hanja: nanumgothic, dotum if absent
+ \ifdefined\hnjsansfont\else
+ \XKiffonthasunichar{\korsansfont}{4E00}
+ {\let\hnjsansfont\korsansfont}
+ {\XKiffontisaccessible{NanumGothic}
+ {\setsanshanjafont{NanumGothic}[Renderer=OpenType]}
+ {\XKiffontisaccessible{Dotum}
+ {\setsanshanjafont{Dotum}[AutoFakeBold]}
+ {\let\hnjsansfont\korsansfont}%
+ }%
+ }%
+ \fi
+ \ifdefined\kormonofont\else \let\kormonofont\korsansfont \fi
+ \ifdefined\hnjmonofont\else \let\hnjmonofont\kormonofont \fi
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% reset hangul font and normalfont
+\expandafter\ifx\familydefault\rmdefault
+ \XK@rm@korean@font
+ \protected\edef\normalfont{\unexpanded\expandafter{\normalfont
+ \XK@rm@korean@font}}
+\else \expandafter\ifx\familydefault\sfdefault
+ \XK@sf@korean@font
+ \protected\edef\normalfont{\unexpanded\expandafter{\normalfont
+ \XK@sf@korean@font}}
+\else
+ \XK@tt@korean@font
+ \protected\edef\normalfont{\unexpanded\expandafter{\normalfont
+ \XK@tt@korean@font}}
+\fi\fi
+\let\reset@font\normalfont
+ %%%%%%%%%%%%%%%%%%%%%
+ % hangul in math mode
+ \begingroup
+ \ifx\xetexko@math@hangul@family\undefined
+ \edef\@tempb{\sfdefault}\edef\@tempc{\ttdefault}%
+ \ifx\f@family\@tempb \korsansfont \else
+ \ifx\f@family\@tempc \kormonofont \else
+ \kormainfont \fi\fi
+ \xdef\xetexko@math@hangul@family{\f@family}\fi
+ \endgroup
+ \DeclareSymbolFont{mathhangul}\f@encoding\xetexko@math@hangul@family
+ \mddefault\updefault
+ \ifcsname \f@encoding/\xetexko@math@hangul@family/\bfdefault/\updefault\endcsname
+ \SetSymbolFont{mathhangul}{bold}\f@encoding\xetexko@math@hangul@family
+ \bfdefault\updefault
+ \fi
+ \setmathhangulblock{AC00}{D7A3}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%
+% under [hangul] option
+\if@hangul
+ \linespread{1.3888}
+ \footnotesep=1.3888\footnotesep
+ \skip\footins=\glueexpr\skip\footins/72*100\relax
+ % frenchspacing is default
+ \frenchspacing
+\fi
+
+\endinput
diff --git a/macros/xetex/generic/xetexko/xetexko-hanging.sty b/macros/xetex/generic/xetexko/xetexko-hanging.sty
new file mode 100644
index 0000000000..f413a14a86
--- /dev/null
+++ b/macros/xetex/generic/xetexko/xetexko-hanging.sty
@@ -0,0 +1,133 @@
+% xetexko-hanging.sty
+%
+% Copyright (c) 2013-2018 Dohyun Kim <nomos at ktug org>
+%
+% This work 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
+% version 2006/05/20 or later.
+
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ProvidesPackage\endcsname\relax\else
+ \ProvidesPackage{xetexko-hanging}
+ [2018/04/06 v2.18 Hanging punctuations for XeTeX-ko]
+\fi
+
+\chardef\catcodeofATcharacter\catcode`@
+\catcode`\@ = 11
+
+\let\XK@orig@periodboxstop \XKperiodboxstop
+\let\XK@orig@commaboxstop \XKcommaboxstop
+\let\XK@orig@closingquotestop \XKclosingquotestop
+\let\XK@orig@openingquotestart\XKopeningquotestart
+\let\XK@orig@postcjkfullstop \postcjkfullstop
+\let\XK@orig@postcjkcloseparen\postcjkcloseparen
+\let\XK@orig@precjkopenparen@ \precjkopenparen@
+
+\def\disablehangingpunctuation{%
+ \let\XKperiodboxstop \XK@orig@periodboxstop
+ \let\XKcommaboxstop \XK@orig@commaboxstop
+ \let\XKclosingquotestop \XK@orig@closingquotestop
+ \let\XKopeningquotestart\XK@orig@openingquotestart
+ \let\postcjkfullstop \XK@orig@postcjkfullstop
+ \let\postcjkcloseparen \XK@orig@postcjkcloseparen
+ \let\precjkopenparen@ \XK@orig@precjkopenparen@
+}
+\let\disablehangingpunctuations\disablehangingpunctuation
+
+\ifdefined\strip@pt\else
+ \begingroup
+ \catcode`P=12
+ \catcode`T=12
+ \lowercase{\def\x{\def\rem@pt##1.##2PT{##1\ifnum##2>\z@.##2\fi}}}
+ \expandafter\endgroup\x
+ \def\strip@pt{\expandafter\rem@pt\the}
+\fi
+
+\ifcsname AtBeginDocument\endcsname\else \def\AtBeginDocument#1{#1} \fi
+
+\AtBeginDocument{
+ \begingroup
+ \setbox\z@\hbox{가.}\setbox\tw@\hbox{가}%
+ \xdef\temp@a
+ {\strip@pt\dimexpr(\wd\z@-\wd\tw@)*65536/\number\dimexpr 1em\relax\relax}%
+ \setbox\z@\hbox{가'}%
+ \xdef\temp@b
+ {\strip@pt\dimexpr(\wd\z@-\wd\tw@)*65536/\number\dimexpr 1em\relax\relax}%
+ \endgroup
+ \edef\xetexko@periodwidth{\temp@a em}%
+ \edef\xetexko@quotewidth {\temp@b em}%
+ \def\XKperiodboxstop{%
+ \XK@orig@periodboxstop
+ %\ifnum\XKcurrentfont>\z@
+ \count@\spacefactor
+ \XKH@post@hang\xetexko@periodwidth
+ \spacefactor\count@
+ %\fi
+ }%
+ \def\XKcommaboxstop{%
+ \XK@orig@commaboxstop
+ %\ifnum\XKcurrentfont>\z@
+ \count@\spacefactor
+ \XKH@post@hang\xetexko@periodwidth
+ \spacefactor\count@
+ %\fi
+ }%
+ \def\XKclosingquotestop{%
+ \XK@orig@closingquotestop \XKH@post@hang\xetexko@quotewidth
+ }%
+ \def\XKopeningquotestart{%
+ \XKH@pre@hang\xetexko@quotewidth \XK@orig@openingquotestart
+ }%
+ \def\precjkopenparen@{%
+ \@josa@char@to@number\@let@token\count@
+ \XK@side@bearing\count@\@ne
+ \ifx^^^^201c\@let@token
+ \dimen@ii\dimen@ \advance\dimen@ii-.125em
+ \XKH@pre@hang\dimen@ii
+ \else\ifx^^^^2018\@let@token \XKH@pre@hang\dimen@
+ \fi\fi
+ \leavevmode
+ \ifx\empty\xetexkocharraise\else\raise\xetexkocharraise\fi
+ \hbox
+ \ifx\XKdisablecjksymbolspacing\empty
+ \bgroup
+ \else
+ to\dimen@\bgroup\hss
+ \fi
+ \XeTeXinterchartoks\XKboundary\XKcjkopening = {\empty}%
+ }%
+ \def\postcjkcloseparen{%
+ \XK@orig@postcjkcloseparen
+ \ifx^^^^3001\@let@token \XKH@post@hang\dimen@
+ \else\ifx^^^^ff0c\@let@token \XKH@post@hang\dimen@
+ \else\ifx^^^^201d\@let@token
+ \dimen@ii\dimen@ \advance\dimen@ii-.125em
+ \XKH@post@hang\dimen@ii
+ \else\ifx^^^^2019\@let@token \XKH@post@hang\dimen@
+ \fi\fi\fi\fi
+ }%
+ \def\postcjkfullstop{%
+ \XK@orig@postcjkfullstop \XKH@post@hang\dimen@
+ }%
+}
+\def\XKH@post@hang#1{%
+ \nobreak\hskip\z@\relax
+ \vrule width-#1 height\z@ depth\z@
+ \kern#1\relax
+}
+\def\XKH@pre@hang#1{%
+ \kern#1\relax
+ \vrule width-#1 height\z@ depth\z@
+ \nobreak\hskip\z@\relax
+}
+
+\let\hangingpunctuation\relax
+\let\hangingpunctuations\relax
+
+\catcode`\@\catcodeofATcharacter
+
+\endinput
diff --git a/macros/xetex/generic/xetexko/xetexko-josa.sty b/macros/xetex/generic/xetexko/xetexko-josa.sty
new file mode 100644
index 0000000000..9178213f4a
--- /dev/null
+++ b/macros/xetex/generic/xetexko/xetexko-josa.sty
@@ -0,0 +1,223 @@
+% xetexko-josa.sty
+%
+% Copyright (c) 2013-2018 Dohyun Kim <nomos at ktug org>
+%
+% This work 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
+% version 2006/05/20 or later.
+
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ProvidesPackage\endcsname\relax\else
+ \ProvidesPackage{xetexko-josa}[2018/04/06 v2.18 Auto-josa for XeTeX-ko]
+\fi
+
+\unless\ifcsname @tempcnta\endcsname
+ \alloc@0\count\countdef\insc@unt\@tempcnta\fi
+\unless\ifcsname @tempcntb\endcsname
+ \alloc@0\count\countdef\insc@unt\@tempcntb\fi
+
+%%% user commands
+\protected\def\jong {\global\let\XK@last@char=0}
+\protected\def\rieul{\global\let\XK@last@char=1}
+\protected\def\jung {\global\let\XK@last@char=2}
+
+
+\newcount\@josa
+\def\@jong {\global\@josa\z@ }
+\def\@rieul{\global\@josa\@ne}
+\def\@jung {\global\@josa\tw@}
+\@jung
+
+\begingroup
+\catcode`\A=11
+\catcode`\0=12
+\global\let\dhucs@cat@eleven=A
+\global\let\dhucs@cat@twelve=0
+\endgroup
+
+\expandafter\def\expandafter\strip@characternum@meaning@prefix\detokenize
+ {the character} #1#2\end{\number`#1\relax}
+\expandafter\def\expandafter\strip@letternum@meaning@prefix\detokenize
+ {the letter} #1#2\end{\number`#1\relax}
+
+\def\@josa@char@to@number#1#2{%
+ \ifcat#1\dhucs@cat@eleven
+ \expandafter\expandafter\expandafter#2\expandafter
+ \strip@letternum@meaning@prefix\meaning#1\end
+ \else\ifcat#1\dhucs@cat@twelve
+ \expandafter\expandafter\expandafter#2\expandafter
+ \strip@characternum@meaning@prefix\meaning#1\end
+ \else
+ #2\z@
+ \fi\fi
+}
+
+\def\josa@char@to@number{%
+ \XeTeXinterchartokenstate\z@
+ \@josa@char@to@number\XK@last@char\count@
+ \@josa@char@to@number\XK@lastlast@char\@tempcnta
+ \@josa@char@to@number\XK@lastlastlast@char\@tempcntb
+ \ifnum\count@="302E
+ \count@\@tempcnta \@tempcnta\@tempcntb
+ \else\ifnum\count@="302F
+ \count@\@tempcnta \@tempcnta\@tempcntb
+ \else\ifnum\count@="1160
+ \count@\@tempcnta \@tempcnta\@tempcntb
+ \fi\fi\fi
+ \XeTeXinterchartokenstate\@ne
+}
+
+\def\josa@last@char@latin{%
+ \ifnum 49=\count@ \@rieul\else % 1
+ \ifnum 51=\count@ \@jong \else % 3
+ \ifnum 54=\count@ \@jong \else % 6
+ \ifnum 55=\count@ \@rieul\else % 7
+ \ifnum 56=\count@ \@rieul\else % 8
+ \ifnum 48=\count@ \@jong \else % 0
+ \ifnum 108=\count@ \@rieul\else % l
+ \ifnum 109=\count@ \@jong \else % m
+ \ifnum 110=\count@ \@jong \else % n
+ \ifnum 76=\count@ \@rieul\else % L
+ \ifnum 77=\count@ \@jong \else % M
+ \ifnum 78=\count@ \@jong \else % N
+ \@jung
+ \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi
+ \ifnum 110=\@tempcnta \ifnum 103=\count@ \@jong \fi\fi %skati-ng
+ \ifnum 97=\@tempcnta \ifnum 112=\count@ \@jong \fi\fi %c-ap
+ \ifnum 117=\@tempcnta \ifnum 112=\count@ \@jong \fi\fi %c-up
+ \ifnum 97=\@tempcnta \ifnum 116=\count@ \@jong \fi\fi %c-at
+ \ifnum 101=\@tempcnta \ifnum 116=\count@ \@jong \fi\fi %Haml-et
+ \ifnum 105=\@tempcnta \ifnum 116=\count@ \@jong \fi\fi %summ-it
+ \ifnum 111=\@tempcnta \ifnum 116=\count@ \@jong \fi\fi %n-ot
+ \ifnum 117=\@tempcnta \ifnum 116=\count@ \@jong \fi\fi %n-ut
+ \ifnum 111=\@tempcnta \ifnum 107=\count@ \@jong \fi\fi %bo-ok
+ \ifnum 105=\@tempcnta \ifnum 99=\count@ \@jong \fi\fi %picn-ic
+ \ifnum 108=\@tempcnta \ifnum 101=\count@ \@rieul\fi\fi %app-le
+ \ifnum 105=\@tempcntb \ifnum 109=\@tempcnta \ifnum 101=\count@ \@jong\fi\fi\fi %t-ime
+ \ifnum 105=\@tempcntb \ifnum 110=\@tempcnta \ifnum 101=\count@ \@jong\fi\fi\fi %m-ine
+ \ifnum 97=\@tempcntb \ifnum 99=\@tempcnta \ifnum 107=\count@ \@jong\fi\fi\fi %b-ack
+ \ifnum 105=\@tempcntb \ifnum 99=\@tempcnta \ifnum 107=\count@ \@jong\fi\fi\fi %p-ick
+ \ifnum 111=\@tempcntb \ifnum 97=\@tempcnta \ifnum 116=\count@ \@jung\fi\fi\fi %b-oat
+ \ifnum 84=\@tempcntb \ifnum 69=\@tempcnta \ifnum 88=\count@ \@jong\fi\fi\fi %TEX
+}
+
+\def\josa@hanja@hangul#1{%
+ \begingroup
+ \count@=\z@
+ \openin1=#1\relax \josa@hanja \closein1
+ \endgroup
+}
+\def\josa@hanja{%
+ \read1 to \@tempa
+ \ifnum\count@=\@josa
+ \global\@josa\@tempa \let\next\relax
+ \else
+ \advance\count@\@ne \let\next\josa@hanja
+ \fi
+ \next
+}
+
+\def\num@josa#1{%
+ \bgroup
+ \count@#1%
+ \ifnum\count@<\z@ \count@-\count@ \fi
+ \count\tw@\count@
+ \divide\count\tw@ 10
+ \multiply\count\tw@ 10
+ \advance\count@-\count\tw@
+ \ifcase\count@\@jong\or\@rieul\or\@jung\or\@jong\or\@jung\or
+ \@jung\or\@jong\or\@rieul\or\@rieul\or\@jung\fi
+ \egroup
+}
+
+\def\josa@last@char@cjk{%
+ \ifnum\@josa>19967 \ifnum\@josa<40870 % cjk unified ideographs
+ \advance\@josa-19968 % "4E00
+ \josa@hanja@hangul{hanja_hangul.tab}\fi\fi
+ \ifnum\@josa>13311 \ifnum\@josa<19894 % cjk unified ideographs ext. A
+ \advance\@josa-13312 % "3400
+ \josa@hanja@hangul{hanjaexa_hangul.tab}\fi\fi
+ \ifnum\@josa>63743 \ifnum\@josa<64046 % cjk compatibility ideographs
+ \advance\@josa-63744 % "F900
+ \josa@hanja@hangul{hanjacom_hangul.tab}\fi\fi
+ \ifnum\@josa>44031 \ifnum\@josa<55204 % hangul syllables
+ \advance\@josa-44032 % "AC00
+ \count@=\@josa \divide\count@28 \multiply\count@28
+ \advance\@josa-\count@ \advance\@josa4519 % "11A7
+ \fi\fi
+ \ifnum\@josa>"115F \ifnum\@josa<"11A8 % jamo vowels
+ \ifnum\@josa="1160 \ifnum\@tempcnta="1105 \@rieul \else \@jong \fi % ㄹ or other chosong
+ \else \@jung \fi\fi\fi
+ \ifnum\@josa>"11A7 \ifnum\@josa<"1200 % jamo final consonants
+ \ifnum\@josa="11AF \@rieul \else \@jong \fi\fi\fi
+ \ifnum\@josa>"D7AF \ifnum\@josa<"D7C7 \@jung \fi\fi % jamo vowels
+ \ifnum\@josa>"D7CA \ifnum\@josa<"D7FC \@jong \fi\fi % jamo final consonants
+ \ifnum\@josa>12592 \ifnum\@josa<12623 % ㄱㄴㄷㄹ
+ \ifnum\@josa=12601 \@rieul
+ \else\@jong\fi \fi\fi
+ \ifnum\@josa>12895 \ifnum\@josa<12924 \advance\@josa-96 \fi\fi
+ \ifnum\@josa>12799 \ifnum\@josa<12814 % ㉠ or ㈀
+ \ifnum\@josa=12803 \@rieul
+ \else\@jong\fi \fi\fi
+ \ifnum\@josa>12813 \ifnum\@josa<12829 % ㉮ or ㈎
+ \@jung \fi\fi
+ \ifnum\@josa>9311 \ifnum\@josa<9372 % ① or ⑴
+ \advance\@josa\m@ne \num@josa{\@josa}\fi\fi
+ \ifnum\@josa>9423 \ifnum\@josa<9450 \advance\@josa-26 \fi\fi
+ \ifnum\@josa>9397 \ifnum\@josa<9424 \advance\@josa-26 \fi\fi
+ \ifnum\@josa>9371 \ifnum\@josa<9398 % ⓐ or ⒜
+ \ifnum\@josa=9383 \@rieul\else % l
+ \ifnum\@josa=9384 \@jong\else % m
+ \ifnum\@josa=9385 \@jong\else % n
+ \@jung\fi\fi\fi \fi\fi
+ \ifnum\@josa>8543 \ifnum\@josa<8556 % ⅰ ⅱ ⅲ
+ \advance\@josa-3 \num@josa{\@josa}\fi\fi
+ \ifnum\@josa>8559 \ifnum\@josa<8572 % Ⅰ Ⅱ Ⅲ
+ \advance\@josa\@ne \num@josa{\@josa}\fi\fi
+}
+
+\protected\def\makejosa#1#2{%
+ \josa@char@to@number
+ \ifnum\count@<\@cclvi
+ \ifnum\lastskip>\z@\else\XKcjklatinsmallbreak\fi % probably last char is latin ㅠㅠ
+ \josa@last@char@latin
+ \else
+ \@josa\count@
+ \josa@last@char@cjk
+ \fi
+ \ifcase\@josa #2% jong
+ \or \ifx\@empty#1\@empty \else#2\fi% rieul
+ \else #1% jung
+ \fi
+}
+
+\def\가{\makejosa{가}{이}}
+\def\이{\futurelet\dhucs@next\makejosa@I}
+\def\은{\makejosa{는}{은}}
+\def\는{\makejosa{는}{은}}
+\def\을{\makejosa{를}{을}}
+\def\를{\makejosa{를}{을}}
+\def\와{\makejosa{와}{과}}
+\def\과{\makejosa{와}{과}}
+\def\으{\makejosa{}{으}}
+\def\로{\makejosa{}{으}로}
+\def\라{\makejosa{라}{이라}}
+\def\makejosa@I{%
+ \ifcat\dhucs@next\dhucs@cat@twelve
+ \expandafter\expandafter\expandafter\count@\expandafter
+ \strip@characternum@meaning@prefix\meaning\dhucs@next\end
+ \ifnum 0\ifnum\count@>"ABFF \ifnum\count@<"D7A4 1\fi\fi>\z@
+ \makejosa\relax{이}%
+ \else
+ \makejosa{가}{이}%
+ \fi
+ \else
+ \makejosa{가}{이}%
+ \fi
+}
+
+\endinput
diff --git a/macros/xetex/generic/xetexko/xetexko-space.sty b/macros/xetex/generic/xetexko/xetexko-space.sty
new file mode 100644
index 0000000000..525878f4c1
--- /dev/null
+++ b/macros/xetex/generic/xetexko/xetexko-space.sty
@@ -0,0 +1,1650 @@
+% xetexko-space.sty
+%
+% Copyright (c) 2013-2018 Dohyun Kim <nomos at ktug org>
+%
+% This work 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
+% version 2006/05/20 or later.
+
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ProvidesPackage\endcsname\relax\else
+ \ProvidesPackage{xetexko-space}
+ [2018/04/19 v2.19 Spacings and fonts for XeTeX-ko]
+\fi
+
+%%% we need XeTeX > 0.997
+\ifx\XeTeXinterchartoks\XeTeXcharclass
+ \errmessage{This package requires XeTeX 0.997 or higher.}
+ \expandafter\endinput
+\fi
+\ifcsname newXeTeXintercharclass\endcsname\else
+ \errmessage{This package requires TeXLive 2009 or higher.}
+ \expandafter\endinput
+\fi
+
+\unless\ifcsname @sptoken\endcsname
+ {\def\:{\global\let\@sptoken= } \: }% space token
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%
+% assign char classes
+
+\def\XK@assign@char@class#1#2#3{%
+ \count@=#1\relax
+ \loop
+ \ifx #3\XKhangulsyllable
+ \catcode\count@ = 12 % revert recent change of unicode-letters.tex
+ \fi
+ \XeTeXcharclass\count@ = #3\relax
+ \ifnum\count@<#2\relax \advance\count@\@ne
+ \repeat
+}
+
+% xetex 0.99994 extended char class limit.
+\ifdim\the\XeTeXversion\XeTeXrevision pt<0.99994pt
+ \let\XeTeXcharclassIgnore\@cclvi
+ \let\XKboundary\@cclv
+\else
+ \chardef\XeTeXcharclassIgnore=4096
+ \chardef\XKboundary=4095
+\fi
+% from JW
+\ifdefined\XeTeXcharclassID\else
+ \ifdefined\xtxHanGlue
+ \let\XeTeXcharclassID\@ne
+ \let\XeTeXcharclassOP\tw@
+ \let\XeTeXcharclassCL\thr@@
+ \else
+ \newXeTeXintercharclass\XeTeXcharclassID
+ \newXeTeXintercharclass\XeTeXcharclassOP
+ \newXeTeXintercharclass\XeTeXcharclassCL
+ \global\let\XeTeXcharclassCJ\XeTeXcharclassID
+ \global\let\XeTeXcharclassEX\XeTeXcharclassCL
+ \global\let\XeTeXcharclassIS\XeTeXcharclassCL
+ \global\let\XeTeXcharclassNS\XeTeXcharclassCL
+ \global\let\XeTeXcharclassCM\XeTeXcharclassIgnore
+ \input load-unicode-xetex-classes %
+ \fi
+\fi
+
+\let \XKhanja \XeTeXcharclassID
+\let \XKcjkopening \XeTeXcharclassOP
+\let \XKcjkclosing \XeTeXcharclassCL
+\let \XKlatinchar \z@
+
+\XeTeXcharclass "2018 = \XKcjkopening % ‘
+\XeTeXcharclass "201C = \XKcjkopening % “
+
+\XeTeXcharclass "2019 = \XKcjkclosing % ’
+\XeTeXcharclass "201D = \XKcjkclosing % ”
+
+\XeTeXcharclass "25A1 = \XKhanja % □
+
+%%% small kana (something has changed)
+\newXeTeXintercharclass \XKsmallkana
+\XeTeXcharclass "3041 = \XKsmallkana
+\XeTeXcharclass "3043 = \XKsmallkana
+\XeTeXcharclass "3045 = \XKsmallkana
+\XeTeXcharclass "3047 = \XKsmallkana
+\XeTeXcharclass "3049 = \XKsmallkana
+\XeTeXcharclass "3063 = \XKsmallkana
+\XeTeXcharclass "3083 = \XKsmallkana
+\XeTeXcharclass "3085 = \XKsmallkana
+\XeTeXcharclass "3087 = \XKsmallkana
+\XeTeXcharclass "308E = \XKsmallkana
+\XeTeXcharclass "3095 = \XKsmallkana
+\XeTeXcharclass "3096 = \XKsmallkana
+\XeTeXcharclass "30A1 = \XKsmallkana
+\XeTeXcharclass "30A3 = \XKsmallkana
+\XeTeXcharclass "30A5 = \XKsmallkana
+\XeTeXcharclass "30A7 = \XKsmallkana
+\XeTeXcharclass "30A9 = \XKsmallkana
+\XeTeXcharclass "30C3 = \XKsmallkana
+\XeTeXcharclass "30E3 = \XKsmallkana
+\XeTeXcharclass "30E5 = \XKsmallkana
+\XeTeXcharclass "30E7 = \XKsmallkana
+\XeTeXcharclass "30EE = \XKsmallkana
+\XeTeXcharclass "30F5 = \XKsmallkana
+\XeTeXcharclass "30F6 = \XKsmallkana
+\XeTeXcharclass "30FC = \XKsmallkana
+\XK@assign@char@class{"31F0}{"31FF}\XKsmallkana
+\XK@assign@char@class{"FF67}{"FF70}\XKsmallkana
+
+%%% cjk colons
+\newXeTeXintercharclass \XKcjkcolon
+\XeTeXcharclass "00B7 = \XKcjkcolon % ·
+\XeTeXcharclass "30FB = \XKcjkcolon % ・
+\XeTeXcharclass "FF1A = \XKcjkcolon % :
+\XeTeXcharclass "FE13 = \XKcjkcolon % ︓
+\XeTeXcharclass "FF1B = \XKcjkcolon % ;
+\XeTeXcharclass "FE14 = \XKcjkcolon % ︔
+
+%%% cjk fullstops
+\newXeTeXintercharclass \XKcjkfullstop
+\XeTeXcharclass "3002 = \XKcjkfullstop % 。
+\XeTeXcharclass "FE12 = \XKcjkfullstop % ︒
+\XeTeXcharclass "FF0E = \XKcjkfullstop % .
+
+%%% cjk liaisons
+\newXeTeXintercharclass \XKcjkliaison
+\XeTeXcharclass "2015 = \XKcjkliaison % ―
+\XeTeXcharclass "2026 = \XKcjkliaison % …
+\XeTeXcharclass "FE19 = \XKcjkliaison % ︙
+\XeTeXcharclass "2025 = \XKcjkliaison % ‥
+\XeTeXcharclass "FE30 = \XKcjkliaison % ︰
+
+%%% cjk question/exclamation marks
+\newXeTeXintercharclass \XKcjkextrastop
+\XeTeXcharclass "FF1F = \XKcjkextrastop % ?
+\XeTeXcharclass "FF01 = \XKcjkextrastop % !
+
+%%% other cjk symbols
+\newXeTeXintercharclass \XKcjksymbol
+%% still missing:
+%% 00AD ­
+%% 0138 ĸ
+%% 0149 ʼn
+%% 0166 Ŧ
+%% 0167 ŧ
+%% 0370.. greek letters
+%% 0400.. cyrillic letters
+\XeTeXcharclass "00B2 = \XKcjksymbol % ²
+\XeTeXcharclass "00B3 = \XKcjksymbol % ³
+\XeTeXcharclass "00B9 = \XKcjksymbol % ¹
+\XeTeXcharclass "00BC = \XKcjksymbol % ¼
+\XeTeXcharclass "00BD = \XKcjksymbol % ½
+\XeTeXcharclass "00BE = \XKcjksymbol % ¾
+\XeTeXcharclass "02D0 = \XKcjksymbol % ː
+\XeTeXcharclass "2032 = \XKcjksymbol % ′
+\XeTeXcharclass "2033 = \XKcjksymbol % ″
+\XeTeXcharclass "203B = \XKcjksymbol % ※
+\XeTeXcharclass "2074 = \XKcjksymbol % ⁴
+\XeTeXcharclass "207F = \XKcjksymbol % ⁿ
+\XeTeXcharclass "2081 = \XKcjksymbol % ₁
+\XeTeXcharclass "2082 = \XKcjksymbol % ₂
+\XeTeXcharclass "2083 = \XKcjksymbol % ₃
+\XeTeXcharclass "2084 = \XKcjksymbol % ₄
+\XeTeXcharclass "2103 = \XKcjksymbol % ℃ changed from smallkana
+\XeTeXcharclass "2109 = \XKcjksymbol % ℉ changed from smallkana
+\XeTeXcharclass "2113 = \XKcjksymbol % ℓ changed from smallkana
+\XeTeXcharclass "2121 = \XKcjksymbol % ℡
+\XeTeXcharclass "2122 = \XKcjksymbol % ™
+\XeTeXcharclass "212B = \XKcjksymbol % Å changed from smallkana
+\XeTeXcharclass "2153 = \XKcjksymbol % ⅓
+\XeTeXcharclass "2154 = \XKcjksymbol % ⅔
+\XeTeXcharclass "215B = \XKcjksymbol % ⅛
+\XeTeXcharclass "215C = \XKcjksymbol % ⅜
+\XeTeXcharclass "215D = \XKcjksymbol % ⅝
+\XeTeXcharclass "215E = \XKcjksymbol % ⅞
+\XK@assign@char@class{"2160}{"216B}\XKcjksymbol % Ⅰ .. Ⅻ
+\XK@assign@char@class{"2170}{"217B}\XKcjksymbol % ⅰ .. ⅻ
+%% math symbols (?)
+\XK@assign@char@class{"2190}{"2199}\XKcjksymbol % ← .. ↙
+\XeTeXcharclass "21D2 = \XKcjksymbol % ⇒
+\XeTeXcharclass "21D4 = \XKcjksymbol % ⇔
+\XeTeXcharclass "2200 = \XKcjksymbol % ∀
+\XeTeXcharclass "2202 = \XKcjksymbol % ∂
+\XeTeXcharclass "2203 = \XKcjksymbol % ∃
+\XeTeXcharclass "2207 = \XKcjksymbol % ∇
+\XeTeXcharclass "2208 = \XKcjksymbol % ∈
+\XeTeXcharclass "220B = \XKcjksymbol % ∋
+\XeTeXcharclass "220F = \XKcjksymbol % ∏
+\XeTeXcharclass "2211 = \XKcjksymbol % ∑
+\XeTeXcharclass "221A = \XKcjksymbol % √
+\XeTeXcharclass "221D = \XKcjksymbol % ∝
+\XeTeXcharclass "2220 = \XKcjksymbol % ∠
+\XeTeXcharclass "2225 = \XKcjksymbol % ∥
+\XeTeXcharclass "2227 = \XKcjksymbol % ∧
+\XeTeXcharclass "2228 = \XKcjksymbol % ∨
+\XeTeXcharclass "2229 = \XKcjksymbol % ∩
+\XeTeXcharclass "222A = \XKcjksymbol % ∪
+\XeTeXcharclass "222B = \XKcjksymbol % ∫
+\XeTeXcharclass "222C = \XKcjksymbol % ∬
+\XeTeXcharclass "222E = \XKcjksymbol % ∮
+\XeTeXcharclass "2234 = \XKcjksymbol % ∴
+\XeTeXcharclass "2235 = \XKcjksymbol % ∵
+\XeTeXcharclass "223C = \XKcjksymbol % ∼
+\XeTeXcharclass "223D = \XKcjksymbol % ∽
+\XeTeXcharclass "2252 = \XKcjksymbol % ≒
+\XeTeXcharclass "2260 = \XKcjksymbol % ≠
+\XeTeXcharclass "2261 = \XKcjksymbol % ≡
+\XeTeXcharclass "2264 = \XKcjksymbol % ≤
+\XeTeXcharclass "2265 = \XKcjksymbol % ≥
+\XeTeXcharclass "226A = \XKcjksymbol % ≪
+\XeTeXcharclass "226B = \XKcjksymbol % ≫
+\XeTeXcharclass "2282 = \XKcjksymbol % ⊂
+\XeTeXcharclass "2283 = \XKcjksymbol % ⊃
+\XeTeXcharclass "2286 = \XKcjksymbol % ⊆
+\XeTeXcharclass "2287 = \XKcjksymbol % ⊇
+\XeTeXcharclass "2299 = \XKcjksymbol % ⊙
+\XeTeXcharclass "22A5 = \XKcjksymbol % ⊥
+\XeTeXcharclass "2312 = \XKcjksymbol % ⌒
+\XK@assign@char@class{"2460}{"24EA}\XKcjksymbol % ① .. ⓪
+\XeTeXcharclass "2500 = \XKcjksymbol % ─
+\XeTeXcharclass "2501 = \XKcjksymbol % ━
+\XeTeXcharclass "2502 = \XKcjksymbol % │
+\XeTeXcharclass "2503 = \XKcjksymbol % ┃
+\XK@assign@char@class{"250C}{"254B}\XKcjksymbol % ─ .. ╋
+\XeTeXcharclass "2592 = \XKcjksymbol % ▒
+\XeTeXcharclass "25A0 = \XKcjksymbol % ■
+%\XeTeXcharclass "25A1 = \XKcjksymbol % □
+\XeTeXcharclass "25A3 = \XKcjksymbol % ▣
+\XeTeXcharclass "25A4 = \XKcjksymbol % ▤
+\XeTeXcharclass "25A5 = \XKcjksymbol % ▥
+\XeTeXcharclass "25A6 = \XKcjksymbol % ▦
+\XeTeXcharclass "25A7 = \XKcjksymbol % ▧
+\XeTeXcharclass "25A8 = \XKcjksymbol % ▨
+\XeTeXcharclass "25A9 = \XKcjksymbol % ▩
+\XeTeXcharclass "25B2 = \XKcjksymbol % ▲
+\XeTeXcharclass "25B3 = \XKcjksymbol % △
+\XeTeXcharclass "25B6 = \XKcjksymbol % ▶
+\XeTeXcharclass "25B7 = \XKcjksymbol % ▷
+\XeTeXcharclass "25BC = \XKcjksymbol % ▼
+\XeTeXcharclass "25BD = \XKcjksymbol % ▽
+\XeTeXcharclass "25C0 = \XKcjksymbol % ◀
+\XeTeXcharclass "25C1 = \XKcjksymbol % ◁
+\XeTeXcharclass "25C6 = \XKcjksymbol % ◆
+\XeTeXcharclass "25C7 = \XKcjksymbol % ◇
+\XeTeXcharclass "25C8 = \XKcjksymbol % ◈
+\XeTeXcharclass "25CB = \XKcjksymbol % ○
+\XeTeXcharclass "25CE = \XKcjksymbol % ◎
+\XeTeXcharclass "25CF = \XKcjksymbol % ●
+\XeTeXcharclass "25D0 = \XKcjksymbol % ◐
+\XeTeXcharclass "25D1 = \XKcjksymbol % ◑
+\XeTeXcharclass "2605 = \XKcjksymbol % ★
+\XeTeXcharclass "2606 = \XKcjksymbol % ☆
+\XeTeXcharclass "260E = \XKcjksymbol % ☎
+\XeTeXcharclass "260F = \XKcjksymbol % ☏
+\XeTeXcharclass "261C = \XKcjksymbol % ☜
+\XeTeXcharclass "261E = \XKcjksymbol % ☞
+\XeTeXcharclass "2640 = \XKcjksymbol % ♀
+\XeTeXcharclass "2642 = \XKcjksymbol % ♂
+\XeTeXcharclass "2660 = \XKcjksymbol % ♠
+\XeTeXcharclass "2661 = \XKcjksymbol % ♡
+\XeTeXcharclass "2663 = \XKcjksymbol % ♣
+\XeTeXcharclass "2664 = \XKcjksymbol % ♤
+\XeTeXcharclass "2665 = \XKcjksymbol % ♥
+\XeTeXcharclass "2667 = \XKcjksymbol % ♧
+\XeTeXcharclass "2668 = \XKcjksymbol % ♨
+\XeTeXcharclass "2669 = \XKcjksymbol % ♩
+\XeTeXcharclass "266A = \XKcjksymbol % ♪
+\XeTeXcharclass "266C = \XKcjksymbol % ♬
+\XeTeXcharclass "266D = \XKcjksymbol % ♭
+\XeTeXcharclass "3012 = \XKcjksymbol % 〒
+\XeTeXcharclass "301C = \XKcjksymbol % 〜
+\XeTeXcharclass "FF04 = \XKcjksymbol % $
+\XeTeXcharclass "FF05 = \XKcjksymbol % %
+\XeTeXcharclass "FF5E = \XKcjksymbol % ~
+\XeTeXcharclass "FFE0 = \XKcjksymbol % ¢
+\XeTeXcharclass "FFE1 = \XKcjksymbol % £
+\XeTeXcharclass "FFE5 = \XKcjksymbol % ¥
+\XeTeXcharclass "FFE6 = \XKcjksymbol % ₩
+
+%%% hangul syllables
+\newXeTeXintercharclass \XKhangulsyllable
+\XK@assign@char@class{"AC00}{"D7A3}\XKhangulsyllable
+% treat compatibility jamo as hangul syllable
+\XK@assign@char@class{"3131}{"318E}\XKhangulsyllable
+% leading consonants jamo as well
+\XK@assign@char@class{"1100}{"115F}\XKhangulsyllable
+\XK@assign@char@class{"A960}{"A97C}\XKhangulsyllable
+
+%%% jungseong/jongseong jamo including tone marks
+\newXeTeXintercharclass \XKhanguljungjong
+\XK@assign@char@class{"1160}{"11FF}\XKhanguljungjong
+\XK@assign@char@class{"D7B0}{"D7FB}\XKhanguljungjong
+\XeTeXcharclass "302E = \XKhanguljungjong
+\XeTeXcharclass "302F = \XKhanguljungjong
+
+%%% latin openings
+\newXeTeXintercharclass \XKlatinopening
+\XeTeXcharclass`\( = \XKlatinopening
+\XeTeXcharclass`\[ = \XKlatinopening
+\XeTeXcharclass`\{ = \XKlatinopening
+\XeTeXcharclass`\< = \XKlatinopening
+
+%%% latin closings
+\newXeTeXintercharclass \XKlatinclosing
+\XeTeXcharclass`\) = \XKlatinclosing
+\XeTeXcharclass`\] = \XKlatinclosing
+\XeTeXcharclass`\} = \XKlatinclosing
+\XeTeXcharclass`\> = \XKlatinclosing
+
+%%% latin quotes
+\newXeTeXintercharclass\XKopeningquote
+\XeTeXcharclass`\` = \XKopeningquote
+\newXeTeXintercharclass\XKclosingquote
+\XeTeXcharclass`\' = \XKclosingquote
+\XeTeXcharclass`\" = \XKclosingquote
+
+%%% latin full stop
+\newXeTeXintercharclass \XKlatinfullstop
+\XeTeXcharclass `\. = \XKlatinfullstop
+
+%%% latin questions/exclamations
+\newXeTeXintercharclass \XKlatinquestion
+\XeTeXcharclass `\? = \XKlatinquestion
+\newXeTeXintercharclass \XKlatinexclamation
+\XeTeXcharclass `\! = \XKlatinexclamation
+
+%%% latin hyphen including /
+\newXeTeXintercharclass \XKlatinhyphen
+\XeTeXcharclass `\- = \XKlatinhyphen % this affects -- --- ligatures
+\XeTeXcharclass `\/ = \XKlatinhyphen
+
+%%% latin comma
+\newXeTeXintercharclass \XKlatincomma
+\XeTeXcharclass `\, = \XKlatincomma
+
+%%% latin colons
+\newXeTeXintercharclass \XKlatincolon
+\XeTeXcharclass `\: = \XKlatincolon
+\XeTeXcharclass `\; = \XKlatincolon
+\XeTeXcharclass "2013 = \XKlatincolon % – ? liaison
+\XeTeXcharclass "2014 = \XKlatincolon % — ? liaison
+
+%%% latin numbers
+\newXeTeXintercharclass \XKlatinnumber
+\XK@assign@char@class{`0}{`9}\XKlatinnumber
+
+%%% variation selectors
+\newXeTeXintercharclass \XKhanjacombining
+\XK@assign@char@class{"FE00}{"FE0F}\XKhanjacombining
+\XK@assign@char@class{"E0100}{"E01EF}\XKhanjacombining
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% define inter char tokes
+%%% ? latin numbers
+\XeTeXinterchartoks \XKlatinchar \XKlatinnumber = {\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKlatinnumber \XKlatinnumber = {\XKlastchar}
+\XeTeXinterchartoks \XKlatinopening \XKlatinnumber = {\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKlatinclosing \XKlatinnumber = {\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKopeningquote \XKlatinnumber = {\XKopeningquotestop\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKclosingquote \XKlatinnumber = {\XKclosingquotestop\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKhanja \XKlatinnumber = {\XKcjkcharboxstop\XKcjklatinsmallbreak\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKhanjacombining \XKlatinnumber = {\XKcjkcharboxstop\XKcjklatinsmallbreak\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKsmallkana \XKlatinnumber = {\XKcjkcharboxstop\XKcjklatinsmallbreak\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKcjksymbol \XKlatinnumber = {\XKcjkcharboxstop\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKcjkopening \XKlatinnumber = {\postcjkopenparen\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKcjkclosing \XKlatinnumber = {\postcjkcloseparen\XKhalfsmallbreak\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKcjkcolon \XKlatinnumber = {\postcjkcolon\XKquatersmallbreak\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKcjkfullstop \XKlatinnumber = {\postcjkfullstop\XKfixedhalfskip\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKcjkliaison \XKlatinnumber = {\XKcjkcharboxstop\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKcjkextrastop \XKlatinnumber = {\XKcjkcharboxstop\XKhalfsmallbreak\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKhangulsyllable \XKlatinnumber = {\XKcjkcharboxstop\XKcjklatinsmallbreak\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKhanguljungjong \XKlatinnumber = {\XKcjkcharboxstop\XKcjklatinsmallbreak\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKlatinfullstop \XKlatinnumber = {\XKperiodboxstop\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKlatinquestion \XKlatinnumber = {\XKquestionboxstop\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKlatinexclamation \XKlatinnumber = {\XKexclamationboxstop\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKlatincomma \XKlatinnumber = {\XKcommaboxstop\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKlatincolon \XKlatinnumber = {\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKlatinhyphen \XKlatinnumber = {\XKlatinnumfont\XKlastchar}
+\XeTeXinterchartoks \XKboundary \XKlatinnumber = {\XKundoignorespaces\XKlatinnumfont\XKbeginboundary\XKlastchar}
+
+%%% ? latin alphabets
+\XeTeXinterchartoks \XKlatinchar \XKlatinchar = {\XKlastchar}
+\XeTeXinterchartoks \XKlatinnumber \XKlatinchar = {\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKlatinopening \XKlatinchar = {\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKlatinclosing \XKlatinchar = {\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKopeningquote \XKlatinchar = {\XKopeningquotestop\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKclosingquote \XKlatinchar = {\XKclosingquotestop\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKhanja \XKlatinchar = {\XKcjkcharboxstop\XKcjklatinsmallbreak\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKhanjacombining \XKlatinchar = {\XKcjkcharboxstop\XKcjklatinsmallbreak\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKsmallkana \XKlatinchar = {\XKcjkcharboxstop\XKcjklatinsmallbreak\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKcjksymbol \XKlatinchar = {\XKcjkcharboxstop\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKcjkopening \XKlatinchar = {\postcjkopenparen\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKcjkclosing \XKlatinchar = {\postcjkcloseparen\XKhalfsmallbreak\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKcjkcolon \XKlatinchar = {\postcjkcolon\XKquatersmallbreak\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKcjkfullstop \XKlatinchar = {\postcjkfullstop\XKfixedhalfskip\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKcjkliaison \XKlatinchar = {\XKcjkcharboxstop\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKcjkextrastop \XKlatinchar = {\XKcjkcharboxstop\XKhalfsmallbreak\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKhangulsyllable \XKlatinchar = {\XKcjkcharboxstop\XKcjklatinsmallbreak\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKhanguljungjong \XKlatinchar = {\XKcjkcharboxstop\XKcjklatinsmallbreak\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKlatinfullstop \XKlatinchar = {\XKperiodboxstop\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKlatinquestion \XKlatinchar = {\XKquestionboxstop\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKlatinexclamation \XKlatinchar = {\XKexclamationboxstop\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKlatincomma \XKlatinchar = {\XKcommaboxstop\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKlatincolon \XKlatinchar = {\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKlatinhyphen \XKlatinchar = {\XKmaybelatinfont\XKlastchar}
+\XeTeXinterchartoks \XKboundary \XKlatinchar = {\XKundoignorespaces\XKmaybelatinfont\XKbeginboundary\XKlastchar}
+
+%%% ? hanja
+\XeTeXinterchartoks \XKlatinchar \XKhanja = {\XKhanjafont\XKcjklatinsmallbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinnumber \XKhanja = {\XKhanjafont\XKcjklatinsmallbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinopening \XKhanja = {\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinclosing \XKhanja = {\XKhanjafont\XKcjklatinbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKopeningquote \XKhanja = {\XKopeningquotestop\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKclosingquote \XKhanja = {\XKclosingquotestop\XKhanjafont\XKcjklatinbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKhanja \XKhanja = {\XKcjkcharboxstop\XKinterhanjabreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKhanjacombining \XKhanja = {\XKcjkcharboxstop\XKinterhanjabreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKsmallkana \XKhanja = {\XKcjkcharboxstop\XKinterhanjabreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjksymbol \XKhanja = {\XKcjkcharboxstop\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjkopening \XKhanja = {\postcjkopenparen\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjkclosing \XKhanja = {\postcjkcloseparen\XKhalfsmallbreak\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjkcolon \XKhanja = {\postcjkcolon\XKquatersmallbreak\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjkfullstop \XKhanja = {\postcjkfullstop\XKfixedhalfskip\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjkliaison \XKhanja = {\XKcjkcharboxstop\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjkextrastop \XKhanja = {\XKcjkcharboxstop\XKhalfsmallbreak\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKhangulsyllable \XKhanja = {\XKcjkcharboxstop\XKhanjafont\XKinterhanjabreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKhanguljungjong \XKhanja = {\XKcjkcharboxstop\XKhanjafont\XKinterhanjabreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinfullstop \XKhanja = {\XKperiodboxstop\XKhanjafont\XKcjklatinbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinquestion \XKhanja = {\XKquestionboxstop\XKhanjafont\XKcjklatinbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinexclamation \XKhanja = {\XKexclamationboxstop\XKhanjafont\XKcjklatinbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatincomma \XKhanja = {\XKcommaboxstop\XKhanjafont\XKcjklatinbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatincolon \XKhanja = {\XKhanjafont\XKcjklatinbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinhyphen \XKhanja = {\XKhanjafont\XKzeroskip\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKboundary \XKhanja = {\XKhanjafont\XKafterboundaryskip\XKbeginboundary\XKcjkcharboxstart\XKhanjalastchar}
+
+%%% ? small kana
+\XeTeXinterchartoks \XKlatinchar \XKsmallkana = {\XKhanjafont\XKcjklatinsmallbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinnumber \XKsmallkana = {\XKhanjafont\XKcjklatinsmallbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinopening \XKsmallkana = {\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinclosing \XKsmallkana = {\XKhanjafont\XKcjklatinsmallbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKopeningquote \XKsmallkana = {\XKopeningquotestop\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKclosingquote \XKsmallkana = {\XKclosingquotestop\XKhanjafont\XKcjklatinsmallbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKhanja \XKsmallkana = {\XKcjkcharboxstop\XKnobreak\XKzeroskip\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKhanjacombining \XKsmallkana = {\XKcjkcharboxstop\XKnobreak\XKzeroskip\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKsmallkana \XKsmallkana = {\XKcjkcharboxstop\XKnobreak\XKzeroskip\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjksymbol \XKsmallkana = {\XKcjkcharboxstop\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjkopening \XKsmallkana = {\postcjkopenparen\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjkclosing \XKsmallkana = {\postcjkcloseparen\XKhalfsmallbreak\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjkcolon \XKsmallkana = {\postcjkcolon\XKquatersmallbreak\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjkfullstop \XKsmallkana = {\postcjkfullstop\XKfixedhalfskip\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjkliaison \XKsmallkana = {\XKcjkcharboxstop\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKcjkextrastop \XKsmallkana = {\XKcjkcharboxstop\XKhalfsmallbreak\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKhangulsyllable \XKsmallkana = {\XKcjkcharboxstop\XKhanjafont\XKinterhanjabreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKhanguljungjong \XKsmallkana = {\XKcjkcharboxstop\XKhanjafont\XKinterhanjabreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinfullstop \XKsmallkana = {\XKperiodboxstop\XKhanjafont\XKcjklatinbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinquestion \XKsmallkana = {\XKquestionboxstop\XKhanjafont\XKcjklatinbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinexclamation \XKsmallkana = {\XKexclamationboxstop\XKhanjafont\XKcjklatinbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatincomma \XKsmallkana = {\XKcommaboxstop\XKhanjafont\XKcjklatinbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatincolon \XKsmallkana = {\XKhanjafont\XKcjklatinbreak\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKlatinhyphen \XKsmallkana = {\XKhanjafont\XKcjkcharboxstart\XKhanjalastchar}
+\XeTeXinterchartoks \XKboundary \XKsmallkana = {\XKhanjafont\XKafterboundaryskip\XKbeginboundary\XKcjkcharboxstart\XKhanjalastchar}
+
+%%% ? cjk symbols
+\XeTeXinterchartoks \XKlatinchar \XKcjksymbol = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinnumber \XKcjksymbol = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinopening \XKcjksymbol = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinclosing \XKcjksymbol = {\XKmaybehanjafont\XKcjklatinsmallbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKopeningquote \XKcjksymbol = {\XKopeningquotestop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKclosingquote \XKcjksymbol = {\XKclosingquotestop\XKmaybehanjafont\XKcjklatinsmallbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKhanja \XKcjksymbol = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKhanjacombining \XKcjksymbol = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKsmallkana \XKcjksymbol = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+%\XeTeXinterchartoks \XKcjksymbol \XKcjksymbol = {}
+\XeTeXinterchartoks \XKcjkopening \XKcjksymbol = {\postcjkopenparen\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKcjkclosing \XKcjksymbol = {\postcjkcloseparen\XKhalfsmallbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKcjkcolon \XKcjksymbol = {\postcjkcolon\XKquatersmallbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKcjkfullstop \XKcjksymbol = {\postcjkfullstop\XKfixedhalfskip\XKcjkcharboxstart}
+%\XeTeXinterchartoks \XKcjkliaison \XKcjksymbol = {}
+\XeTeXinterchartoks \XKcjkextrastop \XKcjksymbol = {\XKcjkcharboxstop\XKhalfsmallbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKhangulsyllable \XKcjksymbol = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKhanguljungjong \XKcjksymbol = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinfullstop \XKcjksymbol = {\XKperiodboxstop\XKmaybehanjafont\XKcjklatinbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinquestion \XKcjksymbol = {\XKquestionboxstop\XKmaybehanjafont\XKcjklatinbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinexclamation \XKcjksymbol = {\XKexclamationboxstop\XKmaybehanjafont\XKcjklatinbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatincomma \XKcjksymbol = {\XKcommaboxstop\XKmaybehanjafont\XKcjklatinbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatincolon \XKcjksymbol = {\XKmaybehanjafont\XKcjklatinbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinhyphen \XKcjksymbol = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKboundary \XKcjksymbol = {\XKmaybehanjafont\XKafterboundaryskip\XKbeginboundary\XKcjkcharboxstart}
+
+%%% ? cjk openings
+\XeTeXinterchartoks \XKlatinchar \XKcjkopening = {\XKmaybehanjafont\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKlatinnumber \XKcjkopening = {\XKmaybehanjafont\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKlatinopening \XKcjkopening = {\XKmaybehanjafont\precjkopenparen}
+\XeTeXinterchartoks \XKlatinclosing \XKcjkopening = {\XKmaybehanjafont\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKopeningquote \XKcjkopening = {\XKopeningquotestop\XKmaybehanjafont\precjkopenparen}
+\XeTeXinterchartoks \XKclosingquote \XKcjkopening = {\XKclosingquotestop\XKmaybehanjafont\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKhanja \XKcjkopening = {\XKcjkcharboxstop\XKhalfsmallbreak\XKmaybehanjafont\precjkopenparen}
+\XeTeXinterchartoks \XKhanjacombining \XKcjkopening = {\XKcjkcharboxstop\XKhalfsmallbreak\XKmaybehanjafont\precjkopenparen}
+\XeTeXinterchartoks \XKsmallkana \XKcjkopening = {\XKcjkcharboxstop\XKhalfsmallbreak\XKmaybehanjafont\precjkopenparen}
+\XeTeXinterchartoks \XKcjksymbol \XKcjkopening = {\XKcjkcharboxstop\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKcjkopening \XKcjkopening = {\postcjkopenparen\precjkopenparen}
+\XeTeXinterchartoks \XKcjkclosing \XKcjkopening = {\postcjkcloseparen\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKcjkcolon \XKcjkopening = {\postcjkcolon\XKquatersmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKcjkfullstop \XKcjkopening = {\postcjkfullstop\XKfixedhalfskip\precjkopenparen}
+\XeTeXinterchartoks \XKcjkliaison \XKcjkopening = {\XKcjkcharboxstop\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKcjkextrastop \XKcjkopening = {\XKcjkcharboxstop\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKhangulsyllable \XKcjkopening = {\XKcjkcharboxstop\XKmaybehanjafont\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKhanguljungjong \XKcjkopening = {\XKcjkcharboxstop\XKmaybehanjafont\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKlatinfullstop \XKcjkopening = {\XKperiodboxstop\XKmaybehanjafont\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKlatinquestion \XKcjkopening = {\XKquestionboxstop\XKmaybehanjafont\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKlatinexclamation \XKcjkopening = {\XKexclamationboxstop\XKmaybehanjafont\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKlatincomma \XKcjkopening = {\XKcommaboxstop\XKmaybehanjafont\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKlatincolon \XKcjkopening = {\XKmaybehanjafont\XKhalfsmallbreak\precjkopenparen}
+\XeTeXinterchartoks \XKlatinhyphen \XKcjkopening = {\XKmaybehanjafont\XKzeroskip\precjkopenparen}
+\XeTeXinterchartoks \XKboundary \XKcjkopening = {\XKmaybehanjafont\XKafterboundaryskip\XKbeginboundary\precjkopenparen}
+
+%%% ? cjk closings
+\XeTeXinterchartoks \XKlatinchar \XKcjkclosing = {\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKlatinnumber \XKcjkclosing = {\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKlatinopening \XKcjkclosing = {\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKlatinclosing \XKcjkclosing = {\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKopeningquote \XKcjkclosing = {\XKopeningquotestop\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKclosingquote \XKcjkclosing = {\XKclosingquotestop\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKhanja \XKcjkclosing = {\XKcjkcharboxstop\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKhanjacombining \XKcjkclosing = {\XKcjkcharboxstop\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKsmallkana \XKcjkclosing = {\XKcjkcharboxstop\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKcjksymbol \XKcjkclosing = {\XKcjkcharboxstop\precjkcloseparen}
+\XeTeXinterchartoks \XKcjkopening \XKcjkclosing = {\postcjkopenparen\precjkcloseparen}
+\XeTeXinterchartoks \XKcjkclosing \XKcjkclosing = {\postcjkcloseparen\precjkcloseparen}
+\XeTeXinterchartoks \XKcjkcolon \XKcjkclosing = {\postcjkcolon\XKnobreak\XKquatersmallbreak\precjkcloseparen}
+\XeTeXinterchartoks \XKcjkfullstop \XKcjkclosing = {\postcjkfullstop\precjkcloseparen}
+\XeTeXinterchartoks \XKcjkliaison \XKcjkclosing = {\XKcjkcharboxstop\precjkcloseparen}
+\XeTeXinterchartoks \XKcjkextrastop \XKcjkclosing = {\XKcjkcharboxstop\precjkcloseparen}
+\XeTeXinterchartoks \XKhangulsyllable \XKcjkclosing = {\XKcjkcharboxstop\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKhanguljungjong \XKcjkclosing = {\XKcjkcharboxstop\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKlatinfullstop \XKcjkclosing = {\XKperiodboxstop\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKlatinquestion \XKcjkclosing = {\XKquestionboxstop\XKmaybehanjafont\XKnobreak\XKcjklatinbreak\precjkcloseparen}
+\XeTeXinterchartoks \XKlatinexclamation \XKcjkclosing = {\XKexclamationboxstop\XKmaybehanjafont\XKnobreak\XKcjklatinbreak\precjkcloseparen}
+\XeTeXinterchartoks \XKlatincomma \XKcjkclosing = {\XKcommaboxstop\XKmaybehanjafont\XKnobreak\XKcjklatinbreak\precjkcloseparen}
+\XeTeXinterchartoks \XKlatincolon \XKcjkclosing = {\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKlatinhyphen \XKcjkclosing = {\XKmaybehanjafont\precjkcloseparen}
+\XeTeXinterchartoks \XKboundary \XKcjkclosing = {\XKmaybehanjafont\XKbeginboundary\precjkcloseparen}
+
+%%% ? latin openings
+\XeTeXinterchartoks \XKlatinchar \XKlatinopening = {\XKwaslatinchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatinnumber \XKlatinopening = {\XKwaslatinchar\XKlatinparenfont}
+%\XeTeXinterchartoks \XKlatinopening \XKlatinopening = {}
+%\XeTeXinterchartoks \XKlatinclosing \XKlatinopening = {}
+\XeTeXinterchartoks \XKopeningquote \XKlatinopening = {\XKopeningquotestop\XKlatinparenfont}
+\XeTeXinterchartoks \XKclosingquote \XKlatinopening = {\XKclosingquotestop\XKzeroskip\XKlatinparenfont}
+\XeTeXinterchartoks \XKhanja \XKlatinopening = {\XKcjkcharboxstop\XKcjklatinbreak\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKhanjacombining \XKlatinopening = {\XKcjkcharboxstop\XKcjklatinbreak\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKsmallkana \XKlatinopening = {\XKcjkcharboxstop\XKcjklatinbreak\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjksymbol \XKlatinopening = {\XKcjkcharboxstop\XKcjklatinbreak\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjkopening \XKlatinopening = {\postcjkopenparen\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjkclosing \XKlatinopening = {\postcjkcloseparen\XKhalfsmallbreak\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjkcolon \XKlatinopening = {\postcjkcolon\XKquatersmallbreak\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjkfullstop \XKlatinopening = {\postcjkfullstop\XKfixedhalfskip\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjkliaison \XKlatinopening = {\XKcjkcharboxstop\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjkextrastop \XKlatinopening = {\XKcjkcharboxstop\XKhalfsmallbreak\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKhangulsyllable \XKlatinopening = {\XKcjkcharboxstop\XKcjklatinbreak\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKhanguljungjong \XKlatinopening = {\XKcjkcharboxstop\XKcjklatinbreak\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatinfullstop \XKlatinopening = {\XKperiodboxstop\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatinquestion \XKlatinopening = {\XKquestionboxstop\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatinexclamation \XKlatinopening = {\XKexclamationboxstop\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatincomma \XKlatinopening = {\XKcommaboxstop\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatincolon \XKlatinopening = {\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatinhyphen \XKlatinopening = {\XKlatinparenfont}
+\XeTeXinterchartoks \XKboundary \XKlatinopening = {\XKundoignorespaces\XKlatinparenfont\XKbeginboundary}
+
+%%% ? latin opening quote `
+\XeTeXinterchartoks \XKlatinchar \XKopeningquote = {\XKwaslatinchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKlatinnumber \XKopeningquote = {\XKwaslatinchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKlatinopening \XKopeningquote = {\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKlatinclosing \XKopeningquote = {\XKlatinquotefont\XKopeningquotestart}
+%\XeTeXinterchartoks \XKopeningquote \XKopeningquote = {}
+\XeTeXinterchartoks \XKclosingquote \XKopeningquote = {\XKclosingquotestop\XKopeningquotestart}
+\XeTeXinterchartoks \XKhanja \XKopeningquote = {\XKcjkcharboxstop\XKcjklatinbreak\XKwascjkchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKhanjacombining \XKopeningquote = {\XKcjkcharboxstop\XKcjklatinbreak\XKwascjkchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKsmallkana \XKopeningquote = {\XKcjkcharboxstop\XKcjklatinbreak\XKwascjkchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKcjksymbol \XKopeningquote = {\XKcjkcharboxstop\XKcjklatinbreak\XKwascjkchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKcjkopening \XKopeningquote = {\postcjkopenparen\XKwascjkchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKcjkclosing \XKopeningquote = {\postcjkcloseparen\XKhalfsmallbreak\XKwascjkchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKcjkcolon \XKopeningquote = {\postcjkcolon\XKquatersmallbreak\XKwascjkchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKcjkfullstop \XKopeningquote = {\postcjkfullstop\XKfixedhalfskip\XKwascjkchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKcjkliaison \XKopeningquote = {\XKcjkcharboxstop\XKwascjkchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKcjkextrastop \XKopeningquote = {\XKcjkcharboxstop\XKhalfsmallbreak\XKwascjkchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKhangulsyllable \XKopeningquote = {\XKcjkcharboxstop\XKcjklatinbreak\XKwascjkchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKhanguljungjong \XKopeningquote = {\XKcjkcharboxstop\XKcjklatinbreak\XKwascjkchar\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKlatinfullstop \XKopeningquote = {\XKperiodboxstop\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKlatinquestion \XKopeningquote = {\XKquestionboxstop\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKlatinexclamation \XKopeningquote = {\XKexclamationboxstop\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKlatincomma \XKopeningquote = {\XKcommaboxstop\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKlatincolon \XKopeningquote = {\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKlatinhyphen \XKopeningquote = {\XKlatinquotefont\XKopeningquotestart}
+\XeTeXinterchartoks \XKboundary \XKopeningquote = {\XKundoignorespaces\XKlatinquotefont\XKbeginboundary\XKopeningquotestart}
+
+%%% ? latin closings
+\XeTeXinterchartoks \XKlatinchar \XKlatinclosing = {\XKwaslatinchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatinnumber \XKlatinclosing = {\XKwaslatinchar\XKlatinparenfont}
+%\XeTeXinterchartoks \XKlatinopening \XKlatinclosing = {}
+%\XeTeXinterchartoks \XKlatinclosing \XKlatinclosing = {}
+\XeTeXinterchartoks \XKopeningquote \XKlatinclosing = {\XKopeningquotestop\XKlatinparenfont}
+\XeTeXinterchartoks \XKclosingquote \XKlatinclosing = {\XKclosingquotestop\XKlatinparenfont}
+\XeTeXinterchartoks \XKhanja \XKlatinclosing = {\XKcjkcharboxstop\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKhanjacombining \XKlatinclosing = {\XKcjkcharboxstop\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKsmallkana \XKlatinclosing = {\XKcjkcharboxstop\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjksymbol \XKlatinclosing = {\XKcjkcharboxstop\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjkopening \XKlatinclosing = {\postcjkopenparen\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjkclosing \XKlatinclosing = {\postcjkcloseparen\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjkcolon \XKlatinclosing = {\postcjkcolon\XKnobreak\XKquatersmallbreak\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjkfullstop \XKlatinclosing = {\postcjkfullstop\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjkliaison \XKlatinclosing = {\XKcjkcharboxstop\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKcjkextrastop \XKlatinclosing = {\XKcjkcharboxstop\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKhangulsyllable \XKlatinclosing = {\XKcjkcharboxstop\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKhanguljungjong \XKlatinclosing = {\XKcjkcharboxstop\XKwascjkchar\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatinfullstop \XKlatinclosing = {\XKperiodboxstop\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatinquestion \XKlatinclosing = {\XKquestionboxstop\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatinexclamation \XKlatinclosing = {\XKexclamationboxstop\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatincomma \XKlatinclosing = {\XKcommaboxstop\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatincolon \XKlatinclosing = {\XKlatinparenfont}
+\XeTeXinterchartoks \XKlatinhyphen \XKlatinclosing = {\XKlatinparenfont}
+\XeTeXinterchartoks \XKboundary \XKlatinclosing = {\XKundoignorespaces\XKlatinparenfont\XKbeginboundary}
+
+%%% ? latin closing quote '
+\XeTeXinterchartoks \XKlatinchar \XKclosingquote = {\XKwaslatinchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKlatinnumber \XKclosingquote = {\XKwaslatinchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKlatinopening \XKclosingquote = {\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKlatinclosing \XKclosingquote = {\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKopeningquote \XKclosingquote = {\XKopeningquotestop\XKclosingquotestart}
+%\XeTeXinterchartoks \XKclosingquote \XKclosingquote = {}
+\XeTeXinterchartoks \XKhanja \XKclosingquote = {\XKcjkcharboxstop\XKwascjkchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKhanjacombining \XKclosingquote = {\XKcjkcharboxstop\XKwascjkchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKsmallkana \XKclosingquote = {\XKcjkcharboxstop\XKwascjkchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKcjksymbol \XKclosingquote = {\XKcjkcharboxstop\XKwascjkchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKcjkopening \XKclosingquote = {\postcjkopenparen\XKwascjkchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKcjkclosing \XKclosingquote = {\postcjkcloseparen\XKwascjkchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKcjkcolon \XKclosingquote = {\postcjkcolon\XKnobreak\XKquatersmallbreak\XKwascjkchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKcjkfullstop \XKclosingquote = {\postcjkfullstop\XKwascjkchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKcjkliaison \XKclosingquote = {\XKcjkcharboxstop\XKwascjkchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKcjkextrastop \XKclosingquote = {\XKcjkcharboxstop\XKwascjkchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKhangulsyllable \XKclosingquote = {\XKcjkcharboxstop\XKwascjkchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKhanguljungjong \XKclosingquote = {\XKcjkcharboxstop\XKwascjkchar\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKlatinfullstop \XKclosingquote = {\XKperiodboxstop\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKlatinquestion \XKclosingquote = {\XKquestionboxstop\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKlatinexclamation \XKclosingquote = {\XKexclamationboxstop\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKlatincomma \XKclosingquote = {\XKcommaboxstop\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKlatincolon \XKclosingquote = {\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKlatinhyphen \XKclosingquote = {\XKlatinquotefont\XKclosingquotestart}
+\XeTeXinterchartoks \XKboundary \XKclosingquote = {\XKundoignorespaces\XKlatinquotefont\XKbeginboundary\XKclosingquotestart}
+
+%%% ? latin colon
+\XeTeXinterchartoks \XKlatinchar \XKlatincolon = {\XKwaslatinchar\XKcolonfont}
+\XeTeXinterchartoks \XKlatinnumber \XKlatincolon = {\XKwaslatinchar\XKcolonfont}
+\XeTeXinterchartoks \XKlatinopening \XKlatincolon = {\XKcolonfont}
+\XeTeXinterchartoks \XKlatinclosing \XKlatincolon = {\XKcolonfont}
+\XeTeXinterchartoks \XKopeningquote \XKlatincolon = {\XKopeningquotestop\XKcolonfont}
+\XeTeXinterchartoks \XKclosingquote \XKlatincolon = {\XKclosingquotestop\XKcolonfont}
+\XeTeXinterchartoks \XKhanja \XKlatincolon = {\XKcjkcharboxstop\XKnobreak\XKcjklatinbreak\XKwascjkchar\XKcolonfont}
+\XeTeXinterchartoks \XKhanjacombining \XKlatincolon = {\XKcjkcharboxstop\XKnobreak\XKcjklatinbreak\XKwascjkchar\XKcolonfont}
+\XeTeXinterchartoks \XKsmallkana \XKlatincolon = {\XKcjkcharboxstop\XKnobreak\XKcjklatinbreak\XKwascjkchar\XKcolonfont}
+\XeTeXinterchartoks \XKcjksymbol \XKlatincolon = {\XKcjkcharboxstop\XKnobreak\XKcjklatinbreak\XKwascjkchar\XKcolonfont}
+\XeTeXinterchartoks \XKcjkopening \XKlatincolon = {\postcjkopenparen\XKwascjkchar\XKcolonfont}
+\XeTeXinterchartoks \XKcjkclosing \XKlatincolon = {\postcjkcloseparen\XKnobreak\XKhalfsmallbreak\XKwascjkchar\XKcolonfont}
+\XeTeXinterchartoks \XKcjkcolon \XKlatincolon = {\postcjkcolon\XKnobreak\XKquatersmallbreak\XKwascjkchar\XKcolonfont}
+\XeTeXinterchartoks \XKcjkfullstop \XKlatincolon = {\postcjkfullstop\XKnobreak\XKfixedhalfskip\XKwascjkchar\XKcolonfont}
+\XeTeXinterchartoks \XKcjkliaison \XKlatincolon = {\XKcjkcharboxstop\XKwascjkchar\XKcolonfont}
+\XeTeXinterchartoks \XKcjkextrastop \XKlatincolon = {\XKcjkcharboxstop\XKnobreak\XKhalfsmallbreak\XKwascjkchar\XKcolonfont}
+\XeTeXinterchartoks \XKhangulsyllable \XKlatincolon = {\XKcjkcharboxstop\XKnobreak\XKcjklatinbreak\XKwascjkchar\XKcolonfont}
+\XeTeXinterchartoks \XKhanguljungjong \XKlatincolon = {\XKcjkcharboxstop\XKnobreak\XKcjklatinbreak\XKwascjkchar\XKcolonfont}
+\XeTeXinterchartoks \XKlatinfullstop \XKlatincolon = {\XKperiodboxstop\XKcolonfont}
+\XeTeXinterchartoks \XKlatinquestion \XKlatincolon = {\XKquestionboxstop\XKcolonfont}
+\XeTeXinterchartoks \XKlatinexclamation \XKlatincolon = {\XKexclamationboxstop\XKcolonfont}
+\XeTeXinterchartoks \XKlatincomma \XKlatincolon = {\XKcommaboxstop\XKcolonfont}
+%\XeTeXinterchartoks \XKlatincolon \XKlatincolon = {}
+\XeTeXinterchartoks \XKlatinhyphen \XKlatincolon = {\XKcolonfont}
+\XeTeXinterchartoks \XKboundary \XKlatincolon = {\XKundoignorespaces\XKcolonfont\XKbeginboundary}
+
+%%% ? hangul syllables
+\XeTeXinterchartoks \XKlatinchar \XKhangulsyllable = {\XKhangulfont\XKcjklatinsmallbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKlatinnumber \XKhangulsyllable = {\XKhangulfont\XKcjklatinsmallbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKlatinopening \XKhangulsyllable = {\XKhangulfont\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKlatinclosing \XKhangulsyllable = {\XKhangulfont\XKcjklatinbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKopeningquote \XKhangulsyllable = {\XKopeningquotestop\XKhangulfont\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKclosingquote \XKhangulsyllable = {\XKclosingquotestop\XKhangulfont\XKcjklatinbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKhanja \XKhangulsyllable = {\XKcjkcharboxstop\XKhangulfont\XKinterhanjabreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKhanjacombining \XKhangulsyllable = {\XKcjkcharboxstop\XKhangulfont\XKinterhanjabreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKsmallkana \XKhangulsyllable = {\XKcjkcharboxstop\XKhangulfont\XKinterhanjabreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKcjksymbol \XKhangulsyllable = {\XKcjkcharboxstop\XKhangulfont\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKcjkopening \XKhangulsyllable = {\postcjkopenparen\XKhangulfont\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKcjkclosing \XKhangulsyllable = {\postcjkcloseparen\XKhangulfont\XKhalfsmallbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKcjkcolon \XKhangulsyllable = {\postcjkcolon\XKhangulfont\XKquatersmallbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKcjkfullstop \XKhangulsyllable = {\postcjkfullstop\XKhangulfont\XKfixedhalfskip\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKcjkliaison \XKhangulsyllable = {\XKcjkcharboxstop\XKhangulfont\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKcjkextrastop \XKhangulsyllable = {\XKcjkcharboxstop\XKhangulfont\XKhalfsmallbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKhangulsyllable \XKhangulsyllable = {\XKcjkcharboxstop\XKinterhangulbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKhanguljungjong \XKhangulsyllable = {\XKcjkcharboxstop\XKinterhangulbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKlatinfullstop \XKhangulsyllable = {\XKperiodboxstop\XKhangulfont\XKcjklatinbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKlatinquestion \XKhangulsyllable = {\XKquestionboxstop\XKhangulfont\XKcjklatinbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKlatinexclamation \XKhangulsyllable = {\XKexclamationboxstop\XKhangulfont\XKcjklatinbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKlatincomma \XKhangulsyllable = {\XKcommaboxstop\XKhangulfont\XKcjklatinbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKlatincolon \XKhangulsyllable = {\XKhangulfont\XKcjklatinbreak\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKlatinhyphen \XKhangulsyllable = {\XKhangulfont\XKzeroskip\XKcjkcharboxstart\XKcjklastchar}
+\XeTeXinterchartoks \XKboundary \XKhangulsyllable = {\XKhangulfont\XKafterboundaryskip\XKbeginboundary\XKcjkcharboxstart\XKcjklastchar}
+
+%%% ? jungseong/jongseong jamo
+\XeTeXinterchartoks \XKhangulsyllable \XKhanguljungjong = {\XKlastchar}
+\XeTeXinterchartoks \XKhanguljungjong \XKhanguljungjong = {\XKlastchar}
+
+%%% ? latin period [.]
+\XeTeXinterchartoks \XKlatinchar \XKlatinfullstop = {\XKwaslatinchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKlatinnumber \XKlatinfullstop = {\XKwaslatinchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKlatinopening \XKlatinfullstop = {\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKlatinclosing \XKlatinfullstop = {\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKopeningquote \XKlatinfullstop = {\XKopeningquotestop\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKclosingquote \XKlatinfullstop = {\XKclosingquotestop\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKhanja \XKlatinfullstop = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKhanjacombining \XKlatinfullstop = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKsmallkana \XKlatinfullstop = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKcjksymbol \XKlatinfullstop = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKcjkopening \XKlatinfullstop = {\postcjkopenparen \XKwascjkchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKcjkclosing \XKlatinfullstop = {\postcjkcloseparen\XKwascjkchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKcjkcolon \XKlatinfullstop = {\postcjkcolon\XKnobreak\XKquatersmallbreak\XKwascjkchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKcjkfullstop \XKlatinfullstop = {\postcjkfullstop\XKwascjkchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKcjkliaison \XKlatinfullstop = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKcjkextrastop \XKlatinfullstop = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKhangulsyllable \XKlatinfullstop = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKhanguljungjong \XKlatinfullstop = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKperiodboxstart}
+%\XeTeXinterchartoks \XKlatinfullstop \XKlatinfullstop = {}
+%\XeTeXinterchartoks \XKlatinquestion \XKlatinfullstop = {}
+%\XeTeXinterchartoks \XKlatinexclamation \XKlatinfullstop = {}
+%\XeTeXinterchartoks \XKlatincomma \XKlatinfullstop = {}
+\XeTeXinterchartoks \XKlatincolon \XKlatinfullstop = {\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKlatinhyphen \XKlatinfullstop = {\XKpunctsfont\XKperiodboxstart}
+\XeTeXinterchartoks \XKboundary \XKlatinfullstop = {\XKundoignorespaces\XKpunctsfont\XKbeginboundary\XKperiodboxstart}
+
+%%% ? latin question
+\XeTeXinterchartoks \XKlatinchar \XKlatinquestion = {\XKwaslatinchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKlatinnumber \XKlatinquestion = {\XKwaslatinchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKlatinopening \XKlatinquestion = {\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKlatinclosing \XKlatinquestion = {\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKopeningquote \XKlatinquestion = {\XKopeningquotestop\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKclosingquote \XKlatinquestion = {\XKclosingquotestop\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKhanja \XKlatinquestion = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKhanjacombining \XKlatinquestion = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKsmallkana \XKlatinquestion = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKcjksymbol \XKlatinquestion = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKcjkopening \XKlatinquestion = {\postcjkopenparen\XKwascjkchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKcjkclosing \XKlatinquestion = {\postcjkcloseparen\XKwascjkchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKcjkcolon \XKlatinquestion = {\postcjkcolon\XKnobreak\XKquatersmallbreak\XKwascjkchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKcjkfullstop \XKlatinquestion = {\postcjkfullstop\XKwascjkchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKcjkliaison \XKlatinquestion = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKcjkextrastop \XKlatinquestion = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKhangulsyllable \XKlatinquestion = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKhanguljungjong \XKlatinquestion = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKquestionboxstart}
+%\XeTeXinterchartoks \XKlatinfullstop \XKlatinquestion = {}
+%\XeTeXinterchartoks \XKlatinquestion \XKlatinquestion = {}
+%\XeTeXinterchartoks \XKlatinexclamation \XKlatinquestion = {}
+%\XeTeXinterchartoks \XKlatincomma \XKlatinquestion = {}
+\XeTeXinterchartoks \XKlatincolon \XKlatinquestion = {\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKlatinhyphen \XKlatinquestion = {\XKpunctsfont\XKquestionboxstart}
+\XeTeXinterchartoks \XKboundary \XKlatinquestion = {\XKundoignorespaces\XKpunctsfont\XKbeginboundary\XKquestionboxstart}
+
+%%% ? latin exclamation
+\XeTeXinterchartoks \XKlatinchar \XKlatinexclamation = {\XKwaslatinchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKlatinnumber \XKlatinexclamation = {\XKwaslatinchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKlatinopening \XKlatinexclamation = {\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKlatinclosing \XKlatinexclamation = {\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKopeningquote \XKlatinexclamation = {\XKopeningquotestop\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKclosingquote \XKlatinexclamation = {\XKclosingquotestop\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKhanja \XKlatinexclamation = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKhanjacombining \XKlatinexclamation = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKsmallkana \XKlatinexclamation = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKcjksymbol \XKlatinexclamation = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKcjkopening \XKlatinexclamation = {\postcjkopenparen\XKwascjkchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKcjkclosing \XKlatinexclamation = {\postcjkcloseparen\XKwascjkchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKcjkcolon \XKlatinexclamation = {\postcjkcolon\XKnobreak\XKquatersmallbreak\XKwascjkchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKcjkfullstop \XKlatinexclamation = {\postcjkfullstop\XKwascjkchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKcjkliaison \XKlatinexclamation = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKcjkextrastop \XKlatinexclamation = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKhangulsyllable \XKlatinexclamation = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKhanguljungjong \XKlatinexclamation = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKexclamationboxstart}
+%\XeTeXinterchartoks \XKlatinfullstop \XKlatinexclamation = {}
+%\XeTeXinterchartoks \XKlatinquestion \XKlatinexclamation = {}
+%\XeTeXinterchartoks \XKlatinexclamation \XKlatinexclamation = {}
+%\XeTeXinterchartoks \XKlatincomma \XKlatinexclamation = {}
+\XeTeXinterchartoks \XKlatincolon \XKlatinexclamation = {\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKlatinhyphen \XKlatinexclamation = {\XKpunctsfont\XKexclamationboxstart}
+\XeTeXinterchartoks \XKboundary \XKlatinexclamation = {\XKundoignorespaces\XKpunctsfont\XKbeginboundary\XKexclamationboxstart}
+
+% ? latin comma
+\XeTeXinterchartoks \XKlatinchar \XKlatincomma = {\XKwaslatinchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKlatinnumber \XKlatincomma = {\XKwaslatinchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKlatinopening \XKlatincomma = {\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKlatinclosing \XKlatincomma = {\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKopeningquote \XKlatincomma = {\XKopeningquotestop\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKclosingquote \XKlatincomma = {\XKclosingquotestop\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKhanja \XKlatincomma = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKhanjacombining \XKlatincomma = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKsmallkana \XKlatincomma = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKcjksymbol \XKlatincomma = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKcjkopening \XKlatincomma = {\postcjkopenparen\XKwascjkchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKcjkclosing \XKlatincomma = {\postcjkcloseparen\XKwascjkchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKcjkcolon \XKlatincomma = {\postcjkcolon\XKnobreak\XKquatersmallbreak\XKwascjkchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKcjkfullstop \XKlatincomma = {\postcjkfullstop\XKwascjkchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKcjkliaison \XKlatincomma = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKcjkextrastop \XKlatincomma = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKhangulsyllable \XKlatincomma = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKhanguljungjong \XKlatincomma = {\XKcjkcharboxstop\XKwascjkchar\XKpunctsfont\XKcommaboxstart}
+%\XeTeXinterchartoks \XKlatinfullstop \XKlatincomma = {}
+%\XeTeXinterchartoks \XKlatinquestion \XKlatincomma = {}
+%\XeTeXinterchartoks \XKlatinexclamation \XKlatincomma = {}
+%\XeTeXinterchartoks \XKlatincomma \XKlatincomma = {}
+\XeTeXinterchartoks \XKlatincolon \XKlatincomma = {\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKlatinhyphen \XKlatincomma = {\XKpunctsfont\XKcommaboxstart}
+\XeTeXinterchartoks \XKboundary \XKlatincomma = {\XKundoignorespaces\XKpunctsfont\XKbeginboundary\XKcommaboxstart}
+
+%%% ? latin hyphens [-/]
+\XeTeXinterchartoks \XKlatinchar \XKlatinhyphen = {\XKwaslatinchar\XKhyphenfont}
+\XeTeXinterchartoks \XKlatinnumber \XKlatinhyphen = {\XKwaslatinchar\XKhyphenfont}
+\XeTeXinterchartoks \XKlatinopening \XKlatinhyphen = {\XKhyphenfont}
+\XeTeXinterchartoks \XKlatinclosing \XKlatinhyphen = {\XKhyphenfont}
+\XeTeXinterchartoks \XKopeningquote \XKlatinhyphen = {\XKopeningquotestop\XKhyphenfont}
+\XeTeXinterchartoks \XKclosingquote \XKlatinhyphen = {\XKclosingquotestop\XKhyphenfont}
+\XeTeXinterchartoks \XKhanja \XKlatinhyphen = {\XKcjkcharboxstop\XKwascjkchar\XKhyphenfont}
+\XeTeXinterchartoks \XKhanjacombining \XKlatinhyphen = {\XKcjkcharboxstop\XKwascjkchar\XKhyphenfont}
+\XeTeXinterchartoks \XKsmallkana \XKlatinhyphen = {\XKcjkcharboxstop\XKwascjkchar\XKhyphenfont}
+\XeTeXinterchartoks \XKcjksymbol \XKlatinhyphen = {\XKcjkcharboxstop\XKwascjkchar\XKhyphenfont}
+\XeTeXinterchartoks \XKcjkopening \XKlatinhyphen = {\postcjkopenparen\XKwascjkchar\XKhyphenfont}
+\XeTeXinterchartoks \XKcjkclosing \XKlatinhyphen = {\postcjkcloseparen\XKwascjkchar\XKhyphenfont}
+\XeTeXinterchartoks \XKcjkcolon \XKlatinhyphen = {\postcjkcolon\XKnobreak\XKquatersmallbreak\XKwascjkchar\XKhyphenfont}
+\XeTeXinterchartoks \XKcjkfullstop \XKlatinhyphen = {\postcjkfullstop\XKwascjkchar\XKhyphenfont}
+\XeTeXinterchartoks \XKcjkliaison \XKlatinhyphen = {\XKcjkcharboxstop\XKwascjkchar\XKhyphenfont}
+\XeTeXinterchartoks \XKcjkextrastop \XKlatinhyphen = {\XKcjkcharboxstop\XKwascjkchar\XKhyphenfont}
+\XeTeXinterchartoks \XKhangulsyllable \XKlatinhyphen = {\XKcjkcharboxstop\XKwascjkchar\XKhyphenfont}
+\XeTeXinterchartoks \XKhanguljungjong \XKlatinhyphen = {\XKcjkcharboxstop\XKwascjkchar\XKhyphenfont}
+\XeTeXinterchartoks \XKlatinfullstop \XKlatinhyphen = {\XKperiodboxstop\XKhyphenfont}
+\XeTeXinterchartoks \XKlatinquestion \XKlatinhyphen = {\XKquestionboxstop\XKhyphenfont}
+\XeTeXinterchartoks \XKlatinexclamation \XKlatinhyphen = {\XKexclamationboxstop\XKhyphenfont}
+\XeTeXinterchartoks \XKlatincomma \XKlatinhyphen = {\XKcommaboxstop\XKhyphenfont}
+\XeTeXinterchartoks \XKlatincolon \XKlatinhyphen = {\XKhyphenfont}
+%\XeTeXinterchartoks \XKlatinhyphen \XKlatinhyphen = {}
+\XeTeXinterchartoks \XKboundary \XKlatinhyphen = {\XKundoignorespaces\XKhyphenfont\XKbeginboundary}
+
+%%% ? boundary
+\XeTeXinterchartoks \XKlatinchar \XKboundary = {\XKendboundary\XKwaslatinchar\XKstoreprevfont}
+\XeTeXinterchartoks \XKlatinnumber \XKboundary = {\XKendboundary\XKwaslatinchar\XKstoreprevfont}
+\XeTeXinterchartoks \XKlatinopening \XKboundary = {\XKendboundary\XKstoreprevfont}
+\XeTeXinterchartoks \XKlatinclosing \XKboundary = {\XKendboundary\XKstoreprevfont}
+\XeTeXinterchartoks \XKopeningquote \XKboundary = {\XKopeningquotestop\XKendboundary\XKstoreprevfont}
+\XeTeXinterchartoks \XKclosingquote \XKboundary = {\XKclosingquotestop\XKendboundary\XKstoreprevfont}
+\XeTeXinterchartoks \XKhanja \XKboundary = {\XKcjkcharboxstop\XKendboundary\XKwascjkchar\XKignorespaces\XKstoreprevfont}
+\XeTeXinterchartoks \XKhanjacombining \XKboundary = {\XKcjkcharboxstop\XKendboundary\XKwascjkchar\XKignorespaces\XKstoreprevfont}
+\XeTeXinterchartoks \XKsmallkana \XKboundary = {\XKcjkcharboxstop\XKendboundary\XKwascjkchar\XKignorespaces\XKstoreprevfont}
+\XeTeXinterchartoks \XKcjksymbol \XKboundary = {\XKcjkcharboxstop\XKendboundary\XKwascjkchar\XKignorespaces\XKstoreprevfont}
+\XeTeXinterchartoks \XKcjkopening \XKboundary = {\postcjkopenparen\XKendboundary\XKwascjkchar\XKignorespaces\XKstoreprevfont}
+\XeTeXinterchartoks \XKcjkclosing \XKboundary = {\postcjkcloseparen\XKendboundary\ifcjtypeset\XKhalfskip\fi\XKwascjkchar\XKignorespaces\XKstoreprevfont}
+\XeTeXinterchartoks \XKcjkcolon \XKboundary = {\postcjkcolon\XKendboundary\XKnobreak\XKquatersmallbreak\XKwascjkchar\XKignorespaces\XKstoreprevfont}
+\XeTeXinterchartoks \XKcjkfullstop \XKboundary = {\postcjkfullstop\XKendboundary\ifcjtypeset\XKfixedhalfskip\fi\XKwascjkchar\XKignorespaces\XKstoreprevfont}
+\XeTeXinterchartoks \XKcjkliaison \XKboundary = {\XKcjkcharboxstop\XKendboundary\XKwascjkchar\XKignorespaces\XKstoreprevfont}
+\XeTeXinterchartoks \XKcjkextrastop \XKboundary = {\XKcjkcharboxstop\XKendboundary\XKwascjkchar\XKignorespaces\XKstoreprevfont}
+\XeTeXinterchartoks \XKhangulsyllable \XKboundary = {\XKcjkcharboxstop\XKendboundary\XKwascjkchar\XKignorespaces\XKstoreprevfont}
+\XeTeXinterchartoks \XKhanguljungjong \XKboundary = {\XKcjkcharboxstop\XKendboundary\XKwascjkchar\XKignorespaces\XKstoreprevfont}
+\XeTeXinterchartoks \XKlatinfullstop \XKboundary = {\XKperiodboxstop\XKendboundary\XKstoreprevfont}
+\XeTeXinterchartoks \XKlatinquestion \XKboundary = {\XKquestionboxstop\XKendboundary\XKstoreprevfont}
+\XeTeXinterchartoks \XKlatinexclamation \XKboundary = {\XKexclamationboxstop\XKendboundary\XKstoreprevfont}
+\XeTeXinterchartoks \XKlatincomma \XKboundary = {\XKcommaboxstop\XKendboundary\XKstoreprevfont}
+\XeTeXinterchartoks \XKlatincolon \XKboundary = {\XKendboundary\XKstoreprevfont}
+\XeTeXinterchartoks \XKlatinhyphen \XKboundary = {\XKendboundary\XKstoreprevfont}
+%\XeTeXinterchartoks \XKboundary \XKboundary = {}
+
+%%% ? cjk colons
+\XeTeXinterchartoks \XKlatinchar \XKcjkcolon = {\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKlatinnumber \XKcjkcolon = {\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKlatinopening \XKcjkcolon = {\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKlatinclosing \XKcjkcolon = {\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKopeningquote \XKcjkcolon = {\XKopeningquotestop\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKclosingquote \XKcjkcolon = {\XKclosingquotestop\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKhanja \XKcjkcolon = {\XKcjkcharboxstop\XKnobreak\XKquatersmallbreak\XKmaybehanjafont\precjkcolon}
+\XeTeXinterchartoks \XKhanjacombining \XKcjkcolon = {\XKcjkcharboxstop\XKnobreak\XKquatersmallbreak\XKmaybehanjafont\precjkcolon}
+\XeTeXinterchartoks \XKsmallkana \XKcjkcolon = {\XKcjkcharboxstop\XKnobreak\XKquatersmallbreak\XKmaybehanjafont\precjkcolon}
+\XeTeXinterchartoks \XKcjksymbol \XKcjkcolon = {\XKcjkcharboxstop\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKcjkopening \XKcjkcolon = {\postcjkopenparen\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKcjkclosing \XKcjkcolon = {\postcjkcloseparen\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKcjkcolon \XKcjkcolon = {\postcjkcolon\XKnobreak\ifcjtypeset\XKhalfminusquaterskip\else\XKsmallskip\fi\precjkcolon}
+\XeTeXinterchartoks \XKcjkfullstop \XKcjkcolon = {\postcjkfullstop\XKnobreak\ifcjtypeset\XKthreequaterskip\else\XKsmallskip\fi\precjkcolon}
+\XeTeXinterchartoks \XKcjkliaison \XKcjkcolon = {\XKcjkcharboxstop\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKcjkextrastop \XKcjkcolon = {\XKcjkcharboxstop\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKhangulsyllable \XKcjkcolon = {\XKcjkcharboxstop\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKhanguljungjong \XKcjkcolon = {\XKcjkcharboxstop\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKlatinfullstop \XKcjkcolon = {\XKperiodboxstop\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKlatinquestion \XKcjkcolon = {\XKquestionboxstop\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKlatinexclamation \XKcjkcolon = {\XKexclamationboxstop\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKlatincomma \XKcjkcolon = {\XKcommaboxstop\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKlatincolon \XKcjkcolon = {\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKlatinhyphen \XKcjkcolon = {\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\precjkcolon}
+\XeTeXinterchartoks \XKboundary \XKcjkcolon = {\XKmaybehanjafont\XKnobreak\XKquatersmallbreak\XKbeginboundary\precjkcolon}
+
+%%% ? cjk fullstop
+\XeTeXinterchartoks \XKlatinchar \XKcjkfullstop = {\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKlatinnumber \XKcjkfullstop = {\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKlatinopening \XKcjkfullstop = {\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKlatinclosing \XKcjkfullstop = {\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKopeningquote \XKcjkfullstop = {\XKopeningquotestop\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKclosingquote \XKcjkfullstop = {\XKclosingquotestop\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKhanja \XKcjkfullstop = {\XKcjkcharboxstop\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKhanjacombining \XKcjkfullstop = {\XKcjkcharboxstop\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKsmallkana \XKcjkfullstop = {\XKcjkcharboxstop\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKcjksymbol \XKcjkfullstop = {\XKcjkcharboxstop\precjkfullstop}
+\XeTeXinterchartoks \XKcjkopening \XKcjkfullstop = {\postcjkopenparen\precjkfullstop}
+\XeTeXinterchartoks \XKcjkclosing \XKcjkfullstop = {\postcjkcloseparen\precjkfullstop}
+\XeTeXinterchartoks \XKcjkcolon \XKcjkfullstop = {\postcjkcolon\XKnobreak\XKquatersmallbreak\precjkfullstop}
+\XeTeXinterchartoks \XKcjkfullstop \XKcjkfullstop = {\postcjkfullstop\precjkfullstop}
+\XeTeXinterchartoks \XKcjkliaison \XKcjkfullstop = {\XKcjkcharboxstop\precjkfullstop}
+\XeTeXinterchartoks \XKcjkextrastop \XKcjkfullstop = {\XKcjkcharboxstop\precjkfullstop}
+\XeTeXinterchartoks \XKhangulsyllable \XKcjkfullstop = {\XKcjkcharboxstop\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKhanguljungjong \XKcjkfullstop = {\XKcjkcharboxstop\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKlatinfullstop \XKcjkfullstop = {\XKperiodboxstop\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKlatinquestion \XKcjkfullstop = {\XKquestionboxstop\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKlatinexclamation \XKcjkfullstop = {\XKexclamationboxstop\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKlatincomma \XKcjkfullstop = {\XKcommaboxstop\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKlatincolon \XKcjkfullstop = {\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKlatinhyphen \XKcjkfullstop = {\XKmaybehanjafont\precjkfullstop}
+\XeTeXinterchartoks \XKboundary \XKcjkfullstop = {\XKmaybehanjafont\XKbeginboundary\precjkfullstop}
+
+%%% ? cjk liaison
+\XeTeXinterchartoks \XKlatinchar \XKcjkliaison = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinnumber \XKcjkliaison = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinopening \XKcjkliaison = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinclosing \XKcjkliaison = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKopeningquote \XKcjkliaison = {\XKopeningquotestop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKclosingquote \XKcjkliaison = {\XKclosingquotestop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKhanja \XKcjkliaison = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKhanjacombining \XKcjkliaison = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKsmallkana \XKcjkliaison = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+%\XeTeXinterchartoks \XKcjksymbol \XKcjkliaison = {}
+\XeTeXinterchartoks \XKcjkopening \XKcjkliaison = {\postcjkopenparen\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKcjkclosing \XKcjkliaison = {\postcjkcloseparen\XKnobreak\XKhalfsmallbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKcjkcolon \XKcjkliaison = {\postcjkcolon\XKnobreak\XKquatersmallbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKcjkfullstop \XKcjkliaison = {\postcjkfullstop\XKnobreak\XKfixedhalfskip\XKcjkcharboxstart}
+%\XeTeXinterchartoks \XKcjkliaison \XKcjkliaison = {}
+%\XeTeXinterchartoks \XKcjkextrastop \XKcjkliaison = {}
+\XeTeXinterchartoks \XKhangulsyllable \XKcjkliaison = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKhanguljungjong \XKcjkliaison = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinfullstop \XKcjkliaison = {\XKperiodboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinquestion \XKcjkliaison = {\XKquestionboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinexclamation \XKcjkliaison = {\XKexclamationboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatincomma \XKcjkliaison = {\XKcommaboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatincolon \XKcjkliaison = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinhyphen \XKcjkliaison = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKboundary \XKcjkliaison = {\XKmaybehanjafont\XKbeginboundary\XKcjkcharboxstart}
+
+%%% ? cjk quesiton/exclamation
+\XeTeXinterchartoks \XKlatinchar \XKcjkextrastop = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinnumber \XKcjkextrastop = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinopening \XKcjkextrastop = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinclosing \XKcjkextrastop = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKopeningquote \XKcjkextrastop = {\XKopeningquotestop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKclosingquote \XKcjkextrastop = {\XKclosingquotestop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKhanja \XKcjkextrastop = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKhanjacombining \XKcjkextrastop = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKsmallkana \XKcjkextrastop = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+%\XeTeXinterchartoks \XKcjksymbol \XKcjkextrastop = {}
+\XeTeXinterchartoks \XKcjkopening \XKcjkextrastop = {\postcjkopenparen\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKcjkclosing \XKcjkextrastop = {\postcjkcloseparen\XKnobreak\XKhalfsmallbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKcjkcolon \XKcjkextrastop = {\postcjkcolon\XKnobreak\XKquatersmallbreak\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKcjkfullstop \XKcjkextrastop = {\postcjkfullstop\XKnobreak\XKfixedhalfskip\XKcjkcharboxstart}
+%\XeTeXinterchartoks \XKcjkliaison \XKcjkextrastop = {}
+%\XeTeXinterchartoks \XKcjkextrastop \XKcjkextrastop = {}
+\XeTeXinterchartoks \XKhangulsyllable \XKcjkextrastop = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKhanguljungjong \XKcjkextrastop = {\XKcjkcharboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinfullstop \XKcjkextrastop = {\XKperiodboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinquestion \XKcjkextrastop = {\XKquestionboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinexclamation \XKcjkextrastop = {\XKexclamationboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatincomma \XKcjkextrastop = {\XKcommaboxstop\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatincolon \XKcjkextrastop = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKlatinhyphen \XKcjkextrastop = {\XKmaybehanjafont\XKcjkcharboxstart}
+\XeTeXinterchartoks \XKboundary \XKcjkextrastop = {\XKmaybehanjafont\XKbeginboundary\XKcjkcharboxstart}
+
+
+\let\XKnobreak\nobreak
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% font setting
+\def\XKlatinfont{\ifcase\XKcurrentfont\else\XK@latinfont\fi}
+\def\XKhangulfont
+ {\ifcase\XKcurrentfont\XK@storeprevfont\XK@hangulfont\or\or\XK@hangulfont\fi}
+\def\XKhanjafont
+ {\ifcase\XKcurrentfont\XK@storeprevfont\XK@hanjafont\or\XK@hanjafont\fi}
+\def\XK@latinfont {\chardef\XKcurrentfont\z@\XKprevfont}
+\def\XK@hangulfont{\chardef\XKcurrentfont\@ne\hangfnt}
+\def\XK@hanjafont {\chardef\XKcurrentfont\tw@\hanifnt}
+\def\XK@storeprevfont{\edef\XKprevfont{\the\font}}
+\let\XKstoreprevfont\XKlatinfont
+\chardef\XKcurrentfont\z@ \XK@storeprevfont
+% bug #2 : http://www.ktug.org/xe/index.php?document_srl=203582
+\let\hangfnt\relax \def\hanifnt{\hangfnt}
+
+\protected\def\latincjksymbols {\def\XKmaybehanjafont{\XKlatinfont}}
+\protected\def\hangulcjksymbols {\def\XKmaybehanjafont{\XKhangulfont}}
+\protected\def\hanjacjksymbols {\def\XKmaybehanjafont{\XKhanjafont}}
+\protected\def\prevfontcjksymbols{\def\XKmaybehanjafont{\empty}}
+
+\protected\def\latinalphs {\def\XKmaybelatinfont{\XKlatinfont}}
+\protected\def\hangulalphs {\def\XKmaybelatinfont{\XKhangulfont}}
+\protected\def\hanjaalphs {\def\XKmaybelatinfont{\XKhanjafont}}
+\protected\def\prevfontalphs{\def\XKmaybelatinfont{\empty}}
+
+\protected\def\latinnums {\def\XKlatinnumfont{\XKlatinfont}}
+\protected\def\hangulnums {\def\XKlatinnumfont{\XKhangulfont}}
+\protected\def\hanjanums {\def\XKlatinnumfont{\XKhanjafont}}
+\protected\def\prevfontnums{\def\XKlatinnumfont{\empty}}
+
+\protected\def\latinparens {\def\XKlatinparenfont{\XKlatinfont}}
+\protected\def\hangulparens {\def\XKlatinparenfont{\XKhangulfont}}
+\protected\def\hanjaparens {\def\XKlatinparenfont{\XKhanjafont}}
+\protected\def\prevfontparens{\def\XKlatinparenfont{\empty}}
+
+\protected\def\latinquotes {\def\XKlatinquotefont{\XKlatinfont}}
+\protected\def\hangulquotes {\def\XKlatinquotefont{\XKhangulfont}}
+\protected\def\hanjaquotes {\def\XKlatinquotefont{\XKhanjafont}}
+\protected\def\prevfontquotes{\def\XKlatinquotefont{\empty}}
+
+\protected\def\latinhyphens {\def\XKhyphenfont{\XKlatinfont}}
+\protected\def\hangulhyphens {\def\XKhyphenfont{\XKhangulfont}}
+\protected\def\hanjahyphens {\def\XKhyphenfont{\XKhanjafont}}
+\protected\def\prevfonthyphens{\def\XKhyphenfont{\empty}}
+
+\protected\def\latincolons {\def\XKcolonfont{\XKlatinfont}}
+\protected\def\hangulcolons {\def\XKcolonfont{\XKhangulfont}}
+\protected\def\hanjacolons {\def\XKcolonfont{\XKhanjafont}}
+\protected\def\prevfontcolons{\def\XKcolonfont{\empty}}
+
+\protected\def\latinpuncts {\def\XKpunctsfont{\XKlatinfont}}
+\protected\def\hangulpuncts {\def\XKpunctsfont{\XKhangulfont}}
+\protected\def\hanjapuncts {\def\XKpunctsfont{\XKhanjafont}}
+\protected\def\prevfontpuncts{\def\XKpunctsfont{\empty}}
+
+\protected\def\latinmarks
+ {\latinalphs \latinnums \latinpuncts \latinquotes
+ \latinparens \latinhyphens \latincolons \latincjksymbols}
+\protected\def\hangulmarks
+ {\hangulalphs\hangulnums\hangulpuncts\hangulquotes
+ \hangulparens\hangulhyphens\hangulcolons \hangulcjksymbols}
+\protected\def\hanjamarks
+ {\hanjaalphs \hanjanums \hanjapuncts \hanjaquotes
+ \hanjaparens \hanjahyphens \hanjacolons \hanjacjksymbols}
+\protected\def\prevfontmarks
+ {\prevfontalphs\prevfontnums\prevfontparens\prevfontquotes
+ \prevfonthyphens\prevfontcolons\prevfontpuncts\prevfontcjksymbols}
+
+\latinmarks
+\prevfontpuncts % empty default font in case of latin . , ? !
+\prevfontcolons % empty default font in case of latin ; :
+\hangulcjksymbols % cjk symbols in hangul font
+
+% simple command to typeset hanja by hangul font
+\protected\def\hanjabyhangulfont{\let\XKhanjafont\XKhangulfont}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% options regarding micro-spacing
+\def\xetexkohu {0.05em }
+\def\xetexkointerhchar {}
+\def\xetexkolowerperiod {}
+\def\xetexkolowerquestion {}
+\def\xetexkolowerexclamation {}
+\def\xetexkolowercomma {}
+\def\xetexkopreperiodkern {}
+\def\xetexkopostperiodkern {}
+\def\xetexkoprequestionkern {}
+\def\xetexkopostquestionkern {}
+\def\xetexkopreexclamationkern {}
+\def\xetexkopostexclamationkern {}
+\def\xetexkoprecommakern {}
+\def\xetexkopostcommakern {}
+\def\xetexkoquotewidth {}
+\def\xetexkoquoteraise {}
+\def\xetexkocharraise {}
+\def\xetexkopostmathskip {\dimexpr (\xetexkohu + \z@) * \tw@\relax}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% `` '' or ` '
+\def\XKopeningquotestart{%
+ \chardef\XK@make@quotebox\z@
+ \ifx\empty\xetexkoquotewidth
+ \ifx\empty\xetexkoquoteraise \else
+ \chardef\XK@make@quotebox\tw@
+ \fi
+ \else
+ \chardef\XK@make@quotebox\@ne
+ \fi
+ \ifnum\XK@make@quotebox>\z@
+ \leavevmode
+ \ifnum\XK@make@quotebox=\tw@ \raise\xetexkoquoteraise \fi
+ \hbox
+ \ifnum\XK@make@quotebox=\@ne to\xetexkoquotewidth \fi
+ \bgroup\hss
+ \fi
+}
+\def\XKopeningquotestop{%
+ \ifnum\XK@make@quotebox>\z@
+ \egroup\nobreak\hskip\z@
+ \fi
+}
+\def\XKclosingquotestart{%
+ \chardef\XK@make@quotebox\z@
+ \ifx\empty\xetexkoquotewidth
+ \ifx\empty\xetexkoquoteraise \else
+ \chardef\XK@make@quotebox\tw@
+ \fi
+ \else
+ \chardef\XK@make@quotebox\@ne
+ \fi
+ \ifnum\XK@make@quotebox>\z@
+ \leavevmode\nobreak\hskip\z@
+ \ifnum\XK@make@quotebox=\tw@ \raise\xetexkoquoteraise \fi
+ \hbox
+ \ifnum\XK@make@quotebox=\@ne to\xetexkoquotewidth \fi
+ \bgroup
+ \fi
+}
+\def\XKclosingquotestop{%
+ \ifnum\XK@make@quotebox>\z@
+ \hss\egroup
+ \fi
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% . , ? !
+\def\XKwaslatinchar{\chardef\XK@after@cjk@punct\z@}
+\def\XKwascjkchar {\chardef\XK@after@cjk@punct\@ne}
+\XKwaslatinchar
+\chardef\XK@inpunctuationbox\z@
+
+\def\XKperiodboxstart{% .
+ \ifnum\XK@after@cjk@punct>\z@
+ \ifx\empty\xetexkolowerperiod
+ \else
+ \leavevmode\lower\xetexkolowerperiod\hbox\bgroup
+ \chardef\XK@inpunctuationbox\@ne
+ \fi
+ \fi
+ \ifnum\XKcurrentfont>\z@
+ \ifx\empty\xetexkopreperiodkern
+ \else
+ \kern\xetexkopreperiodkern\relax
+ \fi
+ \fi
+}
+\def\XKperiodboxstop{%
+ \ifnum\XKcurrentfont>\z@
+ \ifx\empty\xetexkopostperiodkern
+ \else
+ \vrule width\xetexkopostperiodkern height\z@ depth\z@
+ \fi
+ \fi
+ \ifnum\XK@inpunctuationbox=\@ne
+ \global\count@\spacefactor\egroup\spacefactor\count@
+ \fi
+}
+
+\def\XKquestionboxstart{% ?
+ \ifnum\XK@after@cjk@punct>\z@
+ \ifx\empty\xetexkolowerquestion
+ \else
+ \leavevmode\lower\xetexkolowerquestion\hbox\bgroup
+ \chardef\XK@inpunctuationbox\@ne
+ \fi
+ \fi
+ \ifnum\XKcurrentfont>\z@
+ \ifx\empty\xetexkoprequestionkern
+ \else
+ \kern\xetexkoprequestionkern\relax
+ \fi
+ \fi
+}
+\def\XKquestionboxstop{%
+ \ifnum\XKcurrentfont>\z@
+ \ifx\empty\xetexkopostquestionkern
+ \else
+ \vrule width\xetexkopostquestionkern height\z@ depth\z@
+ \fi
+ \fi
+ \ifnum\XK@inpunctuationbox=\@ne
+ \global\count@\spacefactor\egroup\spacefactor\count@
+ \fi
+}
+
+\def\XKexclamationboxstart{% !
+ \ifnum\XK@after@cjk@punct>\z@
+ \ifx\empty\xetexkolowerexclamation
+ \else
+ \leavevmode\lower\xetexkolowerexclamation\hbox\bgroup
+ \chardef\XK@inpunctuationbox\@ne
+ \fi
+ \fi
+ \ifnum\XKcurrentfont>\z@
+ \ifx\empty\xetexkopreexclamationkern
+ \else
+ \kern\xetexkopreexclamationkern\relax
+ \fi
+ \fi
+}
+\def\XKexclamationboxstop{%
+ \ifnum\XKcurrentfont>\z@
+ \ifx\empty\xetexkopostexclamationkern
+ \else
+ \vrule width\xetexkopostexclamationkern height\z@ depth\z@
+ \fi
+ \fi
+ \ifnum\XK@inpunctuationbox=\@ne
+ \global\count@\spacefactor\egroup\spacefactor\count@
+ \fi
+}
+
+\def\XKcommaboxstart{% ,
+ \ifnum\XK@after@cjk@punct>\z@
+ \ifx\empty\xetexkolowercomma
+ \else
+ \leavevmode\lower\xetexkolowercomma\hbox\bgroup
+ \chardef\XK@inpunctuationbox\@ne
+ \fi
+ \fi
+ \ifnum\XKcurrentfont>\z@
+ \ifx\empty\xetexkoprecommakern
+ \else
+ \kern\xetexkoprecommakern\relax
+ \fi
+ \fi
+}
+\def\XKcommaboxstop{%
+ \ifnum\XKcurrentfont>\z@
+ \ifx\empty\xetexkopostcommakern
+ \else
+ \vrule width\xetexkopostcommakern height\z@ depth\z@
+ \fi
+ \fi
+ \ifnum\XK@inpunctuationbox=\@ne
+ \global\count@\spacefactor\egroup\spacefactor\count@
+ \fi
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% cjk openings and closings
+%%% considering bounding box
+\def\XK@side@bearing#1#2{% 1: char index; 2: left=1 or right=3 -> dimen@
+ \ifdim\XeTeXglyphbounds#2\XeTeXcharglyph#1>.5em
+ \dimen@.5em
+ \else
+ \dimen@\fontcharwd\font\count@
+ \fi
+}
+\def\precjkopenparen{\futurelet\@let@token\precjkopenparen@}
+\def\precjkopenparen@{%
+ \@josa@char@to@number\@let@token\count@
+ \XK@side@bearing\count@\@ne
+ \leavevmode
+ \ifx\empty\xetexkocharraise\else\raise\xetexkocharraise\fi
+ \hbox
+ \ifx\XKdisablecjksymbolspacing\empty
+ \bgroup
+ \else % default: half
+ to\dimen@ \bgroup\hss
+ \fi
+ \XeTeXinterchartoks\XKboundary\XKcjkopening = {\empty}}
+\def\postcjkopenparen{\egroup}
+
+\def\precjkcloseparen{\futurelet\@let@token\precjkcloseparen@}
+\def\precjkcloseparen@{%
+ \@josa@char@to@number\@let@token\count@
+ \XK@side@bearing\count@\thr@@
+ \leavevmode
+ \ifx\empty\xetexkocharraise\else\raise\xetexkocharraise\fi
+ \hbox
+ \ifx\XKdisablecjksymbolspacing\empty\else % default: half
+ to\dimen@
+ \fi
+ \bgroup
+ \XeTeXinterchartoks\XKboundary\XKcjkclosing = {\empty}}
+\def\postcjkcloseparen{%
+ \ifx\XKdisablecjksymbolspacing\empty\else % default: half
+ \hss
+ \fi
+ \egroup}
+
+\def\precjkfullstop{\futurelet\@let@token\precjkfullstop@}
+\def\precjkfullstop@{%
+ \@josa@char@to@number\@let@token\count@
+ \XK@side@bearing\count@\thr@@
+ \leavevmode
+ \ifx\empty\xetexkocharraise\else\raise\xetexkocharraise\fi
+ \hbox
+ \ifx\XKdisablecjksymbolspacing\empty\else % default: half
+ to\dimen@
+ \fi
+ \bgroup
+ \XeTeXinterchartoks\XKboundary\XKcjkfullstop = {\empty}}
+\def\postcjkfullstop{%
+ \ifx\XKdisablecjksymbolspacing\empty\else % default: half
+ \hss
+ \fi
+ \egroup}
+
+\def\precjkcolon {\leavevmode
+ \ifx\empty\xetexkocharraise\else\raise\xetexkocharraise\fi
+ \hbox
+ \ifx\XKdisablecjksymbolspacing\empty
+ \bgroup
+ \else % default: half
+ to 0.5em\bgroup\hss
+ \fi
+}
+\def\postcjkcolon{%
+ \ifx\XKdisablecjksymbolspacing\empty\else % default: half
+ \hss
+ \fi
+ \egroup}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% various spaces
+\def\XKskipstretchshrink {plus .04em minus .02em}
+\def\XKzeroskip {\hskip\z@\XKskipstretchshrink}
+\def\XKsmallskip
+ {\hskip\dimexpr (\xetexkohu + \z@) * \tw@ \relax \XKskipstretchshrink}
+\def\XKsmallsmallskip
+ {\hskip\dimexpr \xetexkohu + \z@ \relax \XKskipstretchshrink}
+\def\XKxkanjiskip {\hskip0.25em plus0.15em minus0.06em }
+\def\XKhalfskip {\hskip0.5em minus 0.5em }
+\def\XKfixedhalfskip {\hskip0.5em\relax}
+\def\XKquaterskip {\hskip0.25em minus 0.25em }
+\def\XKhalfminusquaterskip {\hskip0.5em minus 0.25em }
+\def\XKthreequaterskip {\hskip0.75em minus 0.25em }
+\def\XKinterhangulpenalty {\penalty50 }
+
+\def\XKinterhangulbreak
+ {\ifcjtypeset\else\XKinterhangulpenalty\fi
+ \hskip\dimexpr\xetexkointerhchar + \z@\relax \XKskipstretchshrink}
+\def\XKinterhanjabreak {\ifcjtypeset\else\XKinterhangulpenalty\fi \XKzeroskip}
+\def\XKcjklatinbreak {\ifcjtypeset\XKxkanjiskip\else\XKsmallskip\fi}
+\def\XKcjklatinsmallbreak {\ifcjtypeset\XKxkanjiskip\else\XKsmallsmallskip\fi}
+\def\XKhalfsmallbreak {\ifcjtypeset\XKhalfskip\else\XKsmallsmallskip\fi}
+\def\XKquatersmallbreak {\ifcjtypeset\XKquaterskip\else\XKsmallskip\fi}
+
+\def\XKafterboundaryskip{%
+ \ifcase\lastnodetype
+ \or \XKzeroskip % 1. hbox: especially after indent box
+ \or \XKzeroskip % 2. vbox
+ \or\or\or\or\or\or
+ \or % 9. whatsit. see issue #3
+ \or \XKcjkmathbreak % 10. math
+ \or
+ \or \XKzeroskip % 12. kern
+ \fi}
+%% users can redefine XKcjkmathbreak
+\def\XKcjkmathbreak{%
+ \ifcjtypeset\XKxkanjiskip
+ \else\hskip\xetexkopostmathskip\XKskipstretchshrink\fi}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% everyhangul/everyhanja
+%%% request from karnes at 2013.11.18
+\def\everyhanja#1{%
+ \def\XK@every@hanja##1{#1}%
+ \let\XKcjkcharboxstart\empty
+ \let\XKcjkcharboxstop\empty % conflict w. everyhanja
+}
+\def\XK@every@hanja#1{#1}
+\def\everyhangul#1{%
+ \def\XK@every@hangul##1{#1}%
+ \let\XKcjkcharboxstart\empty
+ \let\XKcjkcharboxstop\empty % conflict w. everyhangul
+}
+\def\XK@every@hangul#1{#1}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% for autojosa, get last chars
+\let\XK@last@char=0
+\let\XK@lastlast@char\XK@last@char
+\let\XK@lastlastlast@char\XK@lastlast@char
+
+\def\XKlastchar{\futurelet\@let@token\XK@save@last@char}
+\def\XK@save@last@char{%
+ \global\let\XK@lastlastlast@char\XK@lastlast@char
+ \global\let\XK@lastlast@char \XK@last@char
+ \global\let\XK@last@char \@let@token
+}
+
+\def\XK@fallback@hanja@font@family#1{%
+ \chardef\XK@use@fallback@font\z@
+ \iffontchar\font`#1\else
+ \ifdefined\fallbackhanjafont
+ \chardef\XK@use@fallback@font\@ne
+ \expandafter\let\expandafter\XK@fallback@plain@font@temp\the\font
+ \let\XK@fallback@latex@family@temp\f@family % redundant for plain
+ \fallbackhanjafont
+ \fi
+ \fi
+}
+
+\def\XKhanjalastchar#1{%
+ \let\@let@token#1\XK@save@last@char
+ % fallbackhanjafont for, say, HanaMinB
+ \XK@fallback@hanja@font@family{#1}%
+ \XK@every@hanja{#1}% everyhanja
+ \ifcase\XK@use@fallback@font\else
+ \XK@fallback@plain@font@temp
+ \let\f@family\XK@fallback@latex@family@temp
+ \fi
+}
+
+\newtoks\XK@toks@
+
+\def\XKcjklastchar#1{%
+ \let\@let@token#1\XK@save@last@char
+ % and supress char orphan
+ \XK@toks@{\XK@every@hangul{#1}}% everyhangul 가
+ \ifnum\lastpenalty=\z@ % bypass 가\\나 case
+ \expandafter\XK@futurelet@let@token
+ \else
+ \expandafter\XK@normal@the@toks@
+ \fi
+}
+\def\XK@check@next@char{%
+ \ifx\par\@let@token
+ \let\next\XK@nobreak@the@toks@
+ \else\ifx\@sptoken\@let@token
+ \XK@toks@\expandafter{\the\XK@toks@\@sptoken}%
+ \let\next\XK@afterassign@let@token
+ \else\ifx.\@let@token
+ \XK@toks@\expandafter{\the\XK@toks@ .}%
+ \let\next\XK@afterassign@let@token
+ \else\ifx^^^^3002\@let@token
+ \XK@toks@\expandafter{\the\XK@toks@^^^^3002}%
+ \let\next\XK@afterassign@let@token
+ \else\ifx^^^^ff0e\@let@token
+ \XK@toks@\expandafter{\the\XK@toks@^^^^ff0e}%
+ \let\next\XK@afterassign@let@token
+ \else
+ \let\next\XK@normal@the@toks@
+ \fi\fi\fi\fi\fi
+ \next
+}
+\def\XK@afterassign@let@token{\afterassignment\XK@futurelet@let@token\let\@let@token= }
+\def\XK@futurelet@let@token{\futurelet\@let@token\XK@check@next@char}
+\def\XK@normal@the@toks@{\the\XK@toks@}
+\def\XK@nobreak@the@toks@{\XK@nobreak\the\XK@toks@}
+\def\XK@nobreak{\skip@\lastskip\unskip\unpenalty\nobreak\hskip\skip@}
+
+\def\XKbeginboundary{% empty interchartoks crashes xetex!!!
+ \global\XeTeXinterchartoks\XKboundary\XKlatinnumber = {\empty}%
+ \global\XeTeXinterchartoks\XKboundary\XKlatinchar = {\empty}%
+ \global\XeTeXinterchartoks\XKboundary\XKhanja = {\empty}%
+ \global\XeTeXinterchartoks\XKboundary\XKsmallkana = {\empty}%
+ \global\XeTeXinterchartoks\XKboundary\XKhangulsyllable = {\empty}%
+}
+\def\XKendboundary{%
+ \global\XeTeXinterchartoks\XKboundary\XKlatinnumber = {\XKundoignorespaces\XKlatinnumfont \XKbeginboundary\XKlastchar}%
+ \global\XeTeXinterchartoks\XKboundary\XKlatinchar = {\XKundoignorespaces\XKmaybelatinfont\XKbeginboundary\XKlastchar}%
+ \global\XeTeXinterchartoks\XKboundary\XKhanja = {\XKhanjafont \XKafterboundaryskip\XKbeginboundary\XKcjkcharboxstart\XKhanjalastchar}%
+ \global\XeTeXinterchartoks\XKboundary\XKsmallkana = {\XKhanjafont \XKafterboundaryskip\XKbeginboundary\XKcjkcharboxstart\XKhanjalastchar}%
+ \global\XeTeXinterchartoks\XKboundary\XKhangulsyllable = {\XKhangulfont\XKafterboundaryskip\XKbeginboundary\XKcjkcharboxstart\XKcjklastchar}%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% raise hangul/hanja box
+\def\XKcjkcharboxstart{%
+ \ifx\empty\xetexkocharraise\else
+ \leavevmode\raise\xetexkocharraise\hbox\bgroup
+ \fi
+}
+\def\XKcjkcharboxstop{%
+ \ifx\empty\xetexkocharraise\else
+ \egroup
+ \fi
+}
+
+%%%%%%%%%%%%%%
+% etc commands
+\let\enablejamoautojosa\relax % enabled already
+
+\protected\def\disablejamoautojosa{% newly added by v2.1
+ \XeTeXinterchartoks\XKhangulsyllable\XKhanguljungjong = {}%
+ \XeTeXinterchartoks\XKhanguljungjong\XKhanguljungjong = {}%
+}
+
+\protected\def\disableautojosa{%
+ \disablejamoautojosa
+ \let\XKlastchar\relax
+ \let\XK@save@last@char\relax
+}
+
+\protected\def\disablekoreanfonts{%
+ \let\XKlatinfont \relax
+ \let\XKhangulfont \relax
+ \let\XKhanjafont \relax
+ \let\XKmaybelatinfont \relax
+ \let\XKmaybehanjafont \relax
+ \let\XKpunctsfont \relax
+ \let\XKlatinnumfont \relax
+ \let\XKlatinparenfont \relax
+ \let\XKlatinquotefont \relax
+ \let\XKhyphenfont \relax
+ \let\XKcolonfont \relax
+ \let\XKstoreprevfont \relax
+}
+
+\protected\def\disablecjksymbolspacing{% for natural width of 。「」 etc
+ \let\XKdisablecjksymbolspacing\empty
+}
+
+\protected\def\disablehangulspacing{% all micro-spacing is 0pt
+ \let\XKskipstretchshrink\relax
+ \let\precjkopenparen \relax \let\postcjkopenparen \relax
+ \let\precjkcloseparen\relax \let\postcjkcloseparen\relax
+ \let\precjkfullstop \relax \let\postcjkfullstop \relax
+ \let\precjkcolon \relax \let\postcjkcolon \relax
+ \let\XKopeningquotestart \relax \let\XKopeningquotestop \relax
+ \let\XKclosingquotestart \relax \let\XKclosingquotestop \relax
+ \let\XKperiodboxstart \relax \let\XKperiodboxstop \relax
+ \let\XKquestionboxstart \relax \let\XKquestionboxstop \relax
+ \let\XKexclamationboxstart \relax \let\XKexclamationboxstop \relax
+ \let\XKcommaboxstart \relax \let\XKcommaboxstop \relax
+ \let\XKwaslatinchar \relax \let\XKwascjkchar \relax
+ \let\XKcjkcharboxstart \relax \let\XKcjkcharboxstop \relax
+ \let\XKinterhangulbreak \XKzeroskip
+ \let\XKinterhanjabreak \XKzeroskip
+ \let\XKcjklatinbreak \XKzeroskip
+ \let\XKcjklatinsmallbreak \XKzeroskip
+ \let\XKhalfsmallbreak \XKzeroskip
+ \let\XKfixedhalfskip \XKzeroskip
+ \let\XKquatersmallbreak \XKzeroskip
+ \let\XKhalfminusquaterskip \XKzeroskip
+ \let\XKhalfskip \XKzeroskip
+ \let\XKsmallskip \XKzeroskip
+ \let\XKthreequaterskip \XKzeroskip
+ \let\XKcjkmathbreak \XKzeroskip
+}
+
+\protected\def\disablehangulspacingandlinebreak{% all micro-spacing is \relax
+ \let\XKzeroskip \relax
+ \let\XKnobreak \relax
+ \let\XKafterboundaryskip\relax
+ \def\XKcjklastchar##1{\let\@let@token##1\XK@save@last@char\XK@every@hangul{##1}}%
+ \disablehangulspacing
+}
+
+% still remaining: XKhanjalastchar XKbeginboundary XKendboundary XKignorespaces XKundoignorespaces
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% for old and C/J documents
+\newif\ifcjtypeset
+
+% try to remove space skip
+\def\XKignorespaces{}
+\def\XKundoignorespaces{}
+
+\def\XK@japanese{\cjtypesettrue
+ %% killing spaces after cjk chars
+ \def\XKignorespaces{\futurelet\XK@let@token\XK@ignorespaces}%
+ \def\XK@ignorespaces{\ifx\XK@let@token\@sptoken\kern-1sp\kern1sp\ignorespaces\fi}%
+ \def\XKundoignorespaces{\ifnum\lastkern=\@ne\@sptoken\fi}%
+ %% a little bigger stretch/shrink
+ \def\XKskipstretchshrink{plus .1em minus .1ex}%
+ %% cjksymbols
+ \hanjacjksymbols
+ %% spaceskip is equal to xkanjiskip
+ \spaceskip.25em plus.15em minus.06em
+}
+\protected\def\japanese{\XK@japanese\parindent1em }
+\protected\def\Tchinese{\XK@japanese\parindent2em }
+\protected\def\Schinese{\XK@japanese\parindent2em
+ % these glyphs in simplified chinese fonts are left-aligned.
+ \XeTeXcharclass "FF1F = \XKcjkfullstop % ?
+ \XeTeXcharclass "FF01 = \XKcjkfullstop % !
+ \XeTeXcharclass "FF1A = \XKcjkfullstop % :
+ \XeTeXcharclass "FF1B = \XKcjkfullstop % ;
+ }
+\let\chinese\Schinese
+
+%% inhibitglue
+\let\inhibitglue\relax
+
+%%%%%%%%%%%%%%%%%%%%%%
+%% hangul in math mode -- general
+\def\setmathhangulblock#1#2{%
+ \count@ "#1
+ \loop
+ \Umathcode\count@ = 7 \symmathhangul \count@
+ \ifnum\count@<"#2
+ \advance\count@\@ne \repeat}
+
+%%%%%%%%%%%
+%% for ulem
+\def\xetexkoulemsupport{%
+ \UL@hook\expandafter{\the\UL@hook
+ \let\XK@nobreak\relax
+ \ifdefined\XK@UL@@@hangulfont\else
+ \let\XK@UL@@@hangulfont\XKhangulfont
+ \let\XK@UL@@@hanjafont \XKhanjafont
+ \def\XKhangulfont{\XK@UL@@@hangulfont
+ \aftergroup\aftergroup\aftergroup\XK@UL@@@hangulfont
+ }%
+ \def\XKhanjafont{\XK@UL@@@hanjafont
+ \aftergroup\aftergroup\aftergroup\XK@UL@@@hanjafont
+ }%
+ \fi
+ }%
+}
+
+%%%%%%%%%%
+%% dotemph
+\def\dotemphraise{0.4em }
+\ifcsname bfseries\endcsname
+ \def\dotemphchar{\bfseries ^^^^02d9}
+\else
+ \def\dotemphchar{\bf \char95 }
+\fi
+\newbox\XKdotemphbox
+
+\protected\def\dotemph#1{%
+ \leavevmode
+ \begingroup
+ \def\XKcjklastchar{\futurelet\@let@token\XK@dotemph@last@char}%
+ \let\XKhanjalastchar\XKcjklastchar
+ \let\XKcjkcharboxstart\relax
+ \let\XKcjkcharboxstop\relax
+ \setbox\XKdotemphbox\hbox{\dotemphchar}%
+ #1\relax
+ \endgroup
+}
+
+\def\XK@dotemph@last@char{\XK@save@last@char\dot@@@emph}
+
+\def\dot@@@emph#1{%
+ \setbox\z@\hbox{\XK@fallback@hanja@font@family{#1}#1}%
+ \setbox\tw@\hbox to\wd\z@{\hss\copy\XKdotemphbox\hss}\ht\tw@\z@\dp\tw@\z@
+ \rlap{\raise\dotemphraise\box\tw@}\box\z@
+}
+
+%%% declare to use interchartoken
+\XeTeXinterchartokenstate\@ne
+
+\def\hellipsis{^^^^2026^^^^2026}
+
+\endinput
diff --git a/macros/xetex/generic/xetexko/xetexko-vertical.sty b/macros/xetex/generic/xetexko/xetexko-vertical.sty
new file mode 100644
index 0000000000..f94fed2b2a
--- /dev/null
+++ b/macros/xetex/generic/xetexko/xetexko-vertical.sty
@@ -0,0 +1,177 @@
+% xetexko-vertical.sty
+%
+% Copyright (c) 2013-2018 Dohyun Kim <nomos at ktug org>
+%
+% This work 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
+% version 2006/05/20 or later.
+
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ProvidesPackage\endcsname\relax\else
+ \ProvidesPackage{xetexko-vertical}
+ [2018/04/06 v2.18 Vertical environment for XeTeX-ko]
+\fi
+
+% do not veticalize headline/footline
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname selectfont\endcsname\relax % plain
+ \protected\def\verticaltypesetting{%
+ \dimen@\hsize\hsize\vsize\vsize\dimen@
+ \edef\plainoutput{\unexpanded{\dimen@\hsize\hsize\vsize\vsize\dimen@}%
+ \unexpanded\expandafter{\plainoutput}}%
+ \def\pagebody{\setbox\z@\vbox to\hsize{\boxmaxdepth=\maxdepth
+ \pagecontents}\xetexko@rotatebox\z@\box\z@}%
+ \maxdepth\z@ \XK@vertical@spacing}
+\else % latex
+ \protected\def\verticaltypesetting{%
+ \AtBeginDocument{\XK@vertical@spacing}%
+ \maxdepth\z@
+ \dimen@\textwidth
+ \textwidth\textheight
+ \textheight\dimen@
+ \edef\@outputpage{%
+ \unexpanded{\xetexko@rotatebox\@outputbox\textwidth\textheight}%
+ \unexpanded\expandafter{\@outputpage}}%
+ }
+ \@onlypreamble\verticaltypesetting
+\fi
+
+\def\xetexko@rotatebox#1{%
+ \ifvbox#1\count@\@ne\else\count@\z@\fi
+ \dimen@\wd#1\dimen@ii\dimexpr\ht#1+\dp#1\relax
+ \setbox#1\ifnum\count@=\@ne
+ \vbox to\dimen@\bgroup\hbox to\dimen@ii\bgroup\hfil\else
+ \hbox to\dimen@ii\bgroup\vbox to\dimen@\bgroup\fi
+ \wd#1\z@ \ht#1\z@ \dp#1\z@
+ \special{x:gsave}\special{x:rotate -90}\box#1\special{x:grestore}%
+ \ifnum\count@=\@ne\egroup\vfil\else\vfil\egroup\hfil\fi\egroup
+}
+
+% users can declare vertical EM size, which might be different from 1em.
+\newdimen\verticalem
+
+\def\XK@vertical@spacing{%
+ \ifnum\verticalem > \z@
+ \def\XK@vert@half@em{.5\verticalem}%
+ \else
+ \def\XK@vert@half@em{.5em}%
+ \fi
+ \let\xk@horiz@precjkopenparen \precjkopenparen
+ \let\xk@horiz@precjkcloseparen\precjkcloseparen
+ \let\xk@horiz@precjkfullstop \precjkfullstop
+ \ifx\precjkopenparen\relax\else
+ \def\precjkopenparen {\leavevmode
+ \ifx\empty\xetexkocharraise\else\raise\xetexkocharraise\fi
+ \hbox
+ \ifx\XKdisablecjksymbolspacing\empty
+ \bgroup
+ \else
+ to\XK@vert@half@em \bgroup \hss
+ \fi
+ }%
+ \fi
+ \ifx\precjkcloseparen\relax\else
+ \def\precjkcloseparen{\leavevmode
+ \ifx\empty\xetexkocharraise\else\raise\xetexkocharraise\fi
+ \hbox
+ \ifx\XKdisablecjksymbolspacing\empty\else
+ to\XK@vert@half@em
+ \fi
+ \bgroup}%
+ \fi
+ \ifx\precjkfullstop\relax\else
+ \def\precjkfullstop {\leavevmode
+ \ifx\empty\xetexkocharraise\else\raise\xetexkocharraise\fi
+ \hbox
+ \ifx\XKdisablecjksymbolspacing\empty\else
+ to\XK@vert@half@em
+ \fi
+ \bgroup}%
+ \fi
+ \spaceskip\XK@vert@half@em plus\XK@vert@half@em\relax
+ \parindent\XK@vert@half@em \parindent2\parindent
+}
+
+\protected\def\vertical#1{%
+ \setbox\z@\vbox\bgroup
+ \hsize=#1%
+ \leftskip\z@
+ \rightskip\z@
+ \parindent\z@
+ \everypar{}%
+ \XK@vertical@spacing
+}
+
+\protected\def\endvertical{%
+ \egroup
+ \dimen@\dimexpr\ht\z@+\dp\z@\relax
+ \dimen@ii\dimexpr\wd\z@-\dp\z@\relax
+ \setbox\z@\hbox{%
+ \kern\dimexpr\ht\z@+0.5em\relax
+ \wd\z@\z@
+ \ht\z@\z@
+ \dp\z@\z@
+ \special{x:gsave}%
+ \special{x:rotate -90}%
+ \box\z@
+ \special{x:grestore}}%
+ \wd\z@\dimen@
+ \ht\z@\z@
+ \dp\z@\z@
+ \leavevmode
+ \raise\dimen@ii\box\z@
+}
+
+% horizontal box inside vertical typesetting
+\protected\def\horizontal#1{%
+ \setbox\z@\vbox\bgroup
+ \hsize=#1%
+ \leftskip \z@
+ \rightskip\z@
+ \parindent\z@
+ \everypar {}%
+ \spaceskip \fontdimen2\font
+ plus \fontdimen3\font
+ minus\fontdimen4\font
+ \ifdefined\xk@horiz@precjkopenparen
+ \let\precjkopenparen \xk@horiz@precjkopenparen
+ \let\precjkcloseparen\xk@horiz@precjkcloseparen
+ \let\precjkfullstop \xk@horiz@precjkfullstop
+ \fi
+}
+\protected\def\endhorizontal{%
+ \egroup
+ \dimen@\dimexpr\ht\z@+\dp\z@\relax
+ \dimen@ii\dimexpr\wd\z@+.5ex\relax
+ \setbox\z@\hbox\bgroup
+ \wd\z@\z@\ht\z@\z@\dp\z@\z@
+ \special{x:gsave}%
+ \special{x:rotate 90}%
+ \box\z@
+ \special{x:grestore}%
+ \egroup
+ \wd\z@\dimen@
+ \ht\z@\dimen@ii
+ \dp\z@\z@
+ \fboxsep=-\fboxrule
+ \leavevmode\lower.5ex\box\z@
+}
+
+\protected\def\vertlatin#1{\leavevmode\lower0.5ex\hbox{\latinmarks #1}}
+
+\endinput
+
+%% example:
+%\newhangulfontfamily\myvertfont
+% [Script=Hangul,Vertical=RotatedGlyphs]
+% {HCR Dotum LVT}
+%\verticalem=1.05em
+%\begin{vertical}{12em}\myvertfont
+% 세로쓰기 영역.
+% #1 = 세로길이
+%\end{vertical}
+
diff --git a/macros/xetex/generic/xetexko/xetexko.sty b/macros/xetex/generic/xetexko/xetexko.sty
new file mode 100644
index 0000000000..38a88c1404
--- /dev/null
+++ b/macros/xetex/generic/xetexko/xetexko.sty
@@ -0,0 +1,122 @@
+% xetexko.sty
+%
+% Copyright (c) 2013-2018 Dohyun Kim <nomos at ktug org>
+%
+% This work 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
+% version 2006/05/20 or later.
+
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ProvidesPackage\endcsname\relax\else
+ \ProvidesPackage{xetexko}[2018/04/19 v2.19 Typesetting Korean with XeTeX]
+\fi
+
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname selectfont\endcsname\relax
+ \chardef\catcodeofATcharacter\catcode`@
+ \catcode`\@ = 11
+
+ \input xetexko-space.sty
+ \input xetexko-josa.sty
+ \input xetexko-vertical.sty
+
+ %%% 한글 폰트
+ \def\hangulfont{\font\hangfnt}
+ \def\hanjafont {\font\hanifnt}
+ %\hangulfont="[UnBatang]:mapping=tex-text" at 10pt
+ %%% 수식 한글
+ \newfam\symmathhangul
+ \def\setmathhangulfont#1#{\setmathhangulfont@}
+ \def\setmathhangulfont@#1{%
+ \font\tenhangul = "#1" at 10pt
+ \font\sevenhangul = "#1" at 7pt
+ \font\fivehangul = "#1" at 5pt
+ \textfont\symmathhangul = \tenhangul
+ \scriptfont\symmathhangul = \sevenhangul
+ \scriptscriptfont\symmathhangul = \fivehangul
+ }
+ \setmathhangulblock{AC00}{D7A3}
+ %\setmathhangulfont{[UnBatang]}
+
+ \catcode`\@\catcodeofATcharacter
+ \expandafter\endinput
+\fi
+
+\newif\if@hangul
+\newif\if@hanja
+\DeclareOption{hangul}{\@hangultrue}
+\DeclareOption{hanja}{\@hangultrue\@hanjatrue}
+\DeclareOption{unfonts}{}
+\ProcessOptions\relax
+
+\RequirePackage{xetexko-space}
+\RequirePackage{xetexko-josa}
+\RequirePackage{xetexko-font}
+\RequirePackage{xetexko-vertical}
+
+\RequirePackage{kolabels-utf}
+\if@hangul\AtBeginDocument{\RequirePackage{konames-utf}}\fi
+
+\AtBeginDocument{
+ % for ulem package
+ \ifcsname UL@hook\endcsname \xetexkoulemsupport \fi
+ % for hyperref package
+ \@ifpackageloaded{hyperref}{\pdfstringdefDisableCommands{%
+ \let\dotemph\@firstofone
+ \let\makejosa\@secondoftwo
+ \let\jong\relax
+ \let\jung\relax
+ \let\rieul\relax
+ \let\latinalphs\relax
+ \let\hangulalphs\relax
+ \let\hanjaalphs\relax
+ \let\prevfontalphs\relax
+ \let\latinnums\relax
+ \let\hangulnums\relax
+ \let\hanjanums\relax
+ \let\prevfontnums\relax
+ \let\latinparens\relax
+ \let\hangulparens\relax
+ \let\hanjaparens\relax
+ \let\prevfontparens\relax
+ \let\latinquotes\relax
+ \let\hangulquotes\relax
+ \let\hanjaquotes\relax
+ \let\prevfontquotes\relax
+ \let\latinpuncts\relax
+ \let\hangulpuncts\relax
+ \let\hanjapuncts\relax
+ \let\prevfontpuncts\relax
+ \let\latinmarks\relax
+ \let\hangulmarks\relax
+ \let\hanjamarks\relax
+ \let\prevfontmarks\relax
+ \let\latincolons\relax
+ \let\hangulcolons\relax
+ \let\hanjacolons\relax
+ \let\prevfontcolons\relax
+ \let\latinhyphens\relax
+ \let\hangulhyphens\relax
+ \let\hanjahyphens\relax
+ \let\prevfonthyphens\relax
+ \let\latincjksymbols\relax
+ \let\hangulcjksymbols\relax
+ \let\hanjacjksymbols\relax
+ \let\prevfontcjksymbols\relax
+ \let\disablekoreanfonts\relax
+ \let\disablehangulspacing\relax
+ \let\disablehangulspacingandlinebreak\relax
+ \let\disableautojosa\relax
+ \let\disablecjksymbolspacing\relax
+ \let\japanese\relax
+ \let\chinese\relax
+ \let\Tchinese\relax
+ \let\Schinese\relax
+ }}{}
+}
+
+\endinput
diff --git a/macros/xetex/generic/xevlna/License.txt b/macros/xetex/generic/xevlna/License.txt
new file mode 100644
index 0000000000..90e5e3ab79
--- /dev/null
+++ b/macros/xetex/generic/xevlna/License.txt
@@ -0,0 +1,416 @@
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.3c 2006-05-20
+
+Copyright 1999 2002-2006 LaTeX3 Project
+ Everyone is allowed to distribute verbatim copies of this
+ license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the primary license under
+which the the LaTeX kernel and the base LaTeX packages are distributed.
+
+You may use this license for any work of which you hold the copyright
+and which you wish to distribute. This license may be particularly
+suitable if your work is TeX-related (such as a LaTeX package), but
+it is written in such a way that you can use it even if your work is
+unrelated to TeX.
+
+The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE',
+below, gives instructions, examples, and recommendations for authors
+who are considering distributing their works under this license.
+
+This license gives conditions under which a work may be distributed
+and modified, as well as conditions under which modified versions of
+that work may be distributed.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of your work
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+that work. If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex'
+and `modguide.tex' in the base LaTeX distribution for suggestions.
+
+
+DEFINITIONS
+===========
+
+In this license document the following terms are used:
+
+ `Work'
+ Any work being distributed under this License.
+
+ `Derived Work'
+ Any work that under any applicable law is derived from the Work.
+
+ `Modification'
+ Any procedure that produces a Derived Work under any applicable
+ law -- for example, the production of a file containing an
+ original file associated with the Work or a significant portion of
+ such a file, either verbatim or with modifications and/or
+ translated into another language.
+
+ `Modify'
+ To apply any procedure that produces a Derived Work under any
+ applicable law.
+
+ `Distribution'
+ Making copies of the Work available from one person to another, in
+ whole or in part. Distribution includes (but is not limited to)
+ making any electronic components of the Work accessible by
+ file transfer protocols such as FTP or HTTP or by shared file
+ systems such as Sun's Network File System (NFS).
+
+ `Compiled Work'
+ A version of the Work that has been processed into a form where it
+ is directly usable on a computer system. This processing may
+ include using installation facilities provided by the Work,
+ transformations of the Work, copying of components of the Work, or
+ other activities. Note that modification of any installation
+ facilities provided by the Work constitutes modification of the Work.
+
+ `Current Maintainer'
+ A person or persons nominated as such within the Work. If there is
+ no such explicit nomination then it is the `Copyright Holder' under
+ any applicable law.
+
+ `Base Interpreter'
+ A program or process that is normally needed for running or
+ interpreting a part or the whole of the Work.
+
+ A Base Interpreter may depend on external components but these
+ are not considered part of the Base Interpreter provided that each
+ external component clearly identifies itself whenever it is used
+ interactively. Unless explicitly specified when applying the
+ license to the Work, the only applicable Base Interpreter is a
+ `LaTeX-Format' or in the case of files belonging to the
+ `LaTeX-format' a program implementing the `TeX language'.
+
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+1. Activities other than distribution and/or modification of the Work
+are not covered by this license; they are outside its scope. In
+particular, the act of running the Work is not restricted and no
+requirements are made concerning any offers of support for the Work.
+
+2. You may distribute a complete, unmodified copy of the Work as you
+received it. Distribution of only part of the Work is considered
+modification of the Work, and no right to distribute such a Derived
+Work may be assumed under the terms of this clause.
+
+3. You may distribute a Compiled Work that has been generated from a
+complete, unmodified copy of the Work as distributed under Clause 2
+above, as long as that Compiled Work is distributed in such a way that
+the recipients may install the Compiled Work on their system exactly
+as it would have been installed if they generated a Compiled Work
+directly from the Work.
+
+4. If you are the Current Maintainer of the Work, you may, without
+restriction, modify the Work, thus creating a Derived Work. You may
+also distribute the Derived Work without restriction, including
+Compiled Works generated from the Derived Work. Derived Works
+distributed in this manner by the Current Maintainer are considered to
+be updated versions of the Work.
+
+5. If you are not the Current Maintainer of the Work, you may modify
+your copy of the Work, thus creating a Derived Work based on the Work,
+and compile this Derived Work, thus creating a Compiled Work based on
+the Derived Work.
+
+6. If you are not the Current Maintainer of the Work, you may
+distribute a Derived Work provided the following conditions are met
+for every component of the Work unless that component clearly states
+in the copyright notice that it is exempt from that condition. Only
+the Current Maintainer is allowed to add such statements of exemption
+to a component of the Work.
+
+ a. If a component of this Derived Work can be a direct replacement
+ for a component of the Work when that component is used with the
+ Base Interpreter, then, wherever this component of the Work
+ identifies itself to the user when used interactively with that
+ Base Interpreter, the replacement component of this Derived Work
+ clearly and unambiguously identifies itself as a modified version
+ of this component to the user when used interactively with that
+ Base Interpreter.
+
+ b. Every component of the Derived Work contains prominent notices
+ detailing the nature of the changes to that component, or a
+ prominent reference to another file that is distributed as part
+ of the Derived Work and that contains a complete and accurate log
+ of the changes.
+
+ c. No information in the Derived Work implies that any persons,
+ including (but not limited to) the authors of the original version
+ of the Work, provide any support, including (but not limited to)
+ the reporting and handling of errors, to recipients of the
+ Derived Work unless those persons have stated explicitly that
+ they do provide such support for the Derived Work.
+
+ d. You distribute at least one of the following with the Derived Work:
+
+ 1. A complete, unmodified copy of the Work;
+ if your distribution of a modified component is made by
+ offering access to copy the modified component from a
+ designated place, then offering equivalent access to copy
+ the Work from the same or some similar place meets this
+ condition, even though third parties are not compelled to
+ copy the Work along with the modified component;
+
+ 2. Information that is sufficient to obtain a complete,
+ unmodified copy of the Work.
+
+7. If you are not the Current Maintainer of the Work, you may
+distribute a Compiled Work generated from a Derived Work, as long as
+the Derived Work is distributed to all recipients of the Compiled
+Work, and as long as the conditions of Clause 6, above, are met with
+regard to the Derived Work.
+
+8. The conditions above are not intended to prohibit, and hence do not
+apply to, the modification, by any method, of any component so that it
+becomes identical to an updated version of that component of the Work as
+it is distributed by the Current Maintainer under Clause 4, above.
+
+9. Distribution of the Work or any Derived Work in an alternative
+format, where the Work or that Derived Work (in whole or in part) is
+then produced by applying some process to that format, does not relax or
+nullify any sections of this license as they pertain to the results of
+applying that process.
+
+10. a. A Derived Work may be distributed under a different license
+ provided that license itself honors the conditions listed in
+ Clause 6 above, in regard to the Work, though it does not have
+ to honor the rest of the conditions in this license.
+
+ b. If a Derived Work is distributed under a different license, that
+ Derived Work must provide sufficient documentation as part of
+ itself to allow each recipient of that Derived Work to honor the
+ restrictions in Clause 6 above, concerning changes from the Work.
+
+11. This license places no restrictions on works that are unrelated to
+the Work, nor does this license place any restrictions on aggregating
+such works with the Work by any means.
+
+12. Nothing in this license is intended to, or may be used to, prevent
+complete compliance by all parties with all applicable laws.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for the Work. Except when otherwise stated in
+writing, the Copyright Holder provides the Work `as is', without
+warranty of any kind, either expressed or implied, including, but not
+limited to, the implied warranties of merchantability and fitness for a
+particular purpose. The entire risk as to the quality and performance
+of the Work is with you. Should the Work prove defective, you assume
+the cost of all necessary servicing, repair, or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any author named in the components of the
+Work, or any other party who may distribute and/or modify the Work as
+permitted above, be liable to you for damages, including any general,
+special, incidental or consequential damages arising out of any use of
+the Work or out of inability to use the Work (including, but not limited
+to, loss of data, data being rendered inaccurate, or losses sustained by
+anyone as a result of any failure of the Work to operate with any other
+programs), even if the Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+MAINTENANCE OF THE WORK
+=======================
+
+The Work has the status `author-maintained' if the Copyright Holder
+explicitly and prominently states near the primary copyright notice in
+the Work that the Work can only be maintained by the Copyright Holder
+or simply that it is `author-maintained'.
+
+The Work has the status `maintained' if there is a Current Maintainer
+who has indicated in the Work that they are willing to receive error
+reports for the Work (for example, by supplying a valid e-mail
+address). It is not required for the Current Maintainer to acknowledge
+or act upon these error reports.
+
+The Work changes from status `maintained' to `unmaintained' if there
+is no Current Maintainer, or the person stated to be Current
+Maintainer of the work cannot be reached through the indicated means
+of communication for a period of six months, and there are no other
+significant signs of active maintenance.
+
+You can become the Current Maintainer of the Work by agreement with
+any existing Current Maintainer to take over this role.
+
+If the Work is unmaintained, you can become the Current Maintainer of
+the Work through the following steps:
+
+ 1. Make a reasonable attempt to trace the Current Maintainer (and
+ the Copyright Holder, if the two differ) through the means of
+ an Internet or similar search.
+
+ 2. If this search is successful, then enquire whether the Work
+ is still maintained.
+
+ a. If it is being maintained, then ask the Current Maintainer
+ to update their communication data within one month.
+
+ b. If the search is unsuccessful or no action to resume active
+ maintenance is taken by the Current Maintainer, then announce
+ within the pertinent community your intention to take over
+ maintenance. (If the Work is a LaTeX work, this could be
+ done, for example, by posting to comp.text.tex.)
+
+ 3a. If the Current Maintainer is reachable and agrees to pass
+ maintenance of the Work to you, then this takes effect
+ immediately upon announcement.
+
+ b. If the Current Maintainer is not reachable and the Copyright
+ Holder agrees that maintenance of the Work be passed to you,
+ then this takes effect immediately upon announcement.
+
+ 4. If you make an `intention announcement' as described in 2b. above
+ and after three months your intention is challenged neither by
+ the Current Maintainer nor by the Copyright Holder nor by other
+ people, then you may arrange for the Work to be changed so as
+ to name you as the (new) Current Maintainer.
+
+ 5. If the previously unreachable Current Maintainer becomes
+ reachable once more within three months of a change completed
+ under the terms of 3b) or 4), then that Current Maintainer must
+ become or remain the Current Maintainer upon request provided
+ they then update their communication data within one month.
+
+A change in the Current Maintainer does not, of itself, alter the fact
+that the Work is distributed under the LPPL license.
+
+If you become the Current Maintainer of the Work, you should
+immediately provide, within the Work, a prominent and unambiguous
+statement of your status as Current Maintainer. You should also
+announce your new status to the same pertinent community as
+in 2b) above.
+
+
+WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
+======================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+works under this license. These authors are addressed as `you' in
+this section.
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your work you want or need to use *distribution*
+conditions that differ significantly from those in this license, then
+do not refer to this license anywhere in your work but, instead,
+distribute your work under a different license. You may use the text
+of this license as a model for your own license, but your license
+should not refer to the LPPL or otherwise give the impression that
+your work is distributed under the LPPL.
+
+The document `modguide.tex' in the base LaTeX distribution explains
+the motivation behind the conditions of this license. It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate. Even if your work is
+unrelated to LaTeX, the discussion in `modguide.tex' may still be
+relevant, and authors intending to distribute their works under any
+license are encouraged to read it.
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a component of the Work, even for your own
+personal use, without also meeting the above conditions for
+distributing the modified component. While you might intend that such
+modifications will never be distributed, often this will happen by
+accident -- you may forget that you have modified that component; or
+it may not occur to you when allowing others to access the modified
+version that you are thus distributing it and violating the conditions
+of this license in ways that could have legal implications and, worse,
+cause problems for the community. It is therefore usually in your
+best interest to keep your copy of the Work identical with the public
+one. Many works provide ways to control the behavior of that work
+without altering any of its licensed components.
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the components of your work both
+an explicit copyright notice including your name and the year the work
+was authored and/or last substantially modified. Include also a
+statement that the distribution and/or modification of that
+component is constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+ %% pig.dtx
+ %% Copyright 2005 M. Y. Name
+ %
+ % This work may be distributed and/or modified under the
+ % conditions of the LaTeX Project Public License, either version 1.3
+ % 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.3 or later is part of all distributions of LaTeX
+ % version 2005/12/01 or later.
+ %
+ % This work has the LPPL maintenance status `maintained'.
+ %
+ % The Current Maintainer of this work is M. Y. Name.
+ %
+ % This work consists of the files pig.dtx and pig.ins
+ % and the derived file pig.sty.
+
+Given such a notice and statement in a file, the conditions
+given in this license document would apply, with the `Work' referring
+to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being
+generated from `pig.dtx' using `pig.ins'), the `Base Interpreter'
+referring to any `LaTeX-Format', and both `Copyright Holder' and
+`Current Maintainer' referring to the person `M. Y. Name'.
+
+If you do not want the Maintenance section of LPPL to apply to your
+Work, change `maintained' above into `author-maintained'.
+However, we recommend that you use `maintained', as the Maintenance
+section was added in order to ensure that your Work remains useful to
+the community even when you can no longer maintain and support it
+yourself.
+
+Derived Works That Are Not Replacements
+---------------------------------------
+
+Several clauses of the LPPL specify means to provide reliability and
+stability for the user community. They therefore concern themselves
+with the case that a Derived Work is intended to be used as a
+(compatible or incompatible) replacement of the original Work. If
+this is not the case (e.g., if a few lines of code are reused for a
+completely different task), then clauses 6b and 6d shall not apply.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes the Work
+
+ The LPPL requires that distributions of the Work contain all the
+ files of the Work. It is therefore important that you provide a
+ way for the licensee to determine which files constitute the Work.
+ This could, for example, be achieved by explicitly listing all the
+ files of the Work near the copyright notice of each file or by
+ using a line such as:
+
+ % This work consists of all files listed in manifest.txt.
+
+ in that place. In the absence of an unequivocal list it might be
+ impossible for the licensee to determine what is considered by you
+ to comprise the Work and, in such a case, the licensee would be
+ entitled to make reasonable conjectures as to which files comprise
+ the Work.
+
diff --git a/macros/xetex/generic/xevlna/README b/macros/xetex/generic/xevlna/README
new file mode 100644
index 0000000000..b3dc7ee3d3
--- /dev/null
+++ b/macros/xetex/generic/xevlna/README
@@ -0,0 +1,27 @@
+=============================================================================
+Package: xevlna Version 1.1 25 March 2017
+=============================================================================
+
+The purpose of the package is to insert nonbreakable spaces (in Czech vlna or
+vlnka) after nonsyllabic prepositions and single letter conjuctions directly
+while TeXing the document. The macros recognise math and verbatim by TeX
+means. Inserting nonbreakable spaces by a preprocessor may never be fully
+reliable because user defined macros and environments cannot be recognised.
+It can be used by both XeLaTeX and plain XeTeX.
+
+
+Installation:
+
+1. put xevlna.sty to the directory where both xetex and xelatex expect
+ included files, preferably texmf-dist/tex/xelatex/xevlna/
+
+2. put xevlna.pdf to a directory where texdoc looks for documentation,
+ preferably texmf-dist/doc/xevlna
+
+
+Changes:
+
+Version 1.1 reflects the increased number of character classes and is backward
+compatible with the previous versions of XeTeX.
+
+License: LPPL
diff --git a/macros/xetex/generic/xevlna/xevlna-inc.tex b/macros/xetex/generic/xevlna/xevlna-inc.tex
new file mode 100644
index 0000000000..9aa4b911f7
--- /dev/null
+++ b/macros/xetex/generic/xevlna/xevlna-inc.tex
@@ -0,0 +1,199 @@
+%% $Id: xevlna-inc.tex 535 2017-03-25 16:38:58Z zw $
+
+\ifeng
+
+\section{English manual}
+This is a manual for “vlna” implemented in \XeTeX. It can be used in plain \XeTeX\ as well as in
+\XeLaTeX.
+
+\else
+
+\section{\texorpdfstring{Český manuál}{Cesky manual}}
+Toto je manuál balíčku „vlna“ implementovaného pomocí \XeTeX u. Lze jej použít jak pro plain
+\XeTeX, tak pro \XeLaTeX.
+
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifeng
+
+\subsection{Purpose}
+The purpose of the package is to insert nonbreakable spaces (\verb:~:, in Czech \textit{vlna} or
+\textit{vlnka}) after nonsyllabic prepositions and single letter conjuctions directly while \TeX
+ing the document. The macros recognise math and verbatim by \TeX\ means. Inserting nonbreakable
+spaces by a preprocessor may never be fully reliable because user defined macros and environments
+cannot be recognised.
+
+\else
+
+\subsection{Účel}
+Tento balíček slouží ke vkládání nezlomitelných mezer (vlnek) za neslabičné předložky a
+jednopísmenné spojky přímo při \TeX ování dokumentu. Makra rozeznávají matematiku a verbatim \TeX
+ovými prostředky. Vkládání nezlomitelných mezer preprocesorem nikdy nemůže být naprosto
+spolehlivé, protože uživatelsky definovaná makra a prostředí nelze rozpoznat.
+
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifeng
+
+\subsection{Installation}
+The package consists of the following files:
+\begin{itemize}
+\item \texttt{xevlna.sty} – put it to the directory where both \texttt{xetex} and \texttt{xelatex}
+expect included files, preferably \verb;texmf-dist/tex/xelatex/xevlna/;
+\item \texttt{xevlna.pdf} – compiled manual, put it to a directory where \texttt{texdoc} looks for
+documentation, preferably \verb;texmf-dist/doc/xevlna/;
+\item \texttt{xevlna.tex}, \texttt{xevlna-inc.tex} – source files of the manual
+\end{itemize}
+
+\else
+
+\subsection{Instalace}
+Balíček se skládá z následujících souborů:
+\begin{itemize}
+\item \texttt{xevlna.sty} – uložte jej do adresáře, kde \texttt{xetex} i \texttt{xelatex}
+očekávají vkládané soubory, nejlépe \verb;texmf-dist/tex/xelatex/xevlna/;
+\item \texttt{xevlna.pdf} – zkompilovaný návod, vložte jej do adresáře, odkud \texttt{texdoc} čte
+dokumentaci, nejlépe \verb;texmf-dist/doc/xevlna/;
+\item \texttt{xevlna.tex}, \texttt{xevlna-inc.tex} – zdrojové soubory návodu
+\end{itemize}
+
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifeng
+
+\subsection{Usage in \texorpdfstring{\XeLaTeX}{XeLaTeX}}
+The package is used in \XeLaTeX\ by:
+
+\else
+
+\subsection{Použití v \texorpdfstring{\XeLaTeX u}{XeLaTeXu}}
+Balíček se použije v \XeLaTeX u:
+
+\fi
+
+\medskip
+\begin{verbatim}
+\usepackage{xevlna}
+\end{verbatim}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifeng
+
+\subsection{Usage in plain \texorpdfstring{\XeTeX}{XeTeX}}
+The package is used in plain \XeTeX\ by:
+
+\else
+
+\subsection{Použití v plain \texorpdfstring{\XeTeX u}{XeTeXu}}
+V plain \XeTeX u se balíček použije takto:
+
+\fi
+
+\medskip
+\begin{verbatim}
+\input xevlna.sty
+\end{verbatim}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifeng
+
+\subsection{Enabling and disabling}
+Insertion of nonbreakable spaces may be undesirable in some parts of a multilingual document. It
+may therefore be disabled by \cmd{xevlnaDisable} and enabled \cmd{xevlnaEnable}. Insertion is
+enabled by default.
+
+\else
+
+\subsection{Zapnutí a vypnutí vlnek}
+Vkládání vlnek může být nežádoucí v některých částech vícejazyčného dokumentu. Lze jej vypnout
+makrem \cmd{xevlnaDisable} a znovu zapnout makrem \cmd{xevlnaEnable}. Po načtení balíčku je
+vkládání vlnek zapnuto.
+
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifeng
+
+\subsection{Implementation details}
+The package makes use of the \cmd{XeTeXinterchartoks} mechanism. New classes for prepositions and
+opening punctuation are allocated by \cmd{newXeTeXintercharclass}. The nonbreakable space is
+inserted whenever a single character belonging to the preposition class is followed by a space. It
+will therefore be inserted in expression \verb;o lišce; but not in expression \verb;po lišce;. The
+preposition itself cannot be typeset in a different font because the space is not recognised in
+such a case. If \verb;\textit{i} v \textbf{lese}; is
+entered, the nonbreakable space will be inserted after \textit{v} but not after italic \textit{i}.
+The text following the preposition may be in a different script. The nonbreakable space will be
+inserted after Czech preposition \textit{v} in:
+\else
+
+\subsection{Implementační detaily}
+V balíčku je využíván mechanismus \cmd{XeTeXinterchartoks} specifický pro \XeTeX. Pomocí příkazu \cmd{newXeTeXintercharclass}
+jsou alokovány nové třídy pro předložky a otevírací interpunkci. Nezlomitelná mezera (vlnka) je
+vložena, pokud za samostatným znakem z třídy předložek následuje mezera. Bude tedy vložena do
+výrazu \verb;o lišce;, ne však do výrazu \verb;po lišce;. Předložka nesmí být sázena jiným fontem.
+Ve výrazu \verb;\textit{i} v \textbf{lese}; bude vlnka vložena za předložku \textit{v}, ale nebude
+vložena za spojku \textit{i} v kurzívě. Text po předložce může býd psán i jiným písmem. Vlnka bude
+vložena za předložkou \textit{v}~i ve výraze:
+\fi
+v दिल्ली.
+
+\ifeng
+
+The package does not use “@” in the macro names\footnote{Usage of “@” is now needed for
+recognitnion of \XeTeX\ version and hence setting the correct boundary class.} in order to make it easily usable in plain \XeTeX.
+This brings a danger of redefining internal macros by a user. The packages defines and immediatelly
+consumes \cmd{next} and makes use of these internal macros:
+
+\else
+
+Balíček nepoužívá „@“ ve jménech maker\footnote{Znak „@“ je nyní nutný pro rozpoznání verze
+\XeTeX{}u a tudíž správnému nastavení hodnoty \emph{boundary class}.}, aby bylo usnadněno použití v plain \XeTeX u. To však
+přináší nebezpečí, že bude interní makro předefinováno uživatelem. Balíček definuje a okamžitě
+použije \cmd{next} a používá tato interní makra:
+
+\fi
+
+\begin{itemize}
+\item \cmd{CSopenpunctuation}
+\item \cmd{CSnonsyllabicpreposition}
+\item \cmd{CSinterchartoks}
+\item \cmd{CSnointerchartoks}
+\item \cmd{PreCSpreposition}
+\item \cmd{ExamineCSpreposition}
+\item \cmd{ProcessCSpreposition}
+\item \cmd{xevlnaXeTeXspace}
+\end{itemize}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifeng
+\subsection{Changes}
+Version 1.1 reflects increased number of character classes and is backward compatible with older
+versions of \XeTeX.
+\else
+
+\subsection{Změny}
+Verze 1.1 bere ohled na zvýšený počet znakových tříd a je zpětně kompatibilní s předchozími verzemi
+\XeTeX u.
+\fi
+
+\ifeng
+\subsection{License}
+The package can be used and distributed according to the LaTeX Project Public License version~1.3 or later the
+text of which can be found at the \texttt{License.txt} or at
+\else
+
+\subsection{Licence}
+Balíček může být používán a šířen podle LaTeX Project Public License verze~1.3 nebo novější, jejíž text najdete
+v souboru \texttt{License.txt} nebo na
+\fi
+\url{http://www.latex-project.org/lppl.txt}
diff --git a/macros/xetex/generic/xevlna/xevlna.pdf b/macros/xetex/generic/xevlna/xevlna.pdf
new file mode 100644
index 0000000000..0e29c77086
--- /dev/null
+++ b/macros/xetex/generic/xevlna/xevlna.pdf
Binary files differ
diff --git a/macros/xetex/generic/xevlna/xevlna.sty b/macros/xetex/generic/xevlna/xevlna.sty
new file mode 100644
index 0000000000..2ef3cc02f3
--- /dev/null
+++ b/macros/xetex/generic/xevlna/xevlna.sty
@@ -0,0 +1,63 @@
+\expandafter\ifx\csname ProvidesPackage\endcsname\relax % No identification in plain XeTeX
+\else % Identification for XeLaTeX
+\ProvidesPackage{xevlna}[2016/09/05 vlna for both XeLaTeX and plain XeTeX]
+\PackageInfo{xevlna}{$Id: xevlna.sty 533 2016-09-07 00:22:25Z zw $\@gobble}
+\fi
+
+\edef\CSat{\the\catcode`\@} % in order to work in plain XeTeX
+\catcode`\@=11
+\ifdefined\e@alloc@intercharclass@top
+ \chardef\CSboundary=\e@alloc@intercharclass@top
+\else
+ \ifdefined\XeTeXinterwordspaceshaping
+ \chardef\CSboundary=4095 %
+ \def\newXeTeXintercharclass{%
+ \e@alloc\XeTeXcharclass\chardef
+ \xe@alloc@intercharclass\m@ne\@ucharclass@boundary}
+ \else
+ \chardef\CSboundary=255
+ \fi
+\fi
+\catcode`\@=\CSat
+
+\XeTeXinterchartokenstate 1
+\newXeTeXintercharclass\CSopenpunctuation
+\newXeTeXintercharclass\CSnonsyllabicpreposition
+\XeTeXcharclass`\(\CSopenpunctuation
+\XeTeXcharclass`\[\CSopenpunctuation
+\XeTeXcharclass`\„\CSopenpunctuation
+\XeTeXcharclass`\»\CSopenpunctuation
+\XeTeXcharclass`\K\CSnonsyllabicpreposition
+\XeTeXcharclass`\k\CSnonsyllabicpreposition
+\XeTeXcharclass`\S\CSnonsyllabicpreposition
+\XeTeXcharclass`\s\CSnonsyllabicpreposition
+\XeTeXcharclass`\V\CSnonsyllabicpreposition
+\XeTeXcharclass`\v\CSnonsyllabicpreposition
+\XeTeXcharclass`\Z\CSnonsyllabicpreposition
+\XeTeXcharclass`\z\CSnonsyllabicpreposition
+\XeTeXcharclass`\O\CSnonsyllabicpreposition
+\XeTeXcharclass`\o\CSnonsyllabicpreposition
+\XeTeXcharclass`\U\CSnonsyllabicpreposition
+\XeTeXcharclass`\u\CSnonsyllabicpreposition
+\XeTeXcharclass`\A\CSnonsyllabicpreposition
+\XeTeXcharclass`\a\CSnonsyllabicpreposition
+\XeTeXcharclass`\I\CSnonsyllabicpreposition
+\XeTeXcharclass`\i\CSnonsyllabicpreposition
+\XeTeXinterchartoks \CSboundary \CSnonsyllabicpreposition {\CSinterchartoks}
+\XeTeXinterchartoks \CSopenpunctuation \CSnonsyllabicpreposition {\CSinterchartoks}
+\def\CSnointerchartoks{\let\CSinterchartoks\PreCSpreposition}
+\def\PreCSpreposition{\def\next{}%
+ \ifnum\catcode`\ =10 % nothing will be done in verbatim
+ \ifmmode % nothing in math
+ \else
+ \let\CSinterchartoks\CSnointerchartoks
+ \let\next\ExamineCSpreposition
+ \fi \fi
+ \next}
+\def\ExamineCSpreposition #1{#1\futurelet\next\ProcessCSpreposition}
+\def\ProcessCSpreposition{\ifx\next\xevlnaXeTeXspace\nobreak\fi}
+\futurelet\xevlnaXeTeXspace{ }\CSnointerchartoks
+
+% Enabling and disabling
+\def\xevlnaDisable{\def\CSinterchartoks{}}
+\let\xevlnaEnable\CSnointerchartoks
diff --git a/macros/xetex/generic/xevlna/xevlna.tex b/macros/xetex/generic/xevlna/xevlna.tex
new file mode 100644
index 0000000000..a603fec214
--- /dev/null
+++ b/macros/xetex/generic/xevlna/xevlna.tex
@@ -0,0 +1,51 @@
+%% $Id: xevlna.tex 535 2017-03-25 16:38:58Z zw $
+\documentclass[12pt]{article}
+\usepackage[a4,margins=25mm,footskip=30pt,title=xevlna,author={Zdeněk Wagner},
+ keywords={vlna, XeTeX}]{zwpagelayout}
+\RequireXeTeX
+\usepackage{fontspec,polyglossia,verbatim,rotating}
+\setmainfont[Script=Devanagari,Language=Hindi]{FreeSerif}% needed for one example
+\setmonofont{FreeMono}
+\setsansfont{FreeSans}
+
+\setmainlanguage{english}
+\setotherlanguage{czech}
+
+\pagestyle{plain}
+\newif\ifeng
+
+\DeclareRobustCommand\xevlna{X\kern-.125em\lower.5ex\hbox{\csname
+ reflectbox\endcsname{E}}\kern-.0666em Vlna}
+\DeclareRobustCommand\XeTeX{X\kern-.125em\lower.5ex\hbox{\csname
+ reflectbox\endcsname{E}}\kern-.1667em\TeX}
+\DeclareRobustCommand\XeLaTeX{X\kern-.125em\lower.5ex\hbox{\csname
+ reflectbox\endcsname{E}}\LaTeX}
+
+
+\DeclareRobustCommand*\cmd[1]{\texttt{\char`\\#1}}
+\usepackage[bookmarks,bookmarksopenlevel=2,bookmarksopen]{hyperref}
+\usepackage{xevlna} % You need the egg before having the hen :-(
+\begin{document}
+\title{\textsf{\xevlna}\\Vlna implemented in \XeTeX}
+\author{Zdeněk Wagner\\\url{http://icebearsoft.euweb.cz}}
+\date{25 March 2017}
+\maketitle
+\def\contentsname{Contents\,/\,Obsah}
+\tableofcontents
+
+\clearpage
+
+\xevlnaDisable
+
+\engtrue\input{xevlna-inc}
+
+\clearpage
+
+\xevlnaEnable
+
+\begin{czech}
+\engfalse\input{xevlna-inc}
+\end{czech}
+
+\end{document}
+
diff --git a/macros/xetex/generic/zhspacing/README.md b/macros/xetex/generic/zhspacing/README.md
new file mode 100644
index 0000000000..f4e52f372d
--- /dev/null
+++ b/macros/xetex/generic/zhspacing/README.md
@@ -0,0 +1,46 @@
+zhspacing
+=========
+
+`zhspacing` is a package for typesetting CJK documents in XeTeX
+for plain TeX, LaTeX and ConTeXt.
+
+Contributing
+------------
+
+This package is a part of the [ctex-kit](https://github.com/CTeX-org/ctex-kit) project.
+
+Issues and pull requests are welcome.
+
+Copyright and Licence
+---------------------
+
+ Copyright (C) 2007--2009 by Yin Dian <yindian@gmail.com>
+ Copyright (C) 2010--2012 by Leo Liu <leoliu.pku@gmail.com>
+ Copyright (C) 2016 by Qing Lee <sobenlee@gmail.com>
+ ----------------------------------------------------------------------
+
+ This work 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. This version of this license is in
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+ and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+ and version 1.3 or later is part of all distributions of
+ LaTeX version 2005/12/01 or later.
+
+ This work has the LPPL maintenance status `maintained'.
+
+ The Current Maintainer of this work is Qing Lee.
+
+ This package consists of the files zhspacing.sty,
+ zhsmyclass.sty,
+ zhsusefulmacros.sty,
+ zhfont.sty,
+ zhmath.sty,
+ zhulem.sty,
+ t-zhspacing.tex,
+ zhs-man.tex,
+ zhspacing-context-test.tex,
+ README.md (this file),
+ and the derived files zhs-man.pdf.
diff --git a/macros/xetex/generic/zhspacing/t-zhspacing.tex b/macros/xetex/generic/zhspacing/t-zhspacing.tex
new file mode 100644
index 0000000000..ce91f7ab9a
--- /dev/null
+++ b/macros/xetex/generic/zhspacing/t-zhspacing.tex
@@ -0,0 +1,117 @@
+%D \module
+%D [ file=t-zhspacing,
+%D version=2009.05.11,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Zh-Spacing,
+%D author=Yue Wang,
+%D date=\currentdate,
+%D copyright=Yue Wang
+%D email=yuleopen@gmail.com,
+%D license=BSD]
+
+\writestatus{loading}{Context User Module / Zh-Spacing}
+\unprotect
+
+%D Macro package \type{zhspacing} was written by Yin Dian in order to
+%D typeset Simplified Chinese in \XeTeX. The macro package uses \XeTeX's
+%D inter-char token mechanism in order to support the basic Chinese
+%D typesetting rules. This macro aims to port \type{zhspacing} to Hans
+%D Hagen's \ConTeXt\ format.
+
+%D \ConTeXt\ MKII does not load unicode-letters.tex automatically
+%D when the format is dumped. What's worse, standard \ConTeXt\
+%D distribution does not have unicode-letters.tex included.
+%D So in order to define all the default \XeTeX\ character classes
+%D as in plain \TeX\ and \LaTeX, we striped the related macros
+%D from unicode-letters.tex to \type{zhspacing-unicode}.
+
+
+\def\ID #1 #2 {\set{#1}{#2}{\global\XeTeXcharclass\n=1 \global\catcode\n=11 }}
+\countdef\n=255
+\def\set#1#2#3{\n="#1 \loop #3 \ifnum\n<"#2 \advance\n by 1 \repeat}
+\def\loop#1\repeat{\def\body{#1}\iterate}
+\def\iterate{\body \let\next\iterate \else\let\next\relax\fi \next}
+\let\repeat=\fi \ID 3400 4DB5 \ID 4E00 9FC3 \ID 20000 2A6D6
+
+%D \ConTeXt\ does not have the right catcode for zhspacing.sty defined.
+%D So we should define the catcode correctly in order to load it.
+
+\catcode`\!=12
+\catcode`\@=11
+\catcode`\?=12
+
+
+%D zhspacing uses \TeX\ commands \type{\lq} and \type{\rq} in plain TeX.
+%D However, these are not defined in \ConTeXt. So we define the two macros.
+
+\def\lq{`} \def\rq{'}
+
+%D And now we can load \type{zhspacing.sty} safely.
+
+\input zhspacing.sty
+
+
+%D Last thing: we define the typescript for Adobe Chinese fonts.
+
+\starttypescript [serif] [myzhfont]
+ \definefontsynonym [Serif] [ZhSerif]
+ \definefontsynonym [SerifBold] [ZhSerifBold]
+ \definefontsynonym [SerifItalic] [ZhSerifItalic]
+ \definefontsynonym [SerifBoldItalic] [ZhSerifBoldItalic]
+\stoptypescript
+
+\starttypescript [serif] [myzhfont]
+ \definefontsynonym [ZhSerif] [name:AdobeSongStd-Light]
+ \definefontsynonym [ZhSerifBold] [name:AdobeHeitiStd-Regular]
+ \definefontsynonym [ZhSerifItalic] [name:AdobeKaitiStd-Regular]
+ \definefontsynonym [ZhSerifBoldItalic] [name:AdobeHeitiStd-Regular]
+\stoptypescript
+
+\starttypescript [sans] [myzhfont]
+ \definefontsynonym [Sans] [ZhSans]
+ \definefontsynonym [SansBold] [ZhSansBold]
+ \definefontsynonym [SansItalic] [ZhSansItalic]
+ \definefontsynonym [SansBoldItalic] [ZhSansBoldItalic]
+\stoptypescript
+
+\starttypescript [sans] [myzhfont]
+ \definefontsynonym [ZhSans] [name:AdobeKaitiStd-Regular]
+ \definefontsynonym [ZhSansBold] [name:AdobeHeitiStd-Regular]
+ \definefontsynonym [ZhSansItalic] [name:AdobeKaitiStd-Regular]
+ \definefontsynonym [ZhSansBoldItalic] [name:AdobeHeitiStd-Regular]
+\stoptypescript
+
+\starttypescript [mono] [myzhfont]
+ \definefontsynonym [Mono] [ZhMono]
+ \definefontsynonym [MonoBold] [ZhMonoBold]
+ \definefontsynonym [MonoItalic] [ZhMonoItalic]
+ \definefontsynonym [MonoBoldItalic] [ZhMonoBoldItalic]
+\stoptypescript
+
+\starttypescript [mono] [myzhfont]
+ \definefontsynonym [ZhMono] [name:AdobeFangsongStd-Regular]
+ \definefontsynonym [ZhMonoBold] [name:AdobeHeitiStd-Regular]
+ \definefontsynonym [ZhMonoItalic] [name:AdobeFangsongStd-Regular]
+ \definefontsynonym [ZhMonoBoldItalic] [name:AdobeHeitiStd-Regular]
+\stoptypescript
+
+
+\starttypescript[myzhfont]
+ \definetypeface [myzhfont] [rm] [serif] [myzhfont] [default]
+ \definetypeface [myzhfont] [ss] [sans] [myzhfont] [default]
+ \definetypeface [myzhfont] [tt] [mono] [myzhfont] [default]
+\stoptypescript
+
+\usetypescript[myzhfont]
+
+%D We set all the \type{zhxxxfont} used in \type{zhspacing.sty}.
+
+\zhspacing
+\def\zhongwen{\pushcurrentfont\myzhfont\popcurrentfont}
+\def\zhfont{\zhongwen}
+\def\zhpunctfont{\zhongwen}
+\def\zhcjkextafont{\zhongwen}
+\def\zhcjkextbfont{\zhongwen}
+
+
+\protect \ No newline at end of file
diff --git a/macros/xetex/generic/zhspacing/zhfont.sty b/macros/xetex/generic/zhspacing/zhfont.sty
new file mode 100644
index 0000000000..cc3f98d382
--- /dev/null
+++ b/macros/xetex/generic/zhspacing/zhfont.sty
@@ -0,0 +1,140 @@
+% zhfont.sty coded by YIN Dian
+% Simplify setting various font effects
+% Hist: 071204 First coded.
+% 071210 Improved. Added \newfontfamilywithslant and
+% \newfontfamilywithslantandbold to simplify setting.
+% 071211 Added fake bold support.
+% 071231 Added underdot support.
+% 080102 Minor changes on underdot. Don's use \scantokens.
+% Fixed bug of \zhfont in ulem. Added font family
+% selection and fake bold support in active hanzi.
+\NeedsTeXFormat{LaTeX2e}[1996/12/01]
+\def\filedate{2008/01/02}
+\ProvidesPackage{zhfont}[\filedate]
+\RequirePackage{zhspacing}
+\RequirePackage{zhulem}
+\newif\ifzhfont@fakebold
+\zhfont@fakeboldfalse
+\DeclareOption{fakebold}{\zhfont@fakeboldtrue}
+\ProcessOptions\relax
+
+\def\zhs@tmpmacro{}
+\def\zhs@curr@fam{-1}
+
+\zhnfsssavefont
+\g@addto@macro\zhs@savefont{%
+ \long\edef\zhs@tmpmacro{\f@family}%
+ \def\zhs@curr@fam{0}%
+ \ifx\zhs@tmpmacro\sfdefault
+ \def\zhs@curr@fam{1}%
+ \else\ifx\zhs@tmpmacro\ttdefault
+ \def\zhs@curr@fam{2}%
+ \fi\fi
+ \edef\zhs@tmpmacro{\f@family}%
+ \ifx\zhs@tmpmacro\sfdefault
+ \def\zhs@curr@fam{1}%
+ \else\ifx\zhs@tmpmacro\ttdefault
+ \def\zhs@curr@fam{2}%
+ \fi\fi
+}
+\ifzhfont@fakebold
+\def\zhfont@bx{bx}
+\g@addto@macro\zhs@savefont{%
+ \ifx\f@series\zhfont@bx
+ \special{pdf: literal direct q 0.3 w 2 Tr}%
+ \fi
+}
+\g@addto@macro\zhs@restorefont{%
+ \ifx\f@series\zhfont@bx
+ \special{pdf: literal direct 0 Tr}%
+ \fi
+}
+\fi
+
+\def\newfontfamilywithslant#1#2{%
+ \newfontfamily#1[ItalicFont=#2,ItalicFeatures={RawFeature={slant=0.17}},BoldItalicFont=#2,BoldItalicFeatures={RawFeature={slant=0.17}}]{#2}%
+}
+\def\newfontfamilywithslantandbold#1#2#3{%
+ \newfontfamily#1[BoldFont=#3,ItalicFont=#2,ItalicFeatures={RawFeature={slant=0.17}},BoldItalicFont=#3,BoldItalicFeatures={RawFeature={slant=0.17}}]{#2}%
+}
+
+\ifzhfont@fakebold
+ \newfontfamilywithslant\zhrmfont{SimSun}
+ \newfontfamilywithslant\zhsffont{SimHei}
+ \newfontfamilywithslant\zhttfont{[simfang.ttf]}
+\else
+ \newfontfamilywithslantandbold\zhrmfont{SimSun}{SimHei}
+ \newfontfamilywithslant\zhsffont{SimHei}
+ \newfontfamilywithslantandbold\zhttfont{[simfang.ttf]}{[simkai.ttf]}
+\fi
+\def\zhfont{\ifcase\zhs@curr@fam\zhrmfont\or\zhsffont\or\zhttfont\else\zhrmfont\fi}
+
+\def\setzhmainfont{\newfontfamily\zhrmfont}
+\def\setzhsansfont{\newfontfamily\zhsffont}
+\def\setzhmonofont{\newfontfamily\zhttfont}
+
+\enableactivehanzi
+\def\zhhanzihook#1{%
+ % select family
+ \long\edef\zhs@tmpmacro{\f@family}%
+ \def\zhs@curr@fam{0}%
+ \ifx\zhs@tmpmacro\sfdefault
+ \def\zhs@curr@fam{1}%
+ \else\ifx\zhs@tmpmacro\ttdefault
+ \def\zhs@curr@fam{2}%
+ \fi\fi
+ \edef\zhs@tmpmacro{\f@family}%
+ \ifx\zhs@tmpmacro\sfdefault
+ \def\zhs@curr@fam{1}%
+ \else\ifx\zhs@tmpmacro\ttdefault
+ \def\zhs@curr@fam{2}%
+ \fi\fi
+ \ifzhfont@fakebold\ifx\f@series\zhfont@bx
+ \special{pdf: literal direct q 0.3 w 2 Tr}%
+ \fi\fi
+ {\XeTeXinterchartokenstate=0\zhs@font #1}%
+ \ifzhfont@fakebold\ifx\f@series\zhfont@bx
+ \special{pdf: literal direct 0 Tr}%
+ \fi\fi
+}
+
+\def\underdot@dot{\XeTeXinterchartokenstate=0\zhpunctfont \vbox to 0.5em{\vss\hbox{·}\vss}}
+%\def\underdot@dot{\vbox to 0.5em{\vss\hbox{\bf .}\vss}}
+\newskip\underdot@skip
+\underdot@skip=2.5pt
+\def\underdot{%
+ \begingroup
+ \makehanziglobalactive
+ \def\zhhanzihook##1{%
+ \setbox0=\hbox{\underdot@dot}%
+ \leavevmode\vtop{\baselineskip=\underdot@skip\lineskiplimit=-\maxdimen
+ \advance\baselineskip\ht0
+ % select family
+ \long\edef\zhs@tmpmacro{\f@family}%
+ \def\zhs@curr@fam{0}%
+ \ifx\zhs@tmpmacro\sfdefault
+ \def\zhs@curr@fam{1}%
+ \else\ifx\zhs@tmpmacro\ttdefault
+ \def\zhs@curr@fam{2}%
+ \fi\fi
+ \edef\zhs@tmpmacro{\f@family}%
+ \ifx\zhs@tmpmacro\sfdefault
+ \def\zhs@curr@fam{1}%
+ \else\ifx\zhs@tmpmacro\ttdefault
+ \def\zhs@curr@fam{2}%
+ \fi\fi
+ \ialign{####\cr\XeTeXinterchartokenstate=0\zhs@font
+ \ifzhfont@fakebold\ifx\f@series\zhfont@bx
+ \special{pdf: literal direct q 0.3 w 2 Tr}##1%
+ \special{pdf: literal direct 0 Tr}\else ##1\fi\else ##1\fi
+ \cr\hidewidth\box0\hidewidth\cr}}%
+ }%
+ \underd@t
+}
+\def\underd@t#1{%
+ #1%
+ \makehanzigloballetter
+ \endgroup
+}
+
+\endinput
diff --git a/macros/xetex/generic/zhspacing/zhmath.sty b/macros/xetex/generic/zhspacing/zhmath.sty
new file mode 100644
index 0000000000..80a090dd84
--- /dev/null
+++ b/macros/xetex/generic/zhspacing/zhmath.sty
@@ -0,0 +1,169 @@
+% zhmath.sty coded by YIN Dian
+% Use basic CJK characters in math environment.
+% Hist: 071202 First coded.
+% 071204 Set \XeTeXinterchartokenstate=0 to avoid a XeTeX bug.
+% Added \ProvidesPackage.
+% 071210 Added another method to set Chinese math fonts in
+% LaTeX, via option noactive. Improved format detection.
+% Added ability to set alpha and number fonts.
+% 071211 Put \setalphanummathfonts in preamble so that
+% \usecustommathfonts can be used in document in LaTeX.
+% Changed \hbox to \mbox. Changed default option to
+% noactive.
+% 071215 Removed \XeTeXinterchartokenstate=0, as the XeTeX bug
+% is fixed by JK. Changed \mathcjksizec/d to fit the
+% main text size.
+% 071229 Added \XeTeXinterchartokenstate=0 again, because not
+% everyone has the latest version of XeTeX. Added custom
+% and nocustom options.
+% 2016/02/10 Improved \@setzhmathfonts.
+\catcode`\@=11
+\ifx\zhmath@defined\@undefined
+\def\zhmath@defined{\relax}
+\def\filedate{2007/12/29}
+\ifx\zhspacingrevision\@undefined
+\input zhspacing.sty
+\fi
+
+\def\zhmath@setXeTeXmathcodefam#1#2#3{%
+ % set #1..#2's math family to #3
+ \count@=#1%
+ \loop
+ \XeTeXmathcode\count@=7 #3 \count@
+ \unless\ifnum\count@>#2%
+ \advance\count@ by 1
+ \repeat
+}
+
+\def\zhmath@setactivemathchar#1#2#3#4#5#6{%
+ % set #1..#2 to active math chars, executing \mathchoice #3 #4 #5 #6.
+ \count@=#1%
+ \loop
+ \mathcode\count@="8000
+ {\catcode\count@=\active\lccode`\~=\count@
+ \lowercase{\xdef~{{\mathchoice{\noexpand#3{\number\count@}}%
+ {\noexpand#4{\number\count@}}{\noexpand#5{\number\count@}}
+ {\noexpand#6{\number\count@}}}}}%
+ }%
+ \unless\ifnum\count@>#2%
+ \advance\count@ by 1
+ \repeat
+}
+\newif\ifzhmath@active
+\newif\ifzhmath@custom
+
+\ifLaTeX@e % in LaTeX, similar to mathcjk
+
+\ProvidesPackage{zhmath}[\filedate]
+\DeclareOption{active}{\zhmath@activetrue}
+\DeclareOption{noactive}{\zhmath@activefalse}
+\DeclareOption{custom}{\zhmath@customtrue}
+\DeclareOption{nocustom}{\zhmath@customfalse}
+\zhmath@activefalse
+\zhmath@customtrue
+\ProcessOptions\relax
+
+\def\mathcjksizea{}
+\def\mathcjksizeb{}
+\def\mathcjksizec{\dimen@=\dimexpr\f@size pt*6/10\relax\fontsize{\dimen@}{\dimen@}}
+\def\mathcjksized{\dimen@=\dimexpr\f@size pt*5/10\relax\fontsize{\dimen@}{\dimen@}}
+
+\@ifundefined{zhmathfont}{\newfontfamily\zhmathfont{SimSun}}{}
+
+\ifzhmath@active
+ \def\zhmath@zhfont@disp#1{{\mbox{\XeTeXinterchartokenstate=0\zhmathfont\mathcjksizea\char#1\relax}}}
+ \def\zhmath@zhfont@text#1{{\mbox{\XeTeXinterchartokenstate=0\zhmathfont\mathcjksizeb\char#1\relax}}}
+ \def\zhmath@zhfont@scrp#1{{\mbox{\XeTeXinterchartokenstate=0\zhmathfont\mathcjksizec\char#1\relax}}}
+ \def\zhmath@zhfont@subs#1{{\mbox{\XeTeXinterchartokenstate=0\zhmathfont\mathcjksized\char#1\relax}}}
+
+ \zhmath@setactivemathchar{"2E80}{"9FFF}{\zhmath@zhfont@disp}%
+ {\zhmath@zhfont@text}{\zhmath@zhfont@scrp}{\zhmath@zhfont@subs}
+
+ \def\setzhmathfont#1{\let\zhmathfont=#1}
+\else
+ \def\setzhmathfont#1{%
+ \let\zhmathfont=#1%
+ \begingroup
+ \normalfont
+ \zhmathfont
+ \xdef\zhmath@fenc{\f@encoding}%
+ \xdef\zhmath@ffam{\f@family}%
+ \endgroup
+ \DeclareSymbolFont{hanzi}{\zhmath@fenc}{\zhmath@ffam}{m}{n}%
+ }
+ \setzhmathfont\zhmathfont
+ \zhmath@setXeTeXmathcodefam{"2E80}{"9FFF}{\symhanzi}
+\fi
+
+\ifzhmath@custom
+\def\setalphanummathfonts#1{%
+ \let\zhmathalphanumfont=#1%
+ \begingroup
+ \normalfont
+ \zhmathalphanumfont
+ \xdef\zhmath@@fenc{\f@encoding}%
+ \xdef\zhmath@@ffam{\f@family}%
+ \endgroup
+ \DeclareSymbolFont{@letter}{\zhmath@@fenc}{\zhmath@@ffam}{m}{it}%
+ \DeclareSymbolFont{@number}{\zhmath@@fenc}{\zhmath@@ffam}{m}{n}%
+ \SetSymbolFont{@letter}{bold}{\zhmath@@fenc}{\zhmath@@ffam}{bx}{it}%
+ \SetSymbolFont{@number}{bold}{\zhmath@@fenc}{\zhmath@@ffam}{bx}{n}%
+}
+\@ifundefined{zhmathalphanumfont}{\newfontfamily\zhmathalphanumfont{Times New Roman}}{}
+\setalphanummathfonts\zhmathalphanumfont
+\def\usecustommathfonts{%
+ \zhmath@setXeTeXmathcodefam{`\0}{`\9}{\sym@number}
+ \zhmath@setXeTeXmathcodefam{`\a}{`\z}{\sym@letter}
+ \zhmath@setXeTeXmathcodefam{`\A}{`\Z}{\sym@letter}
+}
+\fi
+
+\else %in plain TeX
+
+\@ifundefined{zhmathfont}{\font\zhmathfont="SimSun" at 10pt}{}
+\newfam\zhmath@fam
+\newfam\zhmath@letterfam
+\newfam\zhmath@numberfam
+
+\begingroup
+ \catcode`\A=12 %
+ \catcode`\P=12 %
+ \catcode`\T=12 %
+\lowercase{\endgroup
+ \def\@setzhmathfonts#1#2{%
+ \expandafter\@setzhmathfonts@auxi\fontname#1 AT PT\relax#2}
+ \def\@setzhmathfonts@auxi #1 AT #2PT#3\relax#4{%
+ \ifx\relax#2\relax
+ \@setzhmathfonts@auxii#4{#1}{10pt}%
+ \else
+ \@setzhmathfonts@auxii#4{#1}{#2pt}%
+ \fi}%
+}
+\def\@setzhmathfonts@auxii#1#2#3{%
+ \font\zhmath@textfont=#2 at #3 \relax
+ \font\zhmath@scriptfont=#2 at .7\dimexpr#3\relax\relax
+ \font\zhmath@scriptscriptfont=#2 at .5\dimexpr#3\relax\relax
+ \textfont#1=\zhmath@textfont
+ \scriptfont#1=\zhmath@scriptfont
+ \scriptscriptfont#1=\zhmath@scriptscriptfont}
+\def\setzhmathfont#1{\@setzhmathfonts{#1}\zhmath@fam}
+\setzhmathfont\zhmathfont
+
+\def\setalphanummathfonts#1#2{% #1: alpha, #2, num
+ \@setzhmathfonts{#1}\zhmath@letterfam
+ \@setzhmathfonts{#2}\zhmath@numberfam
+}
+
+\zhmath@setXeTeXmathcodefam{"2E80}{"9FFF}{\zhmath@fam}
+
+\def\usecustommathfonts{%
+ \@ifundefined{zhmathletterfont}{\font\zhmathletterfont="Times New Roman/I" at 10pt}{}
+ \@ifundefined{zhmathnumberfont}{\font\zhmathnumberfont="Times New Roman" at 10pt}{}
+ \setalphanummathfonts\zhmathletterfont\zhmathnumberfont
+ \zhmath@setXeTeXmathcodefam{`\0}{`\9}{\zhmath@numberfam}
+ \zhmath@setXeTeXmathcodefam{`\a}{`\z}{\zhmath@letterfam}
+ \zhmath@setXeTeXmathcodefam{`\A}{`\Z}{\zhmath@letterfam}
+}
+
+\fi % end if LaTeX
+\fi
diff --git a/macros/xetex/generic/zhspacing/zhs-man.pdf b/macros/xetex/generic/zhspacing/zhs-man.pdf
new file mode 100644
index 0000000000..195afe6284
--- /dev/null
+++ b/macros/xetex/generic/zhspacing/zhs-man.pdf
Binary files differ
diff --git a/macros/xetex/generic/zhspacing/zhs-man.tex b/macros/xetex/generic/zhspacing/zhs-man.tex
new file mode 100644
index 0000000000..57c50fa822
--- /dev/null
+++ b/macros/xetex/generic/zhspacing/zhs-man.tex
@@ -0,0 +1,534 @@
+% Hist: 070824 First document out. All but Implementation written.
+% In the evening fixed some typos.
+\documentclass[12pt]{ltxdoc}
+%\usepackage[margin=1.5in]{geometry}
+\usepackage{fontspec}
+\defaultfontfeatures{Mapping=tex-text}
+\usepackage{hologo}
+\def\eTeX{\hologo{eTeX}}
+\def\XeTeX{\hologo{XeTeX}}
+\def\XeLaTeX{\hologo{XeLaTeX}}
+\usepackage{zhspacing}
+\usepackage[fakebold]{zhfont}
+\usepackage[noactive]{zhmath}
+\usepackage{hyperref}
+\newfontfamily\zhcjkextafont{Sun-ExtA}
+\newfontfamily\zhcjkextbfont{Sun-ExtB}
+\zhspacing
+\usepackage{fancyvrb}
+\DefineVerbatimEnvironment{verbatim}{Verbatim}{baselinestretch=0.9}%,fontsize=\footnotesize}
+\usepackage{pst-all}
+\setlength\parskip{0.5em plus 0.5em minus 0.5em}
+\newcommand\q[1]{``\hbox spread -0.2em{#1}''}
+\newcommand\name[1]{\hbox{#1}}
+\newcommand\fntname[1]{\texttt{#1}}
+\newcommand\NFSS{\textsf{NFSS}}
+\newcommand\mymacro[1]{\ifvmode\noindent\else\setbox0=\lastbox\fi\llap{$\bullet$}\cmd#1\\\indent}
+\makeatletter
+\@addtoreset{section}{part}
+\makeatother
+\begin{document}
+\title{Typesetting Chinese in \XeTeX: |zhspacing| user's
+manual\thanks{Revision: \zhspacingrevision.}}
+\author{\textsc{Yin} Dian\footnote{Lab.\ of Network Comm. System \&
+Control, Univ.\ of Sci.\ \& Tech.\ of China.}}
+\date{2016/05/14}
+\maketitle
+\tableofcontents
+\newpage
+
+\part{zhspacing.sty}
+\section{Introduction}
+\XeTeX\ is a new \TeX\ engine by Jonathan Kew and SIL International, which combines
+\eTeX\ with pervasive Unicode support and advanced font support\footnote{Words
+copied from the ConTeXt Wiki.}. Using \XeTeX, it is possible to typeset scripts
+of any languages whose glyphs are contained in the font in use, without the
+help of any extra packages, such as |CJK|\footnote{|CJK| is a LaTeX 2e macro
+package which enables the use of CJK scripts (Chinese/Japanese/Korean) in
+various encodings, written by Werner Lemberg.}.
+
+However, \XeTeX\ itself does not solve all the problems. Some details in
+Chinese typesetting have not been dealt with by \XeTeX, such as the automatic
+font switch between Chinese and Western characters, the skip adjustment of
+fullwidth punctuations, the automatic skip insertion between Chinese and
+Western characters or math formulas, etc.
+
+To meet the need of easy and high quality typesetting of Chinese documents
+using \XeTeX, the package |zhspacing| is coded, utilizing the new primitive of
+\cs{XeTeXinterchartoks} provided in \XeTeX\ version 0.997.
+
+\section{Getting Started}
+|zhspacing| can be used in both plain \XeTeX\ or \XeLaTeX. The usage is quite
+straightforward. For instance, in plain \XeTeX,
+{\emptyskipscheme
+\begin{verbatim}
+ \input zhspacing.sty
+ \zhspacing
+ 这是中文测 试。中文和English的混排。中
+ 文和$E=mc^2$的混排。
+ \bye
+\end{verbatim}
+}
+And in \XeLaTeX,
+{\emptyskipscheme
+\begin{verbatim}
+ \documentclass{article}
+ \usepackage{zhspacing}
+ \zhspacing
+ \begin{document}
+ 这是中文测 试。中文和English的混排。中
+ 文和$E=mc^2$的混排。
+ \end{document}
+\end{verbatim}
+}
+Both of the examples above produce the same result as follows,
+\begin{center}
+这是中文测 试。中文和English的混排。中
+文和$E=mc^2$的混排。
+\end{center}
+
+As you can see, spaces after Chinese characters are always ignored. Moreover, a
+noticable skip is inserted between Chinese characters and English characters as
+well as math formulas. In fact, all of the following inputs can produce mixed
+langauge output with skip automatically inserted between Chinese and English
+characters,
+\begin{center}
+\emptyskipscheme |中Eng文|,\quad |中 Eng文|,\quad |中Eng 文|\quad and\quad |中 Eng 文|.
+\end{center}
+And their corresponding output is,
+\begin{center}
+中Eng文,\quad 中 Eng文,\quad 中Eng 文\quad and\quad 中 Eng 文.
+\end{center}
+
+Look close and you'll find, that the first and second input generates exactly
+the same output, and so does the third and fourth. However, the skip between
+|Eng| and |文| in the last two cases is wider than the skip between |中| and
+|Eng|. That is because the space is produced by the space token after the
+letter |g|, not the skip automatically inserted by |zhspacing|'s skip
+mechanism.
+
+The space ignoring and skip auto-inserting ability of |zhspacing| can make
+writing documents much comfortable. You don't need to worry about the manual
+insertion of skips such as adding the annoying |~| in |CJK|.
+
+Now come to the topic of punctuation skip adjustment. Proper Chinese
+typesetting requires consecutive fullwidth punctuations be compressed, and a
+linebreak before or after a fullwidth punctuation will cut off the blank spaces
+of this punctuation, making it align to the margin. |zhspacing| does have
+solved these problems, as well as proper prohibitions(禁则). Here's an example.
+\begin{center}
+\begin{minipage}{21em}
+他强调,“三个代表”重要思想是在新的历史条件下运用马克思主义的立场、观点和方法的
+典范,是我们学习马克思主义的立场、观点和方法最现实、最生动的教材。“三个代表”
+重要思想是与时俱进的理论。
+\end{minipage}
+\end{center}
+
+\section{Advanced Usage}
+\subsection{Fonts}
+|zhspacing| uses an extensible way of selecting fonts. The rules can be
+summarized as follows,
+\begin{itemize}
+ \item Western characters, i.e.\ those that are not CJKV ideographies nor
+ CJKV punctuations, use the same font as default.
+ \item Chinese characters use seperate fonts. Font changes in the
+ document does not affect the font used to display Chinese,
+ unless you are using \NFSS\ and change the font series or shape.
+ \item On displaying basic Chinese ideographies, execute the command
+ \cs{zhfont}.
+ \item On displaying Chinese punctuations, execute the command
+ \cs{zhpunctfont}.
+ \item On displaying CJK Ext-A characters, execute the command
+ \cs{zhcjkextafont}.
+ \item On displaying CJK Ext-B characters, execute the command
+ \cs{zhcjkextbfont}.
+ \item When switching from non-Chinese characters to Chinese characters,
+ execute \cs{zhs@savefont}. When switching back, execute
+ \cs{zhs@restorefont}.
+\end{itemize}
+
+When importing |zhspacing| from plain \XeTeX, the default definitions of the
+above commands are,
+\begin{verbatim}
+ \font\zhfont="SimSun" at 10pt
+ \font\zhpunctfont="SimSun" at 10pt
+ \def\zhcjkextafont{\message{CJK Ext-A}}
+ \def\zhcjkextbfont{\message{CJK Ext-B}}
+ \let\zhs@savefont=\begingroup
+ \let\zhs@restorefont=\endgroup
+\end{verbatim}
+
+When imported from \XeLaTeX, the defaults are,
+\begin{verbatim}
+ \newfontfamily\zhfont[BoldFont=SimHei]{SimSun}
+ \newfontfamily\zhpunctfont{SimSun}
+ \def\zhcjkextafont{\message{CJK Ext-A}}
+ \def\zhcjkextbfont{\message{CJK Ext-B}}
+ \def\zhs@savefont{\zhs@savef@nt{old}}
+ \def\zhs@restorefont{\zhs@restoref@nt{old}}
+\end{verbatim}
+Here \cs{zhs@savef@nt} and \cs{zhs@restoref@nt} are internal macros to save and
+restore the \NFSS\ info of the current font to specified places.
+
+CJK Ext-A/B fonts have not been defined by default in consideration that not
+every user has installed the particular fonts. I recommend to use
+\fntname{Sun-ExtA} and \fntname{Sun-ExtB} as the corresponding fonts. You can
+define the ext-font macros manually in a similar way to the definition of
+\cs{zhfont}.
+
+An example of mixed typesetting of various classes of characters is as follows,
+cited from \emph{The Tale of Kiều}\footnote{《金云翘传》,or \emph{Truyện Kiều},
+a Vietnamese \emph{lục bát} poem written in \emph{chữ Nôm}. \emph{Chữ Nôm} is
+a system of ideographies created by the Vietnamese laboring people, most of
+which are encoded in CJK Ext-A\hskip -0.2em/B area, or not even included in
+Unicode.}.
+\begin{center}
+\parbox{21em}{
+\fontspec{Times New Roman}
+𤾓𢆥𥪝𡎝𠊛些
+Trăm năm, trong cõi người ta,
+𡨸才𡨸命𡑛罗恄𠑬
+Chữ tài, chữ mệnh, khéo là ghét nhau.
+𣦆戈𠬠局𣷭橷
+Trải qua một cuộc bể dâu,
+仍條𥉩𧡊𦓡𤴬疸𢚸
+Những điều trông thấy mà đau đớn lòng.
+\footnotemark
+}
+\end{center}
+\footnotetext{Some of the ideographies are replaced by similar characters due
+to the limitation of character set. A picture of the original manuscript can be found at
+\href{http://bbs.gophor.cn/cjkv/attachment/14_2_b44e05d28a68271.jpg}{\emph{this
+link}}.}% or Fig.~\ref{fig:kieu}.}
+\subsection{More on Fonts}
+Sometimes it may be desirable to use different Chinese fonts for different
+\NFSS\ font families in \LaTeX. This can be done by changing the definition of
+\cs{zhs@savefont} and \cs{zhfont}, without modifying the |zhspacing| source.
+
+Here is the way to do it.\footnote{See zhfont.sty later for convenient ways.}
+\begin{verbatim}
+\makeatletter
+\g@addto@macro\zhs@savefont{%
+ \long\edef\zhs@tmpmacro{\f@family}%
+ \def\zhs@curr@fam{0}%
+ \ifx\zhs@tmpmacro\sfdefault
+ \def\zhs@curr@fam{1}%
+ \else\ifx\zhs@tmpmacro\ttdefault
+ \def\zhs@curr@fam{2}%
+ \fi\fi
+ \edef\zhs@tmpmacro{\f@family}%
+ \ifx\zhs@tmpmacro\sfdefault
+ \def\zhs@curr@fam{1}%
+ \else\ifx\zhs@tmpmacro\ttdefault
+ \def\zhs@curr@fam{2}%
+ \fi\fi
+}
+\newfontfamily\zhrmfont[BoldFont=SimHei,
+ ItalicFont=KaiTi]{SimSun}
+\newfontfamily\zhsffont{SimHei}
+\newfontfamily\zhttfont[BoldFont=SimHei]{KaiTi}
+\def\zhfont{\ifcase\zhs@curr@fam\zhrmfont\or\zhsffont
+ \or\zhttfont\else\zhrmfont\fi}
+\end{verbatim}
+\subsection{Skips}
+The skip mechanism in |zhspacing| is also flexible. |zhspacing| utilizes the
+following skip commands. Note that they are defined as macros instead of skip
+register values, in order that the skip varies according to font size changes.
+\begin{description}
+ \item[\mdseries\cs{skipzh}]
+ Skip between adjacent Chinese characters.
+ \item[\mdseries\cs{skipenzh}]
+ Skip between a Chinese character and a Western character or a
+ math formula.
+ \item[\mdseries\cs{skipzhopen}]
+ Skip before fullwidth opening punctuations, such as \q{“},
+ \q{(}, \q{《}, etc.
+ \item[\mdseries\cs{skipzhinteropen}]
+ Skip before a fullwidth opening punctuation when preceded by
+ another fullwidth punctuation.
+ \item[\mdseries\cs{skipzhlinestartopen}]
+ Skip before a fullwidth opening punctuation when it occurs at
+ the start of a line.
+ \item[\mdseries\cs{skipzhclose}]
+ Skip after fullwidth closing punctuations, such as \q{”},
+ \q{)}, \q{》}, etc.
+ \item[\mdseries\cs{skipzhinterclose}]
+ Skip after a fullwidth closing punctuation when followed by
+ another fullwidth punctuation.
+ \item[\mdseries\cs{skipzhlineendclose}]
+ Skip after a fullwidth closing punctuation when it occurs at
+ the end of a line.
+ \item[\mdseries\cs{skipzhfullstop}]
+ Skip after fullwidth fullstop punctuations, such as \q{;},
+ \q{.}, \q{。}, etc.
+ \item[\mdseries\cs{skipzhinterfullstop}]
+ Skip after a fullwidth fullstop punctuation when followed by
+ another fullwidth punctuation.
+ \item[\mdseries\cs{skipzhlineendfullstop}]
+ Skip after a fullwidth fullstop punctuation when it occurs at
+ the end of a line.
+ \item[\mdseries\cs{skipzhhalfstop}]
+ Skip after fullwidth halfstop punctuations, such as \q{、},
+ \q{,}, \q{:}, etc.
+ \item[\mdseries\cs{skipzhinterhalfstop}]
+ Skip after a fullwidth halfstop punctuation when followed by
+ another fullwidth punctuation.
+ \item[\mdseries\cs{skipzhlineendhalfstop}]
+ Skip after a fullwidth halfstop punctuation when it occurs at
+ the end of a line.
+ \item[\mdseries\cs{skipnegzhlinestartopen}]
+ Negative skip to \cs{skipzhlinestartopen}.
+ \item[\mdseries\cs{skipnegzhlineendclose}]
+ Negative skip to \cs{skipzhlineendclose}.
+ \item[\mdseries\cs{skipnegzhlineendfullstop}]
+ Negative skip to \cs{skipzhlineendfullstop}.
+ \item[\mdseries\cs{skipnegzhlineendhalfstop}]
+ Negative skip to \cs{skipzhlineendhalfstop}.
+\end{description}
+
+All of the skip commands above are defined in the pattern \\
+\vadjust{}\hfil |\def\skipxxx{\hskip xxxxx}|.
+
+|zhspacing| comes with three pre-defined skip schemes, namely
+\cs{simsunskipscheme}, \cs{emptyskipscheme} and \cs{haltskipscheme}. The
+first scheme should be suitable for font \fntname{SimSun} and other popular
+Chinese fonts used in China, which does not support OpenType features of
+|halt|, and needs negative spaces be inserted before opening punctuations and
+after closing or judou punctuations. The second scheme simply addes zero
+length. And the last one should be fit for OpenType Chinese fonts supporting
+|halt| feature such as Adobe Song Std, where positive spaces should be inserted
+before or after certain punctuations. You can define your own skip schemes for
+customization, of course.
+\subsection{Vertical Chinese}
+Vertical Chinese can be achieved by adding raw feature |vertical| to the
+specified font. An example could be, \hfil
+\setbox0=\hbox to 0pt{\vbox{\noindent
+\newfontlanguage{Chinese}{CHN}
+\newfontfamily\zhfont[Script=CJK,Language=Chinese,Vertical=RotatedGlyphs,
+ BoldFont=SimHei]{SimSun}
+\let\zhpunctfont\zhfont
+\haltskipscheme
+\rotatebox{-90}{\fbox{\raise 0.8em\hbox{我是中国人,我爱自己的祖国。}}}
+}\hss}
+\dp0=0pt \raise 0.8em\box0
+
+\begin{verbatim}
+ \documentclass[12pt]{article}
+ \usepackage{graphicx}
+ \usepackage{zhspacing}
+ \newfontlanguage{Chinese}{CHN}
+ \newfontfamily\zhfont[
+ Script=CJK, Language=Chinese,
+ Vertical=RotatedGlyphs]{SimSun}
+ \let\zhpunctfont\zhfont
+ \haltskipscheme
+ \zhspacing
+ \begin{document}
+ \rotatebox{-90}{我是中国人,我爱自己的祖国。}
+ \end{document}
+\end{verbatim}
+
+Note that in this example, in order to have proper vertical punctuations, we
+set \cs{zhpunctfont} to use the Adobe one supporting |vert| feature, and change
+the skip scheme to \cs{haltskipscheme} to match the |vhal| feature specified.
+
+However, there exists some bug in typesetting vertical Chinese containing
+punctuations using some fonts such as \fntname{KaiTi\_GB2312} etc. I've told
+this bug to \name{jjgod} in May, but it seems that he hasn't solved the problem
+yet. Moreover, the baseline of vertical Chinese is not correct, so mixed
+typesetting of Chinese and English in vertical mode generates ugly results, and
+thus should be avoided.
+\subsection{Compatibility}
+Theoretically, |zhspacing| should be compatible with all macro packages, except
+those who change the definition of \cs{hskip} and \cs{penalty}, in which case
+special treatment should be applied. I haven't found any conflict when using
+common packages such as |hyperref| and |fancyhdr|. However, |ulem| redefineds
+\cs{hskip} and \cs{penalty}, and causes unexpected output\footnote{I was using
+\cs{begingroup} and \cs{endgroup} as the font saving/restoring commands.
+However, I found |ulem| redefines \cs{hskip} and \cs{penalty} to end the
+current hbox group and start a new hbox, and thus group mismatch occurs. So I
+changed the font saving/restoring commands when used in \LaTeX, using \NFSS\ info
+instead of groups. But in the new hbox group, no Chinese font is applied by
+default so the Chinese characters disappears. Therefore I changed the
+definitions of |ulem|'s new \cs{hskip} and \cs{penalty} in |zhulem|, and advice
+users to use this modified one.}. Use |zhulem| provided along with
+|zhspacing| instead.
+
+|zhspacing| may be not compatible with macro packages which use
+\cs{XeTeXinterchartoks} faculty. For example, the |polyglossia| package (some
+languages).
+
+\subsection{Working with other Chinese package}
+
+|zhspacing| is not compatible with |xeCJK|. The latter can be only used in
+\LaTeX\ format. |zhspacing| is now supposed to be mainly used in Plain \TeX\
+format; in \LaTeX, |xeCJK| is a better choice.
+
+The |ctex| package, made by \href{http://www.ctex.org}{|ctex.org|}, is a widely
+used Chinese document framework which hides the underlying Chinese processing
+details to the user, which enables portability between different Chinese
+processing packages or systems. New version of |ctex| package supports \XeTeX\
+through |xeCJK| package, |zhspacing| is not necessary.
+
+To use |zhspacing| in |cxetex|, a slight modification of the file |ctexcjk.clo|
+should be made. Change the corresponding lines to the followes (\% means the
+original lines).
+\begin{verbatim}
+%\XeTeXlinebreaklocale "zh"
+%\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt
+%\setmainfont[BoldFont={cwTeXHeiBold},
+% ItalicFont={cwTeXKaiItalic},
+% Mapping=tex-text]{cwTeXMing}
+%\setsansfont[BoldFont={cwTeXHeiBold},Mapping=tex-text]{cwTeXYen}
+%\setmonofont{cwTeXFangSongTT}
+\usepackage{zhspacing}
+\newfontfamily\zhfont[BoldFont=SimHei]{SimSun}
+\newfontfamily\zhcjkextafont{Sun-ExtA}
+\newfontfamily\zhcjkextbfont{Sun-ExtB}
+\zhspacing
+\end{verbatim}
+
+You can surely change these lines to your own taste.
+
+\section{Getting \texttt{zhspacing}}
+
+You can get latest stable version of |zhspacing| on CTAN.
+
+|zhspacing| was hosted on an open-source project at googlecode. The old project
+homepage is \url{http://code.google.com/p/zhspacing/}.
+
+Now |zhspacing| is part of |ctex-kit| project (\url{https://github.com/CTeX-org/ctex-kit/}).
+You can get the lastest source via Git.
+
+\goodbreak
+\part{zhfont.sty}
+\section{Introduction}
+To simplify the complex font setting to use \NFSS\ in \LaTeX, the package
+|zhfont| is coded. It also adds simple interface to define fonts with fake
+slant, and also supports fake bold.
+\section{Package Options}
+|zhfont| currently has only one option --- |fakebold|. This option sets
+Chinese show fake boldface when the current series is bold.
+\section{Provided Macros}
+\mymacro\zhrmfont
+\mymacro\zhsffont
+\mymacro\zhttfont
+The font commands to be executed according to the current font family.
+You can redefine them to customize your fonts.
+
+\mymacro\setzhmainfont
+\mymacro\setzhsansfont
+\mymacro\setzhmonofont
+Simply macro to set \cs{zh\{rm/sf/tt\}font} using \cs{newfontfamily}.
+
+\mymacro\newfontfamilywithslant
+Create a font family with fake slant. Take one argument as the font name.
+
+Example: |\newfontfamilywithslant\zhrmfont{SimSun}|
+
+\mymacro\newfontfamilywithslantandbold
+Create a font family with fake slant, and specify another font for its
+boldface. Take two arguments as the font name and bold font name.
+
+Example:\\\quad |\newfontfamilywithslantandbold\zhrmfont{SimSun}{SimHei}|
+\section{Examples}
+The following example is generated with |zhfont| loaded with option
+|fakebold|.
+
+{\emptyskipscheme
+\begin{verbatim}
+\newfontfamilywithslant\zhrmfont{SimSun}
+中文\textbf{测试}。\textit{中文\textbf{测试}。}
+\newfontfamilywithslant\zhrmfont{FangSong}
+中文\textbf{测试}。\textit{中文\textbf{测试}。}
+\end{verbatim}
+}
+\nobreak
+{
+\newfontfamilywithslant\zhrmfont{SimSun}
+中文\textbf{测试}。\textit{中文\textbf{测试}。}
+\newfontfamilywithslant\zhrmfont{FangSong}
+中文\textbf{测试}。\textit{中文\textbf{测试}。}
+}
+\goodbreak
+
+\part{zhmath.sty}
+\section{Introduction}
+|zhmath| is a generic package which allows the Chinese characters to be
+displayed in math formulas. It also allows changing the math font for alphas
+and numbers.
+
+|zhmath| only sets the basic Chinese characters to be displayable, not CJK
+Ext-A/B ones, as they are seldom used and discouraged in math. You can use
+\cs{hbox} to let |zhspacing| display them, however.
+\section{Package Options}
+In \LaTeX, |zhmath| has two options --- |active| and |noactive|. They set the
+method to implement Chinese character displaying in math. The default is
+|noactive|.
+
+When |active| is set, the Chinese characters in math formulas are set to
+active, which, when executed, display the corresponding characters in
+\cs{zhmathfont}. This behavior is much like that of the package |mathcjk|. The
+font size in different styles are also set in \cs{mathcjksizea}/|b|/|c|/|d|.
+
+When |noactive| is set, the mathcodes of Chinese characters are set to use a
+special math font family to display them. This way is more native than to use
+active characters.
+
+Both |active| and |noactive| have disadvantages. In |active| mode the Chinese
+math font sizes are determined by \cs{mathcjksizea}/|b|/|c|/|d|, so they are
+somewhat independent with the main text size, which means their size cannot
+change when the main font size changes, which gives ugly results. However, in
+|noactive| mode, although Chinese math font size varies with the main font
+size, Chinese inside \cs{mathrm} etc cannot be displayed, because the math
+font family are set to \cs{mathrm}'s. So choose the option to your own need.
+
+In plain \TeX\ no package options are available.
+\section{Provided Macros}
+\mymacro\setzhmathfont
+Set the math font used to display Chinese. Take one argument as the font
+command. Preamble only.
+
+\mymacro\zhmathfont
+The font command which determines the math font for Chinese. However, if you
+use |noactive| option in \LaTeX, or you're in plain \TeX, they are not
+executed when Chinese in math occur, but when \cs{setzhmathfont} is invoked.
+So you should always call |\setzhmathfont\zhmathfont| after the change.
+
+\mymacro\usecustommathfonts
+Enable the use of custom math fonts for alphas and numbers. The default is
+Times New Roman.
+
+\mymacro\setalphanummathfonts
+Set the math font used to display alphas and numbers. Preamble only. Take one
+argument as the font family in \LaTeX, and two argument as the font command
+for alphas and numbers accordingly in plain \TeX.
+
+\mymacro\zhmathalphanumfont
+The font command which determines the math font for alphas and numbers in
+\LaTeX. Should always call |\setalphanummathfonts\zhmathalphanumfont| after
+it changes.
+
+\mymacro\zhmathletterfont
+\mymacro\zhmathnumberfont
+The font command which determines the math font for alphas and numbers in plain
+\TeX. After their change \cs{setalphanummathfonts} with corresponding
+arguments should be called.
+\section{Examples}
+{\emptyskipscheme
+\begin{verbatim}
+{
+$中文 in math 测_试$
+\usecustommathfonts
+\Large $能量E = mc^2$, $s_总 = {1 \over 2} at^2$
+}
+\end{verbatim}
+}
+\nobreak
+{
+$中文 in math 测_试$
+\usecustommathfonts
+\Large $能量E = mc^2$, $s_总 = {1 \over 2} at^2$
+}
+\goodbreak
+\end{document}
diff --git a/macros/xetex/generic/zhspacing/zhsmyclass.sty b/macros/xetex/generic/zhspacing/zhsmyclass.sty
new file mode 100644
index 0000000000..4633ee1059
--- /dev/null
+++ b/macros/xetex/generic/zhspacing/zhsmyclass.sty
@@ -0,0 +1,151 @@
+% zhsmyclass.sty coded by YIN Dian
+% Implement easy inter-class token definition with inheritance
+% Hist: 070807 First usable version coded. \newclass, \{set,get,prepend,append}interclasstoks
+% The tricky part is prepending stuffs to a token register, see TeX by Topics.
+% 070808 Added \setclassnum and \registerXeTeXclasstoks
+% 070809 Removed unnecessary \global's.
+% 070810 Only register non-empty tokens.
+% 071019 Added \getclassnum
+% 071210 Changed \@foreach to \@for.
+\catcode`\@=11
+\ifx\@myclass@defined\@undefined\else
+ \expandafter\endinput
+\fi
+\def\@myclass@defined{\relax}
+\input zhsusefulmacros.sty
+\catcode`\@=11
+\def\@class@list{}
+\def\newclass{\@ifnextchar[{\@newclass@param}{\@newclass}}
+\def\@newclass@param[#1]#2{%
+ \if!#1!
+ \errmessage{Base class name shouldn't be empty.}%
+ \fi
+ \if!#2!
+ \errmessage{Class name shouldn't be empty.}%
+ \fi
+ \@ifundefined{@@classname@#1}{%
+ \errmessage{Base class not defined yet.}%
+ }{}%
+ \@ifundefined{@@classname@#2}{% if
+ \@namedef{@@classname@#2}{\relax}%
+ \@namedef{@@baseclass@#2}{#1}%
+ \@for\@@class:=\@class@list\do{% for
+ \if!\@@class!
+ \else
+ \@newinterclasstoks{#2}{\@@class}%
+ \@newinterclasstoks{\@@class}{#2}%
+ %\setinterclasstoks{#2}{\@@class}{\getinterclasstoks{#1}{\@@class}}%
+ %\setinterclasstoks{\@@class}{#2}{\getinterclasstoks{\@@class}{#1}}%
+ \copyinterclasstoks{#2}{\@@class}{#1}{\@@class}%
+ \copyinterclasstoks{\@@class}{#2}{\@@class}{#1}%
+ \fi
+ }% end for
+ \@newinterclasstoks{#2}{#2}%
+ \edef\@class@list{\@class@list,#2}%
+ }{% else
+ \errmessage{Class already defined.}%
+ }% end if
+}
+\def\@newclass#1{%
+ \if!#1!
+ \errmessage{Class name shouldn't be empty.}%
+ \fi
+ \@ifundefined{@@classname@#1}{% if
+ \@namedef{@@classname@#1}{\relax}%
+ \@for\@@class:=\@class@list\do{% for
+ \if!\@@class!
+ \else
+ \@newinterclasstoks{#1}{\@@class}%
+ \@newinterclasstoks{\@@class}{#1}%
+ \fi
+ }% end for
+ \@newinterclasstoks{#1}{#1}%
+ \edef\@class@list{\@class@list,#1}%
+ }{% else
+ \errmessage{Class already defined.}%
+ }% end if
+}
+\def\getbaseclass#1#2{%
+ \@ifundefined{@@baseclass@#1}{\def#2{}}{\edef#2{\csname @@baseclass@#1\endcsname}}%
+}
+\def\@newinterclasstoks#1#2{%
+ \csname newtoks\expandafter\endcsname\csname @@interclasstoks@#1@#2\endcsname
+ \csname @@interclasstoks@#1@#2\endcsname={}%\meaning #1, \meaning #2}%
+ %%\expandafter\gdef\csname @@interclasstoks@#1@#2\endcsname{}%
+}
+\def\setinterclasstoks#1#2#3{%
+ \csname @@interclasstoks@#1@#2\endcsname={#3}%
+ %%\expandafter\edef\csname @@interclasstoks@#1@#2\endcsname{#3}%
+}
+\def\getinterclasstoks#1#2{%
+ \expandafter\the\csname @@interclasstoks@#1@#2\endcsname
+ %%\csname @@interclasstoks@#1@#2\endcsname
+}
+\def\copyinterclasstoks#1#2#3#4{% (#1, #2) <- (#3, #4)
+ \expandafter\csname @@interclasstoks@#1@#2\endcsname\expandafter{\expandafter\the\csname @@interclasstoks@#3@#4\endcsname}%
+}
+\def\prependinterclasstoks#1#2#3{%
+ \toks0={#3}%
+ \edef\@@prepend@act{\csname @@interclasstoks@#1@#2\endcsname={\the\toks0
+ \expandafter\the\csname @@interclasstoks@#1@#2\endcsname}}%
+ \@@prepend@act
+ %%\expandafter\edef\csname @@interclasstoks@#1@#2\endcsname{#3\csname @@interclasstoks@#1@#2\endcsname}%
+}
+\def\appendinterclasstoks#1#2#3{%
+ \expandafter\csname @@interclasstoks@#1@#2\endcsname\expandafter{\the\csname @@interclasstoks@#1@#2\endcsname #3}%
+ %%\global\expandafter\edef\csname @@interclasstoks@#1@#2\endcsname{\csname @@interclasstoks@#1@#2\endcsname #3}%
+}
+\def\showallinterclasstoks{%
+ \par
+ \begingroup
+ \@for\class:=\@class@list\do{%
+ \if!\class!
+ \else
+ \@for\anotherclass:=\@class@list\do{%
+ \if!\anotherclass!
+ \else
+ [\class, \anotherclass]: %\csname @@interclasstoks@\class @\anotherclass\endcsname
+ \expandafter\the\csname @@interclasstoks@\class @\anotherclass\endcsname
+ \hfil\break
+ \fi
+ }%
+ \fi
+ }%
+ \endgroup
+}
+\newlinechar`\^^J
+\def\setclassnum#1#2{%
+ \expandafter\chardef\csname @@classnum@#1\endcsname=#2\relax
+}
+\def\getclassnum#1{%
+ \csname @@classnum@#1\endcsname
+}
+\def\mydbgmessag@#1{}
+\def\registerXeTeXclasstoks{%
+ \@for\class:=\@class@list\do{%
+ \@ifundefined{@@classnum@\class}{}{%
+ \@for\anotherclass:=\@class@list\do{%
+ \@ifundefined{@@classnum@\anotherclass}{}{%
+ \edef\@@temp@macro{\the\csname @@interclasstoks@\class @\anotherclass\endcsname}%
+ \ifx\@@temp@macro\empty
+ \else
+ \edef\@@temp@macro{\@@temp@macro}%
+ \ifx\@@temp@macro\empty
+ \else
+ \edef\@@register@act{\noexpand\XeTeXinterchartoks\csname @@classnum@\class\endcsname
+ \csname @@classnum@\anotherclass\endcsname\noexpand{\expandafter\the\csname
+ @@interclasstoks@\class @\anotherclass\endcsname\noexpand}}%
+ \@@register@act
+ \edef\@@register@act{\noexpand\mydbgmessag@\noexpand{Registered (\expandafter\number
+ \csname @@classnum@\class\endcsname, \expandafter\number
+ \csname @@classnum@\anotherclass\endcsname)\noexpand}}%
+ \@@register@act
+ \mydbgmessag@{Registered (\class, \anotherclass) token: \expandafter\the\csname
+ @@interclasstoks@\class @\anotherclass\endcsname ^^J}%
+ \fi
+ \fi
+ }%
+ }%
+ }%
+ }%
+}
diff --git a/macros/xetex/generic/zhspacing/zhspacing-context-test.tex b/macros/xetex/generic/zhspacing/zhspacing-context-test.tex
new file mode 100644
index 0000000000..1f6c528d25
--- /dev/null
+++ b/macros/xetex/generic/zhspacing/zhspacing-context-test.tex
@@ -0,0 +1,45 @@
+\usemodule[zhspacing]
+
+
+这是中文测试。中文和English的混排。中
+文和$E=mc^2$的混排。
+
+九齿钉耙学名上宝沁晶耙,是俺的武器。九齿钉耙并非普通的农具,而是由
+太上老君\footnote{太上老君,三清之第三位。又称“道德天尊”、
+“混元老君”、“降生天尊”、“太清大帝”等。}用神冰铁亲自锤炼,借五方五
+帝、六丁六甲之力锻造而成,有诗为证:
+
+九齿钉耙学名上宝沁晶耙,是俺的武器。九齿钉耙并非普通的农具,而是由
+太上老君\footnote{太上老君,三清之第三位。又称“道德天尊”、
+“混元老君”、“降生天尊”、“太清大帝”等。}用神冰铁亲自锤炼,借五方五
+帝、六丁六甲之力锻造而成,有诗为证:
+
+\rm\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps
+
+\ss\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps
+
+\tt\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps
+
+\blank
+
+\rm\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par
+\rm\it 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par
+\rm\bf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par
+\rm\bi 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par
+
+\blank
+
+\ss\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par
+\ss\it 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par
+\ss\bf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par
+\ss\bi 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par
+
+\blank
+
+\tt\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par
+\tt\it 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par
+\tt\bf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par
+\tt\bi 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par
+
+
+\bye \ No newline at end of file
diff --git a/macros/xetex/generic/zhspacing/zhspacing.sty b/macros/xetex/generic/zhspacing/zhspacing.sty
new file mode 100644
index 0000000000..0c2826d5e8
--- /dev/null
+++ b/macros/xetex/generic/zhspacing/zhspacing.sty
@@ -0,0 +1,854 @@
+% zhspacing.sty version 3.5
+% Simple macro for typesetting mixed Chinese documents in XeTeX
+% with punctuation space adjustment and prohibitions
+% coded by YIN Dian (yindian@ustc)
+% Licensed under GPL
+% History: 070804 First usable version.
+% 070805 Several line breaking bug fixes.
+% 070807 \zhinteropenskip changed to 0.6em. \enfont
+% TODO list written.
+% 070808 Use macros instead of skips to fit different font size.
+% 070809 Tried to use myclass to manage classes, but failed.
+% Then I found it works when \relax is added.
+% 070810 Changed skip parameters. Removed \relax, only register
+% non-empty tokens instead. Now it seems to work right.
+% Several bugs fixed. CJK Ext-A/B support added.
+% Added three skip schemes.
+% 070812 Fixed font switch bug between CJK Ext-A and Ext-B chars.
+% Obsoleted the use of \enfont.
+% 070822 Fixed bug of unbalanced group when using ulem? Cleared
+% XeTeX's pre-defined inter-char tokens. Use seperate
+% font for punctuations.
+% Deprecated the use of begin/end-groups in LaTeX, in
+% order to work properly with ulem. Coded zhulem.sty.
+% 070823 Use more flexible way to save font. Changed space
+% ignoring mechanism after hanzi to allow \skipenzh added
+% between hanzi and boundary if the next non-space token
+% is a char and is not fullwidth nor in PUA.
+% 070824 Enabled automatic skip between math formulas and CJK
+% chars. Changed skip schemes. Added \zhspacingrevision.
+% 071008 Fixed bug of missing \skipzh when hanzi next to space.
+% Found bug of \zhs@skipspaces --- \iffalse error.
+% Found bug?? in 10pt article:
+% \fbox{\vbox{\hsize=12.2001pt\scriptsize \parindent=0pt
+% \parskip=0pt《口口》口:“}}
+% 071014 Found bug introduced by the last bug fix, which breaks
+% the punctuation prohibitions. (Fixed on 071020)
+% 071015 Fixed bug of not changing punctuation font after space.
+% 071019 Fixed the \iffalse bug. Use \the\XeTeXcharclass
+% instead of ifcjkchar.
+% Defined token patterns to simplify settings, haha.
+% 071020 Added ability to deal with space seperated characters.
+% Added XeTeX existence test. More intelligent parindent
+% setting. Fixed bug of English font change through not
+% using \getinterclasstoks, hmmm.
+% Seperated fullstop and halfstop skips. They were both
+% treated as judou before. Added \halthalfskipscheme.
+% 071027 Fixed bug of \halthalfskipscheme. Added class setting
+% for some punctuations.
+% 071103 Fixed bug of no \skipzh between CJK Ext-A/B chars.
+% However, due to the current bug of XeTeX, CJK Ext-B
+% chars may not have a correct \meaning, so having them
+% after spaces may result in a compiling failure.
+% 071117 Use \ifzhs@isvalidchar to avoid the XeTeX \meaning
+% bug. Added \ProvidesPackage when under LaTeX.
+% 071202 Fixed bug of wrong \ProvidesPackage in plain TeX.
+% 071210 Changed usefulmacros.sty. Removed \@foreach because I
+% find they are redundant --- \@for already has
+% \expandafter #2. Improved LaTeX detecting.
+% 071211 Minor change on \simsunskipscheme.
+% 071229 Added a few punctuation classification settings.
+% Refined code. Added active hanzi hook. Removed some
+% debug code for compiling speed. Not thoroughly tested.
+% 071231 Use \zhs@@a to reduce memory usage. Removed
+% \zhs@active@alphabound because it's not effective.
+% Use \lastnodetype and \spacefactor to determine whether
+% or not to insert \skipenzh. Added a few punctuation
+% classification settings.
+% 080102 No \enableactivehanzi by default. Changed \zhhanzihook.
+% Use hex number to represent hanzi. Added \zhs@font.
+% Added ambiwide and ambinarrow options. Made active
+% hanzi protected.
+% 090720 Rename usefulmacros.sty and myclass.sty to
+% zhsusefulmacros.sty and zhsmyclass.sty.
+% 2012/03/14 Fix bug for Plain format.
+% 2016/02/20 Compatible with LaTeX2e 2016/02/01.
+% 2016/02/10 The boundary class is changed from 255 to 4095
+% since XeTeX 0.99994.
+% Note: 1. Catcode test requires letter 'a' to be in category 11, and '!'
+% to be in category 12. So don't change the default catcodes.
+% 2. To speed up processing long Chinese documents, set \skipzh to
+% empty and \XeTeXinterchartoks 1 1={}. This can save 1/4 time.
+% 3. \zhspacing will generate a few spaces. Using it in horizontal
+% mode will produce unwanted skips.
+\catcode`\@=11
+\ifx\XeTeXrevision\@undefined
+ \errmessage{XeTeX required to use zhspacing}%
+\fi
+\ifx\XeTeXinterchartokenstate\@undefined
+ \errmessage{XeTeX 0.997 or above required to use zhspacing}%
+\fi
+\ifx\zhspacingrevision\@undefined
+\def\zhspacingrevision{2016/05/14}
+\input zhsusefulmacros.sty
+\newif\ifzhs@ambiwide
+\zhs@ambiwidetrue
+\ifLaTeX@e
+ \ProvidesPackage{zhspacing}[\zhspacingrevision]
+ \DeclareOption{ambiwide}{\zhs@ambiwidetrue}
+ \DeclareOption{ambinarrow}{\zhs@ambiwidefalse}
+ \ProcessOptions\relax
+\fi
+\XeTeXlinebreaklocale="zh"
+\XeTeXlinebreakskip=0pt plus 0.2em minus 0.1em
+\def\zhnobreak{\nobreak}
+\def\simsunskipscheme{% should be fit for sim-xxx fonts
+ % my skip
+ \def\skipzh{\hskip 0em plus 0.2em minus 0.1em}
+ \def\skipenzh{\hskip 0.25em plus 0.15em minus 0.05em}
+ \def\skipzhopen{\hskip -0.0em plus 0.0em minus 0.3em}
+ \def\skipzhinteropen{\hskip -0.3em plus 0.1em minus 0.1em}
+ \def\skipzhlinestartopen{\hskip -0.35em}
+ \def\skipzhclose{\hskip -0.0em plus 0.0em minus 0.3em}
+ \def\skipzhinterclose{\hskip -0.3em plus 0.1em minus 0.1em}
+ \def\skipzhlineendclose{\hskip -0.35em}
+ \def\skipzhhalfstop{\hskip -0.0em plus 0.0em minus 0.5em}
+ \def\skipzhinterhalfstop{\hskip -0.3em plus 0.1em minus 0.1em}
+ \def\skipzhlineendhalfstop{\hskip -0.6em}
+ \def\skipzhfullstop{\hskip -0.0em plus 0.0em minus 0.5em}
+ \def\skipzhinterfullstop{\hskip -0.3em plus 0.1em minus 0.1em}
+ \def\skipzhlineendfullstop{\hskip -0.575em}
+ % neg
+ \def\skipnegzhlinestartopen{\hskip 0.35em}
+ \def\skipnegzhlineendclose{\hskip 0.35em}
+ \def\skipnegzhlineendhalfstop{\hskip 0.6em}
+ \def\skipnegzhlineendfullstop{\hskip 0.575em}
+}
+\def\emptyskipscheme{% just for test use
+ % my skip
+ \def\skipzh{\hskip 0em plus 0.1em}
+ \def\skipenzh{\hskip 0em plus 0.2em}
+ \def\skipzhopen{\hskip 0pt}
+ \def\skipzhinteropen{\hskip 0pt}
+ \def\skipzhlinestartopen{\hskip 0pt}
+ \def\skipzhclose{\hskip 0pt}
+ \def\skipzhinterclose{\hskip 0pt}
+ \def\skipzhlineendclose{\hskip 0pt}
+ \def\skipzhhalfstop{\hskip 0pt}
+ \def\skipzhinterhalfstop{\hskip 0pt}
+ \def\skipzhlineendhalfstop{\hskip 0pt}
+ \def\skipzhfullstop{\hskip 0pt}
+ \def\skipzhinterfullstop{\hskip 0pt}
+ \def\skipzhlineendfullstop{\hskip 0pt}
+ % neg
+ \def\skipnegzhlinestartopen{\hskip 0pt}
+ \def\skipnegzhlineendclose{\hskip 0pt}
+ \def\skipnegzhlineendhalfstop{\hskip 0pt}
+ \def\skipnegzhlineendfullstop{\hskip 0pt}
+}
+\def\haltfullskipscheme{% should be fit for Adobe opentype fonts with halfwidth alternative enabled
+ % my skip
+ \def\skipzh{\hskip 0em plus 0.2em minus 0.1em}
+ \def\skipenzh{\hskip 0.25em plus 0.15em minus 0.05em}
+ \def\skipzhopen{\hskip 0.3em minus 0.3em}
+ \def\skipzhinteropen{\hskip 0em plus 0.1em }
+ \def\skipzhlinestartopen{\hskip 0em}
+ \def\skipzhclose{\hskip 0.3em minus 0.3em}
+ \def\skipzhinterclose{\hskip 0em plus 0.1em}
+ \def\skipzhlineendclose{\hskip 0em}
+ \def\skipzhhalfstop{\hskip 0.4em minus 0.4em}
+ \def\skipzhinterhalfstop{\hskip 0em plus 0.1em}
+ \def\skipzhlineendhalfstop{\hskip 0em}
+ \def\skipzhfullstop{\hskip 0.4em minus 0.4em}
+ \def\skipzhinterfullstop{\hskip 0em plus 0.1em}
+ \def\skipzhlineendfullstop{\hskip 0em}
+ % neg
+ \def\skipnegzhlinestartopen{\hskip 0em}
+ \def\skipnegzhlineendclose{\hskip 0em}
+ \def\skipnegzhlineendhalfstop{\hskip 0em}
+ \def\skipnegzhlineendfullstop{\hskip 0em}
+}
+\let\haltskipscheme\haltfullskipscheme % for backward compatibility
+\def\halthalfskipscheme{% should be fit for Adobe opentype fonts with halfwidth alternative enabled
+ % my skip
+ \def\skipzh{\hskip 0em plus 0.2em minus 0.1em}
+ \def\skipenzh{\hskip 0.25em plus 0.15em minus 0.05em}
+ \def\skipzhopen{\hskip 0.0em plus 0.3em}
+ \def\skipzhinteropen{\hskip 0em plus 0.1em }
+ \def\skipzhlinestartopen{\hskip 0em}
+ \def\skipzhclose{\hskip 0.0em plus 0.3em}
+ \def\skipzhinterclose{\hskip 0em plus 0.1em}
+ \def\skipzhlineendclose{\hskip 0em}
+ \def\skipzhhalfstop{\hskip 0.0em plus 0.4em}
+ \def\skipzhinterhalfstop{\hskip 0em plus 0.1em}
+ \def\skipzhlineendhalfstop{\hskip -0.15em}
+ \def\skipzhfullstop{\hskip 0.0em plus 0.4em}
+ \def\skipzhinterfullstop{\hskip 0em plus 0.1em}
+ \def\skipzhlineendfullstop{\hskip -0.15em}
+ % neg
+ \def\skipnegzhlinestartopen{\hskip 0em}
+ \def\skipnegzhlineendclose{\hskip 0em}
+ \def\skipnegzhlineendhalfstop{\hskip 0.15em}
+ \def\skipnegzhlineendfullstop{\hskip 0.15em}
+}
+\simsunskipscheme
+%\let\mydbgmessage\message
+\def\mydbgmessage#1{}
+
+% font save and restore
+\def\zhs@oldf@encoding{}
+\def\zhs@oldf@family{}
+\def\zhs@oldf@series{}
+\def\zhs@oldf@shape{}
+\def\zhs@oldf@size{}
+\def\zhs@savef@nt#1{%
+ \expandafter\xdef\csname zhs@#1f@encoding\endcsname{\f@encoding}%
+ \expandafter\xdef\csname zhs@#1f@family\endcsname{\f@family}%
+ \expandafter\xdef\csname zhs@#1f@series\endcsname{\f@series}%
+ \expandafter\xdef\csname zhs@#1f@shape\endcsname{\f@shape}%
+ \expandafter\xdef\csname zhs@#1f@size\endcsname{\f@size}%
+}
+\def\zhs@restoref@nt#1{%
+ \edef\f@encoding{\csname zhs@#1f@encoding\endcsname}%
+ \edef\f@family{\csname zhs@#1f@family\endcsname}%
+ \edef\f@series{\csname zhs@#1f@series\endcsname}%
+ \edef\f@shape{\csname zhs@#1f@shape\endcsname}%
+ \edef\f@size{\csname zhs@#1f@size\endcsname}%
+ \selectfont
+}
+\def\zhs@printf@nt#1{%
+ \immediate\write16{Font #1 is: \csname zhs@#1f@encoding\endcsname/\csname zhs@#1f@family\endcsname/\csname
+ zhs@#1f@series\endcsname/\csname zhs@#1f@shape\endcsname/\csname zhs@#1f@size\endcsname}%
+}
+\def\zhgroupsavefont{%
+ \let\zhs@savefont=\begingroup
+ \let\zhs@restorefont=\endgroup
+}
+\def\zhnfsssavefont{%
+ \def\zhs@savefont{\zhs@savef@nt{old}}
+ \def\zhs@restorefont{\zhs@restoref@nt{old}}
+}
+\ifLaTeX@e
+ \zhnfsssavefont
+\else
+ \zhgroupsavefont
+\fi
+
+% test CJK char
+\def\chartonum#1#2{% #1: an explicit or implicit char; #2: return macro
+ \ifcat#1a%
+ \edef#2{\expandafter\@lettertonum\meaning #1\@end}%
+ \edef#2{\expandafter\number\expandafter\lq #2}%
+ \else
+ \ifcat#1!%
+ \edef#2{\expandafter\@chartonum\meaning #1\@end}%
+ \edef#2{\expandafter\number\expandafter\lq #2}%
+ \else
+ \errmessage{In \string\chartonum, parameter not a letter, nor a character}%
+ \fi
+ \fi
+}
+{\escapechar=-1
+ \expandafter\expandafter\expandafter\gdef
+ \expandafter\expandafter\expandafter\@lettertonum
+ \expandafter\string\csname the letter \endcsname#1\@end{#1}
+ \expandafter\expandafter\expandafter\gdef
+ \expandafter\expandafter\expandafter\@chartonum
+ \expandafter\string\csname the character \endcsname#1\@end{#1}
+}
+\let\zhs@tmpchar\relax
+\def\zhs@skipspaces{\futurenonspacelet\zhs@tmpchar\zhs@skipsp@ces}
+\def\zhs@skipsp@ces{%
+ %\expandafter\mydbgmessage\expandafter{\meaning\zhs@tmpchar}%
+ \ifcat a\noexpand\zhs@tmpchar % catcode 11
+ \zhs@testskipenzh
+ \else
+ \ifcat !\noexpand\zhs@tmpchar % catcode 12
+ \zhs@testskipenzh
+ \else
+ \ifcat $\noexpand\zhs@tmpchar % catcode 3
+ \skipenzh\relax
+ \fi
+ \fi
+ \fi
+}
+\def\zhs@tmpnum{-1}
+\def\ifzhs@isvalidchar#1??#2\ok{\if!#2!}
+\def\zhs@testskipenzh{%
+ \chartonum\zhs@tmpchar\zhs@tmpnum
+ \expandafter\ifzhs@isvalidchar\zhs@tmpnum??\ok
+ \edef\zhs@tmpnum{\the\XeTeXcharclass\zhs@tmpnum}%
+ \else
+ \edef\zhs@tmpnum{\getclassnum{cjkextb}}%
+ \fi
+ \ifnum\zhs@tmpnum = \getclassnum{alphanum}%
+ \skipenzh\relax
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{hanzi}%
+ \skipzh\relax
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{closefw}%
+ %\getinterclasstoks{hanzi}{closefw}%
+ \zhnobreak
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{halfstop}%
+ %\getinterclasstoks{hanzi}{halfstop}%
+ \zhnobreak
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{fullstop}%
+ \zhnobreak
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{openfw}%
+ \zhnobreak\skipnegzhlinestartopen\relax % compensate
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{cjkexta}%
+ \skipzh\relax
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{cjkextb}%
+ \skipzh\relax
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
+\def\zhs@aftermathskip{%
+ \ifnum\lastnodetype=10 % math node
+ \skipenzh\relax
+ \fi
+}
+% Character class settings.
+\input zhsmyclass.sty
+% three base classes: boundary, halfwidth and fullwidth
+\newclass{boundary}
+
+\ifnum\strcmp{\number\XeTeXversion\XeTeXrevision}{0.99993} > 0 %
+ \chardef\zhs@boundaryclassnum = 4095 %
+\else
+ \chardef\zhs@boundaryclassnum = 255 %
+\fi
+\setclassnum{boundary}{\zhs@boundaryclassnum}
+\newclass{halfwidth}
+\newclass{fullwidth}
+\setinterclasstoks{boundary}{fullwidth}{\mydbgmessage{^^JZ}\zhs@savefont\zhfont}
+\setinterclasstoks{fullwidth}{boundary}{\mydbgmessage{^^Jz}\zhs@restorefont\ignorespaces}
+\setinterclasstoks{halfwidth}{fullwidth}{\mydbgmessage{^^JP}\zhs@savefont\zhfont}
+\setinterclasstoks{fullwidth}{halfwidth}{\mydbgmessage{^^Jp}\zhs@restorefont}
+% derived class alphanum and hanzi
+\newclass[halfwidth]{alphanum}
+\setclassnum{alphanum}{0}
+\newclass[fullwidth]{hanzi}
+\setclassnum{hanzi}{1}
+\setinterclasstoks{hanzi}{hanzi}{\skipzh\relax}
+%\appendinterclasstoks{alphanum}{hanzi}{\mydbgmessage{^^JQ}\skipenzh\relax}
+%\prependinterclasstoks{hanzi}{alphanum}{\mydbgmessage{^^Jq}\skipenzh\relax}
+\setinterclasstoks{alphanum}{hanzi}{\mydbgmessage{^^JQ}\skipenzh\relax\zhs@savefont\zhfont}
+\setinterclasstoks{hanzi}{alphanum}{\mydbgmessage{^^Jq}\zhs@restorefont\skipenzh\relax}
+\setinterclasstoks{hanzi}{boundary}{\mydbgmessage{^^Ji}\zhs@restorefont\zhs@skipspaces}
+\setinterclasstoks{boundary}{hanzi}{\mydbgmessage{^^JI}\zhs@aftermathskip\zhs@savefont\zhfont}
+% derived class from fullwidth
+\newclass[fullwidth]{openfw} % ‘, (, etc
+\setclassnum{openfw}{2}
+\newclass[fullwidth]{closefw} % ’, ), etc
+\setclassnum{closefw}{3}
+\newclass[fullwidth]{halfstop} % ,, , etc
+\setclassnum{halfstop}{4}
+\newclass[fullwidth]{fullstop} % 。 etc
+\setclassnum{fullstop}{10}
+\newclass[fullwidth]{fwpunct} % extra fullwidth punctuations
+\setclassnum{fwpunct}{7}
+% patterns
+\def\zhs@punct@inter#1{%
+ \zhnobreak\csname skipzhinter#1\endcsname\relax
+}
+\def\zhs@leftpunct@after#1{%
+ \allowbreak\csname skipzh#1\endcsname\nobreak\csname skipnegzhlinestart#1\endcsname\vadjust{}\zhnobreak\csname skipzhlinestart#1\endcsname\relax
+}
+\def\zhs@leftpunct@after@boundary#1{%
+ \zhnobreak\csname skipzhlinestart#1\endcsname\relax
+}
+\let\zhs@tmp\relax
+\def\zhs@leftpunct@before@boundary#1{\def\zhs@tmp{#1}\futurenonspacelet\zhs@tmpchar\zhs@leftpunct@before@boundary@}
+\def\zhs@leftpunct@before@boundary@{%
+ %\mydbgmessage{left punct before boundary}%
+ %\expandafter\mydbgmessage\expandafter{\meaning\zhs@tmpchar}%
+ \ifcat a\noexpand\zhs@tmpchar % catcode 11
+ \zhs@leftpunct@before@boundary@@
+ \else
+ \ifcat !\noexpand\zhs@tmpchar % catcode 12
+ \zhs@leftpunct@before@boundary@@
+ \fi
+ \fi
+}
+\def\zhs@leftpunct@before@boundary@@{%
+ \chartonum\zhs@tmpchar\zhs@tmpnum
+ \expandafter\ifzhs@isvalidchar\zhs@tmpnum??\ok
+ \edef\zhs@tmpnum{\the\XeTeXcharclass\zhs@tmpnum}%
+ \else
+ \edef\zhs@tmpnum{\getclassnum{cjkextb}}%
+ \fi
+ \zhs@tmp
+}
+\def\zhs@leftpunct@after@right#1#2{%
+ \zhnobreak\csname skipzhlineend#2\endcsname\allowbreak\csname skipnegzhlineend#2\endcsname\csname skipzhinter#2\endcsname\csname skipzhinter#1\endcsname\csname skipnegzhlinestart#1\endcsname\vadjust{}\zhnobreak\csname skipzhlinestart#1\endcsname\relax
+}
+\def\zhs@rightpunct@before#1{%
+ \zhnobreak\csname skipzhlineend#1\endcsname\allowbreak\csname skipnegzhlineend#1\endcsname\csname skipzh#1\endcsname\relax
+}
+\def\zhs@rightpunct@before@boundary#1{\def\zhs@tmp{#1}\futurenonspacelet\zhs@tmpchar\zhs@rightpunct@before@boundary@}
+\def\zhs@rightpunct@before@boundary@{%
+ %\mydbgmessage{right punct before boundary}%
+ %\expandafter\mydbgmessage\expandafter{\meaning\zhs@tmpchar}%
+ \ifcat a\noexpand\zhs@tmpchar % catcode 11
+ \zhs@rightpunct@before@boundary@@
+ \else
+ \ifcat !\noexpand\zhs@tmpchar % catcode 12
+ \zhs@rightpunct@before@boundary@@
+ \fi
+ \fi
+}
+\def\zhs@rightpunct@before@boundary@@{%
+ \chartonum\zhs@tmpchar\zhs@tmpnum
+ \expandafter\ifzhs@isvalidchar\zhs@tmpnum??\ok
+ \edef\zhs@tmpnum{\the\XeTeXcharclass\zhs@tmpnum}%
+ \else
+ \edef\zhs@tmpnum{\getclassnum{cjkextb}}%
+ \fi
+ \zhs@tmp
+}
+% open fullwidth punctuation after other characters
+\@for\zhs@class:={hanzi,fwpunct,alphanum,halfwidth}\do{%,boundary
+ \prependinterclasstoks{\zhs@class}{openfw}{\mydbgmessage{^^JA1}\zhs@leftpunct@after{open}}
+}
+\setinterclasstoks{openfw}{openfw}{\mydbgmessage{^^JA2}\zhs@punct@inter{open}}
+\setinterclasstoks{closefw}{openfw}{\mydbgmessage{^^JA3}\zhs@leftpunct@after@right{open}{close}}
+\setinterclasstoks{halfstop}{openfw}{\mydbgmessage{^^JA4}\zhs@leftpunct@after@right{open}{halfstop}}
+\setinterclasstoks{fullstop}{openfw}{\mydbgmessage{^^JA4}\zhs@leftpunct@after@right{open}{fullstop}}
+% close fullwidth punctuation before other characters
+\@for\zhs@class:={hanzi,fwpunct,alphanum,halfwidth}\do{%,boundary
+ \prependinterclasstoks{closefw}{\zhs@class}{\mydbgmessage{^^JB1}\zhs@rightpunct@before{close}}
+}
+\setinterclasstoks{closefw}{closefw}{\mydbgmessage{^^JB2}\zhs@punct@inter{close}}
+\setinterclasstoks{closefw}{halfstop}{\mydbgmessage{^^JB3}\zhs@punct@inter{close}}
+\setinterclasstoks{closefw}{fullstop}{\mydbgmessage{^^JB3}\zhs@punct@inter{close}}
+% halfstop punctuation before other characters
+\@for\zhs@class:={hanzi,fwpunct,alphanum,halfwidth}\do{%,boundary
+ \prependinterclasstoks{halfstop}{\zhs@class}{\mydbgmessage{^^JC1}\zhs@rightpunct@before{halfstop}}
+}
+\setinterclasstoks{halfstop}{closefw}{\mydbgmessage{^^Jb2}\zhs@punct@inter{halfstop}}
+\setinterclasstoks{halfstop}{halfstop}{\mydbgmessage{^^JC2}\zhs@punct@inter{halfstop}}
+\setinterclasstoks{halfstop}{fullstop}{\mydbgmessage{^^JC2}\zhs@punct@inter{halfstop}}
+% fullstop punctuation before other characters
+\@for\zhs@class:={hanzi,fwpunct,alphanum,halfwidth}\do{%,boundary
+ \prependinterclasstoks{fullstop}{\zhs@class}{\mydbgmessage{^^JC1}\zhs@rightpunct@before{fullstop}}
+}
+\setinterclasstoks{fullstop}{closefw}{\mydbgmessage{^^Jb2}\zhs@punct@inter{fullstop}}
+\setinterclasstoks{fullstop}{halfstop}{\mydbgmessage{^^JC2}\zhs@punct@inter{fullstop}}
+\setinterclasstoks{fullstop}{fullstop}{\mydbgmessage{^^JC2}\zhs@punct@inter{fullstop}}
+% open fullwidth punctuation before other characters
+\@for\zhs@class:={hanzi,fwpunct,alphanum,halfwidth,closefw,halfstop,fullstop}\do{%,boundary
+ \prependinterclasstoks{openfw}{\zhs@class}{\mydbgmessage{^^Ja}\zhnobreak}
+}
+% close fullwidth punctuation after other characters
+\@for\zhs@class:={hanzi,fwpunct,alphanum,halfwidth,boundary}\do{%
+ \prependinterclasstoks{\zhs@class}{closefw}{\mydbgmessage{^^Jb}\zhnobreak}
+}
+% halfstop punctuation after other characters
+\@for\zhs@class:={hanzi,fwpunct,alphanum,halfwidth,boundary}\do{%
+ \prependinterclasstoks{\zhs@class}{halfstop}{\mydbgmessage{^^Jc}\zhnobreak}
+}
+% fullstop punctuation after other characters
+\@for\zhs@class:={hanzi,fwpunct,alphanum,halfwidth,boundary}\do{%
+ \prependinterclasstoks{\zhs@class}{fullstop}{\mydbgmessage{^^Jc}\zhnobreak}
+}
+% boundary special treat
+\prependinterclasstoks{boundary}{openfw}{\mydbgmessage{^^JA0}\zhs@leftpunct@after@boundary{open}}
+\appendinterclasstoks{closefw}{boundary}{\mydbgmessage{^^JB0}\zhs@rightpunct@before@boundary{%
+ \ifnum\zhs@tmpnum = \getclassnum{closefw}%
+ %\getinterclasstoks{closefw}{closefw}%
+ \zhs@punct@inter{close}%
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{halfstop}%
+ %\getinterclasstoks{closefw}{halfstop}%
+ \zhs@punct@inter{close}%
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{fullstop}%
+ \zhs@punct@inter{close}%
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{openfw}%
+ %\getinterclasstoks{closefw}{openfw}%
+ \zhs@leftpunct@after@right{open}{close}%
+ \zhnobreak\skipnegzhlinestartopen\relax % compensate
+ \else
+ \zhs@rightpunct@before{close}%
+ \fi
+ \fi
+ \fi
+ \fi
+}}
+\appendinterclasstoks{halfstop}{boundary}{\mydbgmessage{^^JC0}\zhs@rightpunct@before@boundary{%
+ \ifnum\zhs@tmpnum = \getclassnum{closefw}%
+ %\getinterclasstoks{halfstop}{closefw}%
+ \zhs@punct@inter{halfstop}%
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{halfstop}%
+ %\getinterclasstoks{halfstop}{halfstop}%
+ \zhs@punct@inter{halfstop}%
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{fullstop}%
+ \zhs@punct@inter{halfstop}%
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{openfw}%
+ %\getinterclasstoks{halfstop}{openfw}%
+ \zhs@leftpunct@after@right{open}{halfstop}%
+ \zhnobreak\skipnegzhlinestartopen\relax % compensate
+ \else
+ \zhs@rightpunct@before{halfstop}%
+ \fi
+ \fi
+ \fi
+ \fi
+}}
+\appendinterclasstoks{fullstop}{boundary}{\mydbgmessage{^^JC0}\zhs@rightpunct@before@boundary{%
+ \ifnum\zhs@tmpnum = \getclassnum{closefw}%
+ \zhs@punct@inter{fullstop}%
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{halfstop}%
+ \zhs@punct@inter{fullstop}%
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{fullstop}%
+ \zhs@punct@inter{fullstop}%
+ \else
+ \ifnum\zhs@tmpnum = \getclassnum{openfw}%
+ \zhs@leftpunct@after@right{open}{fullstop}%
+ \zhnobreak\skipnegzhlinestartopen\relax % compensate
+ \else
+ \zhs@rightpunct@before{fullstop}%
+ \fi
+ \fi
+ \fi
+ \fi
+}}
+\appendinterclasstoks{openfw}{boundary}{\mydbgmessage{^^Ja0}\zhs@leftpunct@before@boundary{%
+ \ifnum\zhs@tmpnum = \getclassnum{openfw}%
+ %\getinterclasstoks{openfw}{openfw}%
+ \zhs@punct@inter{open}%
+ \zhnobreak\skipnegzhlinestartopen\relax % compensate
+ \fi
+}}
+% punctuation font change
+\@for\zhs@class:={openfw,closefw,halfstop,fullstop,fwpunct}\do{%
+ \appendinterclasstoks{hanzi}{\zhs@class}{\zhpunctfont}
+ \appendinterclasstoks{\zhs@class}{hanzi}{\zhfont}
+ \appendinterclasstoks{boundary}{\zhs@class}{\zhpunctfont}
+ \appendinterclasstoks{halfwidth}{\zhs@class}{\zhpunctfont}
+}
+% CJK Ext-A/B support
+\newclass[hanzi]{cjkexta}
+\setclassnum{cjkexta}{8}
+\newclass[hanzi]{cjkextb}
+\setclassnum{cjkextb}{9}
+\@for\zhs@class:={hanzi,fwpunct,openfw,closefw,halfstop,fullstop,alphanum,halfwidth,boundary}\do{%
+ \appendinterclasstoks{\zhs@class}{cjkexta}{\zhcjkextafont}
+ \appendinterclasstoks{\zhs@class}{cjkextb}{\zhcjkextbfont}
+ \prependinterclasstoks{cjkexta}{\zhs@class}{\zhfont}
+ \prependinterclasstoks{cjkextb}{\zhs@class}{\zhfont}
+}
+\setinterclasstoks{cjkexta}{cjkexta}{\skipzh\relax}
+\setinterclasstoks{cjkexta}{cjkextb}{\zhcjkextbfont\skipzh\relax}
+\setinterclasstoks{cjkextb}{cjkexta}{\zhcjkextafont\skipzh\relax}
+\setinterclasstoks{cjkextb}{cjkextb}{\skipzh\relax}
+
+% long fullwidth punctuations
+\newclass[fwpunct]{longpunct} % … etc
+\setclassnum{longpunct}{5}
+\setinterclasstoks{longpunct}{longpunct}{\zhnobreak}
+% derived class from halfwidth
+\newclass[halfwidth]{hwpunct} % (, ., etc
+\setclassnum{hwpunct}{6}
+
+% Font settings
+\ifLaTeX@e
+ \RequirePackage{fontspec}
+ \@ifundefined{zhfont}{\newfontfamily\zhfont[BoldFont=SimHei]{SimSun}}{}
+ \@ifundefined{zhpunctfont}{\newfontfamily\zhpunctfont{SimSun}}{}
+ \@ifundefined{zhcjkextafont}{\def\zhcjkextafont{\message{CJK Ext-A}}}{}
+ \@ifundefined{zhcjkextbfont}{\def\zhcjkextbfont{\message{CJK Ext-B}}}{}
+\else
+ \@ifundefined{zhfont}{\font\zhfont="SimSun" at 10pt}{}
+ \@ifundefined{zhpunctfont}{\font\zhpunctfont="SimSun" at 10pt}{}
+ \@ifundefined{zhcjkextafont}{\def\zhcjkextafont{\message{CJK Ext-A}}}{}
+ \@ifundefined{zhcjkextbfont}{\def\zhcjkextbfont{\message{CJK Ext-B}}}{}
+\fi
+
+% code range utils
+\newif\ifzhs@result
+\newcount\zhs@tmpcnt
+\def\@ifnuminrange#1#2#3#4{% #1: num, #2: range with format a->b,c->d
+ % #3: true block, #4: false block
+ \zhs@resultfalse
+ \@for\zhs@range:=#2\do{%
+ \expandafter\@ifrangecontains\expandafter[\zhs@range]{#1}{\zhs@resulttrue}{}%
+ }%
+ \ifzhs@result #3\else #4\fi
+}
+
+\def\@ifrangecontains[#1->#2]#3#4#5{%
+ \ifnum#3<#1\relax
+ #5%
+ \else
+ \ifnum#3>#2\relax
+ #5%
+ \else
+ #4%
+ \fi
+ \fi
+}
+
+\def\@fornuminrange#1:=#2\do#3{% #1: count register, #2: range
+ \@for\zhs@range:=#2\do{%
+ \expandafter\@@fornuminrange\expandafter[\zhs@range]{#1}{#3}%
+ }%
+}
+\def\@@fornuminrange[#1->#2]#3#4{%
+ #3=#1%
+ \loop
+ \unless\ifnum#3>#2\relax
+ #4\relax
+ \advance #3by 1%
+ \repeat
+}
+
+\def\zhs@hanzirange{% data from unicodeletters.tex
+ "2E80->"2E99,
+ "2E9B->"2EF3,
+ "2F00->"2FD5,
+ "2FF0->"2FFB,
+ "3000->"3000,
+ "3003->"3004,
+ "3006->"3007,
+ "3012->"3013,
+ "3020->"3029,
+ "3030->"303A,
+ "303D->"303F,
+ "3042->"3042,
+ "3044->"3044,
+ "3046->"3046,
+ "3048->"3048,
+ "304A->"3062,
+ "3064->"3082,
+ "3084->"3084,
+ "3086->"3086,
+ "3088->"308D,
+ "308F->"3094,
+ "309F->"309F,
+ "30A2->"30A2,
+ "30A4->"30A4,
+ "30A6->"30A6,
+ "30A8->"30A8,
+ "30AA->"30C2,
+ "30C4->"30E2,
+ "30E4->"30E4,
+ "30E6->"30E6,
+ "30E8->"30ED,
+ "30EF->"30F4,
+ "30F7->"30FA,
+ "30FF->"30FF,
+ "3105->"312C,
+ "3131->"318E,
+ "3190->"31B7,
+ "31C0->"31CF,
+ "3200->"321E,
+ "3220->"3243,
+ "3250->"32FE,
+ "3300->"33FF,
+ "3400->"4DB5,
+ "4E00->"9FBB,
+ "A000->"A014,
+ "A016->"A48C,
+ "A490->"A4C6,
+ "F900->"FA2D,
+ "FA30->"FA6A,
+ "FA70->"FAD9,
+ "FE30->"FE34,
+ "FE45->"FE46,
+ "FE49->"FE4F,
+ "FE51->"FE51,
+ "FE58->"FE58,
+ "FE5F->"FE66,
+ "FE68->"FE68,
+ "FE6B->"FE6B,
+ "FF02->"FF03,
+ "FF06->"FF07,
+ "FF0A->"FF0B,
+ "FF0D->"FF0D,
+ "FF0F->"FF19,
+ "FF1C->"FF1E,
+ "FF20->"FF3A,
+ "FF3C->"FF3C,
+ "FF3E->"FF5A,
+ "FF5C->"FF5C,
+ "FF5E->"FF5E,
+ "FFE2->"FFE4,
+ "20000->"2A6D6,
+ "2F800->"2FA1D
+}
+\def\zhs@extarange{"3400->"4DB5}
+\def\zhs@extbrange{"20000->"2FA1D}
+
+% set active hanzi for hooking
+\def\makehanziglobalactive{%
+ \@fornuminrange\zhs@tmpcnt:=\zhs@hanzirange\do{%
+ \global\catcode\zhs@tmpcnt=\active}%
+}
+
+\def\makehanzigloballetter{%
+ \@fornuminrange\zhs@tmpcnt:=\zhs@hanzirange\do{%
+ \global\catcode\zhs@tmpcnt=11}%
+}
+
+\def\zhhanzihook#1{{\XeTeXinterchartokenstate=0\zhs@font #1}}
+
+\def\zhs@h@x#1{\ifcase#1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or
+ 9\or A\or B\or C\or D\or E\or F\fi}
+\def\zhs@hex#1{\if!#1!\else\ifnum#1<16 \zhs@h@x{#1}\else
+ \expandafter\zhs@hex\expandafter{\number\numexpr(#1-8)/16}%
+ \expandafter\zhs@h@x\expandafter{\number\numexpr#1-(#1-8)/16*16}\fi\fi}
+
+\let\zhs@font\zhfont
+\def\enableactivehanzi{%
+ \def\zhs@@a##1{\zhs@afteralphamathskip
+ \expandafter\@ifrangecontains\expandafter[\zhs@extarange]{"##1}{\global
+ \let\zhs@font\zhcjkextafont}{\expandafter\@ifrangecontains
+ \expandafter[\zhs@extbrange]{"##1}{\global\let\zhs@font\zhcjkextbfont
+ }{\global\let\zhs@font\zhfont}}%
+ \zhhanzihook{\char"##1}\zhs@active@lookafter}%
+ \@fornuminrange\zhs@tmpcnt:=\zhs@hanzirange\do{%
+ \lccode`\~=\zhs@tmpcnt
+ \lowercase{\protected\xdef~{\noexpand\zhs@@a{\expandafter\zhs@hex
+ \expandafter{\number\zhs@tmpcnt}}}}%
+ }%
+}
+
+\def\zhs@afteralphamathskip{%
+ \ifhmode
+ \ifnum\lastnodetype=10 % math node
+ \skipenzh\relax
+ \else\ifnum\lastnodetype=0
+ \ifnum\spacefactor=999
+ \skipenzh
+ \else\ifnum\spacefactor=1000
+ \skipenzh
+ \fi\fi
+ \fi\fi
+ \fi
+}
+
+{\escapechar=-1
+ \xdef\zhs@active@ident{\string\zhs@@a}
+}
+\expandafter\def\expandafter\ifzhs@notactivehanzi\expandafter#\expandafter1%
+ \zhs@active@ident#2\ok{\if!#2!}
+\def\zhs@active@lookafter{\futurenonspacelet\zhs@tmpchar\zhs@active@look@fter}
+\def\zhs@active@look@fter{%
+ %\expandafter\mydbgmessage\expandafter{\meaning\zhs@tmpchar}%
+ \if\relax\noexpand\zhs@tmpchar % control sequence
+ \zhs@beforeactivehanziskip
+ \else
+ \ifcat a\noexpand\zhs@tmpchar % catcode 11
+ \zhs@testskipenzh
+ \else
+ \ifcat !\noexpand\zhs@tmpchar % catcode 12
+ \zhs@testskipenzh
+ \else
+ \ifcat $\noexpand\zhs@tmpchar % catcode 3
+ \skipenzh\relax
+ \fi
+ \fi
+ \fi
+ \fi
+}
+
+\def\zhs@beforeactivehanziskip{%
+ %\let\zhs@tmp\iffalse % for \if match
+ \edef\zhs@tmp{\meaning\zhs@tmpchar}%
+ \expandafter\expandafter\expandafter\ifzhs@notactivehanzi
+ \expandafter\zhs@tmp\zhs@active@ident\ok
+ \else
+ \skipzh\relax
+ \fi
+}
+
+\def\zhs@loadxetexclasses{%
+ \chardef\XeTeXcharclassID = 1 %
+ \chardef\XeTeXcharclassCJ = 1 %
+ \chardef\XeTeXcharclassOP = 2 %
+ \chardef\XeTeXcharclassCL = 3 %
+ \chardef\XeTeXcharclassEX = 3 %
+ \chardef\XeTeXcharclassIS = 3 %
+ \chardef\XeTeXcharclassNS = 3 %
+ \chardef\XeTeXcharclassCM = \numexpr \zhs@boundaryclassnum + 1 \relax
+ \input load-unicode-xetex-classes %
+}
+
+\def\zhspacing{%
+ \ifnum\XeTeXcharclass"4E00 = 1 %
+ % clear XeTeX pre-defined toks
+ \XeTeXinterchartoks 0 1 = {}
+ \XeTeXinterchartoks 0 2 = {}
+ \XeTeXinterchartoks 0 3 = {}
+ \XeTeXinterchartoks 1 0 = {}
+ \XeTeXinterchartoks 2 0 = {}
+ \XeTeXinterchartoks 3 0 = {}
+ \XeTeXinterchartoks 1 1 = {}
+ \XeTeXinterchartoks 1 2 = {}
+ \XeTeXinterchartoks 1 3 = {}
+ \XeTeXinterchartoks 2 1 = {}
+ \XeTeXinterchartoks 2 2 = {}
+ \XeTeXinterchartoks 2 3 = {}
+ \XeTeXinterchartoks 3 1 = {}
+ \XeTeXinterchartoks 3 2 = {}
+ \XeTeXinterchartoks 3 3 = {}
+ \else
+ \expandafter\zhs@loadxetexclasses %
+ \fi
+ \zhs@tmpcnt "3400 %
+ \chardef\zhs@tmpnum = \getclassnum{cjkexta}%
+ \loop
+ \ifnum\zhs@tmpcnt < "4E00 %
+ \XeTeXcharclass\zhs@tmpcnt = \zhs@tmpnum
+ \advance\zhs@tmpcnt by 1 %
+ \repeat
+ \zhs@tmpcnt "20000 %
+ \chardef\zhs@tmpnum = \getclassnum{cjkextb}%
+ \loop
+ \ifnum\zhs@tmpcnt < "30000 %
+ \XeTeXcharclass\zhs@tmpcnt = \zhs@tmpnum
+ \advance\zhs@tmpcnt by 1 %
+ \repeat
+ \@for\zhs@char:={`:,`,,`、}\do{\XeTeXcharclass\zhs@char=4}
+ \@for\zhs@char:={`。,`.,`;}\do{\XeTeXcharclass\zhs@char=10}
+ \ifzhs@ambiwide
+ \@for\zhs@char:={`“,`‘}\do{\XeTeXcharclass\zhs@char=2}
+ \@for\zhs@char:={`”,`’}\do{\XeTeXcharclass\zhs@char=3}
+ \@for\zhs@char:={`—,`…}\do{\XeTeXcharclass\zhs@char=5}
+ \else
+ \@for\zhs@char:={`“,`‘,`”,`’,`—,`…}\do{\XeTeXcharclass\zhs@char=6}
+ \fi
+ \@for\zhs@char:={`\!,`\",`\',`\(,`\),`\,,`\-,`\.,`\:,`\;,`\<,`\>,`\?,`\[,`\],`\`,`\{,`\},`\\,`\/}\do{\XeTeXcharclass\zhs@char=6}
+ \@for\zhs@char:={`℃,`·,`$,`%}\do{\XeTeXcharclass\zhs@char=7}
+ \registerXeTeXclasstoks
+ \XeTeXinterchartokenstate=1\relax
+ \ifLaTeX@e
+ \setbox0=\hbox{\normalsize\def\zhs@tmp{\kern 2em}\zhs@tmp}%
+ \parindent=\wd0
+ \else
+ \parindent=2em\relax
+ \fi
+ \message{zhspacing installed.^^J}
+}
+
+\fi
diff --git a/macros/xetex/generic/zhspacing/zhsusefulmacros.sty b/macros/xetex/generic/zhspacing/zhsusefulmacros.sty
new file mode 100644
index 0000000000..d6c5fec5b8
--- /dev/null
+++ b/macros/xetex/generic/zhspacing/zhsusefulmacros.sty
@@ -0,0 +1,97 @@
+% zhsusefulmacros.sty
+% This file provides several useful LaTeX macros as well as \ifLaTeX@e,
+% and \futurenonspacelet.
+% Licensed under LPPL.
+\catcode`\@=11
+\ifx\@usefulmacros@defined\@undefined\else
+ \expandafter\endinput
+\fi
+\def\@usefulmacros@defined{\relax}
+\def\@usefulmacros@LaTeX@e{LaTeX2e}
+\def\ifLaTeX@e{\ifx\fmtname\@usefulmacros@LaTeX@e}
+\ifLaTeX@e\else
+\def\@nnil{\@nil}%
+\def\@empty{}%
+\def\@fornoop#1\@@#2#3{}%
+\long\def\@for#1:=#2\do#3{%
+ \expandafter\def\expandafter\@fortmp\expandafter{#2}%
+ \ifx\@fortmp\@empty \else
+ \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi}%
+\long\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else
+ #5\def#4{#2}\ifx #4\@nnil \else#5\@iforloop #3\@@#4{#5}\fi\fi}%
+\long\def\@iforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil
+ \expandafter\@fornoop \else
+ #4\relax\expandafter\@iforloop\fi#2\@@#3{#4}}%
+\def\@tfor#1:={\@tf@r#1 }%
+\long\def\@tf@r#1#2\do#3{\def\@fortmp{#2}\ifx\@fortmp\space\else
+ \@tforloop#2\@nil\@nil\@@#1{#3}\fi}%
+\long\def\@tforloop#1#2\@@#3#4{\def#3{#1}\ifx #3\@nnil
+ \expandafter\@fornoop \else
+ #4\relax\expandafter\@tforloop\fi#2\@@#3{#4}}%
+\long\def\@ifnextchar#1#2#3{%
+ \let\reserved@d=#1%
+ \def\reserved@a{#2}%
+ \def\reserved@b{#3}%
+ \futurelet\@let@token\@ifnch}
+\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}
+\def\:{\let\@sptoken= } \: % this makes \@sptoken a space token
+\def\:{\@xifnch} \expandafter\def\: {\futurelet\@let@token\@ifnch}
+%
+\long\def\@firstoftwo#1#2{#1}
+\long\def\@secondoftwo#1#2{#2}
+\expandafter\ifx\csname ifcsname\endcsname\relax
+\def\@ifundefined#1{%
+ \expandafter\ifx\csname#1\endcsname\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+\else
+\def\@ifundefined#1{%
+ \unless\ifcsname#1\endcsname
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+\fi
+%
+\def\@namedef#1{\expandafter\def\csname #1\endcsname}
+%
+\fi % end of \ifLaTeX@e\else
+
+\def\@BTcs{}
+\let\nexttoken\relax
+\let\next\relax
+\def\futurenonspacelet#1{\def\@BTcs{#1}%
+ \afterassignment\@BTfnslone\let\nexttoken= }
+\def\@BTfnslone{\expandafter\futurelet\@BTcs\@BTfnsltwo}
+\def\@BTfnsltwo{\expandafter\ifx\@BTcs\@sptoken\let\next=\@BTfnslthree
+ \else\let\next=\nexttoken\fi \next}
+\def\@BTfnslthree{\afterassignment\@BTfnslone\let\next= }
+
+\ifx\fbox\@undefined
+\newbox\fbox@tmpbox
+\newdimen\fbox@linewidth
+\newdimen\fbox@tmpdim
+\fbox@linewidth=0.4pt
+\long\def\fbox#1{%
+ \setbox\fbox@tmpbox=\hbox{#1}%
+ \fbox@tmpdim=2\fbox@linewidth
+ \advance\fbox@tmpdim\wd\fbox@tmpbox
+ \leavevmode\hbox{\vbox{\hrule height \fbox@linewidth width \fbox@tmpdim
+ \hbox{\vrule width \fbox@linewidth height \ht\fbox@tmpbox
+ #1\vrule width \fbox@linewidth height \ht\fbox@tmpbox}%
+ \hrule height \fbox@linewidth width \fbox@tmpdim
+ }}%
+}
+\fi
diff --git a/macros/xetex/generic/zhspacing/zhulem.sty b/macros/xetex/generic/zhspacing/zhulem.sty
new file mode 100644
index 0000000000..86365e380a
--- /dev/null
+++ b/macros/xetex/generic/zhspacing/zhulem.sty
@@ -0,0 +1,18 @@
+% zhulem.sty coded by YIN Dian
+% Fix compatibility problem with ulem
+% Hist: 070822 Changed \UL@reskip and \UL@@penalty, able to work.
+\NeedsTeXFormat{LaTeX2e}[1996/12/01]
+\def\fileversion{0.4}
+\def\filedate{2007/08/22}
+\ProvidesPackage{zhulem}[\filedate\space\fileversion]
+\RequirePackage{ulem}[2000/05/26]
+%\let\zhulem@printfont\zhs@printf@nt
+\def\zhulem@printfont#1{}
+\def\UL@reskip{\zhs@savef@nt{tmp}\UL@stop \zhulem@printfont{tmp}\UL@leaders
+ \UL@start\zhs@restoref@nt{tmp}}
+\def\UL@@penalty{\LA@penalty \ifnum\count@=\z@
+ \@ne \else \count@ \fi % zero penalty => no penalty, so use 1 instead.
+ \zhs@savef@nt{tmp}\UL@stop \zhulem@printfont{tmp}\UL@start
+ \zhs@restoref@nt{tmp}}
+
+\endinput