-
Notifications
You must be signed in to change notification settings - Fork 1
/
tiparoj.tex
286 lines (233 loc) · 8.3 KB
/
tiparoj.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
% This file is used to test whether
% the following fonts exist:
% - [Source Han Serif CN](https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-serif/SubsetOTF/CN/)
% - [Sarasa Mono SC](https://mirrors.tuna.tsinghua.edu.cn/github-release/be5invis/Sarasa-Gothic/LatestRelease/)
% - [XITS](https://ctan.org/pkg/xits)
% - [Fira Sans](https://ctan.org/pkg/fira)
% - [XITS Math](https://ctan.org/pkg/xits)
% - [TeX Gyre Termes Math](https://ctan.org/pkg/tex-gyre-math-termes)
% - [STIX Two Math](https://ctan.org/pkg/stix2-otf)
% One can build the document with:
% latexmk -xelatex -interaction=nonstopmode -halt-on-error -silent -gg -g tiparoj
%
% If one prefers LuaLaTeX, one can instead run:
% latexmk -lualatex -interaction=nonstopmode -halt-on-error -silent -gg -g tiparoj
%
\documentclass[%
fontset=none,
oneside,
]{ctexbook}
% This packages allows one to check if XeLaTeX is used
% and to do something if it is the case.
\usepackage{ifxetex}
\ifxetex
% This line allows space (U+0020) between CJK characters.
\xeCJKsetup{CJKspace=true}
\fi
% The following lines set the fonts used by the document.
% "fontspec" has been imported (by "ctexbook").
\IfFontExistsTF{XITS-Regular.otf}{%
\IfFontExistsTF{XITS-Italic.otf}{%
\IfFontExistsTF{FiraSans-SemiBold.otf}{%
\IfFontExistsTF{FiraSans-SemiBoldItalic.otf}{%
\setmainfont{XITS}[
Path,
UprightFont = *-Regular.otf,
BoldFont = FiraSans-SemiBold.otf,
ItalicFont = *-Italic.otf,
BoldItalicFont = FiraSans-SemiBoldItalic.otf
]
}{}
}{}
}{}
}{}
\IfFontExistsTF{FiraSans-Light.otf}{%
\IfFontExistsTF{FiraSans-SemiBold.otf}{%
\IfFontExistsTF{FiraSans-LightItalic.otf}{%
\IfFontExistsTF{FiraSans-SemiBoldItalic.otf}{%
\setsansfont{FiraSans}[
Path,
UprightFont = *-Light.otf,
BoldFont = *-SemiBold.otf,
ItalicFont = *-LightItalic.otf,
BoldItalicFont = *-SemiBoldItalic.otf
]
}{}
}{}
}{}
}{}
\IfFontExistsTF{SarasaMonoSC-Light.ttf}{%
\IfFontExistsTF{SarasaMonoSC-LightItalic.ttf}{%
\IfFontExistsTF{SarasaMonoSC-SemiBold.ttf}{%
\IfFontExistsTF{SarasaMonoSC-SemiBoldItalic.ttf}{%
\setmonofont{SarasaMonoSC}[
Path,
UprightFont = *-Light.ttf,
BoldFont = *-SemiBold.ttf,
ItalicFont = *-LightItalic.ttf,
BoldItalicFont = *-SemiBoldItalic.ttf
]
}{}
}{}
}{}
}{}
\IfFontExistsTF{SarasaMonoSC-Light.ttf}{%
\IfFontExistsTF{SarasaMonoSC-LightItalic.ttf}{%
\IfFontExistsTF{SarasaMonoSC-SemiBold.ttf}{%
\IfFontExistsTF{SarasaMonoSC-SemiBoldItalic.ttf}{%
\PassOptionsToClass{fontset=none}{ctexbook}
\setCJKsansfont{SarasaMonoSC}[
Path,
UprightFont = *-Light.ttf,
BoldFont = *-SemiBold.ttf,
ItalicFont = *-LightItalic.ttf,
BoldItalicFont = *-SemiBoldItalic.ttf
]
\setCJKmonofont{SarasaMonoSC}[
Path,
UprightFont = *-Light.ttf,
BoldFont = *-SemiBold.ttf,
ItalicFont = *-LightItalic.ttf,
BoldItalicFont = *-SemiBoldItalic.ttf
]
}{}
}{}
}{}
}{}
\IfFontExistsTF{SourceHanSerifCN-Light.otf}{%
\IfFontExistsTF{SarasaMonoSC-Light.ttf}{%
\IfFontExistsTF{SarasaMonoSC-LightItalic.ttf}{%
\IfFontExistsTF{SarasaMonoSC-SemiBold.ttf}{%
\IfFontExistsTF{SarasaMonoSC-SemiBoldItalic.ttf}{%
\setCJKmainfont{SourceHanSerifCN}[
Path,
UprightFont = *-Light.otf,
BoldFont = SarasaMonoSC-SemiBold.ttf,
ItalicFont = SarasaMonoSC-LightItalic.ttf,
BoldItalicFont = SarasaMonoSC-SemiBoldItalic.ttf
]
}{}
}{}
}{}
}{}
}{}
% These are packages that deal with mathematical formulae.
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage[
math-style=ISO,
bold-style=ISO,
mathrm=sym,
mathbf=sym,
partial=upright,
warnings-off={mathtools-colon,mathtools-overbracket}
]{unicode-math}
\allowdisplaybreaks[3]
% I specify the mathematical fonts used by the document.
\IfFontExistsTF{XITSMath-Regular.otf}{%
\setmathfont{XITSMath-Regular.otf}
}{}
\IfFontExistsTF{texgyretermes-math.otf}{%
\setmathfont{texgyretermes-math.otf}[range=bb/{latin,Latin}]
}{}
\IfFontExistsTF{STIXTwoMath-Regular.otf}{%
\setmathfont{STIXTwoMath-Regular.otf}[range={"2218-"2218}]
}{}
% https://clagnut.com/blog/2380
\newcommand*{\TextA}{今国意我永然警转酬随风鹰.}
\newcommand*{\TextC}{三今力國愛書東永袋酬鬱鷹.}
\newcommand*{\TextJ}{いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす(ん).}
\newcommand*{\TextK}{키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다.}
\newcommand*{\TextD}{Pa's wijze lynx bezag vroom het fikse aquaduct.}
\newcommand*{\TextE}{Eble ĉiu kvazaŭ-deca fuŝĥoraĵo ĝojigos homtipon.}
\newcommand*{\TextU}{The quick brown fox jumped over the lazy dogs.}
\newcommand*{\TextG}{Ο καλύμνιος σφουγγαράς ψιθύρισε πως θα βουτήξει χωρίς να διστάζει.}
\newcommand*{\TextN}{9,876; 543,210.}
\newcommand*{\TextR}{Широкая электрификация южных губерний даст мощный толчок подъёму сельского хозяйства.}
\newcommand*{\Text}{%
\TextA{}
\TextC{}
\TextJ{}
\TextK{}
\TextE{}
% \TextD{}
\TextU{}
\TextG{}
\TextR{}
\TextN{}%
}
% I copied the magic from "memoir", a document class
% for typesetting poetry, fiction, non-fiction,
% and mathematical works.
% According to the basic user manual of "memoir",
% TeX tries very hard to keep text lines justified
% while keeping the interword spacing as constant as possible,
% but sometimes fails and complains about an overfull hbox.
% The default mode for LaTeX typesetting is \fussy
% where the (variation of) interword
% spacing in justified text is kept to a minimum.
% Following the \sloppy declaration
% there may be a much looser setting of justified text.
% Additionally the class ("memoir")
% provides the \midsloppy declaration
% which allows a setting somewhere between \fussy and \sloppy.
% Using \midsloppy one will get
% fewer overfull lines compared with \fussy
% and fewer obvious large interword spaces than with \sloppy.
\makeatletter
\providecommand*{\midsloppy}{%
\tolerance 5000%
\hbadness 4000%
\emergencystretch 1.5em%
\hfuzz .1\p@%
\vfuzz\hfuzz}
\makeatother
\begin{document}
% This line kills as many overfull lines as possible.
\midsloppy
\begingroup
\normalfont\rmfamily\mdseries\upshape\Text
\vspace{2ex}
\normalfont\rmfamily\bfseries\upshape\Text
\vspace{2ex}
\normalfont\rmfamily\mdseries\itshape\Text
\vspace{2ex}
\normalfont\rmfamily\bfseries\itshape\Text
\vspace{2ex}
\normalfont\sffamily\mdseries\upshape\Text
\vspace{2ex}
\normalfont\sffamily\bfseries\upshape\Text
\vspace{2ex}
\normalfont\sffamily\mdseries\itshape\Text
\vspace{2ex}
\normalfont\sffamily\bfseries\itshape\Text
\vspace{2ex}
\normalfont\ttfamily\mdseries\upshape\Text
\vspace{2ex}
\normalfont\ttfamily\bfseries\upshape\Text
\vspace{2ex}
\normalfont\ttfamily\mdseries\itshape\Text
\vspace{2ex}
\normalfont\ttfamily\bfseries\itshape\Text
\normalfont
\endgroup
% XITS Math
\begin{equation*}
a^3 + b^3 + c^3 - 3abc
= (a + b + c)(a^2 + b^2 + c^2 - ab - bc - ca)
\end{equation*}
% TeX Gyre Termes Math (ℕ, ℤ, ℚ, ℝ, ℂ)
% and XITS Math (⊂)
\begin{equation*}
\mathbb{N}
\subset \mathbb{Z}
\subset \mathbb{Q}
\subset \mathbb{R}
\subset \mathbb{C}
\end{equation*}
% STIX Two Math (∘)
% and XITS Math (other mathematical symbols)
\begin{equation*}
(h \circ g) \circ f = h \circ (g \circ f)
\end{equation*}
\end{document}