├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── documentation_CJKsc ├── .vscode │ └── settings.json ├── Cleaning.cmd ├── Compiling.cmd ├── chapters │ ├── 介绍.tex │ ├── 前言.tex │ ├── 图像与表格.tex │ ├── 字母表.tex │ ├── 引用.tex │ ├── 排版.tex │ ├── 数学.tex │ ├── 文本标注.tex │ ├── 译者序.tex │ ├── 选项.tex │ └── 附录.tex ├── images │ ├── miktex.png │ ├── monalisa.jpg │ └── seaside.jpeg ├── main.bib ├── main.pdf ├── main.tex └── styles │ ├── config.tex │ ├── kaoCJKsc.sty │ ├── kaoWinCJKsc.sty │ ├── kaobiblioCJKsc.sty │ ├── kaobookCJKsc.cls │ ├── kaohandtCJKsc.cls │ ├── kaorefsCJKsc.sty │ └── kaotheoremsCJKsc.sty ├── kaobookCJKsc ├── Cleaning.cmd ├── Compiling.cmd ├── screenshots │ ├── main-doc.png │ ├── post-doc.png │ └── pre-doc.png └── styles │ ├── config.tex │ ├── kaoCJKsc.sty │ ├── kaoWinCJKsc.sty │ ├── kaobiblioCJKsc.sty │ ├── kaobookCJKsc.cls │ ├── kaohandtCJKsc.cls │ ├── kaorefsCJKsc.sty │ └── kaotheoremsCJKsc.sty ├── kaobook_origin ├── .github │ ├── CONTRIBUTING.md │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE │ │ ├── bug_report.md │ │ └── feature_request.md │ ├── SUPPORT.md │ └── workflows │ │ └── verify_examples.yml ├── .gitignore ├── CHANGELOG.rst ├── CODE_OF_CONDUCT.md ├── LICENSE ├── MANIFEST.md ├── README.md ├── example_and_documentation.pdf ├── examples │ ├── README.md │ ├── documentation │ │ ├── .latexmkrc │ │ ├── chapters │ │ │ ├── appendix.tex │ │ │ ├── figsntabs.tex │ │ │ ├── introduction.tex │ │ │ ├── layout.tex │ │ │ ├── mathematics.tex │ │ │ ├── options.tex │ │ │ ├── preface.tex │ │ │ ├── references.tex │ │ │ └── textnotes.tex │ │ ├── glossary.tex │ │ ├── images │ │ │ ├── monalisa.jpg │ │ │ └── seaside.jpeg │ │ ├── main.bib │ │ ├── main.pdf │ │ └── main.tex │ ├── machine_learning_project │ │ ├── img │ │ │ ├── bid_expr.png │ │ │ ├── bid_tba.png │ │ │ ├── cv.png │ │ │ ├── cv_example.png │ │ │ ├── expr_vs_tba.png │ │ │ ├── nested_cv.png │ │ │ ├── qq.png │ │ │ ├── regreg.png │ │ │ ├── response.png │ │ │ ├── rho2distr.png │ │ │ ├── tba_tf.png │ │ │ └── tigar_article.png │ │ ├── main.bib │ │ ├── main.pdf │ │ ├── main.tex │ │ └── sections │ │ │ ├── data.tex │ │ │ ├── discussion.tex │ │ │ ├── introduction.tex │ │ │ └── results.tex │ ├── minimal_book │ │ ├── main.pdf │ │ └── main.tex │ └── minimal_report │ │ ├── main.pdf │ │ └── main.tex ├── instructions │ ├── README.md │ ├── latexmk │ │ └── latexmkrc │ ├── normal_usage │ │ └── README.md │ ├── sharelatex_server │ │ ├── 1_DockerShareLatexInstallationSHORT.pdf │ │ ├── 2_DockerSharelatexLONG.txt │ │ └── 3_DockerShareLatexInstallation.docx │ └── texlive_integration │ │ └── README.md ├── kao.sty ├── kaobiblio.sty ├── kaobook.cls ├── kaohandt.cls ├── kaorefs.sty └── kaotheorems.sty ├── minimal_book_CJKsc ├── Cleaning.cmd ├── Compiling.cmd ├── main.bib ├── main.pdf ├── main.tex └── styles │ ├── config.tex │ ├── kaoCJKsc.sty │ ├── kaoWinCJKsc.sty │ ├── kaobiblioCJKsc.sty │ ├── kaobookCJKsc.cls │ ├── kaohandtCJKsc.cls │ ├── kaorefsCJKsc.sty │ └── kaotheoremsCJKsc.sty └── minimal_report_CJKsc ├── Cleaning.cmd ├── Compiling.cmd ├── main.bib ├── main.pdf ├── main.tex └── styles ├── config.tex ├── kaoCJKsc.sty ├── kaoWinCJKsc.sty ├── kaobiblioCJKsc.sty ├── kaobookCJKsc.cls ├── kaohandtCJKsc.cls ├── kaorefsCJKsc.sty └── kaotheoremsCJKsc.sty /.gitignore: -------------------------------------------------------------------------------- 1 | ## Custom exclusions 2 | article-template.pdf 3 | book-template.pdf 4 | Makefile.cmd 5 | 6 | ## Core latex/pdflatex auxiliary files: 7 | *.aux 8 | *.lof 9 | *.log 10 | *.lot 11 | *.fls 12 | *.out 13 | *.toc 14 | *.fmt 15 | *.fot 16 | *.cb 17 | *.cb2 18 | .*.lb 19 | 20 | ## Intermediate documents: 21 | *.dvi 22 | *.xdv 23 | *-converted-to.* 24 | # these rules might exclude image files for figures etc. 25 | # *.ps 26 | # *.eps 27 | # *.pdf 28 | 29 | ## Generated if empty string is given at "Please type another file name for output:" 30 | .pdf 31 | 32 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 33 | *.bbl 34 | *.bcf 35 | *.blg 36 | *-blx.aux 37 | *-blx.bib 38 | *.run.xml 39 | 40 | ## Build tool auxiliary files: 41 | *.fdb_latexmk 42 | *.synctex 43 | *.synctex(busy) 44 | *.synctex.gz 45 | *.synctex.gz(busy) 46 | *.pdfsync 47 | 48 | ## Auxiliary and intermediate files from other packages: 49 | # algorithms 50 | *.alg 51 | *.loa 52 | 53 | # achemso 54 | acs-*.bib 55 | 56 | # amsthm 57 | *.thm 58 | 59 | # beamer 60 | *.nav 61 | *.pre 62 | *.snm 63 | *.vrb 64 | 65 | # changes 66 | *.soc 67 | 68 | # cprotect 69 | *.cpt 70 | 71 | # elsarticle (documentclass of Elsevier journals) 72 | *.spl 73 | 74 | # endnotes 75 | *.ent 76 | 77 | # fixme 78 | *.lox 79 | 80 | # feynmf/feynmp 81 | *.mf 82 | *.mp 83 | *.t[1-9] 84 | *.t[1-9][0-9] 85 | *.tfm 86 | 87 | #(r)(e)ledmac/(r)(e)ledpar 88 | *.end 89 | *.?end 90 | *.[1-9] 91 | *.[1-9][0-9] 92 | *.[1-9][0-9][0-9] 93 | *.[1-9]R 94 | *.[1-9][0-9]R 95 | *.[1-9][0-9][0-9]R 96 | *.eledsec[1-9] 97 | *.eledsec[1-9]R 98 | *.eledsec[1-9][0-9] 99 | *.eledsec[1-9][0-9]R 100 | *.eledsec[1-9][0-9][0-9] 101 | *.eledsec[1-9][0-9][0-9]R 102 | 103 | # glossaries 104 | *.acn 105 | *.acr 106 | *.glg 107 | *.glo 108 | *.gls 109 | *.glsdefs 110 | 111 | # gnuplottex 112 | *-gnuplottex-* 113 | 114 | # gregoriotex 115 | *.gaux 116 | *.gtex 117 | 118 | # htlatex 119 | *.4ct 120 | *.4tc 121 | *.idv 122 | *.lg 123 | *.trc 124 | *.xref 125 | 126 | # hyperref 127 | *.brf 128 | 129 | # knitr 130 | *-concordance.tex 131 | # TODO Comment the next line if you want to keep your tikz graphics files 132 | *.tikz 133 | *-tikzDictionary 134 | 135 | # listings 136 | *.lol 137 | 138 | # makeidx 139 | *.idx 140 | *.ilg 141 | *.ind 142 | *.ist 143 | 144 | # minitoc 145 | *.maf 146 | *.mlf 147 | *.mlt 148 | *.mtc[0-9]* 149 | *.slf[0-9]* 150 | *.slt[0-9]* 151 | *.stc[0-9]* 152 | 153 | # minted 154 | _minted* 155 | *.pyg 156 | 157 | # morewrites 158 | *.mw 159 | 160 | # nomencl 161 | *.nlg 162 | *.nlo 163 | *.nls 164 | 165 | # pax 166 | *.pax 167 | 168 | # pdfpcnotes 169 | *.pdfpc 170 | 171 | # sagetex 172 | *.sagetex.sage 173 | *.sagetex.py 174 | *.sagetex.scmd 175 | 176 | # scrwfile 177 | *.wrt 178 | 179 | # sympy 180 | *.sout 181 | *.sympy 182 | sympy-plots-for-*.tex/ 183 | 184 | # pdfcomment 185 | *.upa 186 | *.upb 187 | 188 | # pythontex 189 | *.pytxcode 190 | pythontex-files-*/ 191 | 192 | # thmtools 193 | *.loe 194 | 195 | # TikZ & PGF 196 | *.dpth 197 | *.md5 198 | *.auxlock 199 | 200 | # todonotes 201 | *.tdo 202 | 203 | # easy-todo 204 | *.lod 205 | 206 | # xmpincl 207 | *.xmpi 208 | 209 | # xindy 210 | *.xdy 211 | 212 | # xypic precompiled matrices 213 | *.xyc 214 | 215 | # endfloat 216 | *.ttt 217 | *.fff 218 | 219 | # Latexian 220 | TSWLatexianTemp* 221 | 222 | ## Editors: 223 | # WinEdt 224 | *.bak 225 | *.sav 226 | 227 | # Texpad 228 | .texpadtmp 229 | 230 | # Kile 231 | *.backup 232 | 233 | # KBibTeX 234 | *~[0-9]* 235 | 236 | # auto folder when using emacs and auctex 237 | ./auto/* 238 | *.el 239 | 240 | # expex forward references with \gathertags 241 | *-tags.tex 242 | 243 | # standalone packages 244 | *.sta 245 | 246 | # generated if using elsarticle.cls 247 | *.spl 248 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | git add . && git commit --amend --no-edit && git push --force 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kaobookCJKsc - 一个美观的简体中文 LaTeX 模板 2 | 3 | ## 使用 4 | 5 | 复制 `kaobookCJKsc` 所有文件到项目同级目录: 6 | 7 | ``` 8 | . 9 | ├── styles 10 | │   ├── kaobiblioCJKsc.sty 11 | │   ├── kaobookCJKsc.cls 12 | │   ├── kaoCJKsc.sty 13 | │   ├── kaoWinCJKsc.sty 14 | │   ├── kaohandtCJKsc.cls 15 | │   ├── kaorefsCJKsc.sty 16 | │   ├── kaotheoremsCJKsc.sty 17 | │   └── config.tex 18 | ├── main.tex # 你的 LaTeX 文件 19 | ├── Compiling.cmd 20 | └── Cleaning.cmd 21 | ``` 22 | 23 | 编译需要切换到 `xelatex`,`Windows` 平台搭配 `MiKTeX` 发行版,可以直接使用 `Compiling.cmd` 实现一键编译,其他平台类似。 24 | 25 | 编译过程参考以下命令: 26 | 27 | ```latex 28 | xelatex main # 预编译模板 29 | makeindex main.nlo -s nomencl.ist -o main.nls # 编译索引 30 | makeindex main # 编译索引 31 | biber main # 编译参考文献 32 | makeglossaries main # 编译字母表 33 | xelatex main # 再次编译 34 | xelatex main # 两到三次 35 | xelatex main # 防止边注错位 36 | ``` 37 | 38 | 默认使用美观、大方又开源的 [Google Noto](https://github.com/googlefonts/noto-cjk) 字体。如需自定义,可以在配置中自行设定。另外,原版英文字体需安装 `liberation` 系列字体,一并安装。 39 | 40 | > 字体备份:[百度云链接](https://pan.baidu.com/s/1r7qphMtlCdT9M3q26cokfA?pwd=uc75) 41 | 42 | ## 示例 43 | 44 | 包含三个简体中文示例,可以自行测试: 45 | 46 | - documentation_CJKsc 47 | - minimal_book_CJKsc 48 | - minimal_report_CJKsc 49 | 50 | ## 演示 51 | 52 | ![pre-doc](kaobookCJKsc/screenshots/pre-doc.png) 53 | 54 | ![main-doc](kaobookCJKsc/screenshots/main-doc.png) 55 | 56 | ![post-doc](kaobookCJKsc/screenshots/post-doc.png) 57 | 58 | ## FAQ: 59 | 60 | - [TeX capacity exceeded, sorry [main memory size=3000000]](https://tex.stackexchange.com/a/548335) 61 | -------------------------------------------------------------------------------- /documentation_CJKsc/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "latex-workshop.latex.tools": [ 3 | { 4 | "name": "xelatex", 5 | "command": "xelatex", 6 | "args": ["--extra-mem-bot=10000000", "%DOCFILE%"] 7 | }, 8 | { 9 | "name": "pre-makeindex", 10 | "command": "makeindex", 11 | "args": ["%DOCFILE%.nlo", "-s", "nomencl.ist", "-o", "%DOCFILE%.nls"] 12 | }, 13 | { 14 | "name": "makeindex", 15 | "command": "makeindex", 16 | "args": ["%DOCFILE%"] 17 | }, 18 | { 19 | "name": "biber", 20 | "command": "biber", 21 | "args": ["%DOCFILE%"] 22 | }, 23 | { 24 | "name": "makeglossaries", 25 | "command": "makeglossaries", 26 | "args": ["%DOCFILE%"] 27 | } 28 | ], 29 | "latex-workshop.latex.recipes": [ 30 | { 31 | "name": "kaobookCJKsc", 32 | "tools": [ 33 | "xelatex", 34 | "pre-makeindex", 35 | "makeindex", 36 | "biber", 37 | "makeglossaries", 38 | "xelatex", 39 | "xelatex", 40 | "xelatex" 41 | ] 42 | } 43 | ], 44 | "latex-workshop.intellisense.package.enabled": true, 45 | "latex-workshop.latexindent.path": "D:\\Software\\MiKTeX\\latexindent\\latexindent.exe", 46 | "latex-workshop.latex.autoBuild.run": "never", 47 | "latex-workshop.view.pdf.viewer": "tab", 48 | "latex-workshop.latex.autoClean.run": "onFailed", 49 | "latex-workshop.latex.clean.fileTypes": [ 50 | "*.aux", 51 | "*.bbl", 52 | "*.bcf", 53 | "*.blg", 54 | "*.glg", 55 | "*.glo", 56 | "*.gls", 57 | "*.gz", 58 | "*.idx", 59 | "*.ilg", 60 | "*.ind", 61 | "*.lof", 62 | "*.lol", 63 | "*.lot", 64 | "*.mw", 65 | "*.nlo", 66 | "*.nls", 67 | "*.xml", 68 | "*.toc", 69 | "*.xdy" 70 | ] 71 | } 72 | -------------------------------------------------------------------------------- /documentation_CJKsc/Cleaning.cmd: -------------------------------------------------------------------------------- 1 | @echo Cleaning... 2 | del *.aux 3 | del *.bbl 4 | del *.bcf 5 | del *.blg 6 | del *.glg 7 | del *.glo 8 | del *.gls 9 | del *.gz 10 | del *.idx 11 | del *.ilg 12 | del *.ind 13 | del *.loe 14 | del *.lof 15 | del *.log 16 | del *.lol 17 | del *.lot 18 | del *.mw 19 | del *.nlo 20 | del *.nls 21 | del *(busy) 22 | del *.toc 23 | del *.unq 24 | del *.xdy 25 | del *.xml 26 | @echo Finish... 27 | -------------------------------------------------------------------------------- /documentation_CJKsc/Compiling.cmd: -------------------------------------------------------------------------------- 1 | @echo Starting... 2 | xelatex --extra-mem-bot=10000000 main 3 | makeindex main.nlo -s nomencl.ist -o main.nls 4 | makeindex main 5 | biber main 6 | makeglossaries main 7 | xelatex --extra-mem-bot=10000000 main 8 | xelatex --extra-mem-bot=10000000 main 9 | xelatex --extra-mem-bot=10000000 main 10 | @echo Finish... 11 | -------------------------------------------------------------------------------- /documentation_CJKsc/chapters/介绍.tex: -------------------------------------------------------------------------------- 1 | \setchapterpreamble[u]{\margintoc} 2 | \chapter{介绍} 3 | \labch{介绍} 4 | 5 | \section{灵感} 6 | 7 | 许多现代教科书都采用一种显眼的旁白排版,在旁白中可以展示图片,表格,标记等一切可以展示的东西。有证据表明,这种排版通过分离主体文本和辅助文本,有助于作者组织论述。同时,这些引用的辅助文本离主体文本非常近,方便读者查阅。 8 | 9 | 本文档并不是为了论证这种 1.5 栏宽边排版的好坏,因为已经有许多人在做类似的事情了。本文档的目的在于让读者用好 kaobookCJKsc 模板,同时也会介绍该类型的特点。 10 | 11 | kaobookCJKsc 主要灵感来自于这篇\href{https://3d.bk.tudelft.nl/ken/en/2016/04/17/a-1.5-column-layout-in-latex.html}{博客},并且命名来自于原作者的名字 Ken Arroyo Ohori 首字母的缩写——原作者慷慨的授权我基于他的论文样式来创作这份模板。因此,如果你想用这种宽边排版制作你的书籍,可以去读一读他的博文。 12 | 13 | 你可能已经注意到了,另一个灵感来源是 \href{https://github.com/Tufte-LaTeX/tufte-latex}{Tufte-Latex} 模板。设计的本质其实是相似的,因为事实上,已有的这些模板已经足够好了,很难去彻底的提升。但是,我的想法是希望这份模板能比 Tufte-Latex 更灵活。比如,我尝试只用标准的包,并尽量减少从零设计。\sidenote{这也意味着理解并贡献这份模板会变得很容易。确实,许多特性还有待改进,如果感兴趣,就来 Github 主页吧。}因此,对于一些包提供的特性,如果你读了相关的文档,自定义应该非常容易。 14 | 15 | 在这本书里,我会介绍这份模板的主要特性,并提供如何使用和修改相关特性的信息。让我们开始吧。 16 | 17 | \section{是什么} 18 | \labsec{does} 19 | 20 | \Class{kaobookCJKsc} 模板更多关注文档结构,而不是文档样式。正如著名的 \LaTeX 原则强调的,结构和样式应该尽可能分开。这份模板将只提供命令、环境以及一些用于定制的接口。实际上,有些样式相关的设置已经内置在模板中了,但用户仍可以自由定制。 21 | 22 | \noindent 主要特性如下: 23 | 24 | \begin{description} 25 | \item[页面排版] 降低了正文宽度以提高可读性,并且让出空间给文本注释以展示更多元素。 26 | \item[章节标题] 与 Tufte-Latex 不同的是,提供了多种章节标题,可以在本文档查看示例。 27 | \item[页面标题] 平铺整个页面,并且包含了留白。在双页模式下,将交替显示章节名和小节名。\sidenote{这也是区别于 Tufte-Latex 的地方。} 28 | \item[印刷材料] 已重新定义命令 \Command{frontmatter},\Command{mainmatter} 和 \Command{backmatter},以便在主要内容中自动具有宽边距,在前面和后面的内容中具有窄边距。但是,页面样式可以随时更改,即使是在文档的中间。 29 | \item[文本注释] 我们提供命令 \Command{sidenote} 和 \Command{marginnote} 将文本放在页边距中。\sidenote[][-2mm]{sidenote 有编号(像这样!),而 marginnotes 没有编号} 30 | \item[注释图表] \Environment{marginfigure} 和 \Environment{margintable} 是两个很有用的环境,允许你在页边距中放置数字和表格。(参见\reffig{marginmonalisa}). 31 | \item[注释目录] 既然我们有很宽的页边距,为什么不在其中添加一个小目录呢?参考 \Command{margintoc}。 32 | \item[超链接] 默认加载 \Package{hyperref},我们尝试以合理的方式添加书签;特别是,书签级别会在 \Command{appendix} 和 \Command{backmatter} 中自动重置。此外,我们还提供了一个小的包来简化文本其他部分的引用。 33 | \item[参考文献] 我们希望读者能够知道引用了什么,而不必每次都走到文档的末尾,因此引用会出现在页边空白处以及末尾,就像在 Tufte Latex 中一样。然而,与该模板不同的是,您可以根据自己的意愿自由定制引文。 34 | \end{description} 35 | 36 | \begin{marginfigure}[-3.5cm] 37 | \includegraphics{monalisa} 38 | \caption[The Mona Lisa]{蒙娜丽莎\par\url{https://commons.wikimedia.org/wiki/File:Mona_Lisa,_by_Leonardo_da_Vinci,_from_C2RMF_retouched.jpg}} 39 | \labfig{marginmonalisa} 40 | \end{marginfigure} 41 | 42 | 标题页、目录和前言的顺序可以很容易地更改,就像在任何 \LaTeX 文档中一样。此外,该模板基于 \KOMAScript 的 \Class{scrbook},因此它继承了原模板的所有优点。 43 | 44 | \section{不是什么} 45 | \labsec{doesnot} 46 | 47 | 正如预期的那样,该书的进一步定制将留给用户。可以肯定的是,每本书都有相似的旁注、页边数字等,但每本书都有自己独有的字体、目录风格、特殊环境等等。因此,除了类之外,我们只提供合理的默认值,但如果不需要这些特性,则可以忽略它们。这些特殊包位于样式目录中,其组织如下: 48 | 49 | \begin{description} 50 | \item[kaoCJKsc.sty] 包含宏的最重要定义和页面排版规范。这是 \Class{kaobookCJKsc} 的核心。特殊功能包括:最常用的 \LaTeX 包已经自动加载;更改默认排版有一定的灵活性;一些特殊的环境(周围有彩色框、浮动或带计数的组件)是预定义的。\sidenote{参见\refch{引用}。}这是模仿 \Package{biblatex} 的。 51 | \item[kaorefsCJKsc.sty] 包含一些有用的命令来管理标签和引用,再次确保始终以一致的方式引用相同的元素。 52 | \item[kaotheoremsCJKsc.sty] 对于数学环境的样式,可以选择将其包装在彩色的 \Package{mdframed} 块中,如本文档所示,也可以不包装。 53 | \item[kaoWinCJKsc.sty] 提供 Windows 平台相关的设置。 54 | \item[config.tex] 存放一些无法放入样式文件的配置。 55 | \end{description} 56 | 57 | \marginnote[2mm]{大胆的用户可能会想编辑其中一些软件包。如果他们能给我寄来他们所能做到的例子,我将非常高兴!} 58 | 59 | 在本书的其余部分中,我将假设读者不是使用 \LaTeX 的新手,并参考本课程中使用的软件包的文档,了解其中已经解释的内容。此外,如果读者不喜欢默认设置,我假设读者愿意对提供的样式、环境和命令包进行少量编辑。 60 | 61 | \section{如何用} 62 | \labsec{howtouse} 63 | 64 | 先从 GitHub 仓库:\url{https://www.github.com/xuehao/kaobookCJKsc} 下载模板。 65 | 66 | 模板的使用方式有很多种。第一种是基于本文档项目,找到 main.tex 文件编辑即可;根据自己的需要删除部分文本,复制粘贴,重新创作。也可以基于另外两个 minimal 项目进行创作,他们是一个简化版本。无论如何,本文档项目都是最好的示例,你可以发现一些有用的特性,加入你自己的项目中。 67 | 68 | 对于想重头创建项目文档的用户,可以按照如下示例,先创建项目结构。默认使用时,文档结构如下所示\marginnote{译者注:注意 styles 文件夹不可以重命名,否则需要修改所有模板中的路径。}: 69 | 70 | \begin{lstlisting}[style=kaolstplain] 71 | . 72 | ├── styles 73 | │   ├── kaobiblioCJKsc.sty 74 | │   ├── kaobookCJKsc.cls 75 | │   ├── kaoCJKsc.sty 76 | │   ├── kaoWinCJKsc.sty 77 | │   ├── kaohandtCJKsc.cls 78 | │   ├── kaorefsCJKsc.sty 79 | │   ├── kaotheoremsCJKsc.sty 80 | │   └── config.tex 81 | ├── main.tex # 你的 LaTeX 文件 82 | ├── Compiling.cmd 83 | └── Cleaning.cmd 84 | \end{lstlisting} 85 | 86 | 编译同样需要使用命令行工具,切换到项目目录依次使用以下命令执行编译过程\marginnote[]{译者注:为了方便,译者提供了编辑好的编译脚本 \textbf{Compiling.cmd}。搭配 MiKTeX 发行版,已经在 Windows 10 平台上稳定使用。}: 87 | 88 | \begin{lstlisting}[style=kaolstplain] 89 | xelatex main # 预编译模板 90 | makeindex main.nlo -s nomencl.ist -o main.nls # 编译索引 91 | makeindex main # 编译索引 92 | biber main # 编译参考文献 93 | makeglossaries main # 编译字母表 94 | xelatex main # 再次编译模板 95 | xelatex main # 两到三次 96 | xelatex main # 防止边注错位 97 | \end{lstlisting} 98 | 99 | 一般情况,按脚本顺序编译完即可,不会有错误。如有问题,可以去社区 \url{https://tex.stackexchange.org} 寻找答案,记得加上 kaobook 标签。当然,也可以在 GitHub 上创建 issues 或直接发邮件给我。 100 | 101 | \section{\LaTeX 工作室} 102 | 103 | 众所周知,主流的 \LaTeX 发行版自带的编辑器非常难用。内置的编译流程也不太全面,无法做到一键编译。\marginnote{译者注:当然,搭配译者制作的一键编译工具,可以缓解一些不便之处!}为了实现高效编辑、简单编译、快速预览,这里推荐一套开源免费又轻巧好用的 \LaTeX 编译套装。推荐的方案是 \href{https://miktex.org/}{MiKTeX} 发行版,\href{https://code.visualstudio.com/}{Visual Studio Code} 编辑器搭配 \href{https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop}{\LaTeX\ Workshop} 插件。\marginnote{译者注:方案选择的首要原则是稳定,其次是跨平台,最后是免费。} 104 | 105 | 搭建自己的编译套装的前提是,\textbf{你必须了解你的编译工作流!}也就是说,针对你的文档项目,必须能使用前一小节介绍的命令行方式把完整的编译过程成功跑一遍。如果没有的话,大概率可以说明,你对 \LaTeX 编译工作流并不理解,后续对 Visual Studio Code 的配置也不可能正确。 106 | 107 | 在 Windows 平台下,要实现命令行完整编译的流程,需要安装以下几个工具: 108 | 109 | \begin{lstlisting}[style=kaolstplain] 110 | \item 一款支持命令行工具的 \LaTeX 发行版,TeX Live 或 MiKTeX 等。 111 | \item 默认支持的字体 112 | \item 用于生成字母表的 Perl 工具 113 | \end{lstlisting} 114 | 115 | 译者推荐安装 \href{https://miktex.org/}{MiKTeX} 发行版,选择 MiKTeX 有两个原因,其一是安装包很小,便于安装;其二是占用空间少,缺失的包会自动下载。Windows 平台安装完成后,打开命令提示符 CMD 输入以下命令测试(参见\reffig{marginmiktex}): 116 | 117 | \begin{lstlisting}[style=kaolstplain] 118 | > xelatex --version 119 | MiKTeX-XeTeX 4.8 (MiKTeX 22.3) 120 | ... 121 | \end{lstlisting} 122 | 123 | \begin{marginfigure} 124 | \includegraphics{miktex} 125 | \caption[MiKTeX]{MiKTeX} 126 | \labfig{marginmiktex} 127 | \end{marginfigure} 128 | 129 | 简体中文模板默认使用美观、大方又开源的 \href{https://github.com/googlefonts/noto-cjk}{Google Noto} 字体。另外,原版英文字体需安装 liberation 系列字体,一并安装。\marginnote{译者注:字体备份 \url{https://pan.baidu.com/s/1r7qphMtlCdT9M3q26cokfA?pwd=uc75}} 130 | 131 | 除了字体,创建字母表页依赖 Perl 工具。为了后期的顺利编译,我们还需要安装 Perl,这里推荐安装 \href{https://strawberryperl.com/}{Strawberry Perl}。如果不需要字母表功能,可以不用安装,删除相关代码即可。 132 | 133 | 至此,已经可以愉快的使用命令行工具生成完整文档了。如上所述,我们继续安装 Visual Studio Code 以及其 \LaTeX Workshop 插件,以便实现高效编辑、自动编译、快捷预览等功能。 134 | 135 | 如果你之前使用命令行工具成功编译过你的项目,那么你一定会发现项目目录中多了很多杂七杂八的文件。每次删除都非常麻烦,一不小心还会删除自己的文件。\marginnote{译者注:对习惯命令行编译的用户,译者也慷慨地提供了一键清理工具 \textbf{Cleaning.cmd}。这也未尝不是一个好办法。}\LaTeX 项目需要多次编译,每次编译会依赖前一次生成的信息。对于我们这个工作流,编辑器插件虽然提供了自动清除功能,但由于其调用时机不确定,经常影响编译结果,所以不建议大家使用。因此,除非项目编译失败,编译过程中切记不要删除这些中间文件!只有确保文档创建成功后,再一次性清理。 136 | -------------------------------------------------------------------------------- /documentation_CJKsc/chapters/前言.tex: -------------------------------------------------------------------------------- 1 | \chapter*{前言} 2 | \addcontentsline{toc}{chapter}{前言} % Add the preface to the table of contents as a chapter 3 | 4 | I am of the opinion that every \LaTeX\xspace geek, at least once during 5 | his life, feels the need to create his or her own class: this is what 6 | happened to me and here is the result, which, however, should be seen as 7 | a work still in progress. Actually, this class is not completely 8 | original, but it is a blend of all the best ideas that I have found in a 9 | number of guides, tutorials, blogs and tex.stackexchange.com posts. In 10 | particular, the main ideas come from two sources: 11 | 12 | \begin{itemize} 13 | \item \href{https://3d.bk.tudelft.nl/ken/en/}{Ken Arroyo Ohori}'s 14 | \href{https://3d.bk.tudelft.nl/ken/en/nl/ken/en/2016/04/17/a-1.5-column-layout-in-latex.html}{Doctoral 15 | Thesis}, which served, with the author's permission, as a backbone 16 | for the implementation of this class; 17 | \item The 18 | \href{https://github.com/Tufte-LaTeX/tufte-latex}{Tufte-Latex 19 | Class}, which was a model for the style. 20 | \end{itemize} 21 | 22 | The first chapter of this book is introductory and covers the most 23 | essential features of the class. Next, there is a bunch of chapters 24 | devoted to all the commands and environments that you may use in writing 25 | a book; in particular, it will be explained how to add notes, figures 26 | and tables, and references. The second part deals with the page layout 27 | and design, as well as additional features like coloured boxes and 28 | theorem environments. 29 | 30 | I started writing this class as an experiment, and as such it should be 31 | regarded. Since it has always been intended for my personal use, it may 32 | not be perfect but I find it quite satisfactory for the use I want to 33 | make of it. I share this work in the hope that someone might find here 34 | the inspiration for writing his or her own class. 35 | 36 | \begin{flushright} 37 | \textit{Federico Marotta} 38 | \end{flushright} 39 | -------------------------------------------------------------------------------- /documentation_CJKsc/chapters/图像与表格.tex: -------------------------------------------------------------------------------- 1 | \setchapterpreamble[u]{\margintoc} 2 | \chapter{图像与表格} 3 | 4 | \footnotetext{The credits for the image above the chapter title go to: 5 | Bushra Feroz, CC~BY-SA~4.0, \url{https://commons.wikimedia.org/w/index.php?curid=68724647}} 6 | 7 | \section{普通图像与表格} 8 | 9 | Figures and tables can be inserted just like in any standard 10 | \LaTeX\xspace document. The \Package{graphicx} package is already loaded 11 | and configured in such a way that the figure width is equal to the 12 | textwidth and the height is adjusted in order to maintain the original 13 | aspect ratio. As you may have imagined, the captions will be 14 | positioned\ldots well, in the margins. This is achieved with the help of 15 | the \Package{floatrow} package. 16 | 17 | Here is a picture of Mona Lisa (\reffig{normalmonalisa}), as an example. 18 | The captions are formatted as the margin- and the side-notes; If you 19 | want to change something about captions you can use the command 20 | \Command{captsetup} from the \Package{caption} package. Remember that if 21 | you want to reference a figure, the label must come \emph{after} the 22 | caption! 23 | 24 | \begin{figure}[hb] 25 | \includegraphics[width=0.45\textwidth]{monalisa} 26 | \caption[Mona Lisa, again]{It's Mona Lisa again. \blindtext} 27 | \labfig{normalmonalisa} 28 | \end{figure} 29 | 30 | While the format of the caption is managed by \Package{caption}, its 31 | position is handled by the \Package{floatrow} package. Achieving this 32 | result has been quite hard, but now I am pretty satisfied. In two-side 33 | mode, the captions are printed in the correct margin. 34 | 35 | Tables can be inserted just as easily as figures, as exemplified by the 36 | following code: 37 | 38 | \begin{lstlisting}[caption={Caption of a listing.}] 39 | \begin{table} 40 | \begin{tabular}{ c c c c } 41 | \toprule 42 | col1 & col2 & col3 & col 4 \\ 43 | \midrule 44 | \multirow{3}{4em}{Multiple row} & cell2 & cell3 & cell4\\ & 45 | cell5 & cell6 & cell7 \\ & 46 | cell8 & cell9 & cell10 \\ 47 | \multirow{3}{4em}{Multiple row} & cell2 & cell3 & cell4 \\ & 48 | cell5 & cell6 & cell7 \\ & 49 | cell8 & cell9 & cell10 \\ 50 | \bottomrule 51 | \end{tabular} 52 | \end{table} 53 | \end{lstlisting} 54 | 55 | which results in the useless \reftab{useless}. 56 | 57 | \begin{table}[ht] 58 | \caption[A useless table]{A useless table.} 59 | \labtab{useless} 60 | \begin{tabular}{ c c c c } 61 | \toprule 62 | col1 & col2 & col3 & col 4 \\ 63 | \midrule 64 | \multirow{3}{4em}{Multiple row} & cell2 & cell3 & cell4\\ & 65 | cell5 & cell6 & cell7 \\ & 66 | cell8 & cell9 & cell10 \\ 67 | \multirow{3}{4em}{Multiple row} & cell2 & cell3 & cell4 \\ & 68 | cell5 & cell6 & cell7 \\ & 69 | cell8 & cell9 & cell10 \\ 70 | \bottomrule 71 | \end{tabular} 72 | \end{table} 73 | 74 | I don't have much else to say, so I will just insert some blind text. 75 | \blindtext 76 | 77 | \section{旁白图像与表格} 78 | 79 | Marginfigures can be inserted with the environment 80 | \Environment{marginfigure}. In this case, the whole picture is confined 81 | to the margin and the caption is below it. \reffig{marginmonalisa} is 82 | obtained with something like this: 83 | 84 | \begin{lstlisting}[caption={Another caption.}] 85 | \begin{marginfigure} 86 | \includegraphics{monalisa} 87 | \caption[The Mona Lisa]{The Mona Lisa.} 88 | \labfig{marginmonalisa} 89 | \end{marginfigure} 90 | \end{lstlisting} 91 | 92 | There is also the \Environment{margintable} environment, of which 93 | \reftab{anotheruseless} is an example. Notice how you can place the 94 | caption above the table by just placing the \Command{caption} command 95 | before beginning the \Environment{tabular} environment. Usually, figure 96 | captions are below, while table captions are above. This rule is also 97 | respected for normal figures and tables: the captions are always on the 98 | side, but for figure they are aligned to the bottom, while for tables to 99 | the top. 100 | 101 | \begin{margintable} 102 | \caption[Another useless table]{Another useless table.} 103 | \labtab{anotheruseless} 104 | \raggedright 105 | \begin{tabular}{ c c c c } 106 | \hline 107 | col1 & col2 & col3 \\ 108 | \hline 109 | \multirow{3}{4em}{Multiple row} & cell2 & cell3 \\ & cell5 & cell6 110 | \\ & cell8 & cell9 \\ \hline 111 | \end{tabular} 112 | \end{margintable} 113 | 114 | Marginfigures and tables can be positioned with an optional offset 115 | command, like so: 116 | 117 | \begin{lstlisting} 118 | \begin{marginfigure}[offset] 119 | \includegraphics{seaside} 120 | \end{marginfigure} 121 | \end{lstlisting} 122 | 123 | Offset ca be either a measure or a multiple of \Command{baselineskip}, 124 | much like with \Command{sidenote}, \Command{marginnote} and 125 | \Command{margintoc}.\todo{Improve this part.} If you are wondering how I 126 | inserted this orange bubble, have a look at the \Package{todo} package. 127 | 128 | \section{超宽图像与表格} 129 | 130 | With the environments \Environment{figure*} and \Environment{table*} you 131 | can insert figures which span the whole page width. For example, here 132 | are a wide figure and a wide table. 133 | 134 | \begin{figure*}[h!] 135 | \includegraphics{seaside} 136 | \caption[A wide seaside]{A wide seaside, and a wide caption. 137 | Credits: By Bushra Feroz, CC BY-SA 4.0, \url{https://commons.wikimedia.org/w/index.php?curid=68724647}} 138 | \end{figure*} 139 | 140 | \begin{table*}[h!] 141 | \caption{A wide table with invented data about three people living in the UK. Note that wide figures and tables are centered and their caption also extends into the margin.} 142 | \begin{tabular}{p{2.0cm} p{2.0cm} p{2.0cm} p{2.0cm} p{2.0cm} p{2.0cm} p{1.5cm}} 143 | \toprule 144 | Name & Surname & Job & Salary & Age & Height & Country \\ 145 | \midrule 146 | Alice & Red & Writer & 4.000 \pounds & 34 & 167 cm & England \\ 147 | Bob & White & Bartender & 2.000 \pounds & 24 & 180 cm & Scotland \\ 148 | Drake & Green & Scientist & 4.000 \pounds & 26 & 175 cm & Wales \\ 149 | \bottomrule 150 | \end{tabular} 151 | \end{table*} 152 | 153 | It is the user's responsibility to adjust the width of the table, if 154 | necessary, until it is aesthetically pleasing. The previous table was 155 | obtained with the following code: 156 | 157 | \begin{lstlisting}[caption=How to typeset a wide table] 158 | \begin{table*}[h!] 159 | \caption{A wide table with invented data about three people living in the UK. Note that wide figures and tables are centered and their caption also extends into the margin.} 160 | \begin{tabular}{p{2.0cm} p{2.0cm} p{2.0cm} p{2.0cm} p{2.0cm} p{2.0cm} p{1.5cm}} 161 | \toprule 162 | Name & Surname & Job & Salary & Age & Height & Country \\ 163 | \midrule 164 | Alice & Red & Writer & 4.000 \pounds & 34 & 167 cm & England \\ 165 | Bob & White & Bartender & 2.000 \pounds & 24 & 180 cm & Scotland \\ 166 | Drake & Green & Scientist & 4.000 \pounds & 26 & 175 cm & Wales \\ 167 | \bottomrule 168 | \end{tabular} 169 | \end{table*} 170 | \end{lstlisting} 171 | 172 | The \Package{floatrow} package provides the \enquote{H} specifier to 173 | instruct \LaTeX to position the figure (or table) in precisely the same 174 | position it occupies in the source code. However, this specifier does 175 | not work with wide figures or tables: you should use \enquote{h!} 176 | instead, like so: \lstinline|\begin{figure*}[h!]|. 177 | 178 | You may have noticed the full width image at the very beginning of this 179 | chapter: that, however, is set up in an entirely different way, which 180 | you'll read about in \vrefch{排版}. 181 | 182 | \Class{kaobook} also supports paginated tables (have a look at the 183 | \Package{longtable} package). The 184 | \Environment{longtable}\sidenote{Interestingly, \Environment{longtable}s 185 | may require up to four rounds of compilation before they are typeset 186 | correctly.} environment behaves a bit differently from 187 | \Environment{table}, in that \Environment{longtable} encompasses both 188 | \Environment{table} and \Environment{tabular}, so that you can write, 189 | \eg, 190 | 191 | \begin{lstlisting}[caption=Example of a longtable] 192 | \begin{longtable}{|l c c|} 193 | \hline 194 | One & Two & Three \\ 195 | Left & Center & Center \\ 196 | \hline 197 | \caption{Caption of the longtable.} 198 | \end{longtable} 199 | \end{lstlisting} 200 | 201 | to obtain the following table: 202 | \begin{longtable}{|l c c|} 203 | \hline 204 | One & Two & Three \\ 205 | Left & Center & Center \\ 206 | \hline 207 | \caption{Caption of the longtable.} 208 | \end{longtable} 209 | 210 | The caption of a \Environment{longtable} is always positioned below the 211 | table, and it has the same width as the text (it doesn't extend into the 212 | margin). However, sometimes you may need a \Environment{longtable} that 213 | is so wide that it trespass into the margins; in those cases, you may 214 | want to also increase the width of the caption. To do so, you'll have to 215 | write two additional commands, one before and one after the 216 | \Environment{longtable}: 217 | 218 | \begin{lstlisting}[caption=Increasing the width of the caption of a \Environment{longtable}.] 219 | \floatsetup[longtable]{margins=centering,LTcapwidth=table} % Add this line before the longtable to increase the caption width 220 | \begin{longtable}{lp{8cm}p{5cm}p{2cm}} 221 | ... 222 | \end{longtable} 223 | \floatsetup[longtable]{margins=raggedright,LTcapwidth=\textwidth} % Add this line after the longtable to revert the previous change 224 | \end{lstlisting} 225 | 226 | Having seen figures and tables, it is now time to tackle 227 | hyperreferences. 228 | -------------------------------------------------------------------------------- /documentation_CJKsc/chapters/字母表.tex: -------------------------------------------------------------------------------- 1 | \newglossaryentry{computer}{ 2 | name=computer, 3 | description={一种可编程机器,它接收输入、存储和操作数据,并以有用的格式提供输出} 4 | } 5 | 6 | % Glossary entries (used in text with e.g. \acrfull{fpsLabel} or \acrshort{fpsLabel}) 7 | \newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{帧率} 8 | \newacronym[longplural={Tables of Contents}]{tocLabel}{TOC}{目录} 9 | 10 | -------------------------------------------------------------------------------- /documentation_CJKsc/chapters/文本标注.tex: -------------------------------------------------------------------------------- 1 | \setchapterpreamble[u]{\margintoc} 2 | \chapter{文本标注} 3 | \labch{文本标注} 4 | 5 | 边注是 1.5 栏宽边排版书籍的显著特性。确实,宽边距意味着更多的信息可以被显示出来,常用于放置带编号的边注、不带编号的边注、较小的章节目录、参考文献以及一些特别的块。 6 | 7 | \section{带编号边注} 8 | 9 | 边注与脚注的区别就是其位置在页边距内,这样可读性会更高。插入一个边注可以使用命令 \Command{sidenote\{说明文本\}}。你可以使用命令 \Command{sidenote[记号]\{文本\}} 指定一个记号,\sidenote[O]{这条边注有一个 O !}也可以设置一个偏置距离,使文本向上或向下移动,完整语法如下: 10 | 11 | \begin{lstlisting}[style=kaolstplain] 12 | \sidenote[记号][偏置距离]{文本} 13 | \end{lstlisting} 14 | 15 | 如果设置偏置距离,则记号的括号必须保留,内容可以为空。\sidenote{了解更多关于命令 \Command{sidenote} 的用法,请阅读 \Package{sidenotes} 包的文档。} 16 | 17 | 在 \Class{kaobookCJKsc} 模板中,我们从 \Package{snotez} 包中拷贝了一个特性:利用 \Command{baselineskip} 命令实现以行为单位的偏移。比如下面这样的语法会向上移动一行: 18 | 19 | \begin{lstlisting}[style=kaolstplain] 20 | \sidenote[][*-1]{边注文本} 21 | \end{lstlisting} 22 | 23 | 刚才说过,边注由 \Package{sidenotes} 包提供,但此包又依赖 \Package{marginnote} 包。 24 | 25 | \section{无编号边注} 26 | 27 | 这个命令,与前一节介绍的命令非常相似。可以用 \Command{marginnote[偏置]\{文本\}} 命令创建无编号的边注,同样包含偏置距离参数,以及基于 \Command{baselineskip} 命令实现的偏置行数参数,等等。\marginnote[-3cm]{虽然无编号边注命令来自 \Package{marginnote} 包,但是已经重新定义以便调整设置偏置参数的位置,目前该参数在边注文本之前设定,而原版命令在文本之后。同样,也基于 \Command{baselineskip} 增加了按行偏置的功能。这些设计目的是让所有命令有个统一的形式,防止太多命令需要记忆!} 28 | 29 | \begin{lstlisting}[style=kaolstplain] 30 | \marginnote[-12pt]{文本} or \marginnote[*-3]{文本} 31 | \end{lstlisting} 32 | 33 | \begin{kaobox}[frametitle=To Do] 34 | A small thing that needs to be done is to renew the \Command{sidenote} 35 | command so that it takes only one optional argument, the offset. The 36 | special mark argument can go somewhere else. In other words, we want the 37 | syntax of \Command{sidenote} to resemble that of \Command{marginnote}. 38 | \end{kaobox} 39 | 40 | 我们加载了 \Package{marginnote}、\Package{marginfix} 和 \Package{placeins} 三个包。既然 \Package{sidenotes} 继承了 \Package{marginnote},我们之前讲的关于有编号边注同样适用于此。两种边注都做了轻微的调整(\texttt{\textbackslash renewcommand\{\textbackslash marginnote\linebreak vadjust\}\{3pt\}}),以对齐底部。重要的一点是,两种边注不指定偏置距离时,都采用垂直浮动布局。但是,一旦指定了偏置距离,浮动会禁用。少数情况下会出现一些问题,有时可以设置偏置距离为 0pt 以便消除浮动。 41 | 42 | \section{脚注} 43 | 44 | 我们在这里讨论脚注,虽然它不显示在边注中,而且其作用也被边注替代。脚注强迫读者转移到页面的另一个区域。有证据表面,边注解决了这个问题。但无论如何,作为竞争者,我们保留了这个命令 \Command{footnote},以便你可以使用。\footnote{脚注以这样的形式存在,PDF 文件也会生成一个引用。} 45 | 46 | \section{章节边注目录} 47 | \labsec{martoc} 48 | 49 | 既然我们谈到了边注,这里再引入一个命令 \Command{margintoc} 用于在边注内生成一个小目录。和我们讨论过的其他命令一样,\Command{margintoc} 接受一个偏置距离参数,像这样:\Command{margintoc[offset]}。 50 | 51 | 命令可以用于文档任何位置,但我们认为在章节开头比较有意义。在这份文档里,我使用了 \KOMAScript 中的一个特性,并在导言区加入了这样的配置: 52 | 53 | \marginnote{边注目录的字体和文档目录字体相同。} 54 | 55 | \begin{lstlisting}[style=kaolstplain] 56 | \setchapterpreamble[u]{\margintoc} 57 | \chapter{Chapter title} 58 | \end{lstlisting} 59 | 60 | 边注的空间是一个重要的资源,所以有可能需要在边注打印简短版的章节目录。于是节(小节)标题可能有三种:正文标题、文档目录标题、边注目录标题。这些不同版本可以使用如下命令同时设定: 61 | 62 | \begin{lstlisting}[style=kaolstplain] 63 | \section[alternative-title-for-toc]{title-as-written-in-text}[alternative-title-for-margintoc] 64 | \end{lstlisting} 65 | 66 | 默认情况下,边注目录只包含节标题和小节标题,如果你只想展示节标题,添加如下命令到导言区: 67 | 68 | \begin{lstlisting}[style=kaolstplain] 69 | \setcounter{margintocdepth}{\sectiontocdepth} 70 | \end{lstlisting} 71 | 72 | \section{旁白列表} 73 | 74 | On some occasions it may happen that you have a very short piece of code 75 | that doesn't look good in the body of the text because it breaks the 76 | flow of narration: for that occasions, you can use a 77 | \Environment{marginlisting}. The support for this feature is still 78 | limited, especially for the captions, but you can try the following 79 | code: 80 | 81 | \begin{marginlisting}[-1.35cm] 82 | \caption{An example of a margin listing.} 83 | \vspace{0.6cm} 84 | \begin{lstlisting}[language=Python,style=kaolstplain] 85 | print("Hello World!") 86 | \end{lstlisting} 87 | \end{marginlisting} 88 | 89 | \begin{verbatim} 90 | \begin{marginlisting}[-0.5cm] 91 | \caption{My caption} 92 | \vspace{0.2cm} 93 | \begin{lstlisting}[language=Python,style=kaolstplain] 94 | ... code ... 95 | \end{lstlisting} 96 | \end{marginlisting} 97 | \end{verbatim} 98 | 99 | Unfortunately, the space between the caption and the listing must be 100 | adjusted manually; if you find a better way, please let me know. 101 | 102 | Not only textual stuff can be displayed in the margin, but also figures. 103 | Those will be the focus of the next chapter. 104 | -------------------------------------------------------------------------------- /documentation_CJKsc/chapters/译者序.tex: -------------------------------------------------------------------------------- 1 | \setchapterimage{seaside} 2 | \chapter*{译者序} % 加星号防止多余书签 3 | \addcontentsline{toc}{chapter}{译者序} % 添加到目录 4 | 5 | 无意间发现这份模板,感觉非常简约大方,所以就想尝试一下。不巧的是,作者没有考虑多语言问题,简体中文并没有默认支持。浅研究一下,就有了这个版本。目前基本满足日常所需,折服于 \LaTeX 的强大,是时候替换 Markdown 了。 6 | 7 | 下面简单说明一下 kaobookCJKsc 模板。首先,原则上\textbf{尽量减少对原模板的修改,以便于未来更新。}但是有些设置,一方面由于作者硬编码在样式文件中,另一方面由于很多包不支持中文,所以并不会自动翻译。为了处理这样的冲突,不得不拷贝一份,重新移植。主要工作有以下几个方面: 8 | 9 | \begin{itemize} 10 | \item 为了区分原模板,所有文件增加了 CJKsc 后缀。 11 | \item 增加了类似 \texttt{kaoWinCJKsc.sty} 这样的配置包,尽可能将中文相关的配置以及平台依赖集中到这里。一来为跨平台提供便利,二来也能避免配置的杂乱无章。 12 | \item 为了项目结构的整洁,加入了 styles 子文件夹。 13 | \item 为了支持多平台,默认依赖 Google Noto 和 liberation 系列字体。 14 | \item 一些中文语序和英文相反,由于配置无法放在导言区或包内,单独增加一个 \texttt{config.tex} 文件保存,在正文中导入即可。 15 | \end{itemize} 16 | 17 | 至此,一份漂亮的图书模板就做好了。本着够用就好的原则,没必要浪费太多时间在工具配置上。那么,万事具备,只欠东风,剩下的事情就交给你了。用好这份模板,多多创作吧! 18 | 19 | \begin{flushright} 20 | \textit{薛浩}\hspace*{2.5em} 21 | 22 | \textit{\zhtoday} 23 | \end{flushright} 24 | -------------------------------------------------------------------------------- /documentation_CJKsc/chapters/选项.tex: -------------------------------------------------------------------------------- 1 | \setchapterpreamble[u]{\margintoc} 2 | \chapter{文档类型选项} 3 | \labch{文档类型选项} 4 | 5 | 本章将介绍最常用的选项,这些选项来自 \Class{scrbook} 以及 \Class{kaoCJKsc} 特有的部分。给模板设置选项将会改变其默认的行为,但要小心,有些选项会造成意想不到的结果…… 6 | 7 | \section{\Class{KOMA} 选项} 8 | 9 | \Class{kaobookCJKsc} 模板基于 \Class{scrbook},因此,继承而来的设置选项同样可以生效。如果你有耐心,可以读一读 \KOMAScript 的使用手册。\sidenote{手册可以从这里下载 \url{https://ctan.org/pkg/koma-script?lang=en}。}实际上,建议读一下类似的使用手册,因为这些包含很多指导性的内容。 10 | 11 | 设置给模板的每一个 \KOMAScript 选项,会被自动加载。另外,在 \Class{kaobookCJKsc} 模板中,已经修改了部分默认的设置。比如,字体大小默认设置为 9.5pt,段落之间会使用空格分割\sidenote[][-7mm]{强调一下,段落间距默认设置为一半的行距:\Option{parskip} 值为 \enquote{half}。} ,并且会缩进 2 个汉字。 12 | 13 | \section{\Class{kaoCJKsc} 选项} 14 | 15 | 未来计划加入一些设置段落格式的选项,以及边注位置的选项。\marginnote{译者注:原模板的段落是每行对齐的,\Class{kaobookCJKsc} 模板已经按中文习惯设置首行缩进。}借此机会,呼吁大家踊跃添加特性,重新设计现有特性,并能将结果发给我。可以在这里查看原版仓库 \url{https://github.com/fmarotta/kaobook}。 16 | 17 | \begin{kaobox}[frametitle=\noindent 待办] 18 | Implement the \Option{justified} and \Option{margin} options. To be consistent with the \KOMAScript style, they should accept a simple switch as a parameter, where the simple switch should be \Option{true} or \Option{false}, or one of the other standard values for simple switches supported by \KOMAScript. See the \KOMAScript documentation for further information. 19 | \end{kaobox} 20 | 21 | 以上是使用 \Environment{kaobox} 的示例,将会在\nrefch{数学}详细介绍。本书会使用这样的块,标记将要实现的一些特性。 22 | 23 | \section{其他值得关注的东西} 24 | 25 | 因实现的需要,一大堆包已经加载在该模板里了: 26 | 27 | \begin{itemize} 28 | \item etoolbox 29 | \item calc 30 | \item xifthen 31 | \item xkeyval 32 | \item xparse 33 | \item xstring 34 | \end{itemize} 35 | 36 | 对于大多数包,会在合适的时间去讨论。此刻,只提及一些用于段落格式调整的包(别忘了,未来这些可能被调整),主要包括以下这些: 37 | 38 | \begin{itemize} 39 | \item ragged2e 40 | \item setspace 41 | \item hyphenat 42 | \item microtype 43 | \item needspace 44 | \item xspace 45 | \item xcolor (with options \Option{usenames,dvipsnames}) 46 | \end{itemize} 47 | 48 | 以上这些,有的不是针对段落格式的,但我们还是归到一起了。默认情况下,原模板主体文本和边注都是每行对齐的,而中文版主体文本调整为首行缩进,边注保持原样。 49 | 50 | 最后提醒一下,\Package{cleveref} 包与 \Class{kaobookCJKsc} 模板不兼容,请使用\nrefsec{hyprefs}讨论的命令替代。 51 | 52 | \section{文档结构} 53 | 54 | 我们给 \Command{title} 和 \Command{author} 命令提供了可选参数,可以在前置文档中插入简短的文字。相应的,也提供了 \Command{@plaintitle} 和 \Command{@plainauthor} 命令,用于插入无样式的文字。pdf 属性由 \Option{pdftitle} 和 \Option{pdfauthor} 两个选项自动设置,也可以通过 hyperref 超链接设置具体值。\sidenote[][*-1]{由于这很重要,在此强调一下。如果 pdf 元数据被修改,编译时会设置为相应值;否则,元数据默认为文档的标题和作者。} 55 | 56 | 定义了两种页面排版 \Option{margin} 和 \Option{wide},以及两个页面样式 \Option{plain} 和 \Option{fancy}。排版只关注页边距,而样式指的是页眉和页脚。这些会在\nrefch{排版}讨论。\sidenote{目前只需要了解,\Option{margin} 排版有较宽的页边距,而 \Option{wide} 排版没有页边距。\Option{plain} 样式没有页眉页脚,而 \Option{fancy} 样式有页眉但是没有页脚。} 57 | 58 | \Command{frontmatter},\Command{mainmatter} 和 \Command{backmatter} 三个命令重新定义以便自动切换页面的排版和样式。前置文档使用 \Option{wide} 排版和 \Option{plain} 样式。正文部分采用 \Option{margin} 排版和 \Option{fancy} 样式。附录部分保持不变;不过,我们可以使用 \Command{bookmarksetup\{startatroot\}} 命令,把章节书签等级设置为 root 级别,否则将会追加在前面的章节里。后置文档重新使用 \Option{wide} 排版,并重设了书签等级。 59 | -------------------------------------------------------------------------------- /documentation_CJKsc/chapters/附录.tex: -------------------------------------------------------------------------------- 1 | \setchapterstyle{lines} 2 | \labch{附录} 3 | 4 | % \setchapterpreamble[u]{\margintoc} 5 | \chapter{字体测试} 6 | 7 | \section{字号} 8 | 9 | {\tiny The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 10 | 11 | {\scriptsize The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 12 | 13 | {\footnotesize The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 14 | 15 | {\small The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 16 | 17 | {\normalsize Normal: The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 18 | 19 | {\large The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 20 | 21 | {\Large Large: The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 22 | 23 | {\LARGE The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 24 | 25 | {\Huge The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 26 | 27 | \section{字体} 28 | 29 | Windows 10 自带字体测试: 30 | 31 | \dx{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 32 | 33 | \song{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 34 | 35 | \xs{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 36 | 37 | \fs{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 38 | 39 | \yh{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 40 | 41 | \hei{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 42 | 43 | \kai{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 44 | 45 | \hwsong{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 46 | 47 | \hwzs{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 48 | 49 | \hwfs{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 50 | 51 | \hwxh{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 52 | 53 | \hwl{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 54 | 55 | \hwxw{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 56 | 57 | \hwk{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 58 | 59 | \hwxk{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 60 | 61 | \hwcy{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 62 | 63 | \hwhp{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 64 | 65 | \fzs{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 66 | 67 | \fzy{The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 68 | 69 | \section{样式} 70 | 71 | \textup{直立\\The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 72 | 73 | \textmd{中等权重\\The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 74 | 75 | \textbf{加粗\\The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 76 | 77 | \textnormal{默认\\The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 78 | 79 | \textit{斜体\\The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 80 | 81 | \texttt{等宽\\The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 82 | 83 | \textsf{无衬线\\The quick brown fox jumps over the lazy dog. 中国智造,走向世界。} 84 | 85 | 所有字母大写 \\\uppercase{The quick brown fox jumps over the lazy dog.} 86 | 87 | 所有字母大写,小写字母比较小 \\\textsc{The Quick Brown Fox Jumps Over The Lazy Dog.} 88 | -------------------------------------------------------------------------------- /documentation_CJKsc/images/miktex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/documentation_CJKsc/images/miktex.png -------------------------------------------------------------------------------- /documentation_CJKsc/images/monalisa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/documentation_CJKsc/images/monalisa.jpg -------------------------------------------------------------------------------- /documentation_CJKsc/images/seaside.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/documentation_CJKsc/images/seaside.jpeg -------------------------------------------------------------------------------- /documentation_CJKsc/main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/documentation_CJKsc/main.pdf -------------------------------------------------------------------------------- /documentation_CJKsc/main.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % kaobookCJKsc 3 | % LaTeX 文档类型 4 | % Version 0.9.8 (2021/08/23) 5 | % 6 | % 原始模板来自: 7 | % https://www.LaTeXTemplates.com 8 | % 9 | % 最新发布版本: 10 | % https://github.com/fmarotta/kaobook 11 | % 12 | % 中文支持版本: 13 | % https://github.com/xuehao/kaobookCJKsc 14 | % 15 | % 作者: 16 | % Xue Hao (https://www.stickmind.com) 17 | % Federico Marotta (federicomarotta@mail.com) 18 | % Based on the doctoral thesis of Ken Arroyo Ohori (https://3d.bk.tudelft.nl/ken/en) 19 | % and on the Tufte-LaTeX class. 20 | % Modified for LaTeX Templates by Vel (vel@latextemplates.com) 21 | % 22 | % 许可: 23 | % LPPL (see included MANIFEST.md file) 24 | % 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | %---------------------------------------------------------------------------------------- 28 | % kaobookCJKsc 文档类型示例与文档 29 | %---------------------------------------------------------------------------------------- 30 | 31 | \documentclass[ 32 | a4paper, % 页面设置 33 | fontsize=10pt, % 字号设置 34 | twoside=true, % 对偶数页和奇数页使用不同的布局(特别是,如果 twoside=true,边距列将始终在外面) 35 | open=any, % 如果 twoside=true,取消注释以强制新章节在任何页面上开始,而不仅仅是在正确(奇数)页面上 36 | chapterentrydots=true, % 在目录中,添加章节名到页码之间的圆点 37 | numbers=noenddot, % 注释章节号后的输出点; 此选项最常见的值是:enddot、noenddot 和 auto(请参阅 KOMAScript 文档以获得深入的解释) 38 | ]{styles/kaobookCJKsc} 39 | 40 | %---------------------------------------------------------------------------------------- 41 | % 包以及文档配置,新项目可以直接复制粘贴 42 | %---------------------------------------------------------------------------------------- 43 | 44 | % 加载排版包(不支持 chinese) 45 | \usepackage{polyglossia} 46 | \setmainlanguage{english} 47 | \SetLanguageKeys{english}{indentfirst=true} 48 | % 加载引号风格包(不支持 chinese) 49 | \usepackage[style=english]{csquotes} 50 | % 加载参考文献相关设置 51 | \usepackage[style=gb7714-2015ms,backref=false]{styles/kaobiblioCJKsc} % 默认使用 GB 标准 52 | \addbibresource{main.bib} % 参考文献文本 53 | % 加载数学相关设置 54 | \usepackage[framed]{styles/kaotheoremsCJKsc} 55 | % 加载超链接相关设置 56 | \usepackage{styles/kaorefsCJKsc} 57 | % 加载平台中文字体及相关设置 58 | \usepackage[testMathBox]{styles/kaoWinCJKsc} 59 | % 加载测试包 60 | \usepackage{blindtext} 61 | 62 | % 图片路径 63 | \graphicspath{{examples/documentation/images/}{images/}} 64 | % 生成用于编译 索引 的文件 65 | \makeindex[columns=3, title=索引, intoc] 66 | % 生成用于编译 词汇表 的文件 67 | \makeglossaries 68 | \input{chapters/字母表.tex} 69 | % 生成用于编译 术语 的文件 70 | \makenomenclature 71 | % 每章开头重新给 边注 编号 72 | \counterwithin*{sidenote}{chapter} 73 | % 允许标题中出现 \\ 而不发出警告 74 | \pdfstringdefDisableCommands{\let\\\empty} 75 | 76 | %---------------------------------------------------------------------------------------- 77 | \begin{document} 78 | 79 | %---------------------------------------------------------------------------------------- 80 | % 加载其他无法放在导言区的配置 81 | %---------------------------------------------------------------------------------------- 82 | \input{styles/config.tex} 83 | 84 | %---------------------------------------------------------------------------------------- 85 | % 标题页 86 | %---------------------------------------------------------------------------------------- 87 | 88 | \titlehead{嗨 kaobookCJKsc 在此} 89 | \subject{一版在手,天下我有} 90 | 91 | \title{基于 kaobookCJKsc 模板的\\示例与文档} 92 | \subtitle{\nosat\textit{定制属于你的书籍}} 93 | 94 | \author{薛浩} 95 | \date{\zhtoday} 96 | 97 | \publishers{绝绝子出版社} 98 | 99 | %---------------------------------------------------------------------------------------- 100 | 101 | \frontmatter % 前置文档开始,使用罗马数字编号 102 | 103 | %---------------------------------------------------------------------------------------- 104 | % 版权页 105 | %---------------------------------------------------------------------------------------- 106 | 107 | \makeatletter 108 | \uppertitleback{ 109 | \textbf{内容提要} 110 | 111 | \bigskip 112 | 介绍一种宽边排版的 \LaTeX 模板,常见于现代风格教科书。除了提供完整的开箱即用的特性,还允许用户自定义自己的特性。 113 | } 114 | 115 | \lowertitleback{ 116 | \textbf{声明} \\ 117 | 您可以编辑此页面以满足您的需要。例如,有无版权声明以及其他一些信息。此页面基于 Ken Arroyo Ohori 论文的相应页面,改动很小。 118 | 119 | \medskip 120 | \textbf{版权没有,翻版不究} \\ 121 | \cczero 本书使用 CC0 代码发布到公共领域。在法律允许的范围内,我放弃本作品的所有版权。 122 | 123 | 要查看 CC0 代码的副本,请访问:\url{http://creativecommons.org/publicdomain/zero/1.0/} 124 | 125 | \medskip 126 | \textbf{出版说明} \\ 127 | 本文档基于 \href{https://sourceforge.net/projects/koma-script/}{\KOMAScript} 以及 \href{https://www.latex-project.org/}{\LaTeX} 并使用 \href{https://github.com/xuehao/kaobookCJKsc}{kaobookCJKsc} 模板。 128 | 129 | 源码可以从这里下载:\url{https://github.com/xuehao/kaobookCJKsc} 130 | 131 | (欢迎贡献!) 132 | 133 | \medskip 134 | \textbf{版本} \\ 135 | 首次由\textbf{\@publishers}出版于\zhtoday 136 | } 137 | \makeatother 138 | 139 | %---------------------------------------------------------------------------------------- 140 | % 致谢 141 | %---------------------------------------------------------------------------------------- 142 | 143 | \dedication{ 144 | 世界的和谐体现在形式和数量上,心灵和灵魂以及自然哲学的所有诗意都体现在数学美的概念中。\\ 145 | \flushright —— 达西·温特沃斯·汤普森 146 | } 147 | 148 | %---------------------------------------------------------------------------------------- 149 | % 标题页 150 | %---------------------------------------------------------------------------------------- 151 | 152 | \maketitle % 注意,输出的标题页在此位置之前 153 | 154 | %---------------------------------------------------------------------------------------- 155 | % 译者序 156 | %---------------------------------------------------------------------------------------- 157 | 158 | \input{chapters/译者序.tex} 159 | 160 | %---------------------------------------------------------------------------------------- 161 | % 前言 162 | %---------------------------------------------------------------------------------------- 163 | 164 | \setchapterstyle{plain} % 选择后续默认章节标题样式 165 | \input{chapters/前言.tex} 166 | \index{前言} 167 | 168 | %---------------------------------------------------------------------------------------- 169 | % 目录 & 图片表格等列表 170 | %---------------------------------------------------------------------------------------- 171 | 172 | \begingroup % 创建局部变量范围 173 | 174 | \setlength{\textheight}{230\hscale} % 定义目录样式,手动修改页面高度 175 | 176 | % Turn on compatibility mode for the etoc package 177 | \etocstandarddisplaystyle % "toc display" as if etoc was not loaded 178 | \etocstandardlines % "toc lines as if etoc was not loaded 179 | 180 | \tableofcontents % 输出目录页 181 | \listoffigures % 输出图片列表 182 | \listoftables % 输出表格列表 183 | \listoflstlistings % 输出清单(常为代码)列表 184 | \endgroup % 结束局部变量范围 185 | 186 | %---------------------------------------------------------------------------------------- 187 | % 术语 188 | %---------------------------------------------------------------------------------------- 189 | 190 | \nomenclature{$c$}{真空惯性系中的光速} 191 | \nomenclature{$h$}{普朗克常数} 192 | 193 | \renewcommand{\nomname}{符号} % 重命名术语页面标题 194 | \renewcommand{\nompreamble}{\noindent 以下列出正文中将会使用的几个符号:} % 术语表页面添加导言 195 | 196 | \printnomenclature % 输出术语页面 197 | 198 | %---------------------------------------------------------------------------------------- 199 | 200 | \mainmatter % 正文文档开始,重置页码并使用阿拉伯数字 201 | 202 | %---------------------------------------------------------------------------------------- 203 | % 主体部分 204 | %---------------------------------------------------------------------------------------- 205 | 206 | \setchapterstyle{kao} % 设置章节标题样式,为了统一,不要在章节内设置 207 | \input{chapters/介绍.tex} 208 | 209 | \pagelayout{wide} % 无边距 210 | \addpart{基础} 211 | \pagelayout{margin} % 恢复边距 212 | 213 | \input{chapters/选项.tex} 214 | \input{chapters/文本标注.tex} 215 | \input{chapters/图像与表格.tex} 216 | \input{chapters/引用.tex} 217 | 218 | \pagelayout{wide} 219 | \addpart{进阶} 220 | \pagelayout{margin} 221 | 222 | \input{chapters/排版.tex} 223 | \input{chapters/数学.tex} 224 | 225 | \appendix % 从这里开始,章节序号将以字母排序并重设书签等级 226 | 227 | \pagelayout{wide} 228 | \addpart{附录} 229 | \pagelayout{margin} 230 | 231 | \pagelayout{wide} 232 | \input{chapters/附录.tex} 233 | \pagelayout{margin} 234 | 235 | \backmatter % 正文文档结束 236 | 237 | %---------------------------------------------------------------------------------------- 238 | 239 | %---------------------------------------------------------------------------------------- 240 | % 参考文献 241 | %---------------------------------------------------------------------------------------- 242 | 243 | \setchapterstyle{plain} % 设置章节标题样式 244 | \printbibliography[heading=bibintoc, title=参考文献] % 输出参考文献页面 245 | 246 | %---------------------------------------------------------------------------------------- 247 | % 生词表 248 | %---------------------------------------------------------------------------------------- 249 | 250 | \setglossarystyle{listgroup} % 设置词汇表样式,参见 https://en.wikibooks.org/wiki/LaTeX/Glossary 251 | \printglossary[title=词汇表, toctitle=词汇表] % 输出词汇表页面,title 是词汇表页面标题,toctitle 是目录标题 252 | 253 | %---------------------------------------------------------------------------------------- 254 | % 索引 255 | %---------------------------------------------------------------------------------------- 256 | 257 | \printindex % 输出索引页面。若不修改样式,将继承最近的设置,与词汇表相同 258 | 259 | %---------------------------------------------------------------------------------------- 260 | \end{document} 261 | -------------------------------------------------------------------------------- /documentation_CJKsc/styles/config.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%无法放在导言区的设置%%%%%%%%%%%%%%%%%%%% 2 | %目录中文名 3 | \renewcommand{\contentsname}{目录} 4 | \renewcommand{\listfigurename}{插图} 5 | \renewcommand{\listtablename}{表格} 6 | \renewcommand{\lstlistlistingname}{清单} 7 | \renewcommand{\lstlistingname}{清单} 8 | \renewcommand{\indexname}{索引} 9 | \renewcommand{\bibname}{参考文献} 10 | %其他中文名 11 | \renewcommand{\pagename}{页} 12 | \renewcommand{\chaptername}{章} 13 | \renewcommand{\sectionname}{节} 14 | \renewcommand{\subsectionname}{小节} 15 | \renewcommand{\figurename}{图} 16 | \renewcommand{\tablename}{表} 17 | \renewcommand{\eqname}{公式} 18 | \renewcommand{\defname}{定义} 19 | \renewcommand{\assumname}{假设} 20 | \renewcommand{\thmname}{定理} 21 | \renewcommand{\propname}{命题} 22 | \renewcommand{\lemmaname}{引理} 23 | \renewcommand{\remarkname}{备注} 24 | \renewcommand{\examplename}{例} 25 | \renewcommand{\exercisename}{练习} 26 | %引用语序 27 | \renewcommand{\refpage}[1]{\hyperref[#1]{\textcolor{Blue}{第\xspace\pageref{page:#1}\xspace\pagename}}} % 第 84 页 28 | \renewcommand{\refch}[1]{\hyperref[ch:#1]{\textcolor{Blue}{第\xspace\ref{ch:#1}\xspace\chaptername}}} % 第 7 章 29 | \renewcommand{\nrefch}[1]{\hyperref[ch:#1]{\textcolor{Blue}{第\xspace\ref{ch:#1}\xspace\chaptername(\nameref{ch:#1})}}} % 第 7 章(数学) 30 | \renewcommand{\refsec}[1]{\hyperref[sec:#1]{\textcolor{Blue}{第\xspace\ref{sec:#1}\xspace\sectionname}}} 31 | \renewcommand{\nrefsec}[1]{\hyperref[sec:#1]{\textcolor{Blue}{第\xspace\ref{sec:#1}\xspace\sectionname(\nameref{sec:#1})}}} 32 | \renewcommand{\refsubsec}[1]{\hyperref[subsec:#1]{\textcolor{Blue}{第\xspace\ref{subsec:#1}\xspace\subsectionname}}} 33 | \renewcommand{\nrefsubsec}[1]{\hyperref[subsec:#1]{\textcolor{Blue}{第\xspace\ref{subsec:#1}\xspace\subsectionname(\nameref{subsec:#1})}}} 34 | %脚注编号 35 | % \renewcommand{\thefootnote}{\arabic{footnote}} % 1, 2, 3 36 | % \renewcommand{\thefootnote}{\alph{footnote}} % a, b, c 37 | % \renewcommand{\thefootnote}{\roman{footnote}} % i, ii, iii 38 | 39 | -------------------------------------------------------------------------------- /documentation_CJKsc/styles/kaoWinCJKsc.sty: -------------------------------------------------------------------------------- 1 | \ProvidesPackage{styles/kaoWinCJKsc} 2 | 3 | \RequirePackage{kvoptions} % Handle package options 4 | \SetupKeyvalOptions{ 5 | family = kaowincjksc, 6 | prefix = kaowincjksc@ 7 | } 8 | 9 | \DeclareBoolOption{testMathBox}% If true, put theorems into colorful boxes, otherwise write them like normal text 10 | 11 | \ProcessKeyvalOptions{kaowincjksc} 12 | 13 | %---------------------------------------------------------------------------------------- 14 | % 加载包用于字体设置与选择 15 | \RequirePackage{xeCJK} 16 | 17 | % 检查可用中文字体名:fc-list -f "%{family}\n" :lang=zh > zh-font.txt 18 | \setCJKmainfont[BoldFont=Noto Serif CJK SC Bold,AutoFakeSlant]{Noto Serif CJK SC} 19 | \setCJKsansfont[BoldFont=Noto Sans CJK SC Bold,AutoFakeSlant]{Noto Sans CJK SC} 20 | \setCJKmonofont[BoldFont=Noto Sans Mono CJK SC Bold,AutoFakeSlant]{Noto Sans Mono CJK SC} 21 | 22 | %---------------------------------------------------------------------------------------- 23 | % 加载包用于首行缩进 24 | \RequirePackage{indentfirst} 25 | \setlength{\parindent}{2em} % 首行缩进两个汉字或四个字母 26 | 27 | %---------------------------------------------------------------------------------------- 28 | % 文本颜色 29 | \RequirePackage{xcolor} 30 | % 中文数字日期格式 31 | \RequirePackage{zhnumber} 32 | 33 | %---------------------------------------------------------------------------------------- 34 | % Win10 平台中文字体集合 35 | \setCJKfamilyfont{nosat}{Noto Sans CJK SC Thin} 36 | \newcommand{\nosat}{\CJKfamily{nosat}} 37 | \setCJKfamilyfont{dx}{DengXian} %等线 dx 38 | \newcommand{\dx}{\CJKfamily{dx}} 39 | \setCJKfamilyfont{song}{SimSun} %宋体 song 40 | \newcommand{\song}{\CJKfamily{song}} 41 | \setCJKfamilyfont{xs}{NSimSun} %新宋体 xs 42 | \newcommand{\xs}{\CJKfamily{xs}} 43 | \setCJKfamilyfont{fs}{FangSong} %仿宋 fs 44 | \newcommand{\fs}{\CJKfamily{fs}} 45 | \setCJKfamilyfont{yh}{Microsoft YaHei} %微软雅黑 yh 46 | \newcommand{\yh}{\CJKfamily{yh}} 47 | \setCJKfamilyfont{hei}{SimHei} %黑体 hei 48 | \newcommand{\hei}{\CJKfamily{hei}} 49 | \setCJKfamilyfont{kai}{KaiTi} %楷体 kai 50 | \newcommand{\kai}{\CJKfamily{kai}} 51 | \setCJKfamilyfont{li}{LiSu} %隶书 li 52 | \newcommand{\li}{\CJKfamily{li}} 53 | \setCJKfamilyfont{yy}{YouYuan} %幼圆 yy 54 | \newcommand{\yy}{\CJKfamily{yy}} 55 | \setCJKfamilyfont{hwsong}{STSong} %华文宋体 hwsong 56 | \newcommand{\hwsong}{\CJKfamily{hwsong}} 57 | \setCJKfamilyfont{hwzs}{STZhongsong} %华文中宋 hwzs 58 | \newcommand{\hwzs}{\CJKfamily{hwzs}} 59 | \setCJKfamilyfont{hwfs}{STFangsong} %华文仿宋 hwfs 60 | \newcommand{\hwfs}{\CJKfamily{hwfs}} 61 | \setCJKfamilyfont{hwxh}{STXihei} %华文细黑 hwxh 62 | \newcommand{\hwxh}{\CJKfamily{hwxh}} 63 | \setCJKfamilyfont{hwl}{STLiti} %华文隶书 hwl 64 | \newcommand{\hwl}{\CJKfamily{hwl}} 65 | \setCJKfamilyfont{hwxw}{STXinwei} %华文新魏 hwxw 66 | \newcommand{\hwxw}{\CJKfamily{hwxw}} 67 | \setCJKfamilyfont{hwk}{STKaiti} %华文楷体 hwk 68 | \newcommand{\hwk}{\CJKfamily{hwk}} 69 | \setCJKfamilyfont{hwxk}{STXingkai} %华文行楷 hwxk 70 | \newcommand{\hwxk}{\CJKfamily{hwxk}} 71 | \setCJKfamilyfont{hwcy}{STCaiyun} %华文彩云 hwcy 72 | \newcommand{\hwcy}{\CJKfamily{hwcy}} 73 | \setCJKfamilyfont{hwhp}{STHupo} %华文琥珀 hwhp 74 | \newcommand{\hwhp}{\CJKfamily{hwhp}} 75 | \setCJKfamilyfont{fzs}{FZShuTi} %方正舒体 fzs 76 | \newcommand{\fzs}{\CJKfamily{fzs}} 77 | \setCJKfamilyfont{fzy}{FZYaoTi} %方正姚体 fzy 78 | \newcommand{\fzy}{\CJKfamily{fzy}} 79 | 80 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 彩色盒子 81 | \ifkaowincjksc@testMathBox 82 | \RequirePackage{tikz} % Required by mdframed 83 | \RequirePackage[framemethod=TikZ]{mdframed} % Required for colorful boxes 84 | 85 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 86 | %Theorem 87 | % define a counter for continuous numbering of the environment 88 | % by chapter or by section 89 | \newcounter{theo}[section] \setcounter{theo}{0} 90 | %\renewcommand{\thetheo}{\arabic{chapter}.\arabic{theo}} %显示章节名 91 | \renewcommand{\thetheo}{\arabic{theo}} %不显示章节名 92 | \newenvironment{theo}[2][]{% 93 | \refstepcounter{theo}% 94 | \ifstrempty{#1}% 95 | {\mdfsetup{% 96 | frametitle={% 97 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 98 | \node[anchor=east,rectangle,fill=blue!20] 99 | {\strut Theorem~\thetheo};}} 100 | }% 101 | {\mdfsetup{% 102 | frametitle={% 103 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 104 | \node[anchor=east,rectangle,fill=blue!20] 105 | {\strut Theorem~\thetheo:~#1};}}% 106 | }% 107 | \mdfsetup{innertopmargin=10pt,linecolor=blue!20,% 108 | linewidth=2pt,topline=true,% 109 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 110 | } 111 | \begin{mdframed}[]\relax% 112 | \label{#2}}{\end{mdframed}} 113 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 114 | %Lemma 115 | \newcounter{lem}[section] \setcounter{lem}{0} 116 | \renewcommand{\thelem}{\arabic{lem}} 117 | \newenvironment{lem}[2][]{% 118 | \refstepcounter{lem}% 119 | \ifstrempty{#1}% 120 | {\mdfsetup{% 121 | frametitle={% 122 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 123 | \node[anchor=east,rectangle,fill=green!20] 124 | {\strut Lemma~\thelem};}} 125 | }% 126 | {\mdfsetup{% 127 | frametitle={% 128 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 129 | \node[anchor=east,rectangle,fill=green!20] 130 | {\strut Lemma~\thelem:~#1};}}% 131 | }% 132 | \mdfsetup{innertopmargin=10pt,linecolor=green!20,% 133 | linewidth=2pt,topline=true,% 134 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 135 | } 136 | \begin{mdframed}[]\relax% 137 | \label{#2}} 138 | {\end{mdframed}} 139 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 140 | %Proof 141 | % [begin]define a new environment for proof 142 | \newenvironment{prf}[2][]{% 143 | % box style 144 | \ifstrempty{#1} 145 | % if condition (without title) 146 | { 147 | \mdfsetup{% 148 | frametitle={% 149 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 150 | \node[anchor=east,rectangle,fill=red!20] 151 | {\strut Proof~};}} 152 | }% else condition (with title) 153 | { 154 | \mdfsetup{% 155 | frametitle={% 156 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 157 | \node[anchor=east,rectangle,fill=red!20] 158 | {\strut Proof~:~#1};}}% 159 | }% 160 | % Both conditions 161 | \mdfsetup{ 162 | innertopmargin=10pt,linecolor=red!20,% 163 | linewidth=2pt,topline=true,% 164 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 165 | } 166 | 167 | % [begin]define a new environment for proof 168 | \begin{mdframed}[]\relax% 169 | \label{#2} 170 | } 171 | {\qed\end{mdframed}} 172 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 173 | %soln 174 | % [begin]define a new environment for proof 175 | \newenvironment{soln}[2][]{% 176 | % box style 177 | \ifstrempty{#1} 178 | % if condition (without title) 179 | { 180 | \mdfsetup{% 181 | frametitle={% 182 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 183 | \node[anchor=east,rectangle,fill=red!20] 184 | {\strut Solution~};}} 185 | }% else condition (with title) 186 | { 187 | \mdfsetup{% 188 | frametitle={% 189 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 190 | \node[anchor=east,rectangle,fill=red!20] 191 | {\strut Solution~:~#1};}}% 192 | }% 193 | % Both conditions 194 | \mdfsetup{ 195 | innertopmargin=10pt,linecolor=red!20,% 196 | linewidth=2pt,topline=true,% 197 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 198 | } 199 | 200 | % [begin]define a new environment for proof 201 | \begin{mdframed}[]\relax% 202 | \label{#2} 203 | } 204 | {\qed\end{mdframed}} 205 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 206 | \fi 207 | 208 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 高等数学风格 209 | \usepackage{amsthm} 210 | \usepackage{thmtools} 211 | \usepackage[unq]{unique} 212 | 213 | \declaretheoremstyle[% 214 | headindent=\parindent, 215 | headfont=\normalfont\bfseries,% 216 | notefont=\normalfont\bfseries, notebraces={(}{)}, 217 | bodyfont=\normalfont, 218 | postheadspace=1em,% 219 | %qed=\qedsymbol,%空心 220 | qed=$\blacksquare$,%实心 221 | headpunct={} 222 | ]{mathstyle} 223 | 224 | \theoremstyle{mathstyle} 225 | % 使用 amsthm 定义 226 | \newtheorem*{Definition*}{定义} 227 | \newtheorem{Definition}{定义}[section] 228 | \renewcommand{\theDefinition}{\arabic{Definition}} 229 | 230 | \newtheorem*{Theorem*}{定理} 231 | \newtheorem{Theorem}{定理}[section] 232 | \renewcommand{\theTheorem}{\arabic{Theorem}} 233 | 234 | \newtheorem{Corollary}{推论} 235 | \renewcommand{\theCorollary}{\arabic{Corollary}} 236 | 237 | \newtheorem*{Lemma*}{引理} 238 | \newtheorem{Lemma}{引理}[section] 239 | \renewcommand{\theLemma}{\arabic{Lemma}} 240 | 241 | \newtheorem*{Proposition*}{命题} 242 | \newtheorem{Proposition}{命题}[section] 243 | \renewcommand{\theProposition}{\arabic{Proposition}} 244 | 245 | \newtheorem*{Proof*}{证} 246 | \newtheorem{Proof}{证}[section] 247 | \renewcommand{\theProof}{\arabic{Proof}} 248 | 249 | \newtheorem*{Example*}{例} 250 | \newtheorem{Example}{例}[section] 251 | \renewcommand{\theExample}{\arabic{Example}} 252 | 253 | \newtheorem*{Solution*}{解} 254 | \newtheorem{Solution}{解}[section] 255 | \renewcommand{\theSolution}{\arabic{Solution}} 256 | -------------------------------------------------------------------------------- /documentation_CJKsc/styles/kaohandtCJKsc.cls: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % kaobook 3 | % LaTeX Class 4 | % Version 0.9.8 (2021/08/23) 5 | % 6 | % This template originates from: 7 | % https://www.LaTeXTemplates.com 8 | % 9 | % For the latest template development version and to make contributions: 10 | % https://github.com/fmarotta/kaobook 11 | % 12 | % Authors: 13 | % Federico Marotta (federicomarotta@mail.com) 14 | % Based on the doctoral thesis of Ken Arroyo Ohori (https://3d.bk.tudelft.nl/ken/en) 15 | % and on the Tufte-LaTeX class. 16 | % Modified for LaTeX Templates by Vel (vel@latextemplates.com) 17 | % 18 | % License: 19 | % LPPL (see included MANIFEST.md file) 20 | % 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | 23 | %---------------------------------------------------------------------------------------- 24 | % CLASS CONFIGURATION 25 | %---------------------------------------------------------------------------------------- 26 | 27 | \NeedsTeXFormat{LaTeX2e} 28 | \ProvidesClass{styles/kaohandtCJKsc}[2021/08/23 v0.9.8 kaohandt] 29 | \newcommand{\@baseclass}{scrartcl} % Base class name 30 | 31 | % Set the default options 32 | \PassOptionsToClass{a4paper}{\@baseclass} 33 | 34 | % Pass through any other options to the base class 35 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\@baseclass}} 36 | 37 | \ProcessOptions\relax % Process the options 38 | 39 | \LoadClass{\@baseclass} % Load the base class 40 | 41 | \RequirePackage{styles/kaoCJKsc} % Load the code common to all classes 42 | 43 | %---------------------------------------------------------------------------------------- 44 | % TITLE-RELATED SETTINGS 45 | %---------------------------------------------------------------------------------------- 46 | 47 | % Left-align title, authors and date 48 | \xpatchcmd{\@maketitle}{\begin{center}}{\begin{flushleft}}{}{} 49 | \xpatchcmd{\@maketitle}{\end{center}}{\end{flushleft}}{}{} 50 | \xpatchcmd{\@maketitle}{\begin{tabular}[t]{c}}{\begin{tabular}[t]{@{}l@{}}}{}{} 51 | 52 | % Set the font for the title 53 | \addtokomafont{title}{\normalfont\bfseries} 54 | 55 | % Customise the abstract 56 | \RequirePackage[style]{abstract} 57 | 58 | \setlength{\absleftindent}{0pt}% No indentation in the abstract 59 | \if@abstrt 60 | \renewcommand{\abstitlestyle}[1]{% 61 | \vspace{-0.6cm}% 62 | \begin{center}% 63 | {\normalfont\bfseries\hspace{-3em} \abstractname\vspace{-.5em}\vspace{\z@}}% 64 | \end{center}% 65 | } 66 | \else 67 | \renewcommand{\abstitlestyle}[1]{\vspace{-.5em}\vspace{\z@}}% 68 | \fi 69 | 70 | % Set KOMA fonts 71 | \addtokomafont{section}{\normalfont\bfseries} 72 | \addtokomafont{subsection}{\normalfont\bfseries} 73 | \addtokomafont{subsubsection}{\normalfont\bfseries} 74 | \addtokomafont{paragraph}{\normalfont\bfseries} 75 | \setkomafont{descriptionlabel}{\normalfont\bfseries} 76 | 77 | %---------------------------------------------------------------------------------------- 78 | % TOC 79 | %---------------------------------------------------------------------------------------- 80 | 81 | % Adjust the positions of margintoc and marginnotes 82 | \setlength{\mtocshift}{-0.6cm} 83 | \renewcommand{\marginnotevadjust}{-4pt} 84 | 85 | % Do not add lists to the TOC 86 | \PassOptionsToClass{toc=nolistof}{\@baseclass} 87 | \unsettoc{toc}{totoc} 88 | 89 | %---------------------------------------------------------------------------------------- 90 | % NUMBERING 91 | %---------------------------------------------------------------------------------------- 92 | 93 | %\setcounter{secnumdepth}{\kao@secnumdepth} % Set section numbering depth 94 | 95 | \counterwithin*{sidenote}{section} % Uncomment to reset the sidenote counter at each section 96 | %\counterwithout{sidenote}{section} % Uncomment to have one sidenote counter for the whole document 97 | -------------------------------------------------------------------------------- /kaobookCJKsc/Cleaning.cmd: -------------------------------------------------------------------------------- 1 | @echo Cleaning... 2 | del *.aux 3 | del *.bbl 4 | del *.bcf 5 | del *.blg 6 | del *.glg 7 | del *.glo 8 | del *.gls 9 | del *.gz 10 | del *.idx 11 | del *.ilg 12 | del *.ind 13 | del *.loe 14 | del *.lof 15 | del *.log 16 | del *.lol 17 | del *.lot 18 | del *.mw 19 | del *.nlo 20 | del *.nls 21 | del *(busy) 22 | del *.toc 23 | del *.unq 24 | del *.xdy 25 | del *.xml 26 | @echo Finish... 27 | -------------------------------------------------------------------------------- /kaobookCJKsc/Compiling.cmd: -------------------------------------------------------------------------------- 1 | @echo Starting... 2 | xelatex --extra-mem-bot=10000000 main 3 | makeindex main.nlo -s nomencl.ist -o main.nls 4 | makeindex main 5 | biber main 6 | makeglossaries main 7 | xelatex --extra-mem-bot=10000000 main 8 | xelatex --extra-mem-bot=10000000 main 9 | xelatex --extra-mem-bot=10000000 main 10 | @echo Finish... 11 | -------------------------------------------------------------------------------- /kaobookCJKsc/screenshots/main-doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobookCJKsc/screenshots/main-doc.png -------------------------------------------------------------------------------- /kaobookCJKsc/screenshots/post-doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobookCJKsc/screenshots/post-doc.png -------------------------------------------------------------------------------- /kaobookCJKsc/screenshots/pre-doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobookCJKsc/screenshots/pre-doc.png -------------------------------------------------------------------------------- /kaobookCJKsc/styles/config.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%无法放在导言区的设置%%%%%%%%%%%%%%%%%%%% 2 | %目录中文名 3 | \renewcommand{\contentsname}{目录} 4 | \renewcommand{\listfigurename}{插图} 5 | \renewcommand{\listtablename}{表格} 6 | \renewcommand{\lstlistlistingname}{清单} 7 | \renewcommand{\lstlistingname}{清单} 8 | \renewcommand{\indexname}{索引} 9 | \renewcommand{\bibname}{参考文献} 10 | %其他中文名 11 | \renewcommand{\pagename}{页} 12 | \renewcommand{\chaptername}{章} 13 | \renewcommand{\sectionname}{节} 14 | \renewcommand{\subsectionname}{小节} 15 | \renewcommand{\figurename}{图} 16 | \renewcommand{\tablename}{表} 17 | \renewcommand{\eqname}{公式} 18 | \renewcommand{\defname}{定义} 19 | \renewcommand{\assumname}{假设} 20 | \renewcommand{\thmname}{定理} 21 | \renewcommand{\propname}{命题} 22 | \renewcommand{\lemmaname}{引理} 23 | \renewcommand{\remarkname}{备注} 24 | \renewcommand{\examplename}{例} 25 | \renewcommand{\exercisename}{练习} 26 | %引用语序 27 | \renewcommand{\refpage}[1]{\hyperref[#1]{\textcolor{Blue}{第\xspace\pageref{page:#1}\xspace\pagename}}} % 第 84 页 28 | \renewcommand{\refch}[1]{\hyperref[ch:#1]{\textcolor{Blue}{第\xspace\ref{ch:#1}\xspace\chaptername}}} % 第 7 章 29 | \renewcommand{\nrefch}[1]{\hyperref[ch:#1]{\textcolor{Blue}{第\xspace\ref{ch:#1}\xspace\chaptername(\nameref{ch:#1})}}} % 第 7 章(数学) 30 | \renewcommand{\refsec}[1]{\hyperref[sec:#1]{\textcolor{Blue}{第\xspace\ref{sec:#1}\xspace\sectionname}}} 31 | \renewcommand{\nrefsec}[1]{\hyperref[sec:#1]{\textcolor{Blue}{第\xspace\ref{sec:#1}\xspace\sectionname(\nameref{sec:#1})}}} 32 | \renewcommand{\refsubsec}[1]{\hyperref[subsec:#1]{\textcolor{Blue}{第\xspace\ref{subsec:#1}\xspace\subsectionname}}} 33 | \renewcommand{\nrefsubsec}[1]{\hyperref[subsec:#1]{\textcolor{Blue}{第\xspace\ref{subsec:#1}\xspace\subsectionname(\nameref{subsec:#1})}}} 34 | %脚注编号 35 | % \renewcommand{\thefootnote}{\arabic{footnote}} % 1, 2, 3 36 | % \renewcommand{\thefootnote}{\alph{footnote}} % a, b, c 37 | % \renewcommand{\thefootnote}{\roman{footnote}} % i, ii, iii 38 | 39 | -------------------------------------------------------------------------------- /kaobookCJKsc/styles/kaoWinCJKsc.sty: -------------------------------------------------------------------------------- 1 | \ProvidesPackage{styles/kaoWinCJKsc} 2 | 3 | \RequirePackage{kvoptions} % Handle package options 4 | \SetupKeyvalOptions{ 5 | family = kaowincjksc, 6 | prefix = kaowincjksc@ 7 | } 8 | 9 | \DeclareBoolOption{testMathBox}% If true, put theorems into colorful boxes, otherwise write them like normal text 10 | 11 | \ProcessKeyvalOptions{kaowincjksc} 12 | 13 | %---------------------------------------------------------------------------------------- 14 | % 加载包用于字体设置与选择 15 | \RequirePackage{xeCJK} 16 | 17 | % 检查可用中文字体名:fc-list -f "%{family}\n" :lang=zh > zh-font.txt 18 | \setCJKmainfont[BoldFont=Noto Serif CJK SC Bold,AutoFakeSlant]{Noto Serif CJK SC} 19 | \setCJKsansfont[BoldFont=Noto Sans CJK SC Bold,AutoFakeSlant]{Noto Sans CJK SC} 20 | \setCJKmonofont[BoldFont=Noto Sans Mono CJK SC Bold,AutoFakeSlant]{Noto Sans Mono CJK SC} 21 | 22 | %---------------------------------------------------------------------------------------- 23 | % 加载包用于首行缩进 24 | \RequirePackage{indentfirst} 25 | \setlength{\parindent}{2em} % 首行缩进两个汉字或四个字母 26 | 27 | %---------------------------------------------------------------------------------------- 28 | % 文本颜色 29 | \RequirePackage{xcolor} 30 | % 中文数字日期格式 31 | \RequirePackage{zhnumber} 32 | 33 | %---------------------------------------------------------------------------------------- 34 | % Win10 平台中文字体集合 35 | \setCJKfamilyfont{nosat}{Noto Sans CJK SC Thin} 36 | \newcommand{\nosat}{\CJKfamily{nosat}} 37 | \setCJKfamilyfont{dx}{DengXian} %等线 dx 38 | \newcommand{\dx}{\CJKfamily{dx}} 39 | \setCJKfamilyfont{song}{SimSun} %宋体 song 40 | \newcommand{\song}{\CJKfamily{song}} 41 | \setCJKfamilyfont{xs}{NSimSun} %新宋体 xs 42 | \newcommand{\xs}{\CJKfamily{xs}} 43 | \setCJKfamilyfont{fs}{FangSong} %仿宋 fs 44 | \newcommand{\fs}{\CJKfamily{fs}} 45 | \setCJKfamilyfont{yh}{Microsoft YaHei} %微软雅黑 yh 46 | \newcommand{\yh}{\CJKfamily{yh}} 47 | \setCJKfamilyfont{hei}{SimHei} %黑体 hei 48 | \newcommand{\hei}{\CJKfamily{hei}} 49 | \setCJKfamilyfont{kai}{KaiTi} %楷体 kai 50 | \newcommand{\kai}{\CJKfamily{kai}} 51 | \setCJKfamilyfont{li}{LiSu} %隶书 li 52 | \newcommand{\li}{\CJKfamily{li}} 53 | \setCJKfamilyfont{yy}{YouYuan} %幼圆 yy 54 | \newcommand{\yy}{\CJKfamily{yy}} 55 | \setCJKfamilyfont{hwsong}{STSong} %华文宋体 hwsong 56 | \newcommand{\hwsong}{\CJKfamily{hwsong}} 57 | \setCJKfamilyfont{hwzs}{STZhongsong} %华文中宋 hwzs 58 | \newcommand{\hwzs}{\CJKfamily{hwzs}} 59 | \setCJKfamilyfont{hwfs}{STFangsong} %华文仿宋 hwfs 60 | \newcommand{\hwfs}{\CJKfamily{hwfs}} 61 | \setCJKfamilyfont{hwxh}{STXihei} %华文细黑 hwxh 62 | \newcommand{\hwxh}{\CJKfamily{hwxh}} 63 | \setCJKfamilyfont{hwl}{STLiti} %华文隶书 hwl 64 | \newcommand{\hwl}{\CJKfamily{hwl}} 65 | \setCJKfamilyfont{hwxw}{STXinwei} %华文新魏 hwxw 66 | \newcommand{\hwxw}{\CJKfamily{hwxw}} 67 | \setCJKfamilyfont{hwk}{STKaiti} %华文楷体 hwk 68 | \newcommand{\hwk}{\CJKfamily{hwk}} 69 | \setCJKfamilyfont{hwxk}{STXingkai} %华文行楷 hwxk 70 | \newcommand{\hwxk}{\CJKfamily{hwxk}} 71 | \setCJKfamilyfont{hwcy}{STCaiyun} %华文彩云 hwcy 72 | \newcommand{\hwcy}{\CJKfamily{hwcy}} 73 | \setCJKfamilyfont{hwhp}{STHupo} %华文琥珀 hwhp 74 | \newcommand{\hwhp}{\CJKfamily{hwhp}} 75 | \setCJKfamilyfont{fzs}{FZShuTi} %方正舒体 fzs 76 | \newcommand{\fzs}{\CJKfamily{fzs}} 77 | \setCJKfamilyfont{fzy}{FZYaoTi} %方正姚体 fzy 78 | \newcommand{\fzy}{\CJKfamily{fzy}} 79 | 80 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 彩色盒子 81 | \ifkaowincjksc@testMathBox 82 | \RequirePackage{tikz} % Required by mdframed 83 | \RequirePackage[framemethod=TikZ]{mdframed} % Required for colorful boxes 84 | 85 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 86 | %Theorem 87 | % define a counter for continuous numbering of the environment 88 | % by chapter or by section 89 | \newcounter{theo}[section] \setcounter{theo}{0} 90 | %\renewcommand{\thetheo}{\arabic{chapter}.\arabic{theo}} %显示章节名 91 | \renewcommand{\thetheo}{\arabic{theo}} %不显示章节名 92 | \newenvironment{theo}[2][]{% 93 | \refstepcounter{theo}% 94 | \ifstrempty{#1}% 95 | {\mdfsetup{% 96 | frametitle={% 97 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 98 | \node[anchor=east,rectangle,fill=blue!20] 99 | {\strut Theorem~\thetheo};}} 100 | }% 101 | {\mdfsetup{% 102 | frametitle={% 103 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 104 | \node[anchor=east,rectangle,fill=blue!20] 105 | {\strut Theorem~\thetheo:~#1};}}% 106 | }% 107 | \mdfsetup{innertopmargin=10pt,linecolor=blue!20,% 108 | linewidth=2pt,topline=true,% 109 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 110 | } 111 | \begin{mdframed}[]\relax% 112 | \label{#2}}{\end{mdframed}} 113 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 114 | %Lemma 115 | \newcounter{lem}[section] \setcounter{lem}{0} 116 | \renewcommand{\thelem}{\arabic{lem}} 117 | \newenvironment{lem}[2][]{% 118 | \refstepcounter{lem}% 119 | \ifstrempty{#1}% 120 | {\mdfsetup{% 121 | frametitle={% 122 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 123 | \node[anchor=east,rectangle,fill=green!20] 124 | {\strut Lemma~\thelem};}} 125 | }% 126 | {\mdfsetup{% 127 | frametitle={% 128 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 129 | \node[anchor=east,rectangle,fill=green!20] 130 | {\strut Lemma~\thelem:~#1};}}% 131 | }% 132 | \mdfsetup{innertopmargin=10pt,linecolor=green!20,% 133 | linewidth=2pt,topline=true,% 134 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 135 | } 136 | \begin{mdframed}[]\relax% 137 | \label{#2}} 138 | {\end{mdframed}} 139 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 140 | %Proof 141 | % [begin]define a new environment for proof 142 | \newenvironment{prf}[2][]{% 143 | % box style 144 | \ifstrempty{#1} 145 | % if condition (without title) 146 | { 147 | \mdfsetup{% 148 | frametitle={% 149 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 150 | \node[anchor=east,rectangle,fill=red!20] 151 | {\strut Proof~};}} 152 | }% else condition (with title) 153 | { 154 | \mdfsetup{% 155 | frametitle={% 156 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 157 | \node[anchor=east,rectangle,fill=red!20] 158 | {\strut Proof~:~#1};}}% 159 | }% 160 | % Both conditions 161 | \mdfsetup{ 162 | innertopmargin=10pt,linecolor=red!20,% 163 | linewidth=2pt,topline=true,% 164 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 165 | } 166 | 167 | % [begin]define a new environment for proof 168 | \begin{mdframed}[]\relax% 169 | \label{#2} 170 | } 171 | {\qed\end{mdframed}} 172 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 173 | %soln 174 | % [begin]define a new environment for proof 175 | \newenvironment{soln}[2][]{% 176 | % box style 177 | \ifstrempty{#1} 178 | % if condition (without title) 179 | { 180 | \mdfsetup{% 181 | frametitle={% 182 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 183 | \node[anchor=east,rectangle,fill=red!20] 184 | {\strut Solution~};}} 185 | }% else condition (with title) 186 | { 187 | \mdfsetup{% 188 | frametitle={% 189 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 190 | \node[anchor=east,rectangle,fill=red!20] 191 | {\strut Solution~:~#1};}}% 192 | }% 193 | % Both conditions 194 | \mdfsetup{ 195 | innertopmargin=10pt,linecolor=red!20,% 196 | linewidth=2pt,topline=true,% 197 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 198 | } 199 | 200 | % [begin]define a new environment for proof 201 | \begin{mdframed}[]\relax% 202 | \label{#2} 203 | } 204 | {\qed\end{mdframed}} 205 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 206 | \fi 207 | 208 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 高等数学风格 209 | \usepackage{amsthm} 210 | \usepackage{thmtools} 211 | \usepackage[unq]{unique} 212 | 213 | \declaretheoremstyle[% 214 | headindent=\parindent, 215 | headfont=\normalfont\bfseries,% 216 | notefont=\normalfont\bfseries, notebraces={(}{)}, 217 | bodyfont=\normalfont, 218 | postheadspace=1em,% 219 | %qed=\qedsymbol,%空心 220 | qed=$\blacksquare$,%实心 221 | headpunct={} 222 | ]{mathstyle} 223 | 224 | \theoremstyle{mathstyle} 225 | % 使用 amsthm 定义 226 | \newtheorem*{Definition*}{定义} 227 | \newtheorem{Definition}{定义}[section] 228 | \renewcommand{\theDefinition}{\arabic{Definition}} 229 | 230 | \newtheorem*{Theorem*}{定理} 231 | \newtheorem{Theorem}{定理}[section] 232 | \renewcommand{\theTheorem}{\arabic{Theorem}} 233 | 234 | \newtheorem{Corollary}{推论} 235 | \renewcommand{\theCorollary}{\arabic{Corollary}} 236 | 237 | \newtheorem*{Lemma*}{引理} 238 | \newtheorem{Lemma}{引理}[section] 239 | \renewcommand{\theLemma}{\arabic{Lemma}} 240 | 241 | \newtheorem*{Proposition*}{命题} 242 | \newtheorem{Proposition}{命题}[section] 243 | \renewcommand{\theProposition}{\arabic{Proposition}} 244 | 245 | \newtheorem*{Proof*}{证} 246 | \newtheorem{Proof}{证}[section] 247 | \renewcommand{\theProof}{\arabic{Proof}} 248 | 249 | \newtheorem*{Example*}{例} 250 | \newtheorem{Example}{例}[section] 251 | \renewcommand{\theExample}{\arabic{Example}} 252 | 253 | \newtheorem*{Solution*}{解} 254 | \newtheorem{Solution}{解}[section] 255 | \renewcommand{\theSolution}{\arabic{Solution}} 256 | -------------------------------------------------------------------------------- /kaobookCJKsc/styles/kaohandtCJKsc.cls: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % kaobook 3 | % LaTeX Class 4 | % Version 0.9.8 (2021/08/23) 5 | % 6 | % This template originates from: 7 | % https://www.LaTeXTemplates.com 8 | % 9 | % For the latest template development version and to make contributions: 10 | % https://github.com/fmarotta/kaobook 11 | % 12 | % Authors: 13 | % Federico Marotta (federicomarotta@mail.com) 14 | % Based on the doctoral thesis of Ken Arroyo Ohori (https://3d.bk.tudelft.nl/ken/en) 15 | % and on the Tufte-LaTeX class. 16 | % Modified for LaTeX Templates by Vel (vel@latextemplates.com) 17 | % 18 | % License: 19 | % LPPL (see included MANIFEST.md file) 20 | % 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | 23 | %---------------------------------------------------------------------------------------- 24 | % CLASS CONFIGURATION 25 | %---------------------------------------------------------------------------------------- 26 | 27 | \NeedsTeXFormat{LaTeX2e} 28 | \ProvidesClass{styles/kaohandtCJKsc}[2021/08/23 v0.9.8 kaohandt] 29 | \newcommand{\@baseclass}{scrartcl} % Base class name 30 | 31 | % Set the default options 32 | \PassOptionsToClass{a4paper}{\@baseclass} 33 | 34 | % Pass through any other options to the base class 35 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\@baseclass}} 36 | 37 | \ProcessOptions\relax % Process the options 38 | 39 | \LoadClass{\@baseclass} % Load the base class 40 | 41 | \RequirePackage{styles/kaoCJKsc} % Load the code common to all classes 42 | 43 | %---------------------------------------------------------------------------------------- 44 | % TITLE-RELATED SETTINGS 45 | %---------------------------------------------------------------------------------------- 46 | 47 | % Left-align title, authors and date 48 | \xpatchcmd{\@maketitle}{\begin{center}}{\begin{flushleft}}{}{} 49 | \xpatchcmd{\@maketitle}{\end{center}}{\end{flushleft}}{}{} 50 | \xpatchcmd{\@maketitle}{\begin{tabular}[t]{c}}{\begin{tabular}[t]{@{}l@{}}}{}{} 51 | 52 | % Set the font for the title 53 | \addtokomafont{title}{\normalfont\bfseries} 54 | 55 | % Customise the abstract 56 | \RequirePackage[style]{abstract} 57 | 58 | \setlength{\absleftindent}{0pt}% No indentation in the abstract 59 | \if@abstrt 60 | \renewcommand{\abstitlestyle}[1]{% 61 | \vspace{-0.6cm}% 62 | \begin{center}% 63 | {\normalfont\bfseries\hspace{-3em} \abstractname\vspace{-.5em}\vspace{\z@}}% 64 | \end{center}% 65 | } 66 | \else 67 | \renewcommand{\abstitlestyle}[1]{\vspace{-.5em}\vspace{\z@}}% 68 | \fi 69 | 70 | % Set KOMA fonts 71 | \addtokomafont{section}{\normalfont\bfseries} 72 | \addtokomafont{subsection}{\normalfont\bfseries} 73 | \addtokomafont{subsubsection}{\normalfont\bfseries} 74 | \addtokomafont{paragraph}{\normalfont\bfseries} 75 | \setkomafont{descriptionlabel}{\normalfont\bfseries} 76 | 77 | %---------------------------------------------------------------------------------------- 78 | % TOC 79 | %---------------------------------------------------------------------------------------- 80 | 81 | % Adjust the positions of margintoc and marginnotes 82 | \setlength{\mtocshift}{-0.6cm} 83 | \renewcommand{\marginnotevadjust}{-4pt} 84 | 85 | % Do not add lists to the TOC 86 | \PassOptionsToClass{toc=nolistof}{\@baseclass} 87 | \unsettoc{toc}{totoc} 88 | 89 | %---------------------------------------------------------------------------------------- 90 | % NUMBERING 91 | %---------------------------------------------------------------------------------------- 92 | 93 | %\setcounter{secnumdepth}{\kao@secnumdepth} % Set section numbering depth 94 | 95 | \counterwithin*{sidenote}{section} % Uncomment to reset the sidenote counter at each section 96 | %\counterwithout{sidenote}{section} % Uncomment to have one sidenote counter for the whole document 97 | -------------------------------------------------------------------------------- /kaobook_origin/.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | 🎉🎉🎉 Thank you for considering to contribute! 🎉🎉🎉 4 | 5 | ### Code of Conduct 6 | As a contributor, you are expected to follow the [code of conduct](https://github.com/fmarotta/kaobook/blob/master/CODE_OF_CONDUCT.md). 7 | Please read it and comply with the rules. 8 | 9 | ### Ways to Contribute 10 | * Use ```kaobook``` and write [bug reports](https://github.com/fmarotta/kaobook/issues/new?assignees=&labels=&template=bug_report.md) or [feature requests](https://github.com/AlexanderZeilmann/kaobook/issues/new?assignees=&labels=&template=feature_request.md). 11 | * Have a look at our [issues](https://github.com/fmarotta/kaobook/issues) and especially at our ["help wanted" issues](https://github.com/fmarotta/kaobook/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). Maybe you can help out with one of them. 12 | * Help improving our [documentation](https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf). 13 | 14 | ### Code Style Guide 15 | * We do not have a formal code style guide yet. 16 | * Please stick to the style of the surrounding code. 17 | -------------------------------------------------------------------------------- /kaobook_origin/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: "https://paypal.me/marofede" 2 | -------------------------------------------------------------------------------- /kaobook_origin/.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | --- 5 | 6 | 13 | 14 | ### Description 15 | 16 | 17 | ### Minimal Working Example 18 | 19 | 20 | ```latex 21 | \documentclass{kaobook} 22 | \usepackage[english]{babel} 23 | \usepackage{blindtext} 24 | \usepackage{kaobiblio} 25 | \usepackage{kaotheorems} 26 | \usepackage{kaorefs} 27 | 28 | \begin{document} 29 | 30 | \title{Bug Report} 31 | \author{Author} 32 | \date{\today} 33 | 34 | \frontmatter 35 | \maketitle 36 | \mainmatter 37 | \setchapterstyle{kao} 38 | 39 | \chapter{First Chapter} 40 | \blindtext 41 | 42 | \end{document} 43 | ``` 44 | 45 | **Expected behavior:** 46 | 47 | 48 | **Actual behavior:** 49 | 50 | 51 | 52 | ### Additional Information 53 | 54 | -------------------------------------------------------------------------------- /kaobook_origin/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | --- 5 | 6 | ## Summary 7 | 8 | 9 | ## Details 10 | 11 | 12 | ## Additional context 13 | 14 | -------------------------------------------------------------------------------- /kaobook_origin/.github/SUPPORT.md: -------------------------------------------------------------------------------- 1 | Getting Support 2 | =============== 3 | 4 | Depending on your type of problem, there are several ways to get help: 5 | 6 | ### General LaTeX Questions 7 | * Completely new to TeX and LaTeX? → [Learn LaTeX in 30 minutes](https://www.overleaf.com/learn/latex/Learn_LaTeX_in_30_minutes) 8 | * General question regarding TeX or LaTeX? → [TeX - LaTeX Stack Exchange](https://tex.stackexchange.com/) 9 | 10 | ### Questions regarding kaobook 11 | * Got a question on how to use kaobook? → [kaobook Documentation](https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf) 12 | * Got a question that is not answered by the documentation? → [kaobook Discussions](https://github.com/fmarotta/kaobook/discussions) 13 | 14 | ### Bug Reports & Feature requests 15 | * You want to report a bug? → [Create a bug report here.](https://github.com/fmarotta/kaobook/issues/new?assignees=&labels=&template=bug_report.md) 16 | * You want to propose a new feature? → [Create a feature request here.](https://github.com/fmarotta/kaobook/issues/new?assignees=&labels=&template=feature_request.md) 17 | -------------------------------------------------------------------------------- /kaobook_origin/.github/workflows/verify_examples.yml: -------------------------------------------------------------------------------- 1 | name: Verify examples 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | find_examples: 6 | runs-on: ubuntu-latest 7 | outputs: 8 | matrix: ${{ steps.find-dirs.outputs.matrix }} 9 | steps: 10 | - uses: actions/checkout@v2 11 | - name: Gather directories inside examples 12 | id: find-dirs 13 | run: | 14 | cd examples 15 | echo "::set-output name=matrix::{\"dir\":[$(for dir in $(echo */); do echo -n \"${dir%?}\",; done)]}" 16 | build_latex: 17 | needs: find_examples 18 | runs-on: ubuntu-latest 19 | strategy: 20 | matrix: ${{fromJson(needs.find_examples.outputs.matrix)}} 21 | fail-fast: false 22 | steps: 23 | - uses: actions/checkout@v2 24 | - name: Check that LaTeX example compiles 25 | uses: xu-cheng/latex-action@v2 26 | with: 27 | working_directory: examples/${{ matrix.dir }} 28 | pre_compile: | 29 | cp -r ../../* . || true 30 | mkdir styles && cp -r ../../* ./styles/ || true 31 | root_file: main.tex 32 | latexmk_shell_escape: true 33 | - uses: actions/upload-artifact@v2 34 | if: ${{ always() }} 35 | with: 36 | name: Log - ${{ matrix.dir }} 37 | path: examples/${{ matrix.dir }}/main.log 38 | -------------------------------------------------------------------------------- /kaobook_origin/.gitignore: -------------------------------------------------------------------------------- 1 | ## Custom exclusions 2 | article-template.pdf 3 | book-template.pdf 4 | 5 | ## Core latex/pdflatex auxiliary files: 6 | *.aux 7 | *.lof 8 | *.log 9 | *.lot 10 | *.fls 11 | *.out 12 | *.toc 13 | *.fmt 14 | *.fot 15 | *.cb 16 | *.cb2 17 | .*.lb 18 | 19 | ## Intermediate documents: 20 | *.dvi 21 | *.xdv 22 | *-converted-to.* 23 | # these rules might exclude image files for figures etc. 24 | # *.ps 25 | # *.eps 26 | # *.pdf 27 | 28 | ## Generated if empty string is given at "Please type another file name for output:" 29 | .pdf 30 | 31 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 32 | *.bbl 33 | *.bcf 34 | *.blg 35 | *-blx.aux 36 | *-blx.bib 37 | *.run.xml 38 | 39 | ## Build tool auxiliary files: 40 | *.fdb_latexmk 41 | *.synctex 42 | *.synctex(busy) 43 | *.synctex.gz 44 | *.synctex.gz(busy) 45 | *.pdfsync 46 | 47 | ## Auxiliary and intermediate files from other packages: 48 | # algorithms 49 | *.alg 50 | *.loa 51 | 52 | # achemso 53 | acs-*.bib 54 | 55 | # amsthm 56 | *.thm 57 | 58 | # beamer 59 | *.nav 60 | *.pre 61 | *.snm 62 | *.vrb 63 | 64 | # changes 65 | *.soc 66 | 67 | # cprotect 68 | *.cpt 69 | 70 | # elsarticle (documentclass of Elsevier journals) 71 | *.spl 72 | 73 | # endnotes 74 | *.ent 75 | 76 | # fixme 77 | *.lox 78 | 79 | # feynmf/feynmp 80 | *.mf 81 | *.mp 82 | *.t[1-9] 83 | *.t[1-9][0-9] 84 | *.tfm 85 | 86 | #(r)(e)ledmac/(r)(e)ledpar 87 | *.end 88 | *.?end 89 | *.[1-9] 90 | *.[1-9][0-9] 91 | *.[1-9][0-9][0-9] 92 | *.[1-9]R 93 | *.[1-9][0-9]R 94 | *.[1-9][0-9][0-9]R 95 | *.eledsec[1-9] 96 | *.eledsec[1-9]R 97 | *.eledsec[1-9][0-9] 98 | *.eledsec[1-9][0-9]R 99 | *.eledsec[1-9][0-9][0-9] 100 | *.eledsec[1-9][0-9][0-9]R 101 | 102 | # glossaries 103 | *.acn 104 | *.acr 105 | *.glg 106 | *.glo 107 | *.gls 108 | *.glsdefs 109 | 110 | # gnuplottex 111 | *-gnuplottex-* 112 | 113 | # gregoriotex 114 | *.gaux 115 | *.gtex 116 | 117 | # htlatex 118 | *.4ct 119 | *.4tc 120 | *.idv 121 | *.lg 122 | *.trc 123 | *.xref 124 | 125 | # hyperref 126 | *.brf 127 | 128 | # knitr 129 | *-concordance.tex 130 | # TODO Comment the next line if you want to keep your tikz graphics files 131 | *.tikz 132 | *-tikzDictionary 133 | 134 | # listings 135 | *.lol 136 | 137 | # makeidx 138 | *.idx 139 | *.ilg 140 | *.ind 141 | *.ist 142 | 143 | # minitoc 144 | *.maf 145 | *.mlf 146 | *.mlt 147 | *.mtc[0-9]* 148 | *.slf[0-9]* 149 | *.slt[0-9]* 150 | *.stc[0-9]* 151 | 152 | # minted 153 | _minted* 154 | *.pyg 155 | 156 | # morewrites 157 | *.mw 158 | 159 | # nomencl 160 | *.nlg 161 | *.nlo 162 | *.nls 163 | 164 | # pax 165 | *.pax 166 | 167 | # pdfpcnotes 168 | *.pdfpc 169 | 170 | # sagetex 171 | *.sagetex.sage 172 | *.sagetex.py 173 | *.sagetex.scmd 174 | 175 | # scrwfile 176 | *.wrt 177 | 178 | # sympy 179 | *.sout 180 | *.sympy 181 | sympy-plots-for-*.tex/ 182 | 183 | # pdfcomment 184 | *.upa 185 | *.upb 186 | 187 | # pythontex 188 | *.pytxcode 189 | pythontex-files-*/ 190 | 191 | # thmtools 192 | *.loe 193 | 194 | # TikZ & PGF 195 | *.dpth 196 | *.md5 197 | *.auxlock 198 | 199 | # todonotes 200 | *.tdo 201 | 202 | # easy-todo 203 | *.lod 204 | 205 | # xmpincl 206 | *.xmpi 207 | 208 | # xindy 209 | *.xdy 210 | 211 | # xypic precompiled matrices 212 | *.xyc 213 | 214 | # endfloat 215 | *.ttt 216 | *.fff 217 | 218 | # Latexian 219 | TSWLatexianTemp* 220 | 221 | ## Editors: 222 | # WinEdt 223 | *.bak 224 | *.sav 225 | 226 | # Texpad 227 | .texpadtmp 228 | 229 | # Kile 230 | *.backup 231 | 232 | # KBibTeX 233 | *~[0-9]* 234 | 235 | # auto folder when using emacs and auctex 236 | ./auto/* 237 | *.el 238 | 239 | # expex forward references with \gathertags 240 | *-tags.tex 241 | 242 | # standalone packages 243 | *.sta 244 | 245 | # generated if using elsarticle.cls 246 | *.spl 247 | -------------------------------------------------------------------------------- /kaobook_origin/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package kaobook 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.9.8 (2021/08/23) 6 | ---------------- 7 | * Fix some issues 8 | 9 | 0.9.7 (2021/06/02) 10 | ------------------ 11 | * Move the packages to the root of the repository 12 | * Introduce the 'bar' chapterstyle 13 | * Fix some issues 14 | 15 | 0.9.6 (2021/03/23) 16 | ------------------ 17 | * Short margin tocs 18 | * Dynamic section-number-width in the margintoc 19 | * Use kvoptions instead of xkeyval 20 | * Slight modification of the page layout so that margin and wide pages 21 | have the same total width 22 | 23 | 0.9.5 (2020/12/30) 24 | ------------------ 25 | * Use \DeclareCiteCommand in kaobiblio.sty (fixes #68) 26 | * Support f24paper 27 | * Include scrhack 28 | * Add \FloatBarrier before marginfigures, tables and listings 29 | * Improve style of header and chapter, esp. for scales different from A4 30 | * Fix overfull boxes in header and chapter layouts 31 | * Increase the width of the page number boxes in the toc 32 | * Fix typos in the docs (contributor: Martin Michlmayr) 33 | * Set default chapter styles for front-, main-, and back- matter 34 | 35 | 0.9.0 (2020/12/02) 36 | ------------------ 37 | * First official release on GitHub 38 | * Define \hscale and \vscale, and rescale lengths accordingly 39 | * Allow user to choose papersize in the documentclass options 40 | 41 | Ancient history 42 | --------------- 43 | * Add the sidecite command modified to work with BibTeX 44 | * Add an example on how to use the kao_book template with BibTeX 45 | * Add short way to references equations, chapters and sections 46 | * Contributors: Giuseppe Silano 47 | -------------------------------------------------------------------------------- /kaobook_origin/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | ```federicomarotta@mail.com```. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /kaobook_origin/MANIFEST.md: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # First Work: The kaobook Class 4 | 5 | MANIFEST.md 6 | Copyright 2020-2021 Federico Marotta 7 | 8 | This work may be distributed and/or modified under the 9 | conditions of the LaTeX Project Public License, either version 1.3 10 | of this license or (at your option) any later version. 11 | The latest version of this license is in 12 | 13 | http://www.latex-project.org/lppl.txt 14 | 15 | and version 1.3 or later is part of all distributions of LaTeX 16 | version 2005/12/01 or later. 17 | 18 | This work has the LPPL maintenance status `maintained'. 19 | 20 | The Current Maintainer of this work is Federico Marotta. 21 | 22 | This work consists of all files listed below. 23 | 24 | --- 25 | 26 | ``` 27 | kaobook/ 28 | |-- kaobook.cls - book-specific definitions 29 | |-- kaohandt.cls - handout-specific definitions 30 | |-- kao.sty - main definitions 31 | |-- kaobiblio.sty - style of the bibliography 32 | |-- kaotheorems.sty - colorful styling of theorems 33 | `-- kaorefs.sty - commands for referencing 34 | ``` 35 | 36 | --- 37 | 38 | # Second Work: Templates and Examples 39 | 40 | This work is released into the public domain using the CC0 code. To the 41 | extent possible under law, I waive all copyright and related or 42 | neighbouring rights to this work. To view a copy of the CC0 code, visit: 43 | 44 | http://creativecommons.org/publicdomain/zero/1.0 45 | 46 | This work consists of all files listed below as well as the products of 47 | their compilation. 48 | 49 | --- 50 | 51 | ``` 52 | kaobook/ 53 | `-- examples/ 54 | |-- minimal_book/ 55 | | `-- main.tex 56 | |-- minimal_report/ 57 | | `-- main.tex 58 | |-- documentation/ 59 | | |-- main.tex 60 | | |-- main.bib 61 | | |-- glossary.tex 62 | | `-- chapters/ 63 | | |-- appendix.tex 64 | | |-- figsntabs.tex 65 | | |-- introduction.tex 66 | | |-- layout.tex 67 | | |-- mathematics.tex 68 | | |-- options.tex 69 | | |-- preface.tex 70 | | |-- references.tex 71 | | `-- textnotes.tex 72 | `-- machine_learning_project/ 73 | |-- sections/ 74 | | |-- introduction.tex 75 | | |-- data.tex 76 | | |-- results.tex 77 | | `-- discussion.tex 78 | |-- main.tex 79 | `-- main.bib 80 | ``` 81 | 82 | As regards the files in the `kaobook/examples/documentation/images` 83 | directory, they were downloaded from [Wikimedia 84 | Commons](https://commons.wikimedia.org/wiki/Main_Page) and are 85 | attributed inside the example book where they are used. 86 | -------------------------------------------------------------------------------- /kaobook_origin/example_and_documentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/example_and_documentation.pdf -------------------------------------------------------------------------------- /kaobook_origin/examples/README.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | In this folder "examples" you will find 4 examples of KaoBook layouts, 4 | each demonstrating different publications. 5 | * documentation 6 | * machine\_learning\_project 7 | * minimal\_book 8 | * minimal\_report 9 | 10 | The PDF files provided with the individual examples show the appearance 11 | of the respective end product. 12 | 13 | NOTE: These examples are not yet complete in this form. 14 | They must be supplemented by two additional components: 15 | * the "styles" folder 16 | * the file that defines the layout type (Book or Report / kaobook.cls or 17 | kaohandt.cls) 18 | 19 | To make it more clear: 20 | you have to add "kaohandt.cls" for machine\_learning\_project and 21 | to minimal\_report, because these examples are of type "report". 22 | "kaobook.cls" should be included to the two other examples. 23 | -------------------------------------------------------------------------------- /kaobook_origin/examples/documentation/.latexmkrc: -------------------------------------------------------------------------------- 1 | # Output a pdf 2 | $pdf_mode = 1; 3 | $pdflatex = 'pdflatex -output-directory=examples/documentation -shell-escape %O %S'; 4 | 5 | # By default compile only the file called 'main.tex' 6 | @default_files = ('main.tex'); 7 | 8 | # Compile the glossary and acronyms list (package 'glossaries') 9 | add_cus_dep( 'acn', 'acr', 0, 'makeglossaries' ); 10 | add_cus_dep( 'glo', 'gls', 0, 'makeglossaries' ); 11 | $clean_ext .= " acr acn alg glo gls glg"; 12 | sub makeglossaries { 13 | my ($base_name, $path) = fileparse( $_[0] ); 14 | pushd $path; 15 | my $return = system "makeglossaries", $base_name; 16 | popd; 17 | return $return; 18 | } 19 | 20 | # Compile the nomenclature (package 'nomencl') 21 | add_cus_dep( 'nlo', 'nls', 0, 'makenlo2nls' ); 22 | sub makenlo2nls { 23 | system( "makeindex -s nomencl.ist -o \"$_[0].nls\" \"$_[0].nlo\"" ); 24 | } 25 | -------------------------------------------------------------------------------- /kaobook_origin/examples/documentation/chapters/appendix.tex: -------------------------------------------------------------------------------- 1 | \setchapterstyle{lines} 2 | \labch{appendix} 3 | \blinddocument 4 | 5 | \setchapterpreamble[u]{\margintoc} 6 | \chapter{Fonts Testing} 7 | 8 | \section{Font Sizes} 9 | 10 | {\tiny The quick brown fox jumps over the lazy dog.} 11 | 12 | {\scriptsize The quick brown fox jumps over the lazy dog.} 13 | 14 | {\footnotesize The quick brown fox jumps over the lazy dog.} 15 | 16 | {\small The quick brown fox jumps over the lazy dog.} 17 | 18 | {\normalsize The quick brown fox jumps over the lazy dog.} 19 | 20 | {\large The quick brown fox jumps over the lazy dog.} 21 | 22 | {\Large The quick brown fox jumps over the lazy dog.} 23 | 24 | {\LARGE The quick brown fox jumps over the lazy dog.} 25 | 26 | {\huge The quick brown fox jumps over the lazy dog.} 27 | 28 | {\Huge The quick brown fox jumps over the lazy dog.} 29 | 30 | 31 | \section{Font Families} 32 | 33 | \sffamily\blindtext 34 | 35 | \textmd{The quick brown fox jumps over the lazy dog. Medium.} 36 | 37 | \textbf{The quick brown fox jumps over the lazy dog. Bold.} 38 | 39 | \textup{The quick brown fox jumps over the lazy dog. Upright.} 40 | 41 | \textit{The quick brown fox jumps over the lazy dog. Italics.} 42 | 43 | \textsl{The quick brown fox jumps over the lazy dog. Slanted.} 44 | 45 | \textsc{The quick brown fox jumps over the lazy dog. Small Caps.} 46 | 47 | \ttfamily\blindtext 48 | 49 | \textmd{The quick brown fox jumps over the lazy dog. Medium.} 50 | 51 | \textbf{The quick brown fox jumps over the lazy dog. Bold.} 52 | 53 | \textup{The quick brown fox jumps over the lazy dog. Upright.} 54 | 55 | \textit{The quick brown fox jumps over the lazy dog. Italics.} 56 | 57 | \textsl{The quick brown fox jumps over the lazy dog. Slanted.} 58 | 59 | \textsc{The quick brown fox jumps over the lazy dog. Small Caps.} 60 | 61 | \rmfamily\blindtext 62 | 63 | \textmd{The quick brown fox jumps over the lazy dog. Medium.} 64 | 65 | \textbf{The quick brown fox jumps over the lazy dog. Bold.} 66 | 67 | \textup{The quick brown fox jumps over the lazy dog. Upright.} 68 | 69 | \textit{The quick brown fox jumps over the lazy dog. Italics.} 70 | 71 | \textsl{The quick brown fox jumps over the lazy dog. Slanted.} 72 | 73 | \textsc{The quick brown fox jumps over the lazy dog. Small Caps.} 74 | 75 | -------------------------------------------------------------------------------- /kaobook_origin/examples/documentation/chapters/mathematics.tex: -------------------------------------------------------------------------------- 1 | \setchapterstyle{kao} 2 | \setchapterpreamble[u]{\margintoc} 3 | \chapter{Mathematics and Boxes} 4 | \labch{mathematics} 5 | 6 | \section{Theorems} 7 | 8 | Despite most people complain at the sight of a book full of equations, 9 | mathematics is an important part of many books. Here, we shall 10 | illustrate some of the possibilities. We believe that theorems, 11 | definitions, remarks and examples should be emphasised with a shaded 12 | background; however, the colour should not be to heavy on the eyes, so 13 | we have chosen a sort of light yellow.\sidenote{The boxes are all of the 14 | same colour here, because we did not want our document to look like 15 | \href{https://en.wikipedia.org/wiki/Harlequin}{Harlequin}.} 16 | 17 | \begin{definition} 18 | \labdef{openset} 19 | Let $(X, d)$ be a metric space. A subset $U \subset X$ is an open set 20 | if, for any $x \in U$ there exists $r > 0$ such that $B(x, r) \subset 21 | U$. We call the topology associated to d the set $\tau\textsubscript{d}$ 22 | of all the open subsets of $(X, d).$ 23 | \end{definition} 24 | 25 | \refdef{openset} is very important. I am not joking, but I have inserted 26 | this phrase only to show how to reference definitions. The following 27 | statement is repeated over and over in different environments. 28 | 29 | \begin{theorem} 30 | A finite intersection of open sets of (X, d) is an open set of (X, d), 31 | i.e $\tau\textsubscript{d}$ is closed under finite intersections. Any 32 | union of open sets of (X, d) is an open set of (X, d). 33 | \end{theorem} 34 | 35 | \begin{proposition} 36 | A finite intersection of open sets of (X, d) is an open set of (X, d), 37 | i.e $\tau\textsubscript{d}$ is closed under finite intersections. Any 38 | union of open sets of (X, d) is an open set of (X, d). 39 | \end{proposition} 40 | 41 | \marginnote{You can even insert footnotes inside the theorem 42 | environments; they will be displayed at the bottom of the box.} 43 | 44 | \begin{lemma} 45 | A finite intersection\footnote{I'm a footnote} of open sets of (X, d) is 46 | an open set of (X, d), i.e $\tau\textsubscript{d}$ is closed under 47 | finite intersections. Any union of open sets of (X, d) is an open set of 48 | (X, d). 49 | \end{lemma} 50 | 51 | You can safely ignore the content of the theorems\ldots I assume that if 52 | you are interested in having theorems in your book, you already know 53 | something about the classical way to add them. These example should just 54 | showcase all the things you can do within this class. 55 | 56 | \begin{corollary}[Finite Intersection, Countable Union] 57 | A finite intersection of open sets of (X, d) is an open set of (X, d), 58 | i.e $\tau\textsubscript{d}$ is closed under finite intersections. Any 59 | union of open sets of (X, d) is an open set of (X, d). 60 | \end{corollary} 61 | 62 | \begin{proof} 63 | The proof is left to the reader as a trivial exercise. Hint: \blindtext 64 | \end{proof} 65 | 66 | \begin{definition} 67 | Let $(X, d)$ be a metric space. A subset $U \subset X$ is an open set 68 | if, for any $x \in U$ there exists $r > 0$ such that $B(x, r) \subset 69 | U$. We call the topology associated to d the set $\tau\textsubscript{d}$ 70 | of all the open subsets of $(X, d).$ 71 | \end{definition} 72 | 73 | \marginnote{ 74 | Here is a random equation, just because we can: 75 | \begin{equation*} 76 | x = a_0 + \cfrac{1}{a_1 77 | + \cfrac{1}{a_2 78 | + \cfrac{1}{a_3 + \cfrac{1}{a_4} } } } 79 | \end{equation*} 80 | } 81 | 82 | \begin{example} 83 | Let $(X, d)$ be a metric space. A subset $U \subset X$ is an open set 84 | if, for any $x \in U$ there exists $r > 0$ such that $B(x, r) \subset 85 | U$. We call the topology associated to d the set $\tau\textsubscript{d}$ 86 | of all the open subsets of $(X, d).$ 87 | \end{example} 88 | 89 | \begin{remark} 90 | Let $(X, d)$ be a metric space. A subset $U \subset X$ is an open set 91 | if, for any $x \in U$ there exists $r > 0$ such that $B(x, r) \subset 92 | U$. We call the topology associated to d the set $\tau\textsubscript{d}$ 93 | of all the open subsets of $(X, d).$ 94 | \end{remark} 95 | 96 | As you may have noticed, definitions, example and remarks have 97 | independent counters; theorems, propositions, lemmas and corollaries 98 | share the same counter. 99 | 100 | \begin{remark} 101 | Here is how an integral looks like inline: $\int_{a}^{b} x^2 dx$, and 102 | here is the same integral displayed in its own paragraph: 103 | \[\int_{a}^{b} x^2 dx\] 104 | \end{remark} 105 | 106 | There is also an environment for exercises. 107 | 108 | \begin{exercise} 109 | Prove (or disprove) the Riemann hypothesis. 110 | \end{exercise} 111 | 112 | We provide one package for the theorem styles: 113 | \href{kaotheorems.sty}{kaotheorems.sty}, to which you can pass the 114 | \Option{framed} option you do want coloured boxes around theorems, like 115 | in this document.\sidenote{The styles without \Option{framed} are not 116 | showed, but actually the only difference is that they don't have the 117 | yellow boxes.} You may want to edit this files according to your taste 118 | and the general style of the book. However, there is an option to 119 | customise the background colour of the boxes if you use the 120 | \Option{framed} option: when you load this package, you can pass it the 121 | \Option{background=mycolour} option (replace \enquote{mycolour} with the 122 | actual colour, for instance, \enquote{red!35!white}). This will change 123 | the colour of all the boxes, but it is also possible to override the 124 | default colour only for some elements. For instance, the 125 | \Option{propositionbackground=mycolour} option will change the colour 126 | for propositions only. There are similar options for theorem, 127 | definition, lemma, corollary, remark, and example. 128 | 129 | \section[Boxes \& Environments]{Boxes \& Custom Environments 130 | \sidenote[][*1.8]{Notice that in the table of contents and in the 131 | header, the name of this section is \enquote{Boxes \& Environments}; 132 | we achieved this with the optional argument of the \texttt{section} 133 | command.}} 134 | 135 | Say you want to insert a special section, an optional content or just 136 | something you want to emphasise. We think that nothing works better than 137 | a box in these cases. We used \Package{mdframed} to construct the ones 138 | shown below. You can create and modify such environments by editing the 139 | provided file \href{kao.sty}{kao.sty}. 140 | 141 | \begin{kaobox}[frametitle=Title of the box] 142 | \blindtext 143 | \end{kaobox} 144 | 145 | If you set up a counter, you can even create your own numbered 146 | environment. 147 | 148 | \begin{kaocounter} 149 | \blindtext 150 | \end{kaocounter} 151 | 152 | \section{Experiments} 153 | 154 | It is possible to wrap marginnotes inside boxes, too. Audacious readers 155 | are encouraged to try their own experiments and let me know the 156 | outcomes. 157 | 158 | \marginnote[-2.2cm]{ 159 | \begin{kaobox}[frametitle=title of margin note] 160 | Margin note inside a kaobox.\\ 161 | (Actually, kaobox inside a marginnote!) 162 | \end{kaobox} 163 | } 164 | 165 | I believe that many other special things are possible with the 166 | \Class{kaobook} class. During its development, I struggled to keep it as 167 | flexible as possible, so that new features could be added without too 168 | great an effort. Therefore, I hope that you can find the optimal way to 169 | express yourselves in writing a book, report or thesis with this class, 170 | and I am eager to see the outcomes of any experiment that you may try. 171 | 172 | %\begin{margintable} 173 | %\captionsetup{type=table,position=above} 174 | %\begin{kaobox} 175 | %\caption{caption} 176 | %\begin{tabular}{ |c|c|c|c| } 177 | %\hline 178 | %col1 & col2 & col3 \\ 179 | %\hline 180 | %\multirow{3}{4em}{Multiple row} & cell2 & cell3 \\ & cell5 181 | %%& cell6 \\ 182 | %& cell8 & cell9 \\ 183 | %\hline 184 | %\end{tabular} 185 | %\end{kaobox} 186 | %\end{margintable} 187 | -------------------------------------------------------------------------------- /kaobook_origin/examples/documentation/chapters/options.tex: -------------------------------------------------------------------------------- 1 | \setchapterpreamble[u]{\margintoc} 2 | \chapter{Class Options} 3 | \labch{options} 4 | 5 | In this chapter I will describe the most common options used, both the 6 | ones inherited from \Class{scrbook} and the \Class{kao}-specific ones. 7 | Options passed to the class modifies its default behaviour; beware 8 | though that some options may lead to unexpected results\ldots 9 | 10 | \section{\Class{KOMA} Options} 11 | 12 | The \Class{kaobook} class is based on \Class{scrbook}, therefore it 13 | understands all of the options you would normally pass to that class. If 14 | you have a lot of patience, you can read the \KOMAScript\xspace 15 | guide.\sidenote{The guide can be downloaded from 16 | \url{https://ctan.org/pkg/koma-script?lang=en}.} Actually, the reading 17 | of such guide is suggested as it is very instructive. 18 | 19 | Every \KOMAScript\xspace option you pass to the class when you load it 20 | is automatically activated. In addition, in \Class{kaobook} some options 21 | have modified default values. For instance, the font size is 9.5pt and 22 | the paragraphs are separated by space,\sidenote[][-7mm]{To be precise, 23 | they are separated by half a line worth of space: the \Option{parskip} 24 | value is \enquote{half}.} not marked by indentation. 25 | 26 | \section{\Class{kao} Options} 27 | 28 | In the future I plan to add more options to set the paragraph formatting 29 | (justified or ragged) and the position of the margins (inner or outer in 30 | twoside mode, left or right in oneside mode).\sidenote{As of now, 31 | paragraphs are justified, formatted with \Command{singlespacing} (from 32 | the \Package{setspace} package) and \Command{frenchspacing}.} 33 | 34 | I take this opportunity to renew the call for help: everyone is 35 | encouraged to add features or reimplement existing ones, and to send me 36 | the results. You can find the GitHub repository at 37 | \url{https://github.com/fmarotta/kaobook}. 38 | 39 | \begin{kaobox}[frametitle=To Do] 40 | Implement the \Option{justified} and \Option{margin} options. To be 41 | consistent with the \KOMAScript\xspace style, they should accept a 42 | simple switch as a parameter, where the simple switch should be 43 | \Option{true} or \Option{false}, or one of the other standard values for 44 | simple switches supported by \KOMAScript. See the \KOMAScript\xspace 45 | documentation for further information. 46 | \end{kaobox} 47 | 48 | The above box is an example of a \Environment{kaobox}, which will be 49 | discussed more thoroughly in \frefch{mathematics}. Throughout the book I 50 | shall use these boxes to remarks what still needs to be done. 51 | 52 | \section{Other Things Worth Knowing} 53 | 54 | A bunch of packages are already loaded in the class because they are 55 | needed for the implementation. These include: 56 | 57 | \begin{itemize} 58 | \item etoolbox 59 | \item calc 60 | \item xifthen 61 | \item xkeyval 62 | \item xparse 63 | \item xstring 64 | \end{itemize} 65 | 66 | Many more packages are loaded, but they will be discussed in due time. 67 | Here, we will mention only one more set of packages, needed to change 68 | the paragraph formatting (recall that in the future there will be 69 | options to change this). In particular, the packages we load are: 70 | 71 | \begin{itemize} 72 | \item ragged2e 73 | \item setspace 74 | \item hyphenat 75 | \item microtype 76 | \item needspace 77 | \item xspace 78 | \item xcolor (with options \Option{usenames,dvipsnames}) 79 | \end{itemize} 80 | 81 | Some of the above packages do not concern paragraph formatting, but we 82 | nevertheless grouped them with the others. By default, the main text is 83 | justified and formatted with singlespacing and frenchspacing; the margin 84 | text is the same, except that the font is a bit smaller. 85 | 86 | As a last warning, please be aware that the \Package{cleveref} package 87 | is not compatible with \Class{kaobook}. You should use the commands 88 | discussed in \refsec{hyprefs} instead. 89 | 90 | \section{Document Structure} 91 | 92 | We provide optional arguments to the \Command{title} and 93 | \Command{author} commands so that you can insert short, plain text 94 | versions of this fields, which can be used, typically in the half-title 95 | or somewhere else in the front matter, through the commands 96 | \Command{@plaintitle} and \Command{@plainauthor}, respectively. The PDF 97 | properties \Option{pdftitle} and \Option{pdfauthor} are automatically 98 | set by hyperref to the plain values if present, otherwise to the normal 99 | values.\sidenote[][*-1]{We think that this is an important point so 100 | we remark it here. If you compile the document with pdflatex, the PDF 101 | metadata will be altered so that they match the plain title and author 102 | you have specified; if you did not specify them, the metadata will be 103 | set to the normal title and author.} 104 | 105 | There are defined two page layouts, \Option{margin} and \Option{wide}, 106 | and two page styles, \Option{plain} and \Option{fancy}. The layout 107 | basically concern the width of the margins, while the style refers to 108 | headers and footer; these issues will be 109 | discussed in \frefch{layout}.\sidenote[][6mm]{For now, suffice it to say that pages with 110 | the \Option{margin} layout have wide margins, while with the 111 | \Option{wide} layout the margins are absent. In \Option{plain} pages the 112 | headers and footer are suppressed, while in \Option{fancy} pages there 113 | is a header.} 114 | 115 | The commands \Command{frontmatter}, \Command{mainmatter}, and 116 | \Command{backmatter} have been redefined in order to automatically 117 | change page layout and style for these sections of the book. The front 118 | matter uses the \Option{margin} layout and the \Option{plain} page 119 | style. In the mainmatter the margins are wide and the headings are 120 | fancy. In the appendix the style and the layout do not change; however 121 | we use \Command{bookmarksetup\{startatroot\}} so that the bookmarks of 122 | the chapters are on the root level (without this, they would be under 123 | the preceding part). In the backmatter the margins shrink again and we 124 | also reset the bookmarks root. 125 | -------------------------------------------------------------------------------- /kaobook_origin/examples/documentation/chapters/preface.tex: -------------------------------------------------------------------------------- 1 | \chapter*{Preface} 2 | \addcontentsline{toc}{chapter}{Preface} % Add the preface to the table of contents as a chapter 3 | 4 | I am of the opinion that every \LaTeX\xspace geek, at least once during 5 | his life, feels the need to create his or her own class: this is what 6 | happened to me and here is the result, which, however, should be seen as 7 | a work still in progress. Actually, this class is not completely 8 | original, but it is a blend of all the best ideas that I have found in a 9 | number of guides, tutorials, blogs and tex.stackexchange.com posts. In 10 | particular, the main ideas come from two sources: 11 | 12 | \begin{itemize} 13 | \item \href{https://3d.bk.tudelft.nl/ken/en/}{Ken Arroyo Ohori}'s 14 | \href{https://3d.bk.tudelft.nl/ken/en/nl/ken/en/2016/04/17/a-1.5-column-layout-in-latex.html}{Doctoral 15 | Thesis}, which served, with the author's permission, as a backbone 16 | for the implementation of this class; 17 | \item The 18 | \href{https://github.com/Tufte-LaTeX/tufte-latex}{Tufte-Latex 19 | Class}, which was a model for the style. 20 | \end{itemize} 21 | 22 | The first chapter of this book is introductory and covers the most 23 | essential features of the class. Next, there is a bunch of chapters 24 | devoted to all the commands and environments that you may use in writing 25 | a book; in particular, it will be explained how to add notes, figures 26 | and tables, and references. The second part deals with the page layout 27 | and design, as well as additional features like coloured boxes and 28 | theorem environments. 29 | 30 | I started writing this class as an experiment, and as such it should be 31 | regarded. Since it has always been intended for my personal use, it may 32 | not be perfect but I find it quite satisfactory for the use I want to 33 | make of it. I share this work in the hope that someone might find here 34 | the inspiration for writing his or her own class. 35 | 36 | \begin{flushright} 37 | \textit{Federico Marotta} 38 | \end{flushright} 39 | -------------------------------------------------------------------------------- /kaobook_origin/examples/documentation/chapters/textnotes.tex: -------------------------------------------------------------------------------- 1 | \setchapterpreamble[u]{\margintoc} 2 | \chapter{Margin Stuff} 3 | 4 | Sidenotes are a distinctive feature of all 1.5-column-layout books. 5 | Indeed, having wide margins means that some material can be displayed 6 | there. We use margins for all kind of stuff: sidenotes, marginnotes, 7 | small tables of contents, citations, and, why not?, special boxes and 8 | environments. 9 | 10 | \section{Sidenotes} 11 | 12 | Sidenotes are like footnotes, except that they go in the margin, where 13 | they are more readable. To insert a sidenote, just use the command 14 | \Command{sidenote\{Text of the note\}}. You can specify a 15 | mark\sidenote[O]{This sidenote has a special mark, a big O!} with \\ 16 | \Command{sidenote[mark]\{Text\}}, but you can also specify an offset, 17 | which moves the sidenote upwards or downwards, so that the full syntax is: 18 | 19 | \begin{lstlisting}[style=kaolstplain] 20 | \sidenote[mark][offset]{Text} 21 | \end{lstlisting} 22 | 23 | If you use an offset, you always have to add the brackets for the mark, 24 | but they can be empty.\sidenote{If you want to know more about the usage 25 | of the \Command{sidenote} command, read the documentation of the 26 | \Package{sidenotes} package.} 27 | 28 | In \Class{kaobook} we copied a feature from the \Package{snotez} 29 | package: the possibility to specify a multiple of \Command{baselineskip} 30 | as an offset. For example, if you want to enter a sidenote with the 31 | normal mark and move it upwards one line, type: 32 | 33 | \begin{lstlisting}[style=kaolstplain] 34 | \sidenote[][*-1]{Text of the sidenote.} 35 | \end{lstlisting} 36 | 37 | As we said, sidenotes are handled through the \Package{sidenotes} 38 | package, which in turn relies on the \Package{marginnote} package. 39 | 40 | \section{Marginnotes} 41 | 42 | This command is very similar to the previous one. You can create a 43 | marginnote with \Command{marginnote[offset]\{Text\}}, where the offset 44 | argument can be left out, or it can be a multiple of 45 | \Command{baselineskip},\marginnote[-1cm]{While the command for margin 46 | notes comes from the \Package{marginnote} package, it has been redefined 47 | in order to change the position of the optional offset argument, which 48 | now precedes the text of the note, whereas in the original version it 49 | was at the end. We have also added the possibility to use a multiple of 50 | \Command{baselineskip} as offset. These things were made only to make 51 | everything more consistent, so that you have to remember less things!} 52 | \eg 53 | 54 | \begin{lstlisting}[style=kaolstplain] 55 | \marginnote[-12pt]{Text} or \marginnote[*-3]{Text} 56 | \end{lstlisting} 57 | 58 | \begin{kaobox}[frametitle=To Do] 59 | A small thing that needs to be done is to renew the \Command{sidenote} 60 | command so that it takes only one optional argument, the offset. The 61 | special mark argument can go somewhere else. In other words, we want the 62 | syntax of \Command{sidenote} to resemble that of \Command{marginnote}. 63 | \end{kaobox} 64 | 65 | We load the packages \Package{marginnote}, \Package{marginfix} and 66 | \Package{placeins}. Since \Package{sidenotes} uses \Package{marginnote}, 67 | what we said for marginnotes is also valid for sidenotes. Side- and 68 | margin- notes are shifted slightly upwards 69 | (\Command{renewcommand\{\textbackslash marginnotevadjust\}\{3pt\}}) in 70 | order to align them to the bottom of the line of text where the note is 71 | issued. Importantly, both sidenotes and marginnotes are defined as 72 | floating if the optional argument (\ie the vertical offset) is left 73 | blank, but if the offset is specified they are not floating. Recall that 74 | floats cannot be nested, so in some rare cases you may encounter errors 75 | about lost floats; in those cases, remember that sidenotes and 76 | marginnotes are floats. To solve the problem, it may be possible to 77 | transform them into non-floating elements by specifying an offset of 78 | 0pt. 79 | 80 | \section{Footnotes} 81 | 82 | Even though they are not displayed in the margin, we will discuss about 83 | footnotes here, since sidenotes are mainly intended to be a replacement 84 | of them. Footnotes force the reader to constantly move from one area of 85 | the page to the other. Arguably, marginnotes solve this issue, so you 86 | should not use footnotes. Nevertheless, for completeness, we have left 87 | the standard command \Command{footnote}, just in case you want to put a 88 | footnote once in a while.\footnote{And this is how they look like. 89 | Notice that in the PDF file there is a back reference to the text; 90 | pretty cool, uh?} 91 | 92 | \section{Margintoc} 93 | 94 | Since we are talking about margins, we introduce here the 95 | \Command{margintoc} command, which allows one to put small table of 96 | contents in the margin. Like other commands we have discussed, 97 | \Command{margintoc} accepts a parameter for the vertical offset, like 98 | so: \Command{margintoc[offset]}. 99 | 100 | The command can be used in any point of the document, but we think it 101 | makes sense to use it just at the beginning of chapters or parts. In 102 | this document I make use of a \KOMAScript\xspace feature and put it in 103 | the chapter preamble, with the following code: 104 | 105 | \marginnote{The font used in the margintoc is the same as the one for 106 | the chapter entries in the main table of contents at the beginning 107 | of the document.} 108 | 109 | \begin{lstlisting}[style=kaolstplain] 110 | \setchapterpreamble[u]{\margintoc} 111 | \chapter{Chapter title} 112 | \end{lstlisting} 113 | 114 | As the space in the margin is a valuable resource, there is the 115 | possibility to print a shorter version of the title in the margin toc. 116 | Thus, there are in total three possible versions for the title of a 117 | section (or subsection): the one for the main text, the one for the main 118 | table of contents, and the one for the margintoc. These versions can be 119 | specified at the same time when the section is created in the source 120 | \TeX file: 121 | \begin{lstlisting}[style=kaolstplain] 122 | \section[alternative-title-for-toc]{title-as-written-in-text}[alternative-title-for-margintoc] 123 | \end{lstlisting} 124 | 125 | By default, the margintoc includes sections and subsections. 126 | If you only want to show sections, add 127 | \begin{lstlisting}[style=kaolstplain] 128 | \setcounter{margintocdepth}{\sectiontocdepth} 129 | \end{lstlisting} 130 | somewhere in your preamble. 131 | 132 | \section{Marginlisting} 133 | 134 | On some occasions it may happen that you have a very short piece of code 135 | that doesn't look good in the body of the text because it breaks the 136 | flow of narration: for that occasions, you can use a 137 | \Environment{marginlisting}. The support for this feature is still 138 | limited, especially for the captions, but you can try the following 139 | code: 140 | 141 | \begin{marginlisting}[-1.35cm] 142 | \caption{An example of a margin listing.} 143 | \vspace{0.6cm} 144 | \begin{lstlisting}[language=Python,style=kaolstplain] 145 | print("Hello World!") 146 | \end{lstlisting} 147 | \end{marginlisting} 148 | 149 | \begin{verbatim} 150 | \begin{marginlisting}[-0.5cm] 151 | \caption{My caption} 152 | \vspace{0.2cm} 153 | \begin{lstlisting}[language=Python,style=kaolstplain] 154 | ... code ... 155 | \end{lstlisting} 156 | \end{marginlisting} 157 | \end{verbatim} 158 | 159 | Unfortunately, the space between the caption and the listing must be 160 | adjusted manually; if you find a better way, please let me know. 161 | 162 | Not only textual stuff can be displayed in the margin, but also figures. 163 | Those will be the focus of the next chapter. 164 | -------------------------------------------------------------------------------- /kaobook_origin/examples/documentation/glossary.tex: -------------------------------------------------------------------------------- 1 | \newglossaryentry{computer}{ 2 | name=computer, 3 | description={is a programmable machine that receives input, stores and manipulates data, and provides output in a useful format} 4 | } 5 | 6 | % Glossary entries (used in text with e.g. \acrfull{fpsLabel} or \acrshort{fpsLabel}) 7 | \newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} 8 | \newacronym[longplural={Tables of Contents}]{tocLabel}{TOC}{Table of Contents} 9 | 10 | -------------------------------------------------------------------------------- /kaobook_origin/examples/documentation/images/monalisa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/documentation/images/monalisa.jpg -------------------------------------------------------------------------------- /kaobook_origin/examples/documentation/images/seaside.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/documentation/images/seaside.jpeg -------------------------------------------------------------------------------- /kaobook_origin/examples/documentation/main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/documentation/main.pdf -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/img/bid_expr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/img/bid_expr.png -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/img/bid_tba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/img/bid_tba.png -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/img/cv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/img/cv.png -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/img/cv_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/img/cv_example.png -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/img/expr_vs_tba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/img/expr_vs_tba.png -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/img/nested_cv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/img/nested_cv.png -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/img/qq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/img/qq.png -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/img/regreg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/img/regreg.png -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/img/response.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/img/response.png -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/img/rho2distr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/img/rho2distr.png -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/img/tba_tf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/img/tba_tf.png -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/img/tigar_article.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/img/tigar_article.png -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/machine_learning_project/main.pdf -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/main.tex: -------------------------------------------------------------------------------- 1 | \documentclass[ 2 | fontsize=10pt, % Base font size 3 | twoside=false, % Use different layouts for even and odd pages (in particular, if twoside=true, the margin column will be always on the outside) 4 | %open=any, % If twoside=true, uncomment this to force new chapters to start on any page, not only on right (odd) pages 5 | %chapterprefix=true, % Uncomment to use the word "Chapter" before chapter numbers everywhere they appear 6 | %chapterentrydots=true, % Uncomment to output dots from the chapter name to the page number in the table of contents 7 | numbers=noenddot, % Comment to output dots after chapter numbers; the most common values for this option are: enddot, noenddot and auto (see the KOMAScript documentation for an in-depth explanation) 8 | %draft=true, % If uncommented, rulers will be added in the header and footer 9 | %overfullrule=true, % If uncommented, overly long lines will be marked by a black box; useful for correcting spacing problems 10 | ]{kaohandt} 11 | 12 | % Choose the language 13 | \usepackage[english]{babel} % Load characters and hyphenation 14 | \usepackage[english=british]{csquotes} % English quotes 15 | 16 | % Load the bibliography package 17 | \usepackage{kaobiblio} 18 | \addbibresource{main.bib} % Bibliography file 19 | 20 | % Load mathematical packages for theorems and related environments 21 | \usepackage{kaotheorems} 22 | 23 | % Load the package for hyperreferences 24 | \usepackage{kaorefs} 25 | 26 | % Set the paths where to look for images 27 | \usepackage{subcaption} 28 | \graphicspath{{examples/report/img/}{img/}} 29 | 30 | \begin{document} 31 | 32 | \title{Operation T-REx} 33 | \author[FM]{Federico Marotta} 34 | \date{December 2019} 35 | \maketitle 36 | 37 | \input{sections/introduction.tex} 38 | \input{sections/data.tex} 39 | \input{sections/results.tex} 40 | \input{sections/discussion.tex} 41 | 42 | \defbibnote{bibnote}{Here are the references in citation order.\par\bigskip} % Prepend this text to the bibliography 43 | \renewcommand*{\bibfont}{\small} 44 | \printbibliography[title=Bibliography]% , prenote=bibnote] 45 | 46 | \end{document} 47 | -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/sections/data.tex: -------------------------------------------------------------------------------- 1 | \section{Data} 2 | \labsec{data} 3 | 4 | The Genotype-Tissue Expression (GTEx) project \sidecite{Lonsdale2013a} 5 | aims to characterise gene expression and regulation for 54 human healthy 6 | tissues across nearly 1000 people. While the results of the analyses are 7 | open-access, in order to gain access to the raw data about the DNA and 8 | the gene expression of the individuals, it is necessary to go through a 9 | long bureaucratic procedure. 10 | 11 | Another source of data was the Ensembl project (release 75), 12 | \sidecite[-1.55cm]{Zerbino2018} which was used to obtain the coordinates 13 | of the regulatory regions for each gene. Regulatory regions are 14 | particular positions around a gene where transcription factors can bind; 15 | from there, these transcription factors exert a control on gene 16 | expression.\sidenote{In this project, I considered 141 genes of a 17 | particular type of blood cells, for 95 individuals. Each gene is 18 | associated to about 10 regulatory regions on average.} Each 19 | transcription factor recognises a specific sequence of DNA, therefore it 20 | is possible to compute the affinity of a factor for a given region. The 21 | total binding affinity (TBA) \sidecite[-3.85cm]{Molineris2011a} is one 22 | of the possible affinity measures.\sidenote[][]{The TBA is also 23 | related to the name of this project, T-REx: indeed, the goal is to 24 | estimate the TBA-Regulated Expression.} 25 | 26 | Gene expression in GTEx was measured with a technique called 27 | RNA-sequencing, which returns, for each gene and each individual, the 28 | RPKM, \sidecite[-4.6cm]{Mortazavi2008} which is the number of sequencing 29 | reads normalised by the length of the gene and by the total number of 30 | reads. 31 | 32 | %\begin{figure}[H] 33 | \begin{figure}[H] 34 | \begin{subfigure}{\textwidth} 35 | \centering 36 | \caption{} 37 | % \caption{Histogram and normal Q\babelhyphen{nobreak}Q plot of the 38 | %expression of a randomly selected gene called BID. In the histogram, the 39 | %brown dashed line indicates the mean, while the dotted lines indicate 40 | %plus and minus one standard deviation. In the Q\babelhyphen{nobreak}Q 41 | %plot, each point represents an individual.} 42 | \labfig{distrexpr} 43 | \includegraphics[height=4.8cm,width=.8\textwidth,keepaspectratio=false]{bid_expr} 44 | \end{subfigure} 45 | %\end{figure} 46 | 47 | \begin{subfigure}{\textwidth} 48 | %\begin{figure}[t] 49 | \centering 50 | \caption{} 51 | % \caption{Scree plot and biplot of 52 | % the \textasciitilde800 affinities for the gene BID. In the biplot, each 53 | % label corresponds to an individual.} 54 | \labfig{pcatba} 55 | \includegraphics[height=4.8cm,width=.8\textwidth,keepaspectratio=false]{bid_tba} 56 | \end{subfigure} 57 | % \end{figure} 58 | \caption{(a): Histogram and normal Q\babelhyphen{nobreak}Q plot of the 59 | expression of a randomly selected gene called BID. In the histogram, the 60 | brown dashed line indicates the mean, while the dotted lines indicate 61 | plus and minus one standard deviation. In the Q\babelhyphen{nobreak}Q 62 | plot, each point represents an individual. (b): Scree plot and biplot of 63 | the \textasciitilde800 affinities for the gene BID. In the biplot, each 64 | label corresponds to an individual.} 65 | \labfig{expl} 66 | \end{figure} 67 | 68 | The expression was preprocessed as recommended by the Stephen's 69 | Lab.\sidenote[][*7]{\url{http://stephenslab.github.io/gtex-eqtls/analysis/20170515\_RNASeq\_Analysis.html}} 70 | In summary, I applied a quantile normalisation to make sure that the 71 | distribution of our response variable was normal, and then I obtained 72 | the residuals of a linear model 73 | $Y~\sim~SEX+PEER\_FA+POPULATION+PLATFORM$, so as to disregard the 74 | effects of these covariates on the expression. The final result can be 75 | seen in \reffig{distrexpr}. 76 | 77 | The genotypes were also obtained with a sequencing technique and were 78 | provided in VCF format. \sidecite[-3.2cm]{Danecek2011} I 79 | used a software called 80 | \nohyphens{VCF\textunderscore\nobreak\hspace{0pt}rider}\sidenote[][*3]{\url{https://github.com/vodkatad/vcf\_rider}} 81 | to compute the total binding affinity of each transcription factor for 82 | each regulatory region associated to a gene (the total number of 83 | transcription factors is about 800). \reffig{pcatba} reports the PCA of 84 | the TBA for the gene BID. 85 | -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/sections/discussion.tex: -------------------------------------------------------------------------------- 1 | \section{Discussion} 2 | \labsec{discussion} 3 | 4 | Instead of finding a better model, in this project I tried to find 5 | better predictors. Using the affinities instead of the genotypes has 6 | several advantages: 7 | 8 | \begin{itemize} 9 | \item The model is more interpretable; 10 | \item The number of predictors decreases; 11 | \item The predictive power is higher; 12 | \end{itemize} 13 | 14 | Upon doing some biochemical considerations, it is possible to find even 15 | better predictors, although they violate the constraint of using only 16 | the DNA sequence to predict gene expression. 17 | 18 | There are many ways to continue this work. One would be to construct an 19 | ensemble model that chooses, for each gene, the model that achieved the 20 | best prediction on a training set. 21 | 22 | Another possibility is that of exploiting further the interpretability 23 | of this model, and use the trees produced by BART to make inferences 24 | about the regulatory network among genes. 25 | 26 | Finally, one of the biggest limitations of these kind of models is that 27 | they consider each gene as independent of all the others. One possible 28 | way to use the information hidden among other genes is what I call the 29 | \enquote{bagging of the genes,} where the prediction for a new gene is 30 | given by the average of the prediction of a number of other models 31 | trained on different genes. 32 | 33 | If we were able to accurately predict gene expression, the benefit would 34 | be twofold: first, it would be possible to predict which individuals are 35 | at risk of developing a disease, and consequently to prevent it; 36 | secondly, the biological mechanisms through which the illnesses arise 37 | would be elucidated, potentially leading to the discovery of new 38 | therapeutic targets. In conclusion, I hope that this project will give a 39 | contribution, albeit very small, in understanding the relationships 40 | between genome, expression and diseases. 41 | -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/sections/introduction.tex: -------------------------------------------------------------------------------- 1 | \section{Introduction} 2 | \labsec{intro} 3 | 4 | Ever since the sequence of the human genome was made available some 20 5 | years ago, \sidecite[-1\baselineskip]{Lander2001a} one of the most 6 | compelling goals in both science and medicine has been that of finding 7 | the genetic variants associated to diseases. 8 | 9 | % The first attempts relied on statistical association tests, like the 10 | % $\chi^2$ test, to identify the genetic variants that are more likely to 11 | % occur in ill rather than healthy individuals. \sidecite{Visscher2012a} 12 | % Despite its successes, the power of this approach is hampered by the 13 | % fact that there are so many genetic variants (on average, the DNA 14 | % sequences of two non-related people differ of about one letter every one 15 | % thousand \sidecite{Durbin2010}), most of which, the so-called rare 16 | % variants, appear only in a tiny fraction of individuals. 17 | 18 | In 2015 it was proposed a new method, 19 | \sidecite[-1.1cm]{Gamazon2015a} dubbed Transcriptome-Wide 20 | Association Study (TWAS), which consists of using the genetic variants 21 | to predict gene expression, and then finding associations between the 22 | predicted expression and a disease. The first advantage is that it is 23 | possible to avoid a direct measurement of gene expression, which can be 24 | expensive or even impossible for certain tissues. But another, more 25 | subtle advantage is that predicted values are less noisy than the real 26 | ones, because they do not include the environmental component of 27 | expression (\refeq{expr}). In view of this method, predicting gene 28 | expression is a relevant problem. 29 | 30 | A gene is a region of DNA, and its expression can be defined as the 31 | amount of RNA molecules that originate from that region 32 | (\vreffig{response}). This amount is different in different individuals, 33 | and our goal is to predict these differences. 34 | 35 | \begin{marginfigure}[-3.8cm] 36 | \includegraphics{response} 37 | \caption{Each gene is \enquote{transcribed} into many RNA molecules, 38 | which then are \enquote{translated} into proteins.} 39 | \labfig{response} 40 | \end{marginfigure} 41 | 42 | As regards the DNA itself, in this context it can be regarded as a 43 | 3-billion letter long string, different for each individual. Most of the 44 | positions in the sequence are the same, but there are some specific 45 | positions, called polymorphic loci, which harbour different letters in 46 | different people (\reffig{predictorsA}). There are many kinds of 47 | differences, but, as similar works do, 48 | \sidecite[-8.6cm]{Nagpal2019} here we will focus only on 49 | single-letter differences such that in the population only two letters 50 | are present, \ie we will only consider those positions that can be in 51 | two states. 52 | 53 | \begin{marginfigure}[-1.5cm] 54 | \setlength{\tabcolsep}{2pt} 55 | \scalebox{0.7}{% 56 | \begin{subfigure}{\textwidth} 57 | \caption{} 58 | \labfig{predictorsA} 59 | \small 60 | \texttt{% 61 | \begin{tabular}{l c c c c c c c c c c c c c c c c c c} 62 | \textsf{Alice\hspace{.2cm}} & A & T & G & \cellcolor{yellow}G & T & G & \cellcolor{cyan}C & T & G & T & C & T & C & C & T & G & \cellcolor{red}T & C \\ 63 | \textsf{Bob\hspace{.2cm}} & A & T & G & \cellcolor{yellow}G & T & G & \cellcolor{cyan}C & T & G & T & C & T & C & C & T & G & \cellcolor{cyan}C & C \\ 64 | \textsf{Craig\hspace{.2cm}} & A & T & G & \cellcolor{green}A & T & G & \cellcolor{green}A & T & G & T & C & T & C & C & T & G & \cellcolor{cyan}C & C \\ 65 | \textsf{Dave\hspace{.2cm}} & A & T & G & \cellcolor{green}A & T & G & \cellcolor{cyan}C & T & G & T & C & T & C & C & T & G & \cellcolor{cyan}C & C \\ 66 | \textsf{Eve\hspace{.2cm}} & A & T & G & \cellcolor{yellow}G & T & G & \cellcolor{green}A & T & G & T & C & T & C & C & T & G & \cellcolor{red}T & C \\ 67 | \textsf{Frank\hspace{.2cm}} & A & T & G & \cellcolor{yellow}G & T & G & \cellcolor{green}A & T & G & T & C & T & C & C & T & G & \cellcolor{cyan}C & C \\ 68 | \end{tabular}} 69 | \end{subfigure} 70 | } 71 | 72 | \scalebox{0.7}{% 73 | \begin{subfigure}{\textwidth} 74 | \caption{} 75 | \labfig{predictorsB} 76 | \small 77 | \texttt{% 78 | \begin{tabular}{l c c c c c c c c c c c c c c c c c c} 79 | \textsf{Alice\hspace{.2cm}} & \phantom{A} & \phantom{A} & \phantom{A} & 0 & \phantom{A} & \phantom{A} & 0 & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & 1 & \phantom{A} \\ 80 | \textsf{Bob\hspace{.2cm}} & \phantom{A} & \phantom{A} & \phantom{A} & 0 & \phantom{A} & \phantom{A} & 0 & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & 0 & \phantom{A} \\ 81 | \textsf{Craig\hspace{.2cm}} & \phantom{A} & \phantom{A} & \phantom{A} & 1 & \phantom{A} & \phantom{A} & 1 & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & 0 & \phantom{A} \\ 82 | \textsf{Dave\hspace{.2cm}} & \phantom{A} & \phantom{A} & \phantom{A} & 1 & \phantom{A} & \phantom{A} & 0 & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & 0 & \phantom{A} \\ 83 | \textsf{Eve\hspace{.2cm}} & \phantom{A} & \phantom{A} & \phantom{A} & 0 & \phantom{A} & \phantom{A} & 1 & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & 1 & \phantom{A} \\ 84 | \textsf{Frank\hspace{.2cm}} & \phantom{A} & \phantom{A} & \phantom{A} & 0 & \phantom{A} & \phantom{A} & 1 & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & \phantom{A} & 0 & \phantom{A} \\ 85 | \end{tabular}} 86 | \end{subfigure} 87 | } 88 | \caption{(a) Examples of DNA sequences; polymorphic loci are highlighted 89 | with different colours. (b) Predictors matrix built from the sequences 90 | in (a).} 91 | \labfig{predictors} 92 | \end{marginfigure} 93 | 94 | DNA lends itself to a representation where the positions that are the 95 | same in all the individuals are ignored, and the two possible letters of 96 | these polymorphic loci are encoded as zeroes or ones 97 | (\reffig{predictorsB}). Indeed, all the published works on this topic 98 | use a matrix of this kind, constructed on a window of one million 99 | letters around each gene. Moreover, each gene is treated independently 100 | of all the others, and one model is run for each gene. The expression of 101 | gene $A$ in individual $i$ can be modeled as in \vrefeq{expr}, where 102 | $X_{ij}$ is the genotype (0 or 1) of individual $i$ at locus $j$, and 103 | $\beta_j$ is the increase in expression for individuals that have a 1 at 104 | locus $j$ with respect to the other individuals. Importantly, this is an 105 | additive model and no interactions are considered. 106 | 107 | %\marginnote[-1.3cm]{% 108 | \begin{equation} 109 | \labeq{expr} 110 | Y_i^{(A)} = \overbrace{\underbrace{\sum_{j=0}^p \beta_j^{(A)} X_{ij}^{(A)}}_{\text{Genetic effect ($\hat{Y}^{(A)}$)}} + \underbrace{\epsilon_i^{(A)}}_{\text{Environmental effect}}}^{\text{Theoretical real expression}} 111 | \end{equation} 112 | %} 113 | -------------------------------------------------------------------------------- /kaobook_origin/examples/machine_learning_project/sections/results.tex: -------------------------------------------------------------------------------- 1 | \section{Results} 2 | \labsec{results} 3 | 4 | \subsection{Nested Cross-Validation Package} 5 | 6 | All the similar published works use a 5-fold cross-validation to 7 | evaluate their models. However, since there are also some parameters to 8 | tune, they rely on a (computationally expensive) netsed cross-validation 9 | in order not to overestimate the predictive power. Since I needed to run 10 | several different models for each of the 140 genes, each with its own 11 | parameters, I decided to write an R 12 | package\sidenote[][-2.3cm]{\url{https://github.com/fmarotta/cvtools}} to 13 | perform the nested cross-validation with a heuristic algorithm that does 14 | not try all the possible values for the parameters, but rather, 15 | independently for each parameter, it starts at one value and explores 16 | the adjacent ones; then, it moves in the direction where the error 17 | decreases 18 | (\reffig{cv}). 19 | 20 | \begin{marginfigure}[-3.4cm] 21 | \centering 22 | \includegraphics{cv} 23 | \caption{First, the mtry is tuned while the nodesize is kept fixed; 24 | the algorithm started at the default value of 256, then it moved up in 25 | the range as long as the error decreased, and finally it came back to 26 | explore the values in between. Next, the nodesize was tuned in a similar 27 | fashion.} 28 | \labfig{cv} 29 | \end{marginfigure} 30 | 31 | This package requires the user to write a function which takes 32 | predefined arguments and returns a predefined output, but except for 33 | that, it can be used with any regression model. I evaluated the 34 | performances of ridge, BART, random forest, and PCR. 35 | \sidecite[-12.9cm]{James2013a,Hastie2009} 36 | 37 | \subsection{Model Performance} 38 | 39 | The measure of performance is not the MSE nor the $R^2$, but rather the 40 | square of the correlation between true and predicted expression 41 | ($\rho^2$); indeed, we do not want to penalise errors on single 42 | individuals, but we are interested in the general trend of expression. I 43 | decided to compare my results with those of TIGAR, \cite{Nagpal2019} 44 | which is currently most recent paper on this topic. 45 | 46 | \begin{table}[b] 47 | \caption{Mean $\rho^2$ across 141 genes. The t-test was always 48 | performed with respect to TIGAR.} 49 | \labtab{comp} 50 | \begin{tabular}{lcc} 51 | \textbf{Model} & \textbf{Mean} \boldmath$\rho^2$ & \textbf{t-test pval} \\ 52 | \midrule 53 | TIGAR & 0.067 & NA\\ 54 | Ridge & 0.076 & 0.025\\ 55 | BART & 0.074 & 0.121\\ 56 | Ranger & 0.069 & 0.398\\ 57 | PCR & 0.064 & 0.737\\ 58 | \end{tabular} 59 | \end{table} 60 | 61 | Even if it captures only the linear relationships, ridge gave the best 62 | predictive performance (\reffig{rho2distr}), probably because in this 63 | context where $p >> n$, it is a good compromise between bias, variance 64 | and overfitting. According to a t-test, the $\rho^2$ achieved by ridge 65 | with the TBA values are even higher than those obtained by TIGAR 66 | (\reftab{comp}). 67 | 68 | \begin{marginfigure}[-2cm] 69 | \includegraphics{rho2distr} 70 | \caption{Density plot of the $\rho^2$ achieved by T-REx (Ridge) and 71 | TIGAR. The dotted lines denotes the means of the 72 | distributions.} 73 | \labfig{rho2distr} 74 | \end{marginfigure} 75 | 76 | The performance of BART was not so different, despite the method being 77 | completely different. However, an important advantage of BART with 78 | respect to ridge is its ability to provide importance measures, allowing 79 | us to find which transcription factors are important for each gene. 80 | Additionally, BART captures the interactions between transcription 81 | factors. 82 | 83 | The other methods, random forest and principal component regression, 84 | were much less powerful. 85 | 86 | \subsection{Considering the Expression of the Transcription Factor} 87 | 88 | As high as its affinity for the DNA may be, if the transcription factor 89 | is present only in tiny amounts it will not bind many regulatory 90 | regions. For this reason, we tried to enhance our predictors with 91 | information from the expression of the transcription factors. 92 | 93 | \marginnote{% 94 | The Hill equation models the rate of expression of a gene: 95 | \begin{equation*} 96 | \theta = w \frac{L^n}{K^n + L^n} \approx w \left(\frac{L}{K}\right)^n. 97 | \end{equation*} 98 | Here, $L$ is the amount of transcription factor, $K$ is the dissociation 99 | constant (the inverse of the affinity), and $w$ is a constant. It is 100 | reasonable to suppose that if many transcription factors regulate a 101 | gene, the rate will be given by the following product, where we denoted 102 | $A = 1 / K$: 103 | \begin{equation*} 104 | \theta = w_1 \left( L_1 A_1 \right)^{n_1} \cdots w_p \left( L_p A_p \right)^{n_p}. 105 | \end{equation*} 106 | Now, if we compute the log of the rate, we get a linear combination 107 | which in principle is a deterministic function, but in practice we can 108 | use this linear combination as the right-hand side of a model formula 109 | and let ridge estimate the coefficients: 110 | \begin{align*} 111 | Y \sim \beta_0 &+ \beta_1 \left(\log L_1 + \log A_1\right) \\ 112 | &+ \cdots \\ 113 | &+ \beta_p \left(\log L_p + \log A_p\right). 114 | \end{align*} 115 | } 116 | 117 | In the dataset, we have expression values for some 40.000 genes; of 118 | these, about 800 are transcriptional factors. In practice we removed 119 | those rows from the dataset, and summed the TBA and the expression of 120 | corresponding transcription factors. The new predictors gave a 121 | considerable improvement in the performance, and, perhaps surprisingly, 122 | ridge outclassed BART. In the adjacent margin note I describe the 123 | working hypothesis more in detail. 124 | 125 | \begin{table}[H] 126 | \begin{tabular}{lr} 127 | \textbf{Model} & \textbf{Mean} \boldmath$\rho^2$ \\ 128 | \midrule 129 | Ridge & 0.393\\ 130 | BART & 0.268\\ 131 | \end{tabular} 132 | \end{table} 133 | 134 | -------------------------------------------------------------------------------- /kaobook_origin/examples/minimal_book/main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/minimal_book/main.pdf -------------------------------------------------------------------------------- /kaobook_origin/examples/minimal_book/main.tex: -------------------------------------------------------------------------------- 1 | % Load the kaobook class 2 | \documentclass[ 3 | fontsize=10pt, % Base font size 4 | twoside=false, % Use different layouts for even and odd pages (in particular, if twoside=true, the margin column will be always on the outside) 5 | %open=any, % If twoside=true, uncomment this to force new chapters to start on any page, not only on right (odd) pages 6 | secnumdepth=1, % How deep to number headings. Defaults to 1 (sections) 7 | ]{kaobook} 8 | 9 | % Choose the language 10 | \usepackage[english]{babel} % Load characters and hyphenation 11 | \usepackage[english=british]{csquotes} % English quotes 12 | 13 | % Load packages for testing 14 | \usepackage{blindtext} 15 | %\usepackage{showframe} % Uncomment to show boxes around the text area, margin, header and footer 16 | %\usepackage{showlabels} % Uncomment to output the content of \label commands to the document where they are used 17 | 18 | % Load the bibliography package 19 | \usepackage{kaobiblio} 20 | \addbibresource{minimal.bib} % Bibliography file 21 | 22 | % Load mathematical packages for theorems and related environments 23 | \usepackage{kaotheorems} 24 | 25 | % Load the package for hyperreferences 26 | \usepackage{kaorefs} 27 | 28 | \graphicspath{{images/}{./}} % Paths where images are looked for 29 | 30 | \makeindex[columns=3, title=Alphabetical Index, intoc] % Make LaTeX produce the files required to compile the index 31 | 32 | 33 | \begin{document} 34 | 35 | %---------------------------------------------------------------------------------------- 36 | % BOOK INFORMATION 37 | %---------------------------------------------------------------------------------------- 38 | 39 | \titlehead{Document Template} 40 | \title[Template for the {\normalfont\texttt{kaobook}} Class]{Template for the {\normalfont\texttt{kaobook}} Class} 41 | \author[JBG]{Johnny B. Goode} 42 | \date{\today} 43 | \publishers{An Awesome Publisher} 44 | 45 | %---------------------------------------------------------------------------------------- 46 | 47 | \frontmatter % Denotes the start of the pre-document content, uses roman numerals 48 | 49 | %---------------------------------------------------------------------------------------- 50 | % COPYRIGHT PAGE 51 | %---------------------------------------------------------------------------------------- 52 | 53 | \makeatletter 54 | \uppertitleback{\@titlehead} % Header 55 | 56 | \lowertitleback{ 57 | \textbf{Disclaimer} \\ 58 | You can edit this page to suit your needs. For instance, here we have a no copyright statement, a colophon and some other information. This page is based on the corresponding page of Ken Arroyo Ohori's thesis, with minimal changes. 59 | 60 | \medskip 61 | 62 | \textbf{No copyright} \\ 63 | \cczero\ This book is released into the public domain using the CC0 code. To the extent possible under law, I waive all copyright and related or neighbouring rights to this work. 64 | 65 | To view a copy of the CC0 code, visit: \\\url{http://creativecommons.org/publicdomain/zero/1.0/} 66 | 67 | \medskip 68 | 69 | \textbf{Colophon} \\ 70 | This document was typeset with the help of \href{https://sourceforge.net/projects/koma-script/}{\KOMAScript} and \href{https://www.latex-project.org/}{\LaTeX} using the \href{https://github.com/fmarotta/kaobook/}{kaobook} class. 71 | 72 | \medskip 73 | 74 | \textbf{Publisher} \\ 75 | First printed in May 2019 by \@publishers 76 | } 77 | \makeatother 78 | 79 | %---------------------------------------------------------------------------------------- 80 | % DEDICATION 81 | %---------------------------------------------------------------------------------------- 82 | 83 | \dedication{ 84 | The harmony of the world is made manifest in Form and Number, and the heart and soul and all the poetry of Natural Philosophy are embodied in the concept of mathematical beauty.\\ 85 | \flushright -- D'Arcy Wentworth Thompson 86 | } 87 | 88 | %---------------------------------------------------------------------------------------- 89 | % OUTPUT TITLE PAGE AND PREVIOUS 90 | %---------------------------------------------------------------------------------------- 91 | 92 | % Note that \maketitle outputs the pages before here 93 | \maketitle 94 | 95 | %---------------------------------------------------------------------------------------- 96 | % PREFACE 97 | %---------------------------------------------------------------------------------------- 98 | 99 | \chapter*{Preface} 100 | 101 | \blindtext 102 | 103 | %---------------------------------------------------------------------------------------- 104 | % TABLE OF CONTENTS & LIST OF FIGURES/TABLES 105 | %---------------------------------------------------------------------------------------- 106 | 107 | \begingroup % Local scope for the following commands 108 | 109 | % Define the style for the TOC, LOF, and LOT 110 | %\setstretch{1} % Uncomment to modify line spacing in the ToC 111 | %\hypersetup{linkcolor=blue} % Uncomment to set the colour of links in the ToC 112 | \setlength{\textheight}{230\vscale} % Manually adjust the height of the ToC pages 113 | 114 | % Turn on compatibility mode for the etoc package 115 | \etocstandarddisplaystyle % "toc display" as if etoc was not loaded 116 | \etocstandardlines % "toc lines as if etoc was not loaded 117 | 118 | \tableofcontents % Output the table of contents 119 | 120 | \listoffigures % Output the list of figures 121 | 122 | % Comment both of the following lines to have the LOF and the LOT on different pages 123 | \let\cleardoublepage\bigskip 124 | \let\clearpage\bigskip 125 | 126 | \listoftables % Output the list of tables 127 | 128 | \endgroup 129 | 130 | %---------------------------------------------------------------------------------------- 131 | % MAIN BODY 132 | %---------------------------------------------------------------------------------------- 133 | 134 | \mainmatter % Denotes the start of the main document content, resets page numbering and uses arabic numbers 135 | \setchapterstyle{kao} % Choose the default chapter heading style 136 | 137 | \chapter{First Chapter} 138 | 139 | \blindtext 140 | 141 | \pagelayout{wide} % No margins 142 | \addpart{Title of the Part} 143 | \pagelayout{margin} % Restore margins 144 | 145 | \chapter{Second Chapter} 146 | 147 | \blindtext 148 | 149 | \appendix % From here onwards, chapters are numbered with letters, as is the appendix convention 150 | 151 | \pagelayout{wide} % No margins 152 | \addpart{Appendix} 153 | \pagelayout{margin} % Restore margins 154 | 155 | \chapter{Some more blindtext} 156 | 157 | \blindtext 158 | 159 | %---------------------------------------------------------------------------------------- 160 | 161 | \backmatter % Denotes the end of the main document content 162 | \setchapterstyle{plain} % Output plain chapters from this point onwards 163 | 164 | %---------------------------------------------------------------------------------------- 165 | % BIBLIOGRAPHY 166 | %---------------------------------------------------------------------------------------- 167 | 168 | % The bibliography needs to be compiled with biber using your LaTeX editor, or on the command line with 'biber main' from the template directory 169 | 170 | \defbibnote{bibnote}{Here are the references in citation order.\par\bigskip} % Prepend this text to the bibliography 171 | \printbibliography[heading=bibintoc, title=Bibliography, prenote=bibnote] % Add the bibliography heading to the ToC, set the title of the bibliography and output the bibliography note 172 | 173 | %---------------------------------------------------------------------------------------- 174 | % INDEX 175 | %---------------------------------------------------------------------------------------- 176 | 177 | % The index needs to be compiled on the command line with 'makeindex main' from the template directory 178 | 179 | \printindex % Output the index 180 | 181 | \end{document} 182 | -------------------------------------------------------------------------------- /kaobook_origin/examples/minimal_report/main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/examples/minimal_report/main.pdf -------------------------------------------------------------------------------- /kaobook_origin/examples/minimal_report/main.tex: -------------------------------------------------------------------------------- 1 | % Load the kaohandt class (with the default options) 2 | \documentclass[ 3 | %fontsize=10pt, % Base font size 4 | %twoside=false, % If true, use different layouts for even and odd pages (in particular, if twoside=true, the margin column will be always on the outside) 5 | %secnumdepth=2, % How deep to number headings. Defaults to 2 (subsections) 6 | %abstract=true, % Uncomment to print the title of the abstract 7 | ]{kaohandt} 8 | 9 | % Choose the language 10 | \usepackage[english]{babel} % Load characters and hyphenation 11 | \usepackage[english=british]{csquotes} % English quotes 12 | 13 | % Load packages for testing 14 | \usepackage{blindtext} 15 | %\usepackage{showframe} % Uncomment to show boxes around the text area, margin, header and footer 16 | %\usepackage{showlabels} % Uncomment to output the content of \label commands to the document where they are used 17 | 18 | \graphicspath{{images/}{./}} % Paths where images are looked for 19 | 20 | % Load mathematical packages for theorems and related environments. 21 | \usepackage{kaotheorems} 22 | 23 | % Load the bibliography package 24 | \usepackage{kaobiblio} 25 | \addbibresource{report-template.bib} % Bibliography file 26 | 27 | % Load the package for hyperreferences 28 | \usepackage{kaorefs} 29 | 30 | %---------------------------------------------------------------------------------------- 31 | 32 | \begin{document} 33 | 34 | %---------------------------------------------------------------------------------------- 35 | % REPORT INFORMATION 36 | %---------------------------------------------------------------------------------------- 37 | 38 | \title[Template for a Kao Report (or Handout)]{Template for a Kao\\ Report (or Handout)} 39 | 40 | \author[MF, JMC]{Michael Faraday\thanks{Royal Society of London} \and John McClane \thanks{New York City Police Department}} 41 | 42 | \date{\today} 43 | 44 | %---------------------------------------------------------------------------------------- 45 | % TITLE AND ABSTRACT 46 | %---------------------------------------------------------------------------------------- 47 | 48 | \maketitle 49 | 50 | \margintoc 51 | 52 | \begin{abstract} 53 | \noindent 54 | \blindtext 55 | \end{abstract} 56 | 57 | {\noindent\textbf{Keywords:} \LaTeX, Kao, handout, article, report} 58 | 59 | \medskip 60 | 61 | %---------------------------------------------------------------------------------------- 62 | % MAIN BODY 63 | %---------------------------------------------------------------------------------------- 64 | 65 | \section{Introduction} 66 | 67 | Write here your introduction,\sidecite{James2013} and make sure to 68 | reference your sources. 69 | 70 | \blindtext\sidenote[][*-8]{\blindtext} 71 | 72 | \section{Methods} 73 | 74 | \blindtext 75 | 76 | \appendix % From here onwards, chapters are numbered with letters, as is the appendix convention 77 | 78 | \section{Appendix} 79 | 80 | \blindtext 81 | 82 | %---------------------------------------------------------------------------------------- 83 | % BIBLIOGRAPHY 84 | %---------------------------------------------------------------------------------------- 85 | 86 | % The bibliography needs to be compiled with biber using your LaTeX editor, or on the command line with 'biber main' from the template directory 87 | 88 | \printbibliography[title=Bibliography] % Set the title of the bibliography and print the references 89 | 90 | \end{document} 91 | -------------------------------------------------------------------------------- /kaobook_origin/instructions/README.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Some of the users of the template were so kind as to provide 4 | instructions to recreate a particular set up that they have been using 5 | to compile their books. In particular, Karl-Heinz Becker, author of 6 | "Dynamical Systems and Fractals," among other books and articles, wrote 7 | detailed instructions to configure a private ShareLaTeX server; and 8 | @pwgallagher opened an issue to tell us how to integrate the kaobook 9 | template with one's local TeX installation. There are also instructions 10 | for what I regards as a 'normal' LaTeX workflow, intended for beginners. 11 | Further instructions are welcome by anyone and will be added here. 12 | 13 | ## ShareLaTeX Server 14 | 15 | These instructions are useful if you don't want to use Overleaf, _e.g._ 16 | because of privacy concerns. Setting up your own ShareLaTeX server is a 17 | nice way to use the template from your browser. Moreover, you get 18 | autocompletion of the commands and automatic spell checking. 19 | 20 | **IMPORTANT:** if you use a ShareLaTeX server, your `main.tex` file must 21 | be at the root of the project, otherwise weird things will happen! 22 | 23 | ## Integration with the Local TeX Installation 24 | 25 | If you are used to TeXLive, then these instructions are for you. They 26 | tell you how to make sure that your local LaTeX installation will find 27 | the template's files, so that you do not need to have the `kaobook.cls` 28 | and `styles` files in the directory of your project. 29 | -------------------------------------------------------------------------------- /kaobook_origin/instructions/latexmk/latexmkrc: -------------------------------------------------------------------------------- 1 | # Output a pdf 2 | $pdf_mode = 1; 3 | $pdflatex = 'pdflatex --shell-escape %O %S'; 4 | 5 | # By default compile only the file called 'main.tex' 6 | @default_files = ('main.tex'); 7 | 8 | # Compile the glossary and acronyms list (package 'glossaries') 9 | add_cus_dep( 'acn', 'acr', 0, 'makeglossaries' ); 10 | add_cus_dep( 'glo', 'gls', 0, 'makeglossaries' ); 11 | $clean_ext .= " acr acn alg glo gls glg"; 12 | sub makeglossaries { 13 | my ($base_name, $path) = fileparse( $_[0] ); 14 | pushd $path; 15 | my $return = system "makeglossaries", $base_name; 16 | popd; 17 | return $return; 18 | } 19 | 20 | # Compile the nomenclature (package 'nomencl') 21 | add_cus_dep( 'nlo', 'nls', 0, 'makenlo2nls' ); 22 | sub makenlo2nls { 23 | system( "makeindex -s nomencl.ist -o \"$_[0].nls\" \"$_[0].nlo\"" ); 24 | } 25 | -------------------------------------------------------------------------------- /kaobook_origin/instructions/normal_usage/README.md: -------------------------------------------------------------------------------- 1 | # Normal Usage 2 | 3 | Here are more specific instructions intended for who has never used 4 | LaTeX before. Feel free to e-mail the author of this template to ask for 5 | clarifications. Also check out the instructions on how to set up your 6 | own ShareLaTeX server, if you want. 7 | 8 | ## Usage with Overleaf 9 | 10 | 1. Open the template from http://www.latextemplates.com/template/kaobook 11 | 12 | 1. Start writing your own content. 13 | 14 | 1. Fix the errors as they appear. 15 | 16 | 1. Go on writing and fixing errors until your book is done. 17 | 18 | 1. Uncork Champagne. 19 | 20 | ## Usage on your local machine 21 | 22 | 1. Download a TeX distribution for your computer (linux, windows or 23 | mac); see https://www.latex-project.org/get/. 24 | 25 | 1. Download the kaobook repository from github (or from overleaf). 26 | 27 | 1. Write your own content. You can either modify the existing files from 28 | the `examples` directory or start from scratch. 29 | 30 | 1. From the command line, run "pdflatex main.tex" to compile the pdf. 31 | Otherwise, install a LaTeX editor such as TeXStudio and follow the 32 | specific instructions to compile your document. 33 | 34 | 1. Fix the errors that will inevitably appear; a wise move is to search 35 | google for the error message you obtained. 36 | 37 | 1. Write more content, compile again, and solve the new errors. Do this 38 | until your book is done. 39 | 40 | 1. Uncork Champagne. 41 | -------------------------------------------------------------------------------- /kaobook_origin/instructions/sharelatex_server/1_DockerShareLatexInstallationSHORT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/instructions/sharelatex_server/1_DockerShareLatexInstallationSHORT.pdf -------------------------------------------------------------------------------- /kaobook_origin/instructions/sharelatex_server/3_DockerShareLatexInstallation.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/kaobook_origin/instructions/sharelatex_server/3_DockerShareLatexInstallation.docx -------------------------------------------------------------------------------- /kaobook_origin/instructions/texlive_integration/README.md: -------------------------------------------------------------------------------- 1 | # TeXLive Integration 2 | 3 | Normally, when you write a book with this template, you need that the 4 | `kaobook.cls` and the `styles` directory be in the same directory as the 5 | `main.tex`. After following these instructions, kindly provided by 6 | @pwgallagher, you can start writing your `main.tex` anywhere in your 7 | computer and still be able to use the kaobook class. 8 | 9 | LaTeX looks at certain directories to find all the packages it can use. 10 | Integrating the kaobook with the TeXLive installation amounts to 11 | copying all the `*.cls` and `*.sty` files in one of the places that are 12 | searched by LaTeX. 13 | 14 | 1. Find the appropriate directory by running `kpsewhich 15 | -var-value=TEXMFHOME`. For instance, suppose it is 16 | `/home/john/texmf/`. 17 | 18 | 1. Create the following hierarchy of directories under the texmf home: 19 | `tex/latex/kaobook/`. 20 | 21 | 1. Copy all the `\*.cls` files and the `styles` directory from the 22 | repository into the directory you just created. If you are in a 23 | hurry, you can copy the whole repository into that directory. 24 | Alternatively, you can `git clone` the `kaobook` repository into that folder 25 | and periodically `git pull` to update your `kaobook` installation. 26 | In the end, the folder `/home/john/texmf/tex/latex/kaobook` should contain the 27 | following files 28 | ``` 29 | kao.sty 30 | kaobiblio.sty 31 | kaobook.cls 32 | kaohandt.cls 33 | kaorefs.sty 34 | kaotheorems.sty 35 | ``` 36 | 37 | 1. Run `kpsewhich kaobook.cls` to make sure that LaTeX can find the 38 | template. 39 | -------------------------------------------------------------------------------- /kaobook_origin/kaohandt.cls: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % kaobook 3 | % LaTeX Class 4 | % Version 0.9.8 (2021/08/23) 5 | % 6 | % This template originates from: 7 | % https://www.LaTeXTemplates.com 8 | % 9 | % For the latest template development version and to make contributions: 10 | % https://github.com/fmarotta/kaobook 11 | % 12 | % Authors: 13 | % Federico Marotta (federicomarotta@mail.com) 14 | % Based on the doctoral thesis of Ken Arroyo Ohori (https://3d.bk.tudelft.nl/ken/en) 15 | % and on the Tufte-LaTeX class. 16 | % Modified for LaTeX Templates by Vel (vel@latextemplates.com) 17 | % 18 | % License: 19 | % LPPL (see included MANIFEST.md file) 20 | % 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | 23 | %---------------------------------------------------------------------------------------- 24 | % CLASS CONFIGURATION 25 | %---------------------------------------------------------------------------------------- 26 | 27 | \NeedsTeXFormat{LaTeX2e} 28 | \ProvidesClass{kaohandt}[2021/08/23 v0.9.8 kaohandt] 29 | \newcommand{\@baseclass}{scrartcl} % Base class name 30 | 31 | % Set the default options 32 | \PassOptionsToClass{a4paper}{\@baseclass} 33 | 34 | % Pass through any other options to the base class 35 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\@baseclass}} 36 | 37 | \ProcessOptions\relax % Process the options 38 | 39 | \LoadClass{\@baseclass} % Load the base class 40 | 41 | \RequirePackage{kao} % Load the code common to all classes 42 | 43 | %---------------------------------------------------------------------------------------- 44 | % TITLE-RELATED SETTINGS 45 | %---------------------------------------------------------------------------------------- 46 | 47 | % Left-align title, authors and date 48 | \xpatchcmd{\@maketitle}{\begin{center}}{\begin{flushleft}}{}{} 49 | \xpatchcmd{\@maketitle}{\end{center}}{\end{flushleft}}{}{} 50 | \xpatchcmd{\@maketitle}{\begin{tabular}[t]{c}}{\begin{tabular}[t]{@{}l@{}}}{}{} 51 | 52 | % Set the font for the title 53 | \addtokomafont{title}{\normalfont\bfseries} 54 | 55 | % Customise the abstract 56 | \RequirePackage[style]{abstract} 57 | 58 | \setlength{\absleftindent}{0pt}% No indentation in the abstract 59 | \if@abstrt 60 | \renewcommand{\abstitlestyle}[1]{% 61 | \vspace{-0.6cm}% 62 | \begin{center}% 63 | {\normalfont\bfseries\hspace{-3em} \abstractname\vspace{-.5em}\vspace{\z@}}% 64 | \end{center}% 65 | } 66 | \else 67 | \renewcommand{\abstitlestyle}[1]{\vspace{-.5em}\vspace{\z@}}% 68 | \fi 69 | 70 | % Set KOMA fonts 71 | \addtokomafont{section}{\normalfont\bfseries} 72 | \addtokomafont{subsection}{\normalfont\bfseries} 73 | \addtokomafont{subsubsection}{\normalfont\bfseries} 74 | \addtokomafont{paragraph}{\normalfont\bfseries} 75 | \setkomafont{descriptionlabel}{\normalfont\bfseries} 76 | 77 | %---------------------------------------------------------------------------------------- 78 | % TOC 79 | %---------------------------------------------------------------------------------------- 80 | 81 | % Adjust the positions of margintoc and marginnotes 82 | \setlength{\mtocshift}{-0.6cm} 83 | \renewcommand{\marginnotevadjust}{-4pt} 84 | 85 | % Do not add lists to the TOC 86 | \PassOptionsToClass{toc=nolistof}{\@baseclass} 87 | \unsettoc{toc}{totoc} 88 | 89 | %---------------------------------------------------------------------------------------- 90 | % NUMBERING 91 | %---------------------------------------------------------------------------------------- 92 | 93 | %\setcounter{secnumdepth}{\kao@secnumdepth} % Set section numbering depth 94 | 95 | \counterwithin*{sidenote}{section} % Uncomment to reset the sidenote counter at each section 96 | %\counterwithout{sidenote}{section} % Uncomment to have one sidenote counter for the whole document 97 | -------------------------------------------------------------------------------- /minimal_book_CJKsc/Cleaning.cmd: -------------------------------------------------------------------------------- 1 | @echo Cleaning... 2 | del *.aux 3 | del *.bbl 4 | del *.bcf 5 | del *.blg 6 | del *.glg 7 | del *.glo 8 | del *.gls 9 | del *.gz 10 | del *.idx 11 | del *.ilg 12 | del *.ind 13 | del *.loe 14 | del *.lof 15 | del *.log 16 | del *.lol 17 | del *.lot 18 | del *.mw 19 | del *.nlo 20 | del *.nls 21 | del *(busy) 22 | del *.toc 23 | del *.unq 24 | del *.xdy 25 | del *.xml 26 | @echo Finish... 27 | -------------------------------------------------------------------------------- /minimal_book_CJKsc/Compiling.cmd: -------------------------------------------------------------------------------- 1 | @echo Starting... 2 | xelatex --extra-mem-bot=10000000 main 3 | makeindex main.nlo -s nomencl.ist -o main.nls 4 | makeindex main 5 | biber main 6 | makeglossaries main 7 | xelatex --extra-mem-bot=10000000 main 8 | xelatex --extra-mem-bot=10000000 main 9 | xelatex --extra-mem-bot=10000000 main 10 | @echo Finish... 11 | -------------------------------------------------------------------------------- /minimal_book_CJKsc/main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/minimal_book_CJKsc/main.pdf -------------------------------------------------------------------------------- /minimal_book_CJKsc/main.tex: -------------------------------------------------------------------------------- 1 | % Load the kaobook class 2 | \documentclass[ 3 | chinese, 4 | fontsize=10pt, % Base font size 5 | twoside=true, % Use different layouts for even and odd pages (in particular, if twoside=true, the margin column will be always on the outside) 6 | open=any, % If twoside=true, uncomment this to force new chapters to start on any page, not only on right (odd) pages 7 | secnumdepth=1, % How deep to number headings. Defaults to 1 (sections) 8 | ]{styles/kaobookCJKsc} 9 | 10 | %---------------------------------------------------------------------------------------- 11 | % 包以及文档配置,新项目可以直接复制粘贴 12 | %---------------------------------------------------------------------------------------- 13 | 14 | % 加载排版包(不支持 chinese) 15 | \usepackage{polyglossia} 16 | \setmainlanguage{english} 17 | \SetLanguageKeys{english}{indentfirst=true} 18 | % 加载引号风格包(不支持 chinese) 19 | \usepackage[style=english]{csquotes} 20 | % 加载参考文献相关设置 21 | \usepackage[style=gb7714-2015ms,backref=false]{styles/kaobiblioCJKsc} % 默认使用 GB 标准 22 | \addbibresource{main.bib} % 参考文献文本 23 | % 加载数学相关设置 24 | \usepackage[framed]{styles/kaotheoremsCJKsc} 25 | % 加载超链接相关设置 26 | \usepackage{styles/kaorefsCJKsc} 27 | % 加载平台中文字体及相关设置 28 | \usepackage[testMathBox]{styles/kaoWinCJKsc} 29 | % 加载测试包 30 | \usepackage{blindtext} 31 | 32 | % 图片路径 33 | \graphicspath{{examples/documentation/images/}{images/}} 34 | % 生成用于编译 索引 的文件 35 | \makeindex[columns=3, title=索引, intoc] 36 | % 生成用于编译 术语 的文件 37 | \makenomenclature 38 | % 每章开头重新给 边注 编号 39 | \counterwithin*{sidenote}{chapter} 40 | % 允许标题中出现 \\ 而不发出警告 41 | \pdfstringdefDisableCommands{\let\\\empty} 42 | 43 | %---------------------------------------------------------------------------------------- 44 | \begin{document} 45 | 46 | %---------------------------------------------------------------------------------------- 47 | % 加载其他无法放在导言区的配置 48 | %---------------------------------------------------------------------------------------- 49 | \input{styles/config.tex} 50 | 51 | 52 | %---------------------------------------------------------------------------------------- 53 | % BOOK INFORMATION 54 | %---------------------------------------------------------------------------------------- 55 | 56 | \titlehead{一本小书} 57 | \title[用于制作书籍的 kaobookCJK 模板]{用于制作书籍的 kaobookCJK 模板} 58 | \author[MK]{薛浩} 59 | \date{\today} 60 | \publishers{绝绝子出版社} 61 | 62 | %---------------------------------------------------------------------------------------- 63 | 64 | \frontmatter % Denotes the start of the pre-document content, uses roman numerals 65 | 66 | %---------------------------------------------------------------------------------------- 67 | % COPYRIGHT PAGE 68 | %---------------------------------------------------------------------------------------- 69 | 70 | \makeatletter 71 | \uppertitleback{ 72 | \textbf{内容提要} 73 | 74 | \bigskip 75 | 76 | 介绍一份可以制作精美图书的 \LaTeX 模板 77 | } 78 | 79 | \lowertitleback{ 80 | \textbf{声明} \\ 81 | You can edit this page to suit your needs. For instance, here we have a no copyright statement, a colophon and some other information. This page is based on the corresponding page of Ken Arroyo Ohori's thesis, with minimal changes. 82 | 83 | \medskip 84 | 85 | \textbf{版权没有,翻版不究} \\ 86 | \cczero\ This book is released into the public domain using the CC0 code. To the extent possible under law, I waive all copyright and related or neighbouring rights to this work. 87 | 88 | To view a copy of the CC0 code, visit: \\\url{http://creativecommons.org/publicdomain/zero/1.0/} 89 | 90 | \medskip 91 | 92 | \textbf{版本} \\ 93 | This document was typeset with the help of \href{https://sourceforge.net/projects/koma-script/}{\KOMAScript} and \href{https://www.latex-project.org/}{\LaTeX} using the \href{https://github.com/fmarotta/kaobook/}{kaobook} class. 94 | 95 | \medskip 96 | 97 | \textbf{出版} \\ 98 | First printed in \today by \@publishers 99 | } 100 | \makeatother 101 | 102 | %---------------------------------------------------------------------------------------- 103 | % DEDICATION 104 | %---------------------------------------------------------------------------------------- 105 | 106 | \dedication{ 107 | 世界的和谐体现在形式和数量上,心灵和自然哲学的所有诗意都体现在数学美的概念中。\\ 108 | \flushright -- 达西·温特沃斯·汤普森 109 | } 110 | 111 | %---------------------------------------------------------------------------------------- 112 | % OUTPUT TITLE PAGE AND PREVIOUS 113 | %---------------------------------------------------------------------------------------- 114 | 115 | % Note that \maketitle outputs the pages before here 116 | \maketitle 117 | 118 | %---------------------------------------------------------------------------------------- 119 | % PREFACE 120 | %---------------------------------------------------------------------------------------- 121 | 122 | \chapter*{前言} 123 | 124 | \blindtext 125 | 126 | %---------------------------------------------------------------------------------------- 127 | % TABLE OF CONTENTS & LIST OF FIGURES/TABLES 128 | %---------------------------------------------------------------------------------------- 129 | 130 | \begingroup % Local scope for the following commands 131 | 132 | % Define the style for the TOC, LOF, and LOT 133 | %\setstretch{1} % Uncomment to modify line spacing in the ToC 134 | %\hypersetup{linkcolor=blue} % Uncomment to set the colour of links in the ToC 135 | \setlength{\textheight}{230\vscale} % Manually adjust the height of the ToC pages 136 | 137 | % Turn on compatibility mode for the etoc package 138 | \etocstandarddisplaystyle % "toc display" as if etoc was not loaded 139 | \etocstandardlines % "toc lines as if etoc was not loaded 140 | 141 | \tableofcontents % Output the table of contents 142 | 143 | \listoffigures % Output the list of figures 144 | 145 | % Comment both of the following lines to have the LOF and the LOT on different pages 146 | \let\cleardoublepage\bigskip 147 | \let\clearpage\bigskip 148 | 149 | \listoftables % Output the list of tables 150 | 151 | \endgroup 152 | 153 | %---------------------------------------------------------------------------------------- 154 | % MAIN BODY 155 | %---------------------------------------------------------------------------------------- 156 | 157 | \mainmatter % Denotes the start of the main document content, resets page numbering and uses arabic numbers 158 | \setchapterstyle{kaoCJK} % Choose the default chapter heading style 159 | 160 | \chapter{第一章} 161 | 162 | 嗨 kaobookCJK 在此。\sidecite{James2013} 163 | 164 | \blindtext 165 | 166 | \pagelayout{wide} % No margins 167 | \addpart{基础篇} 168 | \pagelayout{margin} % Restore margins 169 | 170 | \chapter{第二章} 171 | 172 | \blindtext 173 | 174 | \appendix % From here onwards, chapters are numbered with letters, as is the appendix convention 175 | 176 | \pagelayout{wide} % No margins 177 | \addpart{附录} 178 | \pagelayout{margin} % Restore margins 179 | 180 | \chapter{其他} 181 | 182 | \blindtext 183 | 184 | %---------------------------------------------------------------------------------------- 185 | 186 | \backmatter % Denotes the end of the main document content 187 | \setchapterstyle{plain} % Output plain chapters from this point onwards 188 | 189 | %---------------------------------------------------------------------------------------- 190 | % BIBLIOGRAPHY 191 | %---------------------------------------------------------------------------------------- 192 | 193 | % The bibliography needs to be compiled with biber using your LaTeX editor, or on the command line with 'biber main' from the template directory 194 | 195 | \defbibnote{bibnote}{\noindent 以下依次列出所有参考文献.\par\bigskip} % Prepend this text to the bibliography 196 | \printbibliography[heading=bibintoc, title=参考文献, prenote=bibnote] % Add the bibliography heading to the ToC, set the title of the bibliography and output the bibliography note 197 | 198 | %---------------------------------------------------------------------------------------- 199 | % INDEX 200 | %---------------------------------------------------------------------------------------- 201 | 202 | % The index needs to be compiled on the command line with 'makeindex main' from the template directory 203 | 204 | \printindex % Output the index 205 | 206 | \end{document} 207 | -------------------------------------------------------------------------------- /minimal_book_CJKsc/styles/config.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%无法放在导言区的设置%%%%%%%%%%%%%%%%%%%% 2 | %目录中文名 3 | \renewcommand{\contentsname}{目录} 4 | \renewcommand{\listfigurename}{插图} 5 | \renewcommand{\listtablename}{表格} 6 | \renewcommand{\lstlistlistingname}{清单} 7 | \renewcommand{\lstlistingname}{清单} 8 | \renewcommand{\indexname}{索引} 9 | \renewcommand{\bibname}{参考文献} 10 | %其他中文名 11 | \renewcommand{\pagename}{页} 12 | \renewcommand{\chaptername}{章} 13 | \renewcommand{\sectionname}{节} 14 | \renewcommand{\subsectionname}{小节} 15 | \renewcommand{\figurename}{图} 16 | \renewcommand{\tablename}{表} 17 | \renewcommand{\eqname}{公式} 18 | \renewcommand{\defname}{定义} 19 | \renewcommand{\assumname}{假设} 20 | \renewcommand{\thmname}{定理} 21 | \renewcommand{\propname}{命题} 22 | \renewcommand{\lemmaname}{引理} 23 | \renewcommand{\remarkname}{备注} 24 | \renewcommand{\examplename}{例} 25 | \renewcommand{\exercisename}{练习} 26 | %引用语序 27 | \renewcommand{\refpage}[1]{\hyperref[#1]{\textcolor{Blue}{第\xspace\pageref{page:#1}\xspace\pagename}}} % 第 84 页 28 | \renewcommand{\refch}[1]{\hyperref[ch:#1]{\textcolor{Blue}{第\xspace\ref{ch:#1}\xspace\chaptername}}} % 第 7 章 29 | \renewcommand{\nrefch}[1]{\hyperref[ch:#1]{\textcolor{Blue}{第\xspace\ref{ch:#1}\xspace\chaptername(\nameref{ch:#1})}}} % 第 7 章(数学) 30 | \renewcommand{\refsec}[1]{\hyperref[sec:#1]{\textcolor{Blue}{第\xspace\ref{sec:#1}\xspace\sectionname}}} 31 | \renewcommand{\nrefsec}[1]{\hyperref[sec:#1]{\textcolor{Blue}{第\xspace\ref{sec:#1}\xspace\sectionname(\nameref{sec:#1})}}} 32 | \renewcommand{\refsubsec}[1]{\hyperref[subsec:#1]{\textcolor{Blue}{第\xspace\ref{subsec:#1}\xspace\subsectionname}}} 33 | \renewcommand{\nrefsubsec}[1]{\hyperref[subsec:#1]{\textcolor{Blue}{第\xspace\ref{subsec:#1}\xspace\subsectionname(\nameref{subsec:#1})}}} 34 | %脚注编号 35 | % \renewcommand{\thefootnote}{\arabic{footnote}} % 1, 2, 3 36 | % \renewcommand{\thefootnote}{\alph{footnote}} % a, b, c 37 | % \renewcommand{\thefootnote}{\roman{footnote}} % i, ii, iii 38 | 39 | -------------------------------------------------------------------------------- /minimal_book_CJKsc/styles/kaoWinCJKsc.sty: -------------------------------------------------------------------------------- 1 | \ProvidesPackage{styles/kaoWinCJKsc} 2 | 3 | \RequirePackage{kvoptions} % Handle package options 4 | \SetupKeyvalOptions{ 5 | family = kaowincjksc, 6 | prefix = kaowincjksc@ 7 | } 8 | 9 | \DeclareBoolOption{testMathBox}% If true, put theorems into colorful boxes, otherwise write them like normal text 10 | 11 | \ProcessKeyvalOptions{kaowincjksc} 12 | 13 | %---------------------------------------------------------------------------------------- 14 | % 加载包用于字体设置与选择 15 | \RequirePackage{xeCJK} 16 | 17 | % 检查可用中文字体名:fc-list -f "%{family}\n" :lang=zh > zh-font.txt 18 | \setCJKmainfont[BoldFont=Noto Serif CJK SC Bold,AutoFakeSlant]{Noto Serif CJK SC} 19 | \setCJKsansfont[BoldFont=Noto Sans CJK SC Bold,AutoFakeSlant]{Noto Sans CJK SC} 20 | \setCJKmonofont[BoldFont=Noto Sans Mono CJK SC Bold,AutoFakeSlant]{Noto Sans Mono CJK SC} 21 | 22 | %---------------------------------------------------------------------------------------- 23 | % 加载包用于首行缩进 24 | \RequirePackage{indentfirst} 25 | \setlength{\parindent}{2em} % 首行缩进两个汉字或四个字母 26 | 27 | %---------------------------------------------------------------------------------------- 28 | % 文本颜色 29 | \RequirePackage{xcolor} 30 | % 中文数字日期格式 31 | \RequirePackage{zhnumber} 32 | 33 | %---------------------------------------------------------------------------------------- 34 | % Win10 平台中文字体集合 35 | \setCJKfamilyfont{nosat}{Noto Sans CJK SC Thin} 36 | \newcommand{\nosat}{\CJKfamily{nosat}} 37 | \setCJKfamilyfont{dx}{DengXian} %等线 dx 38 | \newcommand{\dx}{\CJKfamily{dx}} 39 | \setCJKfamilyfont{song}{SimSun} %宋体 song 40 | \newcommand{\song}{\CJKfamily{song}} 41 | \setCJKfamilyfont{xs}{NSimSun} %新宋体 xs 42 | \newcommand{\xs}{\CJKfamily{xs}} 43 | \setCJKfamilyfont{fs}{FangSong} %仿宋 fs 44 | \newcommand{\fs}{\CJKfamily{fs}} 45 | \setCJKfamilyfont{yh}{Microsoft YaHei} %微软雅黑 yh 46 | \newcommand{\yh}{\CJKfamily{yh}} 47 | \setCJKfamilyfont{hei}{SimHei} %黑体 hei 48 | \newcommand{\hei}{\CJKfamily{hei}} 49 | \setCJKfamilyfont{kai}{KaiTi} %楷体 kai 50 | \newcommand{\kai}{\CJKfamily{kai}} 51 | \setCJKfamilyfont{li}{LiSu} %隶书 li 52 | \newcommand{\li}{\CJKfamily{li}} 53 | \setCJKfamilyfont{yy}{YouYuan} %幼圆 yy 54 | \newcommand{\yy}{\CJKfamily{yy}} 55 | \setCJKfamilyfont{hwsong}{STSong} %华文宋体 hwsong 56 | \newcommand{\hwsong}{\CJKfamily{hwsong}} 57 | \setCJKfamilyfont{hwzs}{STZhongsong} %华文中宋 hwzs 58 | \newcommand{\hwzs}{\CJKfamily{hwzs}} 59 | \setCJKfamilyfont{hwfs}{STFangsong} %华文仿宋 hwfs 60 | \newcommand{\hwfs}{\CJKfamily{hwfs}} 61 | \setCJKfamilyfont{hwxh}{STXihei} %华文细黑 hwxh 62 | \newcommand{\hwxh}{\CJKfamily{hwxh}} 63 | \setCJKfamilyfont{hwl}{STLiti} %华文隶书 hwl 64 | \newcommand{\hwl}{\CJKfamily{hwl}} 65 | \setCJKfamilyfont{hwxw}{STXinwei} %华文新魏 hwxw 66 | \newcommand{\hwxw}{\CJKfamily{hwxw}} 67 | \setCJKfamilyfont{hwk}{STKaiti} %华文楷体 hwk 68 | \newcommand{\hwk}{\CJKfamily{hwk}} 69 | \setCJKfamilyfont{hwxk}{STXingkai} %华文行楷 hwxk 70 | \newcommand{\hwxk}{\CJKfamily{hwxk}} 71 | \setCJKfamilyfont{hwcy}{STCaiyun} %华文彩云 hwcy 72 | \newcommand{\hwcy}{\CJKfamily{hwcy}} 73 | \setCJKfamilyfont{hwhp}{STHupo} %华文琥珀 hwhp 74 | \newcommand{\hwhp}{\CJKfamily{hwhp}} 75 | \setCJKfamilyfont{fzs}{FZShuTi} %方正舒体 fzs 76 | \newcommand{\fzs}{\CJKfamily{fzs}} 77 | \setCJKfamilyfont{fzy}{FZYaoTi} %方正姚体 fzy 78 | \newcommand{\fzy}{\CJKfamily{fzy}} 79 | 80 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 彩色盒子 81 | \ifkaowincjksc@testMathBox 82 | \RequirePackage{tikz} % Required by mdframed 83 | \RequirePackage[framemethod=TikZ]{mdframed} % Required for colorful boxes 84 | 85 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 86 | %Theorem 87 | % define a counter for continuous numbering of the environment 88 | % by chapter or by section 89 | \newcounter{theo}[section] \setcounter{theo}{0} 90 | %\renewcommand{\thetheo}{\arabic{chapter}.\arabic{theo}} %显示章节名 91 | \renewcommand{\thetheo}{\arabic{theo}} %不显示章节名 92 | \newenvironment{theo}[2][]{% 93 | \refstepcounter{theo}% 94 | \ifstrempty{#1}% 95 | {\mdfsetup{% 96 | frametitle={% 97 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 98 | \node[anchor=east,rectangle,fill=blue!20] 99 | {\strut Theorem~\thetheo};}} 100 | }% 101 | {\mdfsetup{% 102 | frametitle={% 103 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 104 | \node[anchor=east,rectangle,fill=blue!20] 105 | {\strut Theorem~\thetheo:~#1};}}% 106 | }% 107 | \mdfsetup{innertopmargin=10pt,linecolor=blue!20,% 108 | linewidth=2pt,topline=true,% 109 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 110 | } 111 | \begin{mdframed}[]\relax% 112 | \label{#2}}{\end{mdframed}} 113 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 114 | %Lemma 115 | \newcounter{lem}[section] \setcounter{lem}{0} 116 | \renewcommand{\thelem}{\arabic{lem}} 117 | \newenvironment{lem}[2][]{% 118 | \refstepcounter{lem}% 119 | \ifstrempty{#1}% 120 | {\mdfsetup{% 121 | frametitle={% 122 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 123 | \node[anchor=east,rectangle,fill=green!20] 124 | {\strut Lemma~\thelem};}} 125 | }% 126 | {\mdfsetup{% 127 | frametitle={% 128 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 129 | \node[anchor=east,rectangle,fill=green!20] 130 | {\strut Lemma~\thelem:~#1};}}% 131 | }% 132 | \mdfsetup{innertopmargin=10pt,linecolor=green!20,% 133 | linewidth=2pt,topline=true,% 134 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 135 | } 136 | \begin{mdframed}[]\relax% 137 | \label{#2}} 138 | {\end{mdframed}} 139 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 140 | %Proof 141 | % [begin]define a new environment for proof 142 | \newenvironment{prf}[2][]{% 143 | % box style 144 | \ifstrempty{#1} 145 | % if condition (without title) 146 | { 147 | \mdfsetup{% 148 | frametitle={% 149 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 150 | \node[anchor=east,rectangle,fill=red!20] 151 | {\strut Proof~};}} 152 | }% else condition (with title) 153 | { 154 | \mdfsetup{% 155 | frametitle={% 156 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 157 | \node[anchor=east,rectangle,fill=red!20] 158 | {\strut Proof~:~#1};}}% 159 | }% 160 | % Both conditions 161 | \mdfsetup{ 162 | innertopmargin=10pt,linecolor=red!20,% 163 | linewidth=2pt,topline=true,% 164 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 165 | } 166 | 167 | % [begin]define a new environment for proof 168 | \begin{mdframed}[]\relax% 169 | \label{#2} 170 | } 171 | {\qed\end{mdframed}} 172 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 173 | %soln 174 | % [begin]define a new environment for proof 175 | \newenvironment{soln}[2][]{% 176 | % box style 177 | \ifstrempty{#1} 178 | % if condition (without title) 179 | { 180 | \mdfsetup{% 181 | frametitle={% 182 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 183 | \node[anchor=east,rectangle,fill=red!20] 184 | {\strut Solution~};}} 185 | }% else condition (with title) 186 | { 187 | \mdfsetup{% 188 | frametitle={% 189 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 190 | \node[anchor=east,rectangle,fill=red!20] 191 | {\strut Solution~:~#1};}}% 192 | }% 193 | % Both conditions 194 | \mdfsetup{ 195 | innertopmargin=10pt,linecolor=red!20,% 196 | linewidth=2pt,topline=true,% 197 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 198 | } 199 | 200 | % [begin]define a new environment for proof 201 | \begin{mdframed}[]\relax% 202 | \label{#2} 203 | } 204 | {\qed\end{mdframed}} 205 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 206 | \fi 207 | 208 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 高等数学风格 209 | \usepackage{amsthm} 210 | \usepackage{thmtools} 211 | \usepackage[unq]{unique} 212 | 213 | \declaretheoremstyle[% 214 | headindent=\parindent, 215 | headfont=\normalfont\bfseries,% 216 | notefont=\normalfont\bfseries, notebraces={(}{)}, 217 | bodyfont=\normalfont, 218 | postheadspace=1em,% 219 | %qed=\qedsymbol,%空心 220 | qed=$\blacksquare$,%实心 221 | headpunct={} 222 | ]{mathstyle} 223 | 224 | \theoremstyle{mathstyle} 225 | % 使用 amsthm 定义 226 | \newtheorem*{Definition*}{定义} 227 | \newtheorem{Definition}{定义}[section] 228 | \renewcommand{\theDefinition}{\arabic{Definition}} 229 | 230 | \newtheorem*{Theorem*}{定理} 231 | \newtheorem{Theorem}{定理}[section] 232 | \renewcommand{\theTheorem}{\arabic{Theorem}} 233 | 234 | \newtheorem{Corollary}{推论} 235 | \renewcommand{\theCorollary}{\arabic{Corollary}} 236 | 237 | \newtheorem*{Lemma*}{引理} 238 | \newtheorem{Lemma}{引理}[section] 239 | \renewcommand{\theLemma}{\arabic{Lemma}} 240 | 241 | \newtheorem*{Proposition*}{命题} 242 | \newtheorem{Proposition}{命题}[section] 243 | \renewcommand{\theProposition}{\arabic{Proposition}} 244 | 245 | \newtheorem*{Proof*}{证} 246 | \newtheorem{Proof}{证}[section] 247 | \renewcommand{\theProof}{\arabic{Proof}} 248 | 249 | \newtheorem*{Example*}{例} 250 | \newtheorem{Example}{例}[section] 251 | \renewcommand{\theExample}{\arabic{Example}} 252 | 253 | \newtheorem*{Solution*}{解} 254 | \newtheorem{Solution}{解}[section] 255 | \renewcommand{\theSolution}{\arabic{Solution}} 256 | -------------------------------------------------------------------------------- /minimal_book_CJKsc/styles/kaohandtCJKsc.cls: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % kaobook 3 | % LaTeX Class 4 | % Version 0.9.8 (2021/08/23) 5 | % 6 | % This template originates from: 7 | % https://www.LaTeXTemplates.com 8 | % 9 | % For the latest template development version and to make contributions: 10 | % https://github.com/fmarotta/kaobook 11 | % 12 | % Authors: 13 | % Federico Marotta (federicomarotta@mail.com) 14 | % Based on the doctoral thesis of Ken Arroyo Ohori (https://3d.bk.tudelft.nl/ken/en) 15 | % and on the Tufte-LaTeX class. 16 | % Modified for LaTeX Templates by Vel (vel@latextemplates.com) 17 | % 18 | % License: 19 | % LPPL (see included MANIFEST.md file) 20 | % 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | 23 | %---------------------------------------------------------------------------------------- 24 | % CLASS CONFIGURATION 25 | %---------------------------------------------------------------------------------------- 26 | 27 | \NeedsTeXFormat{LaTeX2e} 28 | \ProvidesClass{styles/kaohandtCJKsc}[2021/08/23 v0.9.8 kaohandt] 29 | \newcommand{\@baseclass}{scrartcl} % Base class name 30 | 31 | % Set the default options 32 | \PassOptionsToClass{a4paper}{\@baseclass} 33 | 34 | % Pass through any other options to the base class 35 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\@baseclass}} 36 | 37 | \ProcessOptions\relax % Process the options 38 | 39 | \LoadClass{\@baseclass} % Load the base class 40 | 41 | \RequirePackage{styles/kaoCJKsc} % Load the code common to all classes 42 | 43 | %---------------------------------------------------------------------------------------- 44 | % TITLE-RELATED SETTINGS 45 | %---------------------------------------------------------------------------------------- 46 | 47 | % Left-align title, authors and date 48 | \xpatchcmd{\@maketitle}{\begin{center}}{\begin{flushleft}}{}{} 49 | \xpatchcmd{\@maketitle}{\end{center}}{\end{flushleft}}{}{} 50 | \xpatchcmd{\@maketitle}{\begin{tabular}[t]{c}}{\begin{tabular}[t]{@{}l@{}}}{}{} 51 | 52 | % Set the font for the title 53 | \addtokomafont{title}{\normalfont\bfseries} 54 | 55 | % Customise the abstract 56 | \RequirePackage[style]{abstract} 57 | 58 | \setlength{\absleftindent}{0pt}% No indentation in the abstract 59 | \if@abstrt 60 | \renewcommand{\abstitlestyle}[1]{% 61 | \vspace{-0.6cm}% 62 | \begin{center}% 63 | {\normalfont\bfseries\hspace{-3em} \abstractname\vspace{-.5em}\vspace{\z@}}% 64 | \end{center}% 65 | } 66 | \else 67 | \renewcommand{\abstitlestyle}[1]{\vspace{-.5em}\vspace{\z@}}% 68 | \fi 69 | 70 | % Set KOMA fonts 71 | \addtokomafont{section}{\normalfont\bfseries} 72 | \addtokomafont{subsection}{\normalfont\bfseries} 73 | \addtokomafont{subsubsection}{\normalfont\bfseries} 74 | \addtokomafont{paragraph}{\normalfont\bfseries} 75 | \setkomafont{descriptionlabel}{\normalfont\bfseries} 76 | 77 | %---------------------------------------------------------------------------------------- 78 | % TOC 79 | %---------------------------------------------------------------------------------------- 80 | 81 | % Adjust the positions of margintoc and marginnotes 82 | \setlength{\mtocshift}{-0.6cm} 83 | \renewcommand{\marginnotevadjust}{-4pt} 84 | 85 | % Do not add lists to the TOC 86 | \PassOptionsToClass{toc=nolistof}{\@baseclass} 87 | \unsettoc{toc}{totoc} 88 | 89 | %---------------------------------------------------------------------------------------- 90 | % NUMBERING 91 | %---------------------------------------------------------------------------------------- 92 | 93 | %\setcounter{secnumdepth}{\kao@secnumdepth} % Set section numbering depth 94 | 95 | \counterwithin*{sidenote}{section} % Uncomment to reset the sidenote counter at each section 96 | %\counterwithout{sidenote}{section} % Uncomment to have one sidenote counter for the whole document 97 | -------------------------------------------------------------------------------- /minimal_report_CJKsc/Cleaning.cmd: -------------------------------------------------------------------------------- 1 | @echo Cleaning... 2 | del *.aux 3 | del *.bbl 4 | del *.bcf 5 | del *.blg 6 | del *.glg 7 | del *.glo 8 | del *.gls 9 | del *.gz 10 | del *.idx 11 | del *.ilg 12 | del *.ind 13 | del *.loe 14 | del *.lof 15 | del *.log 16 | del *.lol 17 | del *.lot 18 | del *.mw 19 | del *.nlo 20 | del *.nls 21 | del *(busy) 22 | del *.toc 23 | del *.unq 24 | del *.xdy 25 | del *.xml 26 | @echo Finish... 27 | -------------------------------------------------------------------------------- /minimal_report_CJKsc/Compiling.cmd: -------------------------------------------------------------------------------- 1 | @echo Starting... 2 | xelatex --extra-mem-bot=10000000 main 3 | makeindex main.nlo -s nomencl.ist -o main.nls 4 | makeindex main 5 | biber main 6 | makeglossaries main 7 | xelatex --extra-mem-bot=10000000 main 8 | xelatex --extra-mem-bot=10000000 main 9 | xelatex --extra-mem-bot=10000000 main 10 | @echo Finish... 11 | -------------------------------------------------------------------------------- /minimal_report_CJKsc/main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuehao/kaobookCJKsc/907aefa450fe2e2ab12ae1d4899418a3753d1585/minimal_report_CJKsc/main.pdf -------------------------------------------------------------------------------- /minimal_report_CJKsc/main.tex: -------------------------------------------------------------------------------- 1 | % Load the kaohandt class (with the default options) 2 | \documentclass[ 3 | %fontsize=10pt, % Base font size 4 | %twoside=false, % If true, use different layouts for even and odd pages (in particular, if twoside=true, the margin column will be always on the outside) 5 | %secnumdepth=2, % How deep to number headings. Defaults to 2 (subsections) 6 | %abstract=true, % Uncomment to print the title of the abstract 7 | ]{styles/kaohandtCJKsc} 8 | 9 | 10 | %---------------------------------------------------------------------------------------- 11 | % 包以及文档配置,新项目可以直接复制粘贴 12 | %---------------------------------------------------------------------------------------- 13 | 14 | % 加载排版包(不支持 chinese) 15 | \usepackage{polyglossia} 16 | \setmainlanguage{english} 17 | \SetLanguageKeys{english}{indentfirst=true} 18 | % 加载引号风格包(不支持 chinese) 19 | \usepackage[style=english]{csquotes} 20 | % 加载参考文献相关设置 21 | \usepackage[style=gb7714-2015ms,backref=false]{styles/kaobiblioCJKsc} % 默认使用 GB 标准 22 | \addbibresource{main.bib} % 参考文献文本 23 | % 加载数学相关设置 24 | \usepackage[framed]{styles/kaotheoremsCJKsc} 25 | % 加载超链接相关设置 26 | \usepackage{styles/kaorefsCJKsc} 27 | % 加载平台中文字体及相关设置 28 | \usepackage[testMathBox]{styles/kaoWinCJKsc} 29 | % 加载测试包 30 | \usepackage{blindtext} 31 | 32 | % 图片路径 33 | \graphicspath{{examples/documentation/images/}{images/}} 34 | % 生成用于编译 索引 的文件 35 | \makeindex[columns=3, title=索引, intoc] 36 | % 生成用于编译 术语 的文件 37 | \makenomenclature 38 | % 允许标题中出现 \\ 而不发出警告 39 | \pdfstringdefDisableCommands{\let\\\empty} 40 | 41 | %---------------------------------------------------------------------------------------- 42 | \begin{document} 43 | 44 | %---------------------------------------------------------------------------------------- 45 | % 加载其他无法放在导言区的配置 46 | %---------------------------------------------------------------------------------------- 47 | \input{styles/config.tex} 48 | 49 | %---------------------------------------------------------------------------------------- 50 | % REPORT INFORMATION 51 | %---------------------------------------------------------------------------------------- 52 | 53 | \title[用于报告(或手册)的 KaoCJK 模板]{用于报告(或手册)的 KaoCJK 模板} 54 | 55 | \author[MX, MF, JMC]{薛浩\thanks{Michael Faraday who created Kao} \and Michael Faraday\thanks{Royal Society of London} \and John McClane \thanks{New York City Police Department}} 56 | 57 | \date{\zhtoday} 58 | 59 | %---------------------------------------------------------------------------------------- 60 | % TITLE AND ABSTRACT 61 | %---------------------------------------------------------------------------------------- 62 | 63 | \maketitle 64 | 65 | \margintoc 66 | 67 | \begin{abstract} 68 | \noindent 69 | 摘要部分,以下是测试文字。\blindtext 70 | \end{abstract} 71 | 72 | {\noindent\textbf{关键字:} \LaTeX,KaoCJKsc,手册,文章,报告} 73 | 74 | \medskip 75 | 76 | %---------------------------------------------------------------------------------------- 77 | % MAIN BODY 78 | %---------------------------------------------------------------------------------------- 79 | 80 | \section{介绍} 81 | 82 | 此处写下你的介绍性文字,\sidecite{James2013} 并确保引用你的源文件。 83 | 84 | \blindtext\sidenote{这里是带编号边注} 85 | 86 | \section{方法} 87 | 88 | \appendix % From here onwards, chapters are numbered with letters, as is the appendix convention 89 | 90 | \section{附录} 91 | 92 | \blindtext 93 | 94 | %---------------------------------------------------------------------------------------- 95 | % BIBLIOGRAPHY 96 | %---------------------------------------------------------------------------------------- 97 | 98 | % The bibliography needs to be compiled with biber using your LaTeX editor, or on the command line with 'biber main' from the template directory 99 | 100 | \printbibliography[title=参考文献] % Set the title of the bibliography and print the references 101 | 102 | \end{document} 103 | -------------------------------------------------------------------------------- /minimal_report_CJKsc/styles/config.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%无法放在导言区的设置%%%%%%%%%%%%%%%%%%%% 2 | %目录中文名 3 | \renewcommand{\contentsname}{目录} 4 | \renewcommand{\listfigurename}{插图} 5 | \renewcommand{\listtablename}{表格} 6 | \renewcommand{\lstlistlistingname}{清单} 7 | \renewcommand{\lstlistingname}{清单} 8 | \renewcommand{\indexname}{索引} 9 | \renewcommand{\bibname}{参考文献} 10 | %其他中文名 11 | \renewcommand{\pagename}{页} 12 | \renewcommand{\chaptername}{章} 13 | \renewcommand{\sectionname}{节} 14 | \renewcommand{\subsectionname}{小节} 15 | \renewcommand{\figurename}{图} 16 | \renewcommand{\tablename}{表} 17 | \renewcommand{\eqname}{公式} 18 | \renewcommand{\defname}{定义} 19 | \renewcommand{\assumname}{假设} 20 | \renewcommand{\thmname}{定理} 21 | \renewcommand{\propname}{命题} 22 | \renewcommand{\lemmaname}{引理} 23 | \renewcommand{\remarkname}{备注} 24 | \renewcommand{\examplename}{例} 25 | \renewcommand{\exercisename}{练习} 26 | %引用语序 27 | \renewcommand{\refpage}[1]{\hyperref[#1]{\textcolor{Blue}{第\xspace\pageref{page:#1}\xspace\pagename}}} % 第 84 页 28 | \renewcommand{\refch}[1]{\hyperref[ch:#1]{\textcolor{Blue}{第\xspace\ref{ch:#1}\xspace\chaptername}}} % 第 7 章 29 | \renewcommand{\nrefch}[1]{\hyperref[ch:#1]{\textcolor{Blue}{第\xspace\ref{ch:#1}\xspace\chaptername(\nameref{ch:#1})}}} % 第 7 章(数学) 30 | \renewcommand{\refsec}[1]{\hyperref[sec:#1]{\textcolor{Blue}{第\xspace\ref{sec:#1}\xspace\sectionname}}} 31 | \renewcommand{\nrefsec}[1]{\hyperref[sec:#1]{\textcolor{Blue}{第\xspace\ref{sec:#1}\xspace\sectionname(\nameref{sec:#1})}}} 32 | \renewcommand{\refsubsec}[1]{\hyperref[subsec:#1]{\textcolor{Blue}{第\xspace\ref{subsec:#1}\xspace\subsectionname}}} 33 | \renewcommand{\nrefsubsec}[1]{\hyperref[subsec:#1]{\textcolor{Blue}{第\xspace\ref{subsec:#1}\xspace\subsectionname(\nameref{subsec:#1})}}} 34 | %脚注编号 35 | % \renewcommand{\thefootnote}{\arabic{footnote}} % 1, 2, 3 36 | % \renewcommand{\thefootnote}{\alph{footnote}} % a, b, c 37 | % \renewcommand{\thefootnote}{\roman{footnote}} % i, ii, iii 38 | 39 | -------------------------------------------------------------------------------- /minimal_report_CJKsc/styles/kaoWinCJKsc.sty: -------------------------------------------------------------------------------- 1 | \ProvidesPackage{styles/kaoWinCJKsc} 2 | 3 | \RequirePackage{kvoptions} % Handle package options 4 | \SetupKeyvalOptions{ 5 | family = kaowincjksc, 6 | prefix = kaowincjksc@ 7 | } 8 | 9 | \DeclareBoolOption{testMathBox}% If true, put theorems into colorful boxes, otherwise write them like normal text 10 | 11 | \ProcessKeyvalOptions{kaowincjksc} 12 | 13 | %---------------------------------------------------------------------------------------- 14 | % 加载包用于字体设置与选择 15 | \RequirePackage{xeCJK} 16 | 17 | % 检查可用中文字体名:fc-list -f "%{family}\n" :lang=zh > zh-font.txt 18 | \setCJKmainfont[BoldFont=Noto Serif CJK SC Bold,AutoFakeSlant]{Noto Serif CJK SC} 19 | \setCJKsansfont[BoldFont=Noto Sans CJK SC Bold,AutoFakeSlant]{Noto Sans CJK SC} 20 | \setCJKmonofont[BoldFont=Noto Sans Mono CJK SC Bold,AutoFakeSlant]{Noto Sans Mono CJK SC} 21 | 22 | %---------------------------------------------------------------------------------------- 23 | % 加载包用于首行缩进 24 | \RequirePackage{indentfirst} 25 | \setlength{\parindent}{2em} % 首行缩进两个汉字或四个字母 26 | 27 | %---------------------------------------------------------------------------------------- 28 | % 文本颜色 29 | \RequirePackage{xcolor} 30 | % 中文数字日期格式 31 | \RequirePackage{zhnumber} 32 | 33 | %---------------------------------------------------------------------------------------- 34 | % Win10 平台中文字体集合 35 | \setCJKfamilyfont{nosat}{Noto Sans CJK SC Thin} 36 | \newcommand{\nosat}{\CJKfamily{nosat}} 37 | \setCJKfamilyfont{dx}{DengXian} %等线 dx 38 | \newcommand{\dx}{\CJKfamily{dx}} 39 | \setCJKfamilyfont{song}{SimSun} %宋体 song 40 | \newcommand{\song}{\CJKfamily{song}} 41 | \setCJKfamilyfont{xs}{NSimSun} %新宋体 xs 42 | \newcommand{\xs}{\CJKfamily{xs}} 43 | \setCJKfamilyfont{fs}{FangSong} %仿宋 fs 44 | \newcommand{\fs}{\CJKfamily{fs}} 45 | \setCJKfamilyfont{yh}{Microsoft YaHei} %微软雅黑 yh 46 | \newcommand{\yh}{\CJKfamily{yh}} 47 | \setCJKfamilyfont{hei}{SimHei} %黑体 hei 48 | \newcommand{\hei}{\CJKfamily{hei}} 49 | \setCJKfamilyfont{kai}{KaiTi} %楷体 kai 50 | \newcommand{\kai}{\CJKfamily{kai}} 51 | \setCJKfamilyfont{li}{LiSu} %隶书 li 52 | \newcommand{\li}{\CJKfamily{li}} 53 | \setCJKfamilyfont{yy}{YouYuan} %幼圆 yy 54 | \newcommand{\yy}{\CJKfamily{yy}} 55 | \setCJKfamilyfont{hwsong}{STSong} %华文宋体 hwsong 56 | \newcommand{\hwsong}{\CJKfamily{hwsong}} 57 | \setCJKfamilyfont{hwzs}{STZhongsong} %华文中宋 hwzs 58 | \newcommand{\hwzs}{\CJKfamily{hwzs}} 59 | \setCJKfamilyfont{hwfs}{STFangsong} %华文仿宋 hwfs 60 | \newcommand{\hwfs}{\CJKfamily{hwfs}} 61 | \setCJKfamilyfont{hwxh}{STXihei} %华文细黑 hwxh 62 | \newcommand{\hwxh}{\CJKfamily{hwxh}} 63 | \setCJKfamilyfont{hwl}{STLiti} %华文隶书 hwl 64 | \newcommand{\hwl}{\CJKfamily{hwl}} 65 | \setCJKfamilyfont{hwxw}{STXinwei} %华文新魏 hwxw 66 | \newcommand{\hwxw}{\CJKfamily{hwxw}} 67 | \setCJKfamilyfont{hwk}{STKaiti} %华文楷体 hwk 68 | \newcommand{\hwk}{\CJKfamily{hwk}} 69 | \setCJKfamilyfont{hwxk}{STXingkai} %华文行楷 hwxk 70 | \newcommand{\hwxk}{\CJKfamily{hwxk}} 71 | \setCJKfamilyfont{hwcy}{STCaiyun} %华文彩云 hwcy 72 | \newcommand{\hwcy}{\CJKfamily{hwcy}} 73 | \setCJKfamilyfont{hwhp}{STHupo} %华文琥珀 hwhp 74 | \newcommand{\hwhp}{\CJKfamily{hwhp}} 75 | \setCJKfamilyfont{fzs}{FZShuTi} %方正舒体 fzs 76 | \newcommand{\fzs}{\CJKfamily{fzs}} 77 | \setCJKfamilyfont{fzy}{FZYaoTi} %方正姚体 fzy 78 | \newcommand{\fzy}{\CJKfamily{fzy}} 79 | 80 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 彩色盒子 81 | \ifkaowincjksc@testMathBox 82 | \RequirePackage{tikz} % Required by mdframed 83 | \RequirePackage[framemethod=TikZ]{mdframed} % Required for colorful boxes 84 | 85 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 86 | %Theorem 87 | % define a counter for continuous numbering of the environment 88 | % by chapter or by section 89 | \newcounter{theo}[section] \setcounter{theo}{0} 90 | %\renewcommand{\thetheo}{\arabic{chapter}.\arabic{theo}} %显示章节名 91 | \renewcommand{\thetheo}{\arabic{theo}} %不显示章节名 92 | \newenvironment{theo}[2][]{% 93 | \refstepcounter{theo}% 94 | \ifstrempty{#1}% 95 | {\mdfsetup{% 96 | frametitle={% 97 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 98 | \node[anchor=east,rectangle,fill=blue!20] 99 | {\strut Theorem~\thetheo};}} 100 | }% 101 | {\mdfsetup{% 102 | frametitle={% 103 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 104 | \node[anchor=east,rectangle,fill=blue!20] 105 | {\strut Theorem~\thetheo:~#1};}}% 106 | }% 107 | \mdfsetup{innertopmargin=10pt,linecolor=blue!20,% 108 | linewidth=2pt,topline=true,% 109 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 110 | } 111 | \begin{mdframed}[]\relax% 112 | \label{#2}}{\end{mdframed}} 113 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 114 | %Lemma 115 | \newcounter{lem}[section] \setcounter{lem}{0} 116 | \renewcommand{\thelem}{\arabic{lem}} 117 | \newenvironment{lem}[2][]{% 118 | \refstepcounter{lem}% 119 | \ifstrempty{#1}% 120 | {\mdfsetup{% 121 | frametitle={% 122 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 123 | \node[anchor=east,rectangle,fill=green!20] 124 | {\strut Lemma~\thelem};}} 125 | }% 126 | {\mdfsetup{% 127 | frametitle={% 128 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 129 | \node[anchor=east,rectangle,fill=green!20] 130 | {\strut Lemma~\thelem:~#1};}}% 131 | }% 132 | \mdfsetup{innertopmargin=10pt,linecolor=green!20,% 133 | linewidth=2pt,topline=true,% 134 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 135 | } 136 | \begin{mdframed}[]\relax% 137 | \label{#2}} 138 | {\end{mdframed}} 139 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 140 | %Proof 141 | % [begin]define a new environment for proof 142 | \newenvironment{prf}[2][]{% 143 | % box style 144 | \ifstrempty{#1} 145 | % if condition (without title) 146 | { 147 | \mdfsetup{% 148 | frametitle={% 149 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 150 | \node[anchor=east,rectangle,fill=red!20] 151 | {\strut Proof~};}} 152 | }% else condition (with title) 153 | { 154 | \mdfsetup{% 155 | frametitle={% 156 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 157 | \node[anchor=east,rectangle,fill=red!20] 158 | {\strut Proof~:~#1};}}% 159 | }% 160 | % Both conditions 161 | \mdfsetup{ 162 | innertopmargin=10pt,linecolor=red!20,% 163 | linewidth=2pt,topline=true,% 164 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 165 | } 166 | 167 | % [begin]define a new environment for proof 168 | \begin{mdframed}[]\relax% 169 | \label{#2} 170 | } 171 | {\qed\end{mdframed}} 172 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 173 | %soln 174 | % [begin]define a new environment for proof 175 | \newenvironment{soln}[2][]{% 176 | % box style 177 | \ifstrempty{#1} 178 | % if condition (without title) 179 | { 180 | \mdfsetup{% 181 | frametitle={% 182 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 183 | \node[anchor=east,rectangle,fill=red!20] 184 | {\strut Solution~};}} 185 | }% else condition (with title) 186 | { 187 | \mdfsetup{% 188 | frametitle={% 189 | \tikz[baseline=(current bounding box.east),outer sep=0pt] 190 | \node[anchor=east,rectangle,fill=red!20] 191 | {\strut Solution~:~#1};}}% 192 | }% 193 | % Both conditions 194 | \mdfsetup{ 195 | innertopmargin=10pt,linecolor=red!20,% 196 | linewidth=2pt,topline=true,% 197 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax 198 | } 199 | 200 | % [begin]define a new environment for proof 201 | \begin{mdframed}[]\relax% 202 | \label{#2} 203 | } 204 | {\qed\end{mdframed}} 205 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 206 | \fi 207 | 208 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 高等数学风格 209 | \usepackage{amsthm} 210 | \usepackage{thmtools} 211 | \usepackage[unq]{unique} 212 | 213 | \declaretheoremstyle[% 214 | headindent=\parindent, 215 | headfont=\normalfont\bfseries,% 216 | notefont=\normalfont\bfseries, notebraces={(}{)}, 217 | bodyfont=\normalfont, 218 | postheadspace=1em,% 219 | %qed=\qedsymbol,%空心 220 | qed=$\blacksquare$,%实心 221 | headpunct={} 222 | ]{mathstyle} 223 | 224 | \theoremstyle{mathstyle} 225 | % 使用 amsthm 定义 226 | \newtheorem*{Definition*}{定义} 227 | \newtheorem{Definition}{定义}[section] 228 | \renewcommand{\theDefinition}{\arabic{Definition}} 229 | 230 | \newtheorem*{Theorem*}{定理} 231 | \newtheorem{Theorem}{定理}[section] 232 | \renewcommand{\theTheorem}{\arabic{Theorem}} 233 | 234 | \newtheorem{Corollary}{推论} 235 | \renewcommand{\theCorollary}{\arabic{Corollary}} 236 | 237 | \newtheorem*{Lemma*}{引理} 238 | \newtheorem{Lemma}{引理}[section] 239 | \renewcommand{\theLemma}{\arabic{Lemma}} 240 | 241 | \newtheorem*{Proposition*}{命题} 242 | \newtheorem{Proposition}{命题}[section] 243 | \renewcommand{\theProposition}{\arabic{Proposition}} 244 | 245 | \newtheorem*{Proof*}{证} 246 | \newtheorem{Proof}{证}[section] 247 | \renewcommand{\theProof}{\arabic{Proof}} 248 | 249 | \newtheorem*{Example*}{例} 250 | \newtheorem{Example}{例}[section] 251 | \renewcommand{\theExample}{\arabic{Example}} 252 | 253 | \newtheorem*{Solution*}{解} 254 | \newtheorem{Solution}{解}[section] 255 | \renewcommand{\theSolution}{\arabic{Solution}} 256 | -------------------------------------------------------------------------------- /minimal_report_CJKsc/styles/kaohandtCJKsc.cls: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % kaobook 3 | % LaTeX Class 4 | % Version 0.9.8 (2021/08/23) 5 | % 6 | % This template originates from: 7 | % https://www.LaTeXTemplates.com 8 | % 9 | % For the latest template development version and to make contributions: 10 | % https://github.com/fmarotta/kaobook 11 | % 12 | % Authors: 13 | % Federico Marotta (federicomarotta@mail.com) 14 | % Based on the doctoral thesis of Ken Arroyo Ohori (https://3d.bk.tudelft.nl/ken/en) 15 | % and on the Tufte-LaTeX class. 16 | % Modified for LaTeX Templates by Vel (vel@latextemplates.com) 17 | % 18 | % License: 19 | % LPPL (see included MANIFEST.md file) 20 | % 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | 23 | %---------------------------------------------------------------------------------------- 24 | % CLASS CONFIGURATION 25 | %---------------------------------------------------------------------------------------- 26 | 27 | \NeedsTeXFormat{LaTeX2e} 28 | \ProvidesClass{styles/kaohandtCJKsc}[2021/08/23 v0.9.8 kaohandt] 29 | \newcommand{\@baseclass}{scrartcl} % Base class name 30 | 31 | % Set the default options 32 | \PassOptionsToClass{a4paper}{\@baseclass} 33 | 34 | % Pass through any other options to the base class 35 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\@baseclass}} 36 | 37 | \ProcessOptions\relax % Process the options 38 | 39 | \LoadClass{\@baseclass} % Load the base class 40 | 41 | \RequirePackage{styles/kaoCJKsc} % Load the code common to all classes 42 | 43 | %---------------------------------------------------------------------------------------- 44 | % TITLE-RELATED SETTINGS 45 | %---------------------------------------------------------------------------------------- 46 | 47 | % Left-align title, authors and date 48 | \xpatchcmd{\@maketitle}{\begin{center}}{\begin{flushleft}}{}{} 49 | \xpatchcmd{\@maketitle}{\end{center}}{\end{flushleft}}{}{} 50 | \xpatchcmd{\@maketitle}{\begin{tabular}[t]{c}}{\begin{tabular}[t]{@{}l@{}}}{}{} 51 | 52 | % Set the font for the title 53 | \addtokomafont{title}{\normalfont\bfseries} 54 | 55 | % Customise the abstract 56 | \RequirePackage[style]{abstract} 57 | 58 | \setlength{\absleftindent}{0pt}% No indentation in the abstract 59 | \if@abstrt 60 | \renewcommand{\abstitlestyle}[1]{% 61 | \vspace{-0.6cm}% 62 | \begin{center}% 63 | {\normalfont\bfseries\hspace{-3em} \abstractname\vspace{-.5em}\vspace{\z@}}% 64 | \end{center}% 65 | } 66 | \else 67 | \renewcommand{\abstitlestyle}[1]{\vspace{-.5em}\vspace{\z@}}% 68 | \fi 69 | 70 | % Set KOMA fonts 71 | \addtokomafont{section}{\normalfont\bfseries} 72 | \addtokomafont{subsection}{\normalfont\bfseries} 73 | \addtokomafont{subsubsection}{\normalfont\bfseries} 74 | \addtokomafont{paragraph}{\normalfont\bfseries} 75 | \setkomafont{descriptionlabel}{\normalfont\bfseries} 76 | 77 | %---------------------------------------------------------------------------------------- 78 | % TOC 79 | %---------------------------------------------------------------------------------------- 80 | 81 | % Adjust the positions of margintoc and marginnotes 82 | \setlength{\mtocshift}{-0.6cm} 83 | \renewcommand{\marginnotevadjust}{-4pt} 84 | 85 | % Do not add lists to the TOC 86 | \PassOptionsToClass{toc=nolistof}{\@baseclass} 87 | \unsettoc{toc}{totoc} 88 | 89 | %---------------------------------------------------------------------------------------- 90 | % NUMBERING 91 | %---------------------------------------------------------------------------------------- 92 | 93 | %\setcounter{secnumdepth}{\kao@secnumdepth} % Set section numbering depth 94 | 95 | \counterwithin*{sidenote}{section} % Uncomment to reset the sidenote counter at each section 96 | %\counterwithout{sidenote}{section} % Uncomment to have one sidenote counter for the whole document 97 | --------------------------------------------------------------------------------