-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc.tex
378 lines (363 loc) · 14.3 KB
/
doc.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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
\documentclass{flownotes}
\begin{document}
% notes
\begin{notebox}{Doc\#19072501}
\tcbsubtitle{A digital template for my notebook}
At some point in July, 2019,
I got the idea of maybe developing a digital version of my note taking method,
using \XeLaTeX.
I hope it could be easy and efficient to use and the same time it keeps all the features of my original on-paper note taking method.
If this is possible, then I can get rid of a heavy notebook being carried all the time and yet I can still take notes like I have been doing.
\tcbline
The template is based on the \noteurl[tufte-book]{https://github.com/Tufte-LaTeX/tufte-latex} class.
\tcbsubtitle{font settings and usage}
{\centering
\resizebox{\columnwidth}{!}{
\begin{tabular}{cccc}
\toprule
\multicolumn{1}{c}{\textbf{Language}} &
\multicolumn{1}{c}{\textbf{Style}} &
\multicolumn{1}{c}{\textbf{Font}} &
\multicolumn{1}{c}{\textbf{Examples}} \\
\midrule
\begin{tabular}{l}
Latin\\
\end{tabular}
&
\begin{tabular}{l}
Serif\\
Sans Serif\\
Monospace\\
\end{tabular}
&
\begin{tabular}{r}
Bembo\\
GillSans\\
Menlo\\
\end{tabular}
&
\begin{tabular}{r}
ABC123\\
\textsf{ABC123}\\
\texttt{ABC123}\\
\end{tabular}
\\
\midrule
\begin{tabular}{l}
CJK\\
\end{tabular}
&
\begin{tabular}{l}
Serif\\
Sans Serif\\
Monospace\\
\end{tabular}
&
\begin{tabular}{r}
SourceHanSerif\\
SourceHanSans\\
SourceHanMono\\
\end{tabular}
&
\begin{tabular}{r}
汉字かな한글\\
{\sans 汉字かな한글}\\
{\sans 汉字かな한글}\\
\end{tabular}
\\
\bottomrule
\end{tabular}}\par
}
\tcbline
The default CJK glyphs are for Simplified Chinese. To change them for a specific CJK language, use the following commands:
\begin{lstlisting}[language=TeX,
basicstyle=\coding\jp,
commentstyle=\color{gray},
keywordstyle=\color{blue}\bfseries]
\jp % Japanese: 骨文才免返曜
\end{lstlisting}
\begin{lstlisting}[language=TeX,
basicstyle=\coding\kr,
commentstyle=\color{gray},
keywordstyle=\color{blue}\bfseries]
\kr % Korean: 骨文才免返曜
\end{lstlisting}
\begin{lstlisting}[language=TeX,
basicstyle=\coding\sch,
commentstyle=\color{gray},
keywordstyle=\color{blue}\bfseries]
\sch % Simplified Chinese: 骨文才免返曜
\end{lstlisting}
\begin{lstlisting}[language=TeX,
basicstyle=\coding\tch,
commentstyle=\color{gray},
keywordstyle=\color{blue}\bfseries]
\tch % Traditional Chinese: 骨文才免返曜
\end{lstlisting}
% \makeatletter
% \@for\sun:={rising,setting}\do{The sun is \sun. }
% \makeatother
\tcbline
other useful commands:
\begin{lstlisting}[language=TeX,
basicstyle=\coding,
commentstyle=\color{gray},
keywordstyle=\color{blue}\bfseries]
\coding % Menlo + Source Han Mono
\sansall % Source Han Sans for all chars
\sans % GillSans + Source Han Sans
\end{lstlisting}
\end{notebox}
\clearpage
\rfnote[0.8cm]{2}{blue}{Example of referring to text in a note box}
\rfnote[0.8cm]{4}{red}{Cascaded ref note}
\rfnote[0.8cm]{3}{red}{\markinmargin{4}{purple}{Example}of referring to text in the margin}
\begin{notebox}{Doc\#19072801}
\tcbsubtitle{Continue on Doc\#19072501 -- reference notes}
Drawing arrows to refer to some text is very frequent in my notes.\markintext{2}{blue}{This example}links to the reference note on the margin of this page. It is done by:
{\lstset{language=[LaTeX]{TeX},alsoletter={\\},emph={\\,/,notebox},emphstyle=\color{lime!60!black},alsoletter={/}}
\begin{lstlisting}[
basicstyle=\coding,
commentstyle=\color{gray},
frameround=fttt,
frame=trBL,
morekeywords={rfnote},
morekeywords={markintext},
keywordstyle=\color{blue}\bfseries]
% \clearpage
\rfnote[<offset>]{<ref id>}{<color>}{<text>}
\begin{notebox}/
\markintext{<red id>}{<color>}{<text>}
\end{notebox}
\end{lstlisting}}
\texttt{<offset>} means to adjust the end point of the arrow on the ref note. We need this because there is some unknown bug on getting the exact position of a tikz node on the margin. However, this is optional. It should be something like \texttt{0.8cm}. \texttt{<offset>} must be an integer. \texttt{<color>} can be \texttt{blue}, \texttt{red}, etc. The two \texttt{<text>}s are linked texts.
\tcbline
I also want to allow cascading as well.\markintext{3}{red}{This is an example.}It is done by:
\begin{lstlisting}[language=TeX,
basicstyle=\coding,
commentstyle=\color{gray}]
% \clearpage
\rfnote[<offset>]{<ref id #1>}{<color>}{<text>}
\rfnote[<offset>]{<ref id #2>}{<color>}{
\markinmargin{<ref id #1>}{<color>}{<text>}}
\begin{notebox}{<title>}
\markintext{<ref id #2>}{<color>}{<text>}
\end{notebox}
\end{lstlisting}
Note that when the linked \texttt{<text>} is in the margin, then you should use \texttt{\textbackslash markinmargin} instead of \texttt{\textbackslash markintext}.
I recommend using the same color for a whole cascading chain so that it is clear to see.
\tcbsubtitle{To structure a note}
The main part of a note is located in a note box environment. we can use blue-background subtitles and dash lines to structure a note. The related commands are:
\begin{lstlisting}[language=TeX,
basicstyle=\coding,
commentstyle=\color{gray}]
\begin{notebox}{<title>}
\tcbsubtitle{<subtitle>}
\tcbline % dash line
\end{notebox}
\end{lstlisting}
\end{notebox}
\clearpage
\rfnote[0.8cm]{5}{blue}{See here!}
\begin{notebox}{Doc\#19072901}
\tcbsubtitle{vertical texts}
Since CJK texts can be formatted vertically, I think it is beneficial to have a simple command to do that.
\cjkvert[\sans]{0.45\textwidth}{
{\sch 这,是一句中文竖排字符。}\\
\ \\
{\jp これは、\ruby{縦書}{た\ \ て\ \ が}きの文字です。}\\
\ \\
不建议用半角字符ABC123\\
\ \\
建议用全角的ABC123\\
\ \\
{\jp \symbol{"32FF}元年七月二十九日。}\\
}
To do this, use:
\begin{lstlisting}[language=TeX,
basicstyle=\coding,
commentstyle=\color{gray}]
\cjkvert[<commands>]{<vertical length>}{<text>}
\end{lstlisting}
For example, to get the above output, \texttt{<commands>} should be \texttt{\textbackslash sans} and \texttt{<vertical length>} should be \texttt{0.45\textbackslash textwidth}
\tcbline
I aslo want to use Furigana when I am writting some Japanese texts. You can do this as the following example:
\begin{lstlisting}[language=TeX,
basicstyle=\coding\jp,
commentstyle=\color{gray}]
\ruby{外貨}{がいか}預金には、
\ruby{為替}{かわせ}差益や為替差損があります。
\end{lstlisting}
The result is:
{\centering\jp \ruby{外貨}{が\ \ い\ \ か}預金には、
\ruby{為替}{か\ \ わ\ \ せ}差益や為替差損があります。\par}
\end{notebox}
\begin{fullwidth}
\begin{notebox}{Doc\#19073001}
\tcbsubtitle{expand the note box to the whole page}
We can do this using the \texttt{fullwidth} environment provided by \noteurl[tufte-book]{https://github.com/Tufte-LaTeX/tufte-latex} package itself outside the \texttt{notebox} environment.\markintext{5}{blue}{ref note should still work.}However, I don't recommend expanding the note box when using ref notes because some ref notes maybe hidden by the note box.
\end{notebox}
\end{fullwidth}
\clearpage
\begin{notebox}{Doc\#19080201}
\tcbsubtitle{Q\&A}
Q\&A is a very effective way of taking notes. It helps you to get the point of a note very quickly because knowledge is essentially about answering questions. If there are no questions, there is no knowledge.
\qa[2]{The question goes here}{The answer goes here}
To do this, use the following command:
\begin{lstlisting}[language=TeX,
basicstyle=\coding,
commentstyle=\color{gray}]
\qa[<q&a id>]{<question>}{<answer>}
\end{lstlisting}
\end{notebox}
\begin{notebox}{Doc\#190100101}
\tcbsubtitle{Updates on the template}
We now make \textbf{Bold} and \textit{Italic} fonts possible. Here is an example list for both Latin and CJK characters.
{\centering
\begin{tabular}{cccc}
\toprule
\multicolumn{1}{c}{\textbf{Language}} &
\multicolumn{1}{c}{\textbf{Style}} &
\multicolumn{1}{c}{\textbf{Bold}} &
\multicolumn{1}{c}{\textbf{Italic}} \\
\midrule
\begin{tabular}{l}
Latin\\
\end{tabular}
&
\begin{tabular}{l}
Serif\\
Sans Serif\\
Monospace\\
\end{tabular}
&
\begin{tabular}{r}
\textbf{ABC123}\\
\textbf{\textsf{ABC123}}\\
\textbf{\texttt{ABC123}}\\
\end{tabular}
&
\begin{tabular}{r}
\textit{ABC123}\\
\textit{\textsf{ABC123}}\\
\textit{\texttt{ABC123}}\\
\end{tabular}
\\
\midrule
\begin{tabular}{l}
CJK\\
\end{tabular}
&
\begin{tabular}{l}
Serif\\
Sans Serif\\
Monospace\\
\end{tabular}
&
\begin{tabular}{r}
\textbf{汉字かな한글}\\
\textbf{\sans 汉字かな한글}\\
\textbf{\coding 汉字かな한글}\\
\end{tabular}
&
\begin{tabular}{r}
\textit{汉字かな한글}\\
\textit{\sans 汉字かな한글}\\
\textit{\coding 汉字かな한글}\\
\end{tabular}
\\
\bottomrule
\end{tabular}\par
}
\tcbline
We also make a new design on \textit{concept} element.\\
We use a \textit{name-meaning-example} triplet to explain a concept. \\
\concept{name}{meaning}{examples}
To do this, use the following command:
\begin{latexblock}{}{concept}{\small}
\concept[<name>]{<meaning>}{<examples>}
\end{latexblock}
\tcbline
We use curly brackets to group concepts.
\begin{itemize}
\item A
\item B
\begin{fork}
\item B1
\begin{fork}
\item B11
\item B12
\end{fork}
\item B2\tikzmark{a}
\item B3
\item B4\tikzmark{b}
\end{fork}
\item C
\end{itemize}
\merge{a}{b}[merge to $\text{B}^\prime$]
To use forking brackets, make sure you are inside an itemize or enumerate environment, and then use the following envronment:
\begin{latexblock}{fork}{}{\small}
\item A
\begin{fork}
\item A1
\item A2
\end{fork}
\end{latexblock}
To use merging brackets, mark the two endpoints with {\coding \textbackslash tikzmark\{name1\}} and {\coding \textbackslash tikzmark\{name2\}}, and then use the following commands after them:
\begin{latexblock}{}{merge}{\small}
\merge{name1}{name2}[concept C]
\end{latexblock}
\tcbline
Another update is that we now make listing latex code more easy with the following environment (delete the space in {\coding latexbloc\ k}):
\begin{latexblock}{}{merge}{\footnotesize}
\begin{latexbloc k}{emph1,...}{kw1,...}{style commands}
\keyword{emphasized word}
\end{latexbloc k}
\end{latexblock}
\end{notebox}
\clearpage
\begin{fullwidth}
\begin{notebox}{Doc\#19100201}
\tcbsubtitle{updates on text emphasis}
{\centering
\begin{tabular}{cc}
\toprule
\multicolumn{1}{c}{\textbf{Command}} &
\multicolumn{1}{c}{\textbf{Effect}} \\
\midrule
\begin{tabular}{l}
{\coding\textbackslash strikethrough[color]\{text\}}\\
{\coding\textbackslash crossout[color]\{text\}}\\
{\coding\textbackslash highlight[color]\{text\}}\\
{\coding\textbackslash
underline[color]\{text\}}\\
{\coding\textbackslash underdbline[color]\{text\}}\\
{\coding\textbackslash underwave[color]\{text\}}\\
{\coding\textbackslash underdot[color]\{text\}}\\
{\coding\textbackslash undertriangle[color]\{text\}}\\
{\coding\textbackslash undercircle[color]\{text\}}\\
{\coding\textbackslash undercross[color]\{text\}}\\
\end{tabular}
&
\begin{tabular}{l}
\strikethrough[red]{AaBbCc123汉字かな한글}\ \\
\crossout[red]{AaBbCc123汉字かな한글}\\
\highlight{AaBbCc123汉字かな한글}\\
\underline[red]{AaBbCc123汉字かな한글}\\
\underdbline[red]{AaBbCc123汉字かな한글}\\
\underwave[red]{AaBbCc123汉字かな한글}\\
\underdot[red]{AaBbCc123汉字かな한글}\\
\undertriangle[red]{AaBbCc123汉字かな한글}\\
\undercircle[red]{AaBbCc123汉字かな한글}\\
\undercross[red]{AaBbCc123汉字かな한글}\\
\end{tabular}
\\
\bottomrule
\end{tabular}\par
}
\end{notebox}
\end{fullwidth}
\clearpage
\bibliography{docbib}
\bibliographystyle{abbrv}
\end{document}