├── Al-jabr.bib ├── .gitignore ├── ccby.png ├── Lanzhou.png ├── imgs ├── .DS_Store └── figure-1.png ├── Template-AJbook.pdf ├── latex-cheatsheet.pdf ├── README.md ├── font-setup-open.tex ├── latex-cheatsheet.tex ├── titles-setup.tex ├── AJbook.cls ├── Template-AJbook.tex └── LICENSE /Al-jabr.bib: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .texpadtmp 2 | -------------------------------------------------------------------------------- /ccby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/latex-template/HEAD/ccby.png -------------------------------------------------------------------------------- /Lanzhou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/latex-template/HEAD/Lanzhou.png -------------------------------------------------------------------------------- /imgs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/latex-template/HEAD/imgs/.DS_Store -------------------------------------------------------------------------------- /imgs/figure-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/latex-template/HEAD/imgs/figure-1.png -------------------------------------------------------------------------------- /Template-AJbook.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/latex-template/HEAD/Template-AJbook.pdf -------------------------------------------------------------------------------- /latex-cheatsheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/latex-template/HEAD/latex-cheatsheet.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 从李文威老师的《代数学方法》开源项目中搬运,见:https://github.com/wenweili/AlJabr-1 2 | 例子参见文件Template-AJbook.tex 3 | -------------------------------------------------------------------------------- /font-setup-open.tex: -------------------------------------------------------------------------------- 1 | % Copyright 2018 李文威 (Wen-Wei Li). 2 | % Permission is granted to copy, distribute and/or modify this 3 | % document under the terms of the Creative Commons 4 | % Attribution 4.0 International (CC BY 4.0) 5 | % http://creativecommons.org/licenses/by/4.0/ 6 | 7 | % 目的: 字体相关设置, 呼叫相关宏包. 8 | % 将由 AJbook.cls 引入 9 | % 必须提供 \kaishu, \songti, \heiti, \thmheiti, \fangsong 几种字型切换命令, 在文档类中使用. 10 | \ProvidesFile{font-setup-open.tex}[2018/03/04] 11 | 12 | % 设置 xeCJK 字体及中文数字 13 | %\setmainfont{TeX Gyre Pagella} % 设置西文衬线字体 14 | \setsansfont{TeX Gyre Heros} % 设置西文无衬线字体 15 | 16 | % 自用模式: Fandol 字体 + 思源黑体 (Noto Sans CJK SC), 宜留意字体高低差异. 17 | \setCJKmainfont[ 18 | BoldFont=FandolSong-Bold.otf, 19 | ItalicFont=FandolKai-Regular.otf 20 | ]{FandolSong-Regular.otf} 21 | 22 | \setCJKsansfont[ 23 | BoldFont=FandolHei-Bold.otf 24 | ]{FandolHei-Regular.otf} 25 | 26 | \setCJKmonofont[ 27 | BoldFont=FandolHei-Bold.otf, 28 | ]{FandolHei-Regular.otf} 29 | 30 | 31 | \setCJKfamilyfont{kai}[ 32 | BoldFont=FandolKai-Regular.otf, ItalicFont=FandolKai-Regular.otf 33 | ]{FandolKai-Regular.otf} 34 | 35 | \setCJKfamilyfont{song}[ 36 | BoldFont=FandolSong-Bold.otf, 37 | ItalicFont=FandolKai-Regular.otf 38 | ]{FandolSong-Regular.otf} 39 | 40 | \setCJKfamilyfont{fangsong}[ 41 | BoldFont=FandolSong-Bold.otf, 42 | ItalicFont=FandolKai-Regular.otf 43 | ]{FandolFang-Regular.otf} 44 | 45 | \setCJKfamilyfont{hei}[ 46 | BoldFont=FandolHei-Bold.otf, 47 | ItalicFont=FandolHei-Regular.otf 48 | ]{FandolHei-Regular.otf} 49 | 50 | \setCJKfamilyfont{hei2}{Noto Sans CJK SC} 51 | 52 | \setCJKfamilyfont{sectionfont}[ 53 | BoldFont=* Black 54 | ]{Noto Sans CJK SC} 55 | 56 | \setCJKfamilyfont{pffont}[ 57 | BoldFont=* Medium 58 | ]{Noto Sans CJK SC} % 证明用的字体 59 | \setCJKfamilyfont{emfont}[ 60 | BoldFont=FandolHei-Regular.otf 61 | ]{FandolHei-Regular.otf} % 强调用的字体 62 | 63 | \defaultfontfeatures{Ligatures=TeX} 64 | \XeTeXlinebreaklocale "zh" 65 | \XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt 66 | 67 | % 以下设置字体相关命令, 用于定理等环境中. 68 | \newcommand\kaishu{\CJKfamily{kai}} % 楷体 69 | \newcommand\songti{\CJKfamily{song}} % 宋体 70 | \newcommand\heiti{\CJKfamily{hei}} % 黑体 71 | \newcommand\thmheiti{\CJKfamily{hei2}} % 用于定理名称的黑体 72 | \newcommand\fangsong{\CJKfamily{fangsong}} % 仿宋 73 | \renewcommand{\em}{\bfseries\CJKfamily{emfont}} % 强调 -------------------------------------------------------------------------------- /latex-cheatsheet.tex: -------------------------------------------------------------------------------- 1 | %!TEX TS-program = xelatex 2 | %!TEX encoding = UTF-8 3 | 4 | % Template for the class file AJbook, originally designed for Chinese book ``代数学方法''. 5 | % Copyright 2018 李文威 (Wen-Wei Li). 6 | % Permission is granted to copy, distribute and/or modify this 7 | % document under the terms of the Creative Commons 8 | % Attribution 4.0 International (CC BY 4.0) 9 | % http://creativecommons.org/licenses/by/4.0/ 10 | 11 | % 使用自定义的文档类 AJbook.cls. 自动载入 xeCJK. 需要额外档案如下: 12 | % font-setup-open.tex, coverpage.tex, titles-setup.tex, mycommand.sty, myarrows.sty 13 | % 文档类选项 (key/val 格式): 14 | % draftmark = true (未定稿, 底部显示日期) 或 false (成品), 默认 false, 15 | % colors = true (链接带颜色无框) 或 false (黑色无框), 默认 true, 16 | % traditional = true (繁体中文) 或 false (简体中文), 默认 false, 17 | % coverpage = 封面档档名, 默认为空 (此时不制作封面), 一般是 .tex 档, 若为 *.pdf 的形式则直接引入 PDF 页面. 18 | % fontsetup = 字体设置档档名, 19 | % titlesetup = 章节格式设置档名. 20 | 21 | % 注意: 如果文中未使用 \cite 和 \index 命令, 则可能报错. 22 | 23 | % 需动用 imakeidx + xindy (两份索引), biblatex + biber (书目). 24 | % 索引用土法进行中文排序: 如 \index{zhongwen@中文} 等. 25 | \documentclass[ 26 | draftmark = false, % 草稿模式下, 每页底部将打印相关版本信息. 27 | % traditional = true, 28 | % colors = false, 29 | % coverpage = coverpage.tex, 30 | % coverpage = coverpage.pdf, 31 | % geometry = b5, % 版面设置, 目前仅容许 a4, b5, 默认 b5, 其它字串则不作自动设置. 32 | fontsetup = font-setup-open.tex, 33 | titlesetup = titles-setup.tex 34 | ]{AJbook} 35 | 36 | % 可以修改章节编号的深度 37 | % \setcounter{secnumdepth}{3} 38 | 39 | % 必要时仅引入部分档案 40 | % \includeonly{} 41 | 42 | % 生成索引: 选用 xindy + imakeidx 43 | \usepackage[xindy, splitindex]{imakeidx} 44 | \makeindex[ 45 | columns=2, 46 | program=truexindy, 47 | intoc=true, 48 | options=-M texindy -I xelatex -C utf8, 49 | title={名词索引}] % 名词索引 50 | 51 | \usepackage[unicode, bookmarksnumbered]{hyperref} % 启动超链接和 PDF 文档信息所需 52 | % 设置 PDF 文件信息 53 | \hypersetup{ 54 | pdfauthor = {Lichuang}, 55 | pdftitle = {Latex 数学符号、排版cheat sheet}, 56 | CJKbookmarks = true} 57 | 58 | % 增加表格高度 59 | \renewcommand*\arraystretch{1.5} 60 | 61 | % 自订公式的编号 (非必要) 62 | \numberwithin{equation}{section} 63 | \renewcommand{\theequation}{\thesection--\arabic{equation}} 64 | 65 | % 图片相关的宏包 66 | \usepackage{graphicx} %插入图片的宏包 67 | \usepackage{float} %设置图片浮动位置的宏包 68 | \usepackage{subfigure} %插入多图时用子图显示的宏包 69 | 70 | % 自订 figure 的编号 (非必要) 71 | %\numberwithin{figure}{section} 72 | %\renewcommand{\thefigure}{\thechapter--\arabic{figure}} 73 | 74 | % 自订 table 的编号 (非必要) 75 | %\numberwithin{table}{section} 76 | %\renewcommand{\thetable}{\thechapter--\arabic{table}} 77 | 78 | \begin{document} 79 | \frontmatter % 制作封面和目录. 80 | % 注意: 为了简化, 本模板不含封面. 请通过文档类的参数进行设置. 81 | 82 | \mainmatter % 正文开始:逐章引入 TeX 代码 83 | 84 | \chapter{数理逻辑符号} 85 | \newcommand\tauteq{\mathrel{\vDash \mkern -2.25mu 86 | \mathrel{\reflectbox{\ensuremath\vDash}}}} 87 | 88 | \newcommand\syeq{\mathrel{\vdash \mkern -2.25mu 89 | \mathrel{\reflectbox{\ensuremath\vdash}}}} 90 | 91 | \section{符号} 92 | 对于两个公式$A,B$,当“$A \vDash B$且$B \vDash A$”时,写作: 93 | $$ 94 | A \tauteq B 95 | $$ 96 | 97 | 对于两个公式A和B,写: 98 | $$ 99 | A \syeq B 100 | $$ 101 | 表示“$A \vdash B$且$B \vdash A$”,称A和B为\textbf{语法等值公式(syntactically equivalent)}。 102 | 103 | \chapter{插入图片} 104 | \section{单图插入居中显示} 105 | \begin{figure}[H] %H为当前位置,!htb为忽略美学标准,htbp为浮动图形 106 | \centering %图片居中 107 | \includegraphics[width=0.7\textwidth]{./imgs/figure-1.png} %插入图片,[]中设置图片大小,{}中是图片文件名 108 | \caption{Main name 2} %最终文档中希望显示的图片标题 109 | \label{Fig.main1} %用于文内引用的标签 110 | \end{figure} 111 | 112 | \section{多图横排+默认编号} 113 | \begin{figure}[H] 114 | \centering %图片全局居中 115 | \subfigure[name1]{ 116 | \label{Fig.sub.1} 117 | \includegraphics[width=0.45\textwidth]{./imgs/figure-1.png}} 118 | \subfigure[name2]{ 119 | \label{Fig.sub.2} 120 | \includegraphics[width=0.45\textwidth]{./imgs/figure-1.png}} 121 | \caption{Main name} 122 | \label{Fig.main2} 123 | \end{figure} 124 | 125 | \section{多图横排+自定义编号} 126 | %注意:此段中在引用中增加了主图编号的引用 127 | Figure \ref{Fig.main3} has two sub-figures, fig. \ref{Fig.main3}\ref{Fig3.sub.1} is the travel demand of driving auto, and fig. \ref{Fig.main3}\ref{Fig3.sub.2} is the travel demand of park-and-ride. 128 | %以下code与上一小节的无变化 129 | \begin{figure}[H] 130 | \centering %图片全局居中 131 | \subfigure[name1]{ 132 | \label{Fig3.sub.1} 133 | \includegraphics[width=0.45\textwidth]{./imgs/figure-1.png}} 134 | \subfigure[name2]{ 135 | \label{Fig3.sub.2} 136 | \includegraphics[width=0.45\textwidth]{./imgs/figure-1.png}} 137 | \caption{Main name} 138 | \label{Fig.main3} 139 | \end{figure} 140 | 141 | \section{多图并排显示(非子图模式)} 142 | \begin{figure}[H] 143 | \centering %图片全局居中 144 | %并排几个图,就要写几个minipage 145 | \begin{minipage}[b]{0.45\textwidth} %所有minipage宽度之和要小于1,否则会自动变成竖排 146 | \centering %图片局部居中 147 | \includegraphics[width=0.8\textwidth]{./imgs/figure-1.png} %此时的图片宽度比例是相对于这个minipage的,不是全局 148 | \caption{name 1} 149 | \label{Fig.1} 150 | \end{minipage} 151 | \begin{minipage}[b]{0.45\textwidth} %所有minipage宽度之和要小于1,否则会自动变成竖排 152 | \centering %图片局部居中 153 | \includegraphics[width=0.8\textwidth]{./imgs/figure-1.png}%此时的图片宽度比例是相对于这个minipage的,不是全局 154 | \caption{name 2} 155 | \label{Fig.2} 156 | \end{minipage} 157 | \end{figure} 158 | 159 | \section{参考资料} 160 | \begin{itemize} 161 | \item \href{https://zhuanlan.zhihu.com/p/32925549}{LaTeX排版札记:part 4—插入图片(并排显示、自定义编号)} 162 | \end{itemize} 163 | 164 | % % % % % % % % % % 165 | \backmatter 166 | % 使用 bibLaTeX 制作书目 167 | \printbibliography[heading=bibintoc] 168 | 169 | % 图, 表索引. 可有可无. 170 | \listoffigures 171 | \listoftables 172 | 173 | % 制作索引 (用 imakeidx 的功能可以制作多份) 174 | {\footnotesize 175 | \indexprologue{中文术语按汉语拼音排序.} 176 | \printindex} 177 | \end{document} 178 | -------------------------------------------------------------------------------- /titles-setup.tex: -------------------------------------------------------------------------------- 1 | % Copyright 2018 李文威 (Wen-Wei Li). 2 | % Permission is granted to copy, distribute and/or modify this 3 | % document under the terms of the Creative Commons 4 | % Attribution 4.0 International (CC BY 4.0) 5 | % http://creativecommons.org/licenses/by/4.0/ 6 | 7 | % 目的: 设置章节标题格式及目录的显示方式. 8 | % 由 AJbook.cls 引入 9 | \ProvidesFile{titles-setup.tex}[2018/03/04] 10 | 11 | \RequirePackage[calcwidth, nobottomtitles, explicit, newparttoc, indentafter]{titlesec} % 标题格式: explicit 选项导致须在 titleformat 的 before-code 中加 #1. 选项 newparttoc 用来将各部分加入目录. indentafter: 首行一律缩进 12 | \RequirePackage{titletoc} % 目录格式 13 | 14 | % 目录部分: 章名除附录外仍用中文标号, 黑体显示. 以参数是否为大写拉丁字母来判定是否在附录 (烂招) 15 | \if@AJ@traditional 16 | \providecommand{\AJchapterttl}[1]{\IfSubStr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}{#1}{附錄 #1 }{第\CJKnumber{#1}章}} 17 | \else 18 | \providecommand{\AJchapterttl}[1]{\IfSubStr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}{#1}{附录 #1 }{第\CJKnumber{#1}章}} 19 | \fi 20 | 21 | \newlength{\BoxTtlwidth} % 用来计算各种盒子所需宽度 22 | 23 | % 各章标题排版: \MakeChapBox{编号}{标题}, 除附录外, 各章用中文数字显示. 以参数是否为大写拉丁字母来判定是否在附录 (烂招) 24 | \newcommand{\MakeChapBox}[2]{% 25 | \settowidth{\BoxTtlwidth}{\AJchapterttl{#1}} % 计算宽度 26 | \begin{tcolorbox}[ % 设置 tcolorbox 27 | enhanced jigsaw, 28 | skin = bicolor, 29 | frame engine = path, 30 | sharp corners = all, 31 | width = 0.9\textwidth, 32 | top = 4mm, bottom = 4mm, 33 | sidebyside, 34 | frame hidden, 35 | boxrule = 0mm, 36 | lefthand width = \BoxTtlwidth, 37 | colupper = white, 38 | colback = gray!80, 39 | colbacklower = gray!10, 40 | sidebyside align=center, 41 | halign=center] 42 | \AJchapterttl{#1} 43 | \tcblower 44 | #2 45 | \end{tcolorbox}% 46 | } 47 | 48 | % 无编号标题排版: \MakeChapBox{标题} 49 | \newcommand{\MakeChapBoxSingle}[1]{% 50 | \begin{tcolorbox}[ 51 | enhanced, 52 | width = 0.7\textwidth, 53 | sharp corners = all, 54 | top = 4mm, bottom = 4mm, 55 | frame hidden, 56 | boxrule = 0mm, 57 | colback = gray!10, 58 | halign=center] 59 | #1 60 | \end{tcolorbox} 61 | } 62 | 63 | % 各节标题排版: \MakeSectBox{文字}, 问题: 不允许断行 64 | \newtcbox{\MakeSectBox}{ 65 | enhanced, 66 | arc = 0pt, outer arc = 0pt, 67 | before skip = 0pt, after skip = 0.4em, left skip = 0pt, right skip = 0pt, 68 | top = 0pt, left = 0pt, right = 0pt, bottom = 1.5mm, 69 | sharp corners = all, 70 | valign=bottom, 71 | colback = white, 72 | colframe = white, 73 | boxsep = 0pt, leftrule = 0pt, rightrule=0pt, toprule=0pt, bottomrule = 0pt, 74 | overlay = { \draw[line width=1pt] (interior.south west) -- (interior.south east); } 75 | } 76 | 77 | % 用 titlesec 设置各章标题 78 | \titleformat{name=\chapter} 79 | {\filright\sffamily\CJKfamily{hei2}\bfseries\Huge} % Format 80 | {} % Label 81 | {0mm} % Sep 82 | {\MakeChapBox{\thechapter}{#1}} % Before-code 83 | [] % After-code 84 | \titlespacing*{name=\chapter} % 设置间隔 85 | {1pc}{*4}{1em} % {left}{before-sep}{after-sep} 86 | 87 | \titleformat{name=\chapter, numberless} 88 | {\filcenter\sffamily\CJKfamily{hei2}\bfseries\Huge} % Format 89 | {} % Label 90 | {0mm} % Sep 91 | {\MakeChapBoxSingle{#1}} % Before-code 92 | [{\if@mainmatter 93 | \addcontentsline{toc}{chapter}{#1} 94 | \markboth{#1}{} 95 | \fi}] % After-code: 无号章如果出现在正文中, 就加入目录并相应地设置天眉. 96 | \titlespacing*{name=\chapter, numberless} % 设置间隔 97 | {1pc}{*4}{1em} % {left}{before-sep}{after-sep} 98 | 99 | \titleformat{name=\section} % 各节标题 100 | {\filleft\normalfont\sffamily\bfseries\CJKfamily{sectionfont}} 101 | {} 102 | {0mm} 103 | { \settowidth{\BoxTtlwidth}{\Huge \thesection \hspace{0.7em} \Large #1} % 首先计算宽度 104 | \ifdim \BoxTtlwidth < \textwidth % 一般情形下调用 \MakeSectBox 105 | \MakeSectBox{\Huge \thesection \hspace{0.7em} \Large #1}\vskip-18pt% 106 | \else % 万一标题过长则不用 \MakeSectBox (烂招) 107 | \Huge \underline{\thesection} \hspace{0.7em} \Large #1% 108 | \fi % 109 | } 110 | [] 111 | 112 | \titleformat{name=\section, numberless} % 各节标题: 无编号情形 113 | {\filleft\normalfont\sffamily\bfseries\CJKfamily{sectionfont}} 114 | {} 115 | {0mm} 116 | { \settowidth{\BoxTtlwidth}{\Large #1} % 首先计算宽度 117 | \ifdim \BoxTtlwidth < \textwidth % 一般情形下调用 \MakeSectBox 118 | \MakeSectBox{\Large #1}\vskip-18pt% 119 | \else % 万一标题过长则不用 \MakeSectBox (烂招) 120 | \Large #1 % 121 | \fi % 122 | } 123 | [] 124 | 125 | \titlespacing*{name=\section} % 设置间隔 126 | {1pc}{*1.3}{*1} % {left}{before-sep}{after-sep} 127 | 128 | \titleformat{name=\subsection} % 各子节标题, 采取 runin 形式较美观 129 | [runin] 130 | {\filleft\normalfont\sffamily\bfseries\CJKfamily{sectionfont}} 131 | {\Large\thesubsection} % Label 132 | {3mm} % Sep 133 | {#1} % Before-code 134 | [] % After-code 135 | 136 | \titleformat{name=\subsection, numberless} 137 | [runin] 138 | {\filleft\normalfont\sffamily\bfseries\CJKfamily{sectionfont}} 139 | {} % Label 140 | {0mm} % Sep 141 | {#1} % Before-code 142 | [] % After-code 143 | \titlespacing*{name=\subsection} % 设置间隔 144 | {0pt}{*1}{1em} % {left}{before-sep}{after-sep} 145 | 146 | \titleformat{name=\subsubsection} % 次子节标题, 采取 runin 形式较美观 147 | [runin] 148 | {\filleft\normalfont\sffamily\bfseries\CJKfamily{sectionfont}} 149 | {\thesubsubsection} % Label 150 | {3mm} % Sep 151 | {#1} % Before-code 152 | [] % After-code 153 | 154 | \titleformat{name=\subsubsection, numberless} 155 | [runin] 156 | {\filleft\normalfont\sffamily\bfseries\CJKfamily{sectionfont}} 157 | {} % Label 158 | {0mm} % Sep 159 | {#1} % Before-code 160 | [] % After-code 161 | 162 | \titlespacing*{name=\subsubsection} % 设置间隔 163 | {0pt}{*1}{1em} % {left}{before-sep}{after-sep} 164 | 165 | \renewcommand{\thepart}{\CJKnumber{\arabic{part}}} % 部分的标题编号汉化 166 | \titleformat{name=\part}[display] % 各部分标题 167 | {\filcenter\sffamily\bfseries\CJKfamily{song}\Huge} % Format 168 | {第{\thepart}部分} % Label 169 | {1.5em} % Sep 170 | {#1} % Before-code 171 | [] % After-code 172 | 173 | \titlecontents{chapter} 174 | [0pt] 175 | {\addvspace{1pc}\heiti} 176 | {\contentsmargin{0pt}\large\AJchapterttl{\thecontentslabel} \quad} 177 | {\contentsmargin{0pt}\large} 178 | {\titlerule*[.7pc]{.}\contentspage} 179 | 180 | \titlecontents{section} 181 | [1.5em] 182 | {} 183 | {\thecontentslabel\quad} 184 | {\thecontentslabel} 185 | {\titlerule*[.7pc]{.}\contentspage} 186 | 187 | \titlecontents{subsection} 188 | [3.9em] 189 | {\small} 190 | {\thecontentslabel\quad} 191 | {\ (\thecontentspage)} 192 | {\titlerule*[.7pc]{.}\contentspage} 193 | 194 | \titlecontents{part} 195 | [0cm] 196 | {\addvspace{1pc}\songti} 197 | {\contentsmargin{0pt}\large{第{\thecontentslabel}部分}\quad} 198 | {\large} 199 | {\titlerule*[.7pc]{.}\contentspage} 200 | -------------------------------------------------------------------------------- /AJbook.cls: -------------------------------------------------------------------------------- 1 | % The class file for the book project 《代数学方法》 2 | % Copyright 2018 李文威 (Wen-Wei Li). 3 | % Permission is granted to copy, distribute and/or modify this 4 | % document under the terms of the Creative Commons 5 | % Attribution 4.0 International (CC BY 4.0) 6 | % http://creativecommons.org/licenses/by/4.0/ 7 | 8 | % We make use of etoolbox. The package ntheorem is implicitly required. 9 | % It will also import the files titles-setup.tex (for titles of sections) and font-setup-open.tex/font-setup-HEP.tex (for fonts). 10 | 11 | % Identification 12 | % -------------- 13 | \NeedsTeXFormat{LaTeX2e} 14 | \ProvidesClass{AJbook}[2018/03/04 Class for the book project Methods of Algebra] 15 | 16 | % 使用 key-val 格式指定选项之用, 一切以 @AJ 起始. 17 | \RequirePackage{kvoptions} 18 | \RequirePackage{etoolbox} 19 | 20 | \SetupKeyvalOptions{ 21 | family = @AJ, 22 | prefix = @AJ@ 23 | } 24 | 25 | % Declaration of options 26 | % ---------------------- 27 | \DeclareBoolOption[false]{draftmark} % 是否打上未定稿标记 28 | \DeclareBoolOption[true]{colors} % 是否让链接带颜色 29 | \DeclareBoolOption[true]{CJKthechapter} % 是否让天眉的各章编号使用中文数字 30 | \DeclareBoolOption[false]{traditional} % 是否使用繁体中文 31 | \DeclareStringOption[]{coverpage} % 封面档档名, 默认为空 32 | \DeclareStringOption{fontsetup} % 字体设定档档名 33 | \DeclareStringOption{titlesetup} % 章节标题设定档档名 34 | \DeclareStringOption[b5]{geometry} % 版面 (默认 b5) 35 | 36 | \PassOptionsToPackage{dvipsnames}{xcolor} % 让 xcolor 带 dvipsnames 选项; tikz 随后会载入之. 37 | 38 | 39 | % Execution of options 40 | % --------------------- 41 | \ProcessKeyvalOptions* 42 | \relax 43 | 44 | % Package loading 45 | % --------------------- 46 | % 基于 book class, 选项一并载入. 47 | \LoadClass[10pt]{book} 48 | 49 | \RequirePackage{fontspec} % XeLaTeX 50 | \RequirePackage[CJKchecksingle]{xeCJK} % XeCJK 51 | \RequirePackage{CJKnumb} % 使用 CJK 数字 52 | 53 | % 引入 AMS 宏包 + mathtools 54 | \RequirePackage[intlimits]{amsmath} 55 | \RequirePackage{amssymb} 56 | \RequirePackage[centercolon]{mathtools} 57 | 58 | % 支持直接引入 PDF 页面 59 | \RequirePackage{pdfpages} 60 | 61 | % 加入字串处理功能 62 | \RequirePackage{xstring} 63 | 64 | \RequirePackage{emptypage} 65 | \RequirePackage[many]{tcolorbox} % 制作方框 66 | 67 | \RequirePackage{setspace} % 设定适于中文排版的行距 68 | 69 | % 使用 biblatex + biber 制作书目 70 | \RequirePackage[backend=biber, hyperref=auto, backref=true, backrefstyle=three]{biblatex} 71 | 72 | % 要求载入 TikZ 73 | \RequirePackage{tikz} 74 | 75 | % 载入 paralist 76 | \RequirePackage{paralist} 77 | 78 | % Main codes 79 | % ---------- 80 | 81 | \usetikzlibrary{shapes.symbols} % 稍后定义 hint 环境所需 82 | 83 | % 定义在 draftmark=true 模式下显示版本信息的指令 84 | \RequirePackage[iso, english]{isodate} % 使 \today 印出 yyyy-mm-dd 85 | \providecommand{\@AJ@draftstring}{{\color{gray!40}\heiti 未定稿: \today}} 86 | 87 | \onehalfspacing % 行距 88 | %\raggedbottom % 减小页面空白 89 | 90 | \setlength{\parindent}{2em} % 设置适合于汉语排版的段落缩进 91 | 92 | % 扩展 \frontmatter: 制作封面和目录 93 | \g@addto@macro\frontmatter{ 94 | % 当 coverpage 参数非空时, 引入封面档制作封面, 否则 \relax. 95 | \ifdefempty{\@AJ@coverpage}{% 96 | \relax 97 | }{% 98 | \pagestyle{empty}% 清空页面风格 99 | \renewcommand{\thepage}{C\arabic{page}}% 封面部分页码以 C 开头 (PDF: logical page numbers) 100 | \IfEndWith{\@AJ@coverpage}{.pdf}{% 如果档名以 .pdf 或 .PDF 结尾则引入 PDF 101 | \includepdf{\@AJ@coverpage} 102 | }{% 103 | \IfEndWith{\@AJ@coverpage}{.PDF}{% 104 | \includepdf{\@AJ@coverpage} 105 | }{% 106 | \input{\@AJ@coverpage} % 否则引入 .tex 源代码 107 | } 108 | }% 109 | \pagestyle{fancy} % 复原页面风格为 fancy 110 | \pagenumbering{roman} % 页码复原为小写罗马字母 111 | } 112 | 113 | % 重设页数: 封面页结束时应已经 \cleardoublepage 114 | \setcounter{page}{1} 115 | \thispagestyle{empty} 116 | \addtocontents{toc}{\protect\thispagestyle{empty}} 117 | 118 | % 重置目录标题 119 | \if@AJ@traditional 120 | \renewcommand{\contentsname}{目錄} 121 | \else 122 | \renewcommand{\contentsname}{目录} 123 | \fi 124 | 125 | \tableofcontents % 印出目录 126 | } 127 | 128 | % 扩张 \appendix: 重置天眉 129 | \g@addto@macro\appendix{ 130 | % 为附录重置天眉格式 131 | \if@AJ@traditional 132 | \renewcommand{\appendixname}{附錄} 133 | \renewcommand{\chaptermark}[1]{\markboth{附錄 \thechapter \quad #1}{}} 134 | \else 135 | \renewcommand{\appendixname}{附录} 136 | \renewcommand{\chaptermark}[1]{\markboth{附录 \thechapter \quad #1}{}} 137 | \fi 138 | \renewcommand{\sectionmark}[1]{\markright{\S\thesection \quad #1}} 139 | } 140 | 141 | % 扩展 \backmatter: 设置文献显示方式. 注意: 若有附录则须重置天眉格式 142 | \g@addto@macro\backmatter{ 143 | \renewcommand{\em}{\itshape} % 书目部分以斜体表示强调 144 | % 汉化参考文献标题 145 | \if@AJ@traditional 146 | \renewcommand{\refname}{參考文獻} 147 | \renewcommand{\bibname}{參考文獻} 148 | \else 149 | \renewcommand{\refname}{参考文献} 150 | \renewcommand{\bibname}{参考文献} 151 | \fi 152 | } 153 | 154 | % 以下设置 biblatex. 155 | % bibLaTeX 部分第一步: 基本设置与汉化. 156 | \DeclareFieldFormat{postnote}{#1} % 功能是印出 \cite[postnote]{Book} 157 | \if@AJ@traditional 158 | \DefineBibliographyStrings{english}{% 159 | in = {刊於}, 160 | editor = {主編}, 161 | byeditor = {編者為}, 162 | backrefpage = {引用於 p.\!}, 163 | backrefpages = {引用於 pp.\!}, 164 | } 165 | \else 166 | \DefineBibliographyStrings{english}{% 167 | in = {刊于}, 168 | editor = {主编}, 169 | byeditor = {编者为}, 170 | backrefpage = {引用于 p.\!}, 171 | backrefpages = {引用于 pp.\!}, 172 | } 173 | \fi 174 | % biblatex 部分第二步: 要求在 doi 和 URL 并存时移除 URL. 仅适用于 Biblatex + Biber. 源码取自 https://tex.stackexchange.com/questions/119136/biblatex-convert-doi-url-into-doi-field 原文如下. 175 | % The actual value inside \regexp can be adjusted. 176 | % In the first step we create a doi field for each entry where the url field matches the regexp, and the novel field has the value of the url field. In the second step we remove the doi "namespace". 177 | % In the second \map sequence the url and urldate fields are cleared if a doi field is present, to mimic the behavior in the first part of the original question. 178 | \DeclareSourcemap{ 179 | \maps[datatype=bibtex]{ 180 | \map{ 181 | \step[ % copies url to doi field if it starts with http://dx.doi.org/ 182 | fieldsource=url, 183 | match=\regexp{http://dx.doi.org/(.+)}, 184 | fieldtarget=doi, 185 | ] 186 | \step[ % removes http://dx.doi.org/ string from doi field 187 | fieldsource=doi, 188 | match=\regexp{http://dx.doi.org/(.+)}, 189 | replace=\regexp{$1} 190 | ] 191 | } 192 | \map{ % removes url + urldate field from all entries that have a doi field 193 | \step[fieldsource=doi, final] 194 | \step[fieldset=url, null] 195 | \step[fieldset=urldate, null] 196 | } 197 | } 198 | } 199 | 200 | % 汉化 figure 和 table 环境 201 | \if@AJ@traditional 202 | \renewcommand{\figurename}{圖} 203 | \renewcommand{\tablename}{表} 204 | \else 205 | \renewcommand{\figurename}{图} 206 | \renewcommand{\tablename}{表} 207 | \fi 208 | 209 | % 汉化 figure 和 table 索引 210 | \if@AJ@traditional 211 | \renewcommand{\listfigurename}{圖片索引} 212 | \renewcommand{\listtablename}{表格索引} 213 | \else 214 | \renewcommand{\listfigurename}{图片索引} 215 | \renewcommand{\listtablename}{表格索引} 216 | \fi 217 | 218 | % 将 figure 和 table 索引加入目录: 使用 etoolbox 提供的 patching 219 | \pretocmd{\listoffigures}{% 220 | \cleardoublepage 221 | \phantomsection 222 | \addcontentsline{toc}{chapter}{\listfigurename} 223 | }{}{} 224 | \pretocmd{\listoftables}{% 225 | \cleardoublepage 226 | \phantomsection 227 | \addcontentsline{toc}{chapter}{\listtablename} 228 | }{}{} 229 | 230 | % 输入字体设置 231 | \input{\@AJ@fontsetup} 232 | % 输入章节标题设置 233 | \input{\@AJ@titlesetup} 234 | 235 | % 设置习题环境, 置于每章最后: 不用 \section* 以免格式混淆 236 | \if@AJ@traditional 237 | \newenvironment{Exercises}{% 238 | \markright{習題} 239 | \addcontentsline{toc}{section}{習題} 240 | \vspace{1em}\begin{center} 241 | \Large\CJKfamily{sectionfont} 習題 242 | \end{center}\vspace{0.7em} 243 | \begin{small}\begin{enumerate}[\bfseries 1.] % 244 | }{ % 结束 245 | \end{enumerate}\end{small} 246 | } 247 | \else 248 | \newenvironment{Exercises}{% 249 | \markright{习题} 250 | \addcontentsline{toc}{section}{习题} 251 | \vspace{1em}\begin{center} 252 | \Large\CJKfamily{sectionfont} 习题 253 | \end{center}\vspace{0.7em} 254 | \begin{small}\begin{enumerate}[\bfseries 1.] % 255 | }{ % 结束 256 | \end{enumerate}\end{small} 257 | } 258 | \fi 259 | 260 | % 习题提示 (定义为环境, 穿插文中) 261 | \newenvironment{hint}{% 262 | \ifvmode % 用 \ifvmode 测试: 如果提示另起新段, 则不加空白. 263 | \ignorespaces % 消除横向空白, 优于 \unskip 264 | \else 265 | \quad % 否则加入空白. 266 | \fi 267 | \begin{tikzpicture}[baseline=(H.base), every node/.style={signal, draw, very thin, signal to=east, signal from=nowhere, signal pointer angle=120, inner sep=2pt}] 268 | \node[anchor=mid west] (H) at (0,0) {\heiti\footnotesize 提示}; 269 | \end{tikzpicture} 270 | }{} 271 | 272 | % 每章开头的学习提示 (定义为环境) 273 | \if@AJ@traditional 274 | \newtcolorbox{wenxintishi}{ 275 | breakable, 276 | enhanced, 277 | width = \textwidth, 278 | colback = white, colbacktitle = white, 279 | colframe = gray!50, boxrule=0.2mm, 280 | coltitle = black, 281 | fonttitle = \sffamily, 282 | attach boxed title to top left = {yshift=-\tcboxedtitleheight/2, xshift=\tcboxedtitlewidth/4}, 283 | boxed title style = {boxrule=0pt, colframe=white}, 284 | before skip = 0.5cm, 285 | top = 3mm, 286 | bottom = 3mm, 287 | title={閱讀提示} 288 | } 289 | \else 290 | \newtcolorbox{wenxintishi}{ 291 | breakable, 292 | enhanced, 293 | width = \textwidth, 294 | colback = white, colbacktitle = white, 295 | colframe = gray!50, boxrule=0.2mm, 296 | coltitle = black, 297 | fonttitle = \sffamily, 298 | attach boxed title to top left = {yshift=-\tcboxedtitleheight/2, xshift=\tcboxedtitlewidth/4}, 299 | boxed title style = {boxrule=0pt, colframe=white}, 300 | before skip = 0.5cm, 301 | top = 3mm, 302 | bottom = 3mm, 303 | title={阅读提示} 304 | } 305 | \fi 306 | 307 | \AtEndPreamble{ 308 | \RequirePackage[thmmarks, amsmath, hyperref]{ntheorem} % 设置定理环境所需 309 | 310 | % 若 hyperref 已载入, 则按 colors 的 Bool 值设置链接色彩. 311 | \@ifpackageloaded{hyperref}{ 312 | \if@AJ@colors 313 | \hypersetup{ 314 | colorlinks = true, 315 | linkcolor = blue, 316 | citecolor = red, 317 | urlcolor = teal} 318 | \else 319 | \hypersetup{hidelinks} 320 | \fi} 321 | {} 322 | 323 | % 设置页面尺寸 324 | \RequirePackage{geometry} 325 | \IfStrEq{\@AJ@geometry}{b5}{% 载入 b5 版面设置 326 | \geometry{ 327 | paper=b5paper, 328 | headheight=5ex, 329 | headsep=5ex, 330 | textwidth=132mm, 331 | textheight=198mm, 332 | twoside, 333 | % bindingoffset=18pt, 334 | asymmetric % 单双数页不分 335 | }}{} 336 | 337 | \IfStrEq{\@AJ@geometry}{a4}{% 载入 a4 版面设置 338 | \geometry{ 339 | paper=a4paper, 340 | top=3cm, 341 | inner=2.54cm, 342 | outer=2.54cm, 343 | bottom=3cm, 344 | headheight=6ex, 345 | headsep=6ex, 346 | twoside, 347 | asymmetric 348 | }}{} 349 | 350 | % 设置天眉所需 351 | \RequirePackage{fancyhdr} 352 | % 使空页恒空 353 | \fancypagestyle{plain}{ 354 | \fancyhead{} 355 | \renewcommand{\headrulewidth}{0pt} 356 | } 357 | 358 | % 设置天眉 359 | \pagestyle{fancy} 360 | \if@AJ@CJKthechapter 361 | \renewcommand{\chaptermark}[1]{\markboth{ 362 | 第\CJKnumber{\thechapter}章\quad #1 363 | }{}} 364 | \else 365 | \renewcommand{\chaptermark}[1]{\markboth{ 366 | 第 \thechapter 章\quad #1 367 | }{}} 368 | \fi 369 | \renewcommand{\sectionmark}[1]{\markright{\S\arabic{chapter}.\arabic{section} \quad #1}} 370 | \fancyhf{} % 先清空 371 | \fancyhead[EC]{\CJKfamily{hei2}\footnotesize{\leftmark}\vspace{1mm}} 372 | \fancyhead[OC]{\CJKfamily{hei2}\footnotesize{\rightmark}\vspace{1mm}} 373 | \fancyhead[LE,RO]{{\footnotesize \thepage}\vspace{1mm}} % 374 | \fancyhead[RE,LO]{} 375 | \if@AJ@draftmark 376 | \fancyfoot[C]{\@AJ@draftstring} % 在 draftmark=true 时打印版本信息 377 | \fi 378 | \renewcommand{\headrulewidth}{0pt} % 天眉暂不加横线 379 | \renewcommand{\footrulewidth}{0pt} 380 | \addtolength{\headheight}{0.5pt} 381 | } 382 | 383 | \AtBeginDocument{ 384 | % 重置 \Re, \Im, \emptyset. 由于可能用到 unicode-math, 这必须在 \begin{document} 后进行. 385 | \renewcommand{\Re}{\operatorname{Re}} 386 | \renewcommand{\Im}{\operatorname{Im}} 387 | \renewcommand{\emptyset}{\ensuremath{\varnothing}} 388 | 389 | \newcommand{\openbox}{\leavevmode % 复制 amsthm 的 QED 符号: 空心方格 390 | \hbox to.77778em{% 391 | \hfil\vrule 392 | \vbox to.675em{\hrule width.6em\vfil\hrule}% 393 | \vrule\hfil}} 394 | 395 | \theorembodyfont{\fangsong} % 以下用 ntheorem 定义定理等环境 396 | \theoremheaderfont{\sffamily\bfseries\thmheiti} % 须与 \setsansfont 选择的字体兼容 397 | \theoremseparator{\ } 398 | \setlength{\theorempreskipamount}{2mm} 399 | \setlength{\theorempostskipamount}{2mm} 400 | 401 | \if@AJ@traditional 402 | \newtheorem{theorem}{定理}[section] % 按section编号 403 | \newtheorem{corollary}[theorem]{推論} 404 | \newtheorem{lemma}[theorem]{引理} 405 | \newtheorem{proposition}[theorem]{命題} 406 | \newtheorem{definition}[theorem]{定義} 407 | \newtheorem{definition-theorem}[theorem]{定義--定理} 408 | \newtheorem{definition-proposition}[theorem]{定義--命題} 409 | \newtheorem{hypothesis}[theorem]{假設} 410 | \newtheorem{conjecture}[theorem]{猜想} 411 | 412 | \theorembodyfont{\songti} 413 | \newtheorem{example}[theorem]{例} 414 | \newtheorem{remark}[theorem]{注記} 415 | \newtheorem{convention}[theorem]{約定} 416 | \newtheorem{exercise}[theorem]{練習} % 穿插于文中的习题 417 | 418 | \theorembodyfont{} 419 | \theoremstyle{nonumberplain} 420 | \theoremheaderfont{\sffamily\bfseries\CJKfamily{pffont}} 421 | \theoremseparator{\enspace} 422 | \theoremsymbol{\openbox} % 模拟标准的 Proof 环境 423 | \newtheorem{proof}{證明} 424 | \else 425 | \newtheorem{theorem}{定理}[section] % 按section编号 426 | \newtheorem{corollary}[theorem]{推论} 427 | \newtheorem{lemma}[theorem]{引理} 428 | \newtheorem{proposition}[theorem]{命题} 429 | \newtheorem{definition}[theorem]{定义} 430 | \newtheorem{definition-theorem}[theorem]{定义--定理} 431 | \newtheorem{definition-proposition}[theorem]{定义--命题} 432 | \newtheorem{hypothesis}[theorem]{假设} 433 | \newtheorem{conjecture}[theorem]{猜想} 434 | 435 | \theorembodyfont{\songti} 436 | \newtheorem{example}[theorem]{例} 437 | \newtheorem{remark}[theorem]{注记} 438 | \newtheorem{convention}[theorem]{约定} 439 | \newtheorem{exercise}[theorem]{练习} % 穿插于文中的习题 440 | 441 | \theorembodyfont{} 442 | \theoremstyle{nonumberplain} 443 | \theoremheaderfont{\sffamily\bfseries\CJKfamily{pffont}} 444 | \theoremseparator{\enspace} 445 | \theoremsymbol{\openbox} % 模拟标准的 Proof 环境 446 | \newtheorem{proof}{证明} 447 | \fi 448 | } 449 | 450 | \AtEndDocument{ 451 | } 452 | -------------------------------------------------------------------------------- /Template-AJbook.tex: -------------------------------------------------------------------------------- 1 | %!TEX TS-program = xelatex 2 | %!TEX encoding = UTF-8 3 | 4 | % Template for the class file AJbook, originally designed for Chinese book ``代数学方法''. 5 | % Copyright 2018 李文威 (Wen-Wei Li). 6 | % Permission is granted to copy, distribute and/or modify this 7 | % document under the terms of the Creative Commons 8 | % Attribution 4.0 International (CC BY 4.0) 9 | % http://creativecommons.org/licenses/by/4.0/ 10 | 11 | % 使用自定义的文档类 AJbook.cls. 自动载入 xeCJK. 需要额外档案如下: 12 | % font-setup-open.tex, coverpage.tex, titles-setup.tex, mycommand.sty, myarrows.sty 13 | % 文档类选项 (key/val 格式): 14 | % draftmark = true (未定稿, 底部显示日期) 或 false (成品), 默认 false, 15 | % colors = true (链接带颜色无框) 或 false (黑色无框), 默认 true, 16 | % traditional = true (繁体中文) 或 false (简体中文), 默认 false, 17 | % coverpage = 封面档档名, 默认为空 (此时不制作封面), 一般是 .tex 档, 若为 *.pdf 的形式则直接引入 PDF 页面. 18 | % fontsetup = 字体设置档档名, 19 | % titlesetup = 章节格式设置档名. 20 | 21 | % 注意: 如果文中未使用 \cite 和 \index 命令, 则可能报错. 22 | 23 | % 需动用 imakeidx + xindy (两份索引), biblatex + biber (书目). 24 | % 索引用土法进行中文排序: 如 \index{zhongwen@中文} 等. 25 | \documentclass[ 26 | draftmark = true, % 草稿模式下, 每页底部将打印相关版本信息. 27 | % traditional = true, 28 | % colors = false, 29 | % coverpage = coverpage.tex, 30 | % coverpage = coverpage.pdf, 31 | % geometry = b5, % 版面设置, 目前仅容许 a4, b5, 默认 b5, 其它字串则不作自动设置. 32 | fontsetup = font-setup-open.tex, 33 | titlesetup = titles-setup.tex 34 | ]{AJbook} 35 | 36 | % 可以修改章节编号的深度 37 | % \setcounter{secnumdepth}{3} 38 | 39 | % 必要时仅引入部分档案 40 | % \includeonly{} 41 | 42 | % 生成索引: 选用 xindy + imakeidx 43 | \usepackage[xindy, splitindex]{imakeidx} 44 | \makeindex[ 45 | columns=2, 46 | program=truexindy, 47 | intoc=true, 48 | options=-M texindy -I xelatex -C utf8, 49 | title={名词索引}] % 名词索引 50 | 51 | \usepackage[unicode, bookmarksnumbered]{hyperref} % 启动超链接和 PDF 文档信息所需 52 | % 设置 PDF 文件信息 53 | \hypersetup{ 54 | pdfauthor = {李文威 (Wen-Wei Li)}, 55 | pdftitle = {AJbook 文档类模板}, 56 | pdfkeywords = {Template}, 57 | CJKbookmarks = true} 58 | 59 | % 用 bibLaTeX 生成参考文献, 作为示例, 这里引入的是 Al-jabr.bib. 60 | % 载入书目库: 文档类业已引入 biblatex + biber 61 | \addbibresource{Al-jabr.bib} 62 | 63 | % 增加表格高度 64 | \renewcommand*\arraystretch{1.5} 65 | 66 | % 自订公式的编号 (非必要) 67 | \numberwithin{equation}{section} 68 | \renewcommand{\theequation}{\thesection--\arabic{equation}} 69 | 70 | % 自订 figure 的编号 (非必要) 71 | %\numberwithin{figure}{section} 72 | %\renewcommand{\thefigure}{\thechapter--\arabic{figure}} 73 | 74 | % 自订 table 的编号 (非必要) 75 | %\numberwithin{table}{section} 76 | %\renewcommand{\thetable}{\thechapter--\arabic{table}} 77 | 78 | \begin{document} 79 | \frontmatter % 制作封面和目录. 80 | % 注意: 为了简化, 本模板不含封面. 请通过文档类的参数进行设置. 81 | 82 | \mainmatter % 正文开始:逐章引入 TeX 代码 83 | 84 | \chapter*{导言} 85 | \section*{简要说明} 86 | \paragraph*{旨趣} 87 | 此模板的目的是演示文档类 \textsf{AJbook} 的基本用法. 顾名思义, \textsf{AJbook} 原来是为了《代数学方法》一书量身打造的文档类, 基于 \LaTeX 的标准类 \texttt{book}; 但在设计时容许了一定的弹性, 所以它也能够用来制作基础数学或物理领域的中文专业书籍. 字型和各章节的排版方式可以另外调整, 但为了简单起见, 本模板直接沿用《代数学方法》卷一的设置, 打开草稿模式, 并且不含封面. 88 | 89 | \paragraph*{附记} 90 | \begin{enumerate} 91 | \item 此文档类也支持繁体中文. 92 | \item 文章结构中的``部分''(由 \texttt{\textbackslash part} 命令产生), 各章最后的习题, 附录, 以及图/表索引并不是必要的, 放在这里只是作为演示. 93 | \item 以下内容仅作测试用途, 无其它意涵. 94 | \end{enumerate} 95 | 96 | \section*{致谢} 97 | 文档类是从头撰写的, 但排版方式受高等教育出版社的模板启发, 在此表示谢意. 98 | 99 | \vspace{1em} 100 | \begin{flushright}\begin{minipage}{0.3 \textwidth} 101 | \begin{tabular}{c} 102 | {\kaishu 李文威} \\ 103 | 2019 年元旦\\ 104 | 记于北大理教三层 105 | \end{tabular} 106 | \end{minipage}\end{flushright} 107 | 108 | % % % % % % % % % % 109 | \part{测试} 110 | \chapter{各种测试} 111 | 各章开头可有说明文字.\footnote{脚注测试} 视情况加入阅读提示. 112 | \begin{wenxintishi} 113 | 本章 \S\ref{sec:words} 的文字撷取自《明儒学案》, [清] 黄宗羲, 仅作测试之用. 来源于网络, 恐怕多有错漏, 请见谅. \index{huangzongxi@黄宗羲} 114 | \end{wenxintishi} 115 | 116 | \section{节 (section)} 117 | 关于数学词汇的汉译, 比较全面的参考书是 \cite{ZG}. 118 | \begin{theorem}[L.\ Euler] 119 | 以下结果是熟知的. 120 | \begin{equation}\label{eqn:zeta-2} 121 | \sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}. 122 | \end{equation} 123 | 当然, 公式的编号方式可以自订. 124 | \end{theorem} 125 | 126 | 文中可以穿插练习及其提示. 127 | \begin{exercise}\label{exo:Euler} 128 | 试补全公式 \eqref{eqn:zeta-2} 的证明. \begin{hint} 参看表 \ref{table:B}.\end{hint} 129 | \end{exercise} 130 | 131 | \begin{itemize} 132 | \item 已知的其它 $\zeta$ 值包括 $\zeta(4) = \pi^4/90$, $\zeta(6) = \pi^6/945$ 等等. 133 | \item 一般而言, 对所有正整数 $n$ 都有 134 | \begin{equation} 135 | \zeta(2n) = (-1)^{n+1} \underbracket{B_{2n}}_{\text{Bernoulli 数}} \frac{(2\pi)^{2n}}{2(2n)!}. 136 | \end{equation} 137 | 关于 Bernoulli 数\footnote{脚注再测试}, 请见 \S\ref{sec:B}. 138 | \end{itemize} 139 | 140 | 超链接测试: 请常用 \href{http://mathoverflow.net}{MathOverflow} 141 | 142 | \section{文字测试}\label{sec:words} 143 | 144 | 测试 \textsf{description} 环境如下: 145 | \begin{description} 146 | \item[明儒学案] 中国第一部完整的学术史著作 147 | \item[黄宗羲 (1610---1695)] 明末清初思想家、文学家。字太冲,号梨洲,又号南雷。 148 | \end{description} 149 | 150 | \subsection{子节 (subsection)} 151 | 以下测试定义, 定理, 证明等等, 以及文字加粗. 152 | 153 | \begin{definition} 154 | 盈天地皆心也,变化不测,不能不万殊。\emph{心无本体,工夫所至,即其本体},故穷理者,穷此心之万殊,非穷万物之万殊也。是以古之君子,宁凿五丁之间道,不假邯郸之野马,故其途亦不得不殊!奈何今之君子,必欲出於一途,使美厥灵根者,化为焦芽绝港。夫先儒之语录,人人不同,只是印我之心体,变动不居,若执定成局,终是受用不得。此无他,修德而后可讲学。今讲学而不修德,又何怪其举一而废百乎? 155 | \end{definition} 156 | 157 | \subsection*{无编号子节 (subsection*)} 158 | 无编号者不列入目录. 159 | \begin{proposition}[胡居仁] 160 | 胡居仁字叔心,饶之余干人也。学者称为敬斋先生。弱冠时奋志圣贤之学,往游康斋吴先生之门,遂绝意科举,筑室於梅溪山中,事亲讲学之外,不干人事。久之,欲广闻见,适闽历浙、入金陵,从彭蠡而返。所至访求问学之士,归而与乡人娄一斋、罗一峰、张东白为会於弋阳之龟峰、余干之应天寺。提学李龄、锺城相继请主白鹿书院。诸生又请讲学贵溪桐源书院。淮王闻之,请讲《易》於其府。王欲梓其诗文,先生辞曰:“尚需稍进。”先生严毅清苦,左绳右矩,每日必立课程,详书得失以自考,虽器物之微,区别精审,没齿不乱。 161 | \end{proposition} 162 | 163 | \subsubsection{次子节 (subsubsection)} 164 | 次子节默认不再编号. 如需编号, 请手动设置 \LaTeX 中标准的 \textsf{secnumdepth} 参数. 165 | 166 | \begin{lemma}[陈献章]\label{prop:chen} 167 | 有明之学,至白沙始入精微。其吃紧工夫,全在涵养。喜怒未发而非空,万感交集而不动,至阳明而后大。两先生之学,最为相近,不知阳明后来从不说起,其故何也?薛中离,阳明之高第弟子也,於正德十四年上疏请白沙从祀孔庙,是必有以知师门之学同矣。罗一峰曰:“白沙观天人之微,究圣贤之蕴,充道以富,崇德以贵,天下之物,可爱可求,漠然无动於其中。”信斯言也,故出其门者,多清苦自立,不以富贵为意,其高风之所激,远矣。 168 | \end{lemma} 169 | \begin{proof} 170 | 陈献章字公甫,新会之白沙里人。身长八尺,目光如星,右脸有七黑子,如北斗状。自幼警悟绝人,读书一览辄记。尝读《孟子》所谓天民者,慨然曰:“为人必当如此!”梦拊石琴,其音泠泠然,一人谓之曰:“八音中惟石难谐,子能谐此,异日其得道乎?”因别号石斋。正统十二年举广东乡试,明年会试中乙榜,入国子监读书。已至崇仁,受学於康斋先生,归即绝意科举,筑春阳台,静坐其中,不出阈外者数年。寻遭家难。成化二年,复游太学,祭酒邢让试和杨龟山《此日不再得》诗,见先生之作,惊曰:“即龟山不如也。”扬言於朝,以为真儒复出,由是名动京师。罗一峰、章枫山、庄定山、贺医闾皆恨相见之晚,医闾且禀学焉。归而门人益进。十八年,布政使彭韶、都御史朱英交荐,言“国以仁贤为宝,臣自度才德不及献章万万,臣冒高位,而令献章老丘壑,恐坐失社稷之宝”。召至京,阁大臣或尼之,令就试吏部。辞疾不赴,疏乞终养,授翰林院检讨而归。有言其出处与康斋异者,先生曰:“先师为石亨所荐,所以不受职;某以听选监生,始终愿仕,故不敢伪辞以钓虚誉,或受或不受,各有攸宜。”自后屡荐不起。弘治十三年二月十日卒,年七十有三。先生疾革,知县左某以医来,门人进曰:“疾不可为也。”先生曰:“须尽朋友之情。”饮一匙而遣之。 171 | \end{proof} 172 | 173 | \paragraph{段落 (paragraph)} 段落一般也不编号. 174 | \begin{corollary}[吕柟] 175 | 字仲木,号泾野,陕之高陵人。正德戊辰举进士第一,授翰林修撰。逆瑾以乡人致贺,却之,瑾不悦。已请上还宫中,御经筵,亲政事,益不为瑾所容,遂引去。瑾败,起原官。上疏劝学,危言以动之。乾清宫灾,应诏言六事:一、逐日临朝,二、还处宫寝,三、躬亲大祀,四、日朝两宫,五、遣去义子、番僧、边军,六、撤回镇守中官。皆武宗之荒政。不听,复引去。世庙即位,起原官。甲申以修省自劾,语涉大礼,下诏狱。降解州判官,不以迁客自解,摄守事,兴利除害若嗜欲。 176 | \end{corollary} 177 | \begin{proof} 178 | 未第时,即与崔仲凫讲於宝邛寺。正德末,家居筑东郭别墅,以会四方学者。别墅不能容,又筑东林书屋。镇守廖奄张甚,其使者过高陵,必诫之曰:“吕公在,汝不得作过也。”在解州建解梁书院,选民间俊秀,歌诗习礼。九载南都,与湛甘泉邹东廓共主讲席,东南学者,尽出其门。尝道上党,隐士仇栏遮道问学。有梓人张提闻先生讲,自悟其非,曾妄取人物,追还主者。先生因为诗云:“岂有征夫能过化,雄山村里似尧时。”朝鲜国闻先生名,奏谓其文为式国中。先生之学,以格物为穷理。及先知而后行,皆是儒生所习闻。而先生所谓穷理,不是泛常不切於身,只在语默作止处验之;所谓知者,即从闻见之知,以通德性之知,但事事不放过耳。大概工夫,下手明白,无从躲闪也。 179 | \end{proof} 180 | 181 | \begin{remark} 182 | 诸生有言及气运如何,外边人事如何者。曰:“\emph{此都是怨天尤人的心术}。但自家修为,成得个片段,若见用,则百姓受些福;假使不用,与乡党朋友论些学术,化得几人,都是事业,正所谓畅於四肢,发於事业也,何必有官做,然后有事业。” 183 | \end{remark} 184 | 185 | \section{字体和大小} 186 | 自带的设定档中定义了中文排版常用的几种字体命令, 可以手动切换. 如表 \ref{table:ziti}. 187 | \begin{table}[h!] 188 | \begin{tabular}{ll} 189 | \texttt{\textbackslash heiti} & {\heiti 黑体} \\ 190 | \texttt{\textbackslash songti} & {\songti 宋体} \\ 191 | \texttt{\textbackslash kaishu} & {\kaishu 楷体} \\ 192 | \texttt{\textbackslash fangsong} & {\fangsong 仿宋} 193 | \end{tabular} 194 | \caption{几种字体命令} \label{table:ziti} 195 | \end{table} 196 | 197 | \emph{注意}: \LaTeX 的精神是尽量让作者专注于内容, 外观则留给模板. 频繁地手动切换字体不是个好主意. 198 | 199 | 字体大小由标准命令控制, 如表 \ref{table:ziti-size} 所示. 200 | 201 | \begin{table}[h!] 202 | \begin{tabular}{ll} 203 | \texttt{\textbackslash tiny} & {\tiny 极高明而道中庸} \\ 204 | \texttt{\textbackslash scriptsize} & {\scriptsize 极高明而道中庸} \\ 205 | \texttt{\textbackslash footnotesize} & {\footnotesize 极高明而道中庸} \\ 206 | \texttt{\textbackslash small} & {\small 极高明而道中庸} \\ 207 | \texttt{\textbackslash normalsize} & {\normalsize 极高明而道中庸} \\ 208 | \texttt{\textbackslash large} & {\large 极高明而道中庸} \\ 209 | \texttt{\textbackslash Large} & {\Large 极高明而道中庸} \\ 210 | \texttt{\textbackslash LARGE} & {\LARGE 极高明而道中庸} \\ 211 | \texttt{\textbackslash huge} & {\huge 极高明而道中庸} \\ 212 | \texttt{\textbackslash Huge} & {\Huge 极高明而道中庸} 213 | \end{tabular} 214 | \caption{字体大小效果} \label{table:ziti-size} 215 | \end{table} 216 | 217 | \section{图片} 218 | 219 | 本模板采用\emph{知识共享}署名 4.0 国际许可协议进行许可. 点击\href{http://creativecommons.org/licenses/by/4.0/}{链接}查看该许可协议. 220 | \begin{figure}[h!]\begin{center} 221 | \includegraphics{ccby.png} 222 | \caption{许可协议图片} 223 | \end{center}\end{figure} 224 | 225 | \section{混排公式 \texorpdfstring{$e^{i\theta} = \cos\theta + i\sin\theta$}{exp itheta = cos theta + isin theta}} 226 | 西文按寻常方式进行排版. 227 | \begin{quote} 228 | La connaissance de la misère humaine est difficile au riche, au puissant, parce qu'il est presque invinciblement porté à croire qu'il est quelque chose. Elle est également difficile au misérable parce qu'il est presque invinciblement porté à croire que le riche, le puissant est quelques chose. 229 | 230 | \begin{flushright}\textit{La Pesanteur et la grâce}, Simone Weil\end{flushright} 231 | \end{quote} 232 | 233 | 每章最后可以集中安排习题. 234 | \begin{Exercises} 235 | \item 试证...... 236 | \begin{hint} 237 | 请自己做. 238 | \end{hint} 239 | \item 试说明在一般的环 $R$ 中 240 | \begin{enumerate} 241 | \item 对所有 $x, y \in R$ 皆有 $x + y = y + x$; 242 | \item 但一般而言 243 | \[ xy \neq yx. \] 244 | \end{enumerate} 245 | \end{Exercises} 246 | 247 | % % % % % % % % % % 248 | \part{更多测试} 249 | \chapter[短章名]{这是一个充分长的章名, 强势占用三行没商量.} 250 | 如果章名过长, 可以在目录和天眉以另外设置的短章名显示, 方式和 \LaTeX 的标准文档类 \textsf{book} 相同. 251 | 252 | \section{长度正常的节名} 253 | 复数 $\tau$ 的虚部记为 $\Im(\tau)$. 自然对数记为 $\log$. 254 | 255 | \begin{convention}\index{Dedeking $\eta$ 函数} 256 | 本节记 Poincaré 上半平面为 257 | \[ \mathcal{H} := \left\{ \tau \in \mathbb{C}: \Im(\tau) > 0 \right\}. \] 258 | 按例记 $q := e^{2\pi i \tau}$. \emph{Dedekind $\eta$ 函数}定义为无穷乘积 259 | \[ \eta(\tau) := e^{2\pi i \tau/24} \prod_{n=1}^\infty (1 - q^n), \quad \tau \in \mathcal{H}. \] 260 | \end{convention} 261 | 由分析学常识易见此无穷乘积绝对收敛. 进一步, $\eta$ 在 $\mathcal{H}$ 上全纯无零点; 此外 $\eta$ 的对数导数为 262 | \[ \frac{\mathrm{d}}{\mathrm{d}\tau} \log \eta (\tau) := \frac{\eta'(\tau)}{\eta(\tau)} = \frac{\pi i}{12} - 2\pi i \sum_{n=1}^\infty \frac{n q^n}{1 - q^n}. \] 263 | 264 | \begin{example} 265 | 在右半复平面上定义 $\sqrt{z} := \exp(\log|z| + i\arg(z))$, 其中幅角取 $\arg(z) \in \left[-\frac{\pi}{2}, \frac{\pi}{2}\right]$. 则 266 | \[ \eta\left( \frac{-1}{\tau} \right) = \sqrt{-i\tau} \cdot \eta(\tau), \quad \tau \in \mathcal{H}. \] 267 | \end{example} 268 | \begin{proof} 269 | 应用 Eisenstein 级数 $E_2$ 的性质, 将对数导数 $\frac{\mathrm{d}}{\mathrm{d} \tau} \log\eta(\tau)$ 整理为 270 | \begin{multline*} 271 | \frac{\pi i}{12} - 2\pi i \sum_{d \geq 1} \frac{dq^d}{1- q^d} = \frac{\pi i}{12} - 2\pi i \sum_{d \geq 1} \sum_{k \geq 1} d q^{dk} \\ 272 | \stackrel{n := dk}{=} \frac{\pi i}{12} - 2\pi i \sum_{n \geq 1} \sigma_1(n) q^n = \dfrac{\pi i}{12} \cdot E_2(\tau), 273 | \end{multline*} 274 | 若改为对 $\tau \mapsto \eta(\frac{-1}{\tau})$ 求对数导数, 再应用 $E_2$ 的函数方程, 产物则是 275 | \[ \tau^{-2} \cdot \frac{\pi i}{12} \cdot E_2\left(\frac{-1}{\tau}\right) = \frac{\pi i}{12} \left(E_2(\tau) + \frac{12}{2\pi i \tau} \right). \] 276 | 对 $\sqrt{-i\tau}$ 求对数导数给出 $\frac{1}{2} \frac{\mathrm{d}}{\mathrm{d}\tau} \log(-i\tau) = \dfrac{1}{2\tau} = \dfrac{\pi i}{12} \cdot \dfrac{12}{2 \pi i \tau}$. 与上式对比即见 277 | \begin{align*} 278 | \frac{\mathrm{d}}{\mathrm{d} \tau} \log \eta\left( \frac{-1}{\tau} \right) & = \frac{\mathrm{d}}{\mathrm{d} \tau} \log \sqrt{-i\tau} + \frac{\mathrm{d}}{\mathrm{d} \tau} \log \eta(\tau) \\ 279 | & = \frac{\mathrm{d}}{\mathrm{d} \tau} \log \left( \sqrt{-i\tau} \cdot \eta(\tau) \right). 280 | \end{align*} 281 | 故存在 $c \in \mathbb{C}^\times$ 使得 $\eta\left(\frac{-1}{\tau}\right) = c \sqrt{-i\tau} \cdot \eta(\tau)$; 因为 $\eta(i) \neq 0$, 代入 $\tau = i$ 可知 $c = 1$. 282 | \end{proof} 283 | 284 | 著名的 Euler 五边形数定理写作 \index{wubianxingshudingli@五边形数定理 (pentagonal number theorem)} 285 | \begin{equation}\label{eqn:pentagonal-number} 286 | \sum_{n \in \mathbb{Z}} (-1)^n q^{(3n^2 + n)/2} = \prod_{n \geq 1} (1 - q^n); 287 | \end{equation} 288 | 留意到 $3n^2 + n \equiv 0 \pmod 2$ 恒成立. 将 $\frac{3n^2 + n}{2} = \frac{(6n+1)^2 - 1}{24}$ 代入 \eqref{eqn:pentagonal-number}, 即可导出 $\eta$ 的 Fourier 展开 289 | \begin{equation*} 290 | \eta(\tau) = \sum_{n \in \mathbb{Z}} (-1)^n q^{ \frac{1}{24} \cdot (6n + 1)^2}, \quad q^{1/24} := e^{2\pi i \tau /24}. 291 | \end{equation*} 292 | 293 | \section[短节名]{ 294 | 四十男儿学干谒,朝游江淮暮吴越。漫将衣食累朱门,讵有文章动金阙。 295 | 倦游屡岁赋归欤,故人相值还唏嘘。劝我莫作千里客,留我共读三冬书。 296 | 忆别吴阊一年久,为我糟床压春酒。入座争迎作赋才,当筵更觅弹筝手。 297 | 酒酣慷慨唤奈何,风光一往如流波。女坟湖北莺犹少,短簿祠南雨正多。 298 | 君家奇书一千轴,锦袱牙签光历碌。愿随潘左伴青缃,羞与金张斗华毂。 299 | 嗟余短鬓日苍浪,太息忧来未可忘。鼓挝马槊差亦得,若问读书非我长。} 300 | 原诗作者: [清] 陈维崧. 301 | 302 | 不鼓励使用过长的节名. 同样地, 可以在目录和天眉以另外设置的短节名显示, 方式和 \LaTeX 的标准文档类 \textsf{book} 相同. 303 | 304 | 图片取自 \href{https://commons.wikimedia.org}{Wikimedia Commons}, 经过适当加工. 305 | \begin{figure}[h!]\begin{center} 306 | \includegraphics[width=0.5\textwidth]{Lanzhou.png} 307 | \caption{兰州市地图} 308 | \end{center}\end{figure} 309 | 310 | \begin{Exercises} 311 | \item 造访兰州. \begin{hint} 低碳出行, 请乘坐火车. \end{hint} 312 | \item 造访祁连山. 313 | \end{Exercises} 314 | 315 | % % % % % % % % % % 316 | \appendix 317 | \chapter{杂项 \texorpdfstring{$a+b$}{a+b}} 318 | 按惯例, 附录以字母编号. 319 | 320 | \section{文字测试} 321 | 龚自珍, \emph{乙亥杂诗}: 322 | \begin{enumerate} 323 | \item 其一 324 | \begin{center} 325 | 掌故罗胸是国恩,小胥脱腕万言存。\\ 326 | 他年金匮如收采,来叩空山夜雨门。 327 | \end{center} 328 | \item 其二 329 | \begin{center} 330 | 九州生气恃风雷,万马齐喑究可哀。\\ 331 | 我劝天公重抖擞,不拘一格降人才。 332 | \end{center} 333 | \item 其三 334 | \begin{center} 335 | 吟罢江山气不灵,万千种话一灯青。\\ 336 | 忽然搁笔无言说,重礼天台七卷经。 337 | \end{center} 338 | \end{enumerate} \index{gongzizhen@龚自珍} 339 | 340 | \begin{definition-theorem}[龚自珍] 341 | 《己卯京师作杂诗二首》: 342 | \begin{center} 343 | 文格渐卑庸福近,不知庸福究何如? \\ 344 | 常州庄四能怜我,劝我狂删乙丙书。 345 | \end{center} 346 | \end{definition-theorem} 347 | 348 | 交叉参照: 引理 \ref{prop:chen}. 349 | 350 | \section{测试: \texorpdfstring{$B_n(X)$}{BnX}}\label{sec:B} 351 | 首先介绍 Bernoulli 多项式. 多项式变元记为 $X$. 352 | \begin{definition-proposition}\index{Bernoulli 多项式 (Bernoulli polynomials)} 353 | \emph{Bernoulli 多项式} $B_n(X) \in \mathbb{Q}[X]$ 由生成函数 354 | \begin{equation} 355 | \frac{t e^{tX}}{e^t - 1} = \sum_{n \geq 0} B_n(X) \cdot \frac{t^n}{n!} \; \in \mathbb{Q}[X][\![t]\!] 356 | \end{equation} 357 | 确定. 称 $B_n := B_n(0)$ 为第 $n$ 个 \emph{Bernoulli 数}. 358 | \end{definition-proposition} 359 | 360 | \subsection{一张表格} 361 | 以下来测试表格. 362 | 363 | \begin{table}[h!] 364 | \begin{equation*}\begin{array}{c|cccccccc} 365 | n & 0 & 1 & 2 & 4 & 6 & 8 & 10 & 12 \\ \hline 366 | B_n & 1 & -\frac{1}{2} & \frac{1}{6} & -\frac{1}{30} & \frac{1}{42} & -\frac{1}{30} & \frac{5}{66} & \frac{-691}{2730} 367 | \end{array}\end{equation*} 368 | \caption{前几个 Bernoulli 常数.} 369 | \label{table:B} 370 | \end{table} 371 | 交叉参照: 练习 \ref{exo:Euler}. 372 | 373 | \begin{conjecture}[周恩来, 1917]\index{zhouenlai@周恩来} 374 | 大江歌罢掉头东,邃密群科济世穷。面壁十年图破壁,难酬蹈海亦英雄。 375 | \end{conjecture} 376 | 377 | \begin{hypothesis} 378 | Riemann $\zeta$ 函数的非平凡零点全在 $\Re(s) = \frac{1}{2}$ 上. 379 | \end{hypothesis} 380 | 381 | 引用测试: \cite{Oxl11, ZG} 382 | 383 | % % % % % % % % % % 384 | \backmatter 385 | % 使用 bibLaTeX 制作书目 386 | \printbibliography[heading=bibintoc] 387 | 388 | % 图, 表索引. 可有可无. 389 | \listoffigures 390 | \listoftables 391 | 392 | % 制作索引 (用 imakeidx 的功能可以制作多份) 393 | {\footnotesize 394 | \indexprologue{中文术语按汉语拼音排序.} 395 | \printindex} 396 | \end{document} 397 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Attribution 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More_considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution 4.0 International Public License 58 | 59 | By exercising the Licensed Rights (defined below), You accept and agree 60 | to be bound by the terms and conditions of this Creative Commons 61 | Attribution 4.0 International Public License ("Public License"). To the 62 | extent this Public License may be interpreted as a contract, You are 63 | granted the Licensed Rights in consideration of Your acceptance of 64 | these terms and conditions, and the Licensor grants You such rights in 65 | consideration of benefits the Licensor receives from making the 66 | Licensed Material available under these terms and conditions. 67 | 68 | 69 | Section 1 -- Definitions. 70 | 71 | a. Adapted Material means material subject to Copyright and Similar 72 | Rights that is derived from or based upon the Licensed Material 73 | and in which the Licensed Material is translated, altered, 74 | arranged, transformed, or otherwise modified in a manner requiring 75 | permission under the Copyright and Similar Rights held by the 76 | Licensor. For purposes of this Public License, where the Licensed 77 | Material is a musical work, performance, or sound recording, 78 | Adapted Material is always produced where the Licensed Material is 79 | synched in timed relation with a moving image. 80 | 81 | b. Adapter's License means the license You apply to Your Copyright 82 | and Similar Rights in Your contributions to Adapted Material in 83 | accordance with the terms and conditions of this Public License. 84 | 85 | c. Copyright and Similar Rights means copyright and/or similar rights 86 | closely related to copyright including, without limitation, 87 | performance, broadcast, sound recording, and Sui Generis Database 88 | Rights, without regard to how the rights are labeled or 89 | categorized. For purposes of this Public License, the rights 90 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 91 | Rights. 92 | 93 | d. Effective Technological Measures means those measures that, in the 94 | absence of proper authority, may not be circumvented under laws 95 | fulfilling obligations under Article 11 of the WIPO Copyright 96 | Treaty adopted on December 20, 1996, and/or similar international 97 | agreements. 98 | 99 | e. Exceptions and Limitations means fair use, fair dealing, and/or 100 | any other exception or limitation to Copyright and Similar Rights 101 | that applies to Your use of the Licensed Material. 102 | 103 | f. Licensed Material means the artistic or literary work, database, 104 | or other material to which the Licensor applied this Public 105 | License. 106 | 107 | g. Licensed Rights means the rights granted to You subject to the 108 | terms and conditions of this Public License, which are limited to 109 | all Copyright and Similar Rights that apply to Your use of the 110 | Licensed Material and that the Licensor has authority to license. 111 | 112 | h. Licensor means the individual(s) or entity(ies) granting rights 113 | under this Public License. 114 | 115 | i. Share means to provide material to the public by any means or 116 | process that requires permission under the Licensed Rights, such 117 | as reproduction, public display, public performance, distribution, 118 | dissemination, communication, or importation, and to make material 119 | available to the public including in ways that members of the 120 | public may access the material from a place and at a time 121 | individually chosen by them. 122 | 123 | j. Sui Generis Database Rights means rights other than copyright 124 | resulting from Directive 96/9/EC of the European Parliament and of 125 | the Council of 11 March 1996 on the legal protection of databases, 126 | as amended and/or succeeded, as well as other essentially 127 | equivalent rights anywhere in the world. 128 | 129 | k. You means the individual or entity exercising the Licensed Rights 130 | under this Public License. Your has a corresponding meaning. 131 | 132 | 133 | Section 2 -- Scope. 134 | 135 | a. License grant. 136 | 137 | 1. Subject to the terms and conditions of this Public License, 138 | the Licensor hereby grants You a worldwide, royalty-free, 139 | non-sublicensable, non-exclusive, irrevocable license to 140 | exercise the Licensed Rights in the Licensed Material to: 141 | 142 | a. reproduce and Share the Licensed Material, in whole or 143 | in part; and 144 | 145 | b. produce, reproduce, and Share Adapted Material. 146 | 147 | 2. Exceptions and Limitations. For the avoidance of doubt, where 148 | Exceptions and Limitations apply to Your use, this Public 149 | License does not apply, and You do not need to comply with 150 | its terms and conditions. 151 | 152 | 3. Term. The term of this Public License is specified in Section 153 | 6(a). 154 | 155 | 4. Media and formats; technical modifications allowed. The 156 | Licensor authorizes You to exercise the Licensed Rights in 157 | all media and formats whether now known or hereafter created, 158 | and to make technical modifications necessary to do so. The 159 | Licensor waives and/or agrees not to assert any right or 160 | authority to forbid You from making technical modifications 161 | necessary to exercise the Licensed Rights, including 162 | technical modifications necessary to circumvent Effective 163 | Technological Measures. For purposes of this Public License, 164 | simply making modifications authorized by this Section 2(a) 165 | (4) never produces Adapted Material. 166 | 167 | 5. Downstream recipients. 168 | 169 | a. Offer from the Licensor -- Licensed Material. Every 170 | recipient of the Licensed Material automatically 171 | receives an offer from the Licensor to exercise the 172 | Licensed Rights under the terms and conditions of this 173 | Public License. 174 | 175 | b. No downstream restrictions. You may not offer or impose 176 | any additional or different terms or conditions on, or 177 | apply any Effective Technological Measures to, the 178 | Licensed Material if doing so restricts exercise of the 179 | Licensed Rights by any recipient of the Licensed 180 | Material. 181 | 182 | 6. No endorsement. Nothing in this Public License constitutes or 183 | may be construed as permission to assert or imply that You 184 | are, or that Your use of the Licensed Material is, connected 185 | with, or sponsored, endorsed, or granted official status by, 186 | the Licensor or others designated to receive attribution as 187 | provided in Section 3(a)(1)(A)(i). 188 | 189 | b. Other rights. 190 | 191 | 1. Moral rights, such as the right of integrity, are not 192 | licensed under this Public License, nor are publicity, 193 | privacy, and/or other similar personality rights; however, to 194 | the extent possible, the Licensor waives and/or agrees not to 195 | assert any such rights held by the Licensor to the limited 196 | extent necessary to allow You to exercise the Licensed 197 | Rights, but not otherwise. 198 | 199 | 2. Patent and trademark rights are not licensed under this 200 | Public License. 201 | 202 | 3. To the extent possible, the Licensor waives any right to 203 | collect royalties from You for the exercise of the Licensed 204 | Rights, whether directly or through a collecting society 205 | under any voluntary or waivable statutory or compulsory 206 | licensing scheme. In all other cases the Licensor expressly 207 | reserves any right to collect such royalties. 208 | 209 | 210 | Section 3 -- License Conditions. 211 | 212 | Your exercise of the Licensed Rights is expressly made subject to the 213 | following conditions. 214 | 215 | a. Attribution. 216 | 217 | 1. If You Share the Licensed Material (including in modified 218 | form), You must: 219 | 220 | a. retain the following if it is supplied by the Licensor 221 | with the Licensed Material: 222 | 223 | i. identification of the creator(s) of the Licensed 224 | Material and any others designated to receive 225 | attribution, in any reasonable manner requested by 226 | the Licensor (including by pseudonym if 227 | designated); 228 | 229 | ii. a copyright notice; 230 | 231 | iii. a notice that refers to this Public License; 232 | 233 | iv. a notice that refers to the disclaimer of 234 | warranties; 235 | 236 | v. a URI or hyperlink to the Licensed Material to the 237 | extent reasonably practicable; 238 | 239 | b. indicate if You modified the Licensed Material and 240 | retain an indication of any previous modifications; and 241 | 242 | c. indicate the Licensed Material is licensed under this 243 | Public License, and include the text of, or the URI or 244 | hyperlink to, this Public License. 245 | 246 | 2. You may satisfy the conditions in Section 3(a)(1) in any 247 | reasonable manner based on the medium, means, and context in 248 | which You Share the Licensed Material. For example, it may be 249 | reasonable to satisfy the conditions by providing a URI or 250 | hyperlink to a resource that includes the required 251 | information. 252 | 253 | 3. If requested by the Licensor, You must remove any of the 254 | information required by Section 3(a)(1)(A) to the extent 255 | reasonably practicable. 256 | 257 | 4. If You Share Adapted Material You produce, the Adapter's 258 | License You apply must not prevent recipients of the Adapted 259 | Material from complying with this Public License. 260 | 261 | 262 | Section 4 -- Sui Generis Database Rights. 263 | 264 | Where the Licensed Rights include Sui Generis Database Rights that 265 | apply to Your use of the Licensed Material: 266 | 267 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 268 | to extract, reuse, reproduce, and Share all or a substantial 269 | portion of the contents of the database; 270 | 271 | b. if You include all or a substantial portion of the database 272 | contents in a database in which You have Sui Generis Database 273 | Rights, then the database in which You have Sui Generis Database 274 | Rights (but not its individual contents) is Adapted Material; and 275 | 276 | c. You must comply with the conditions in Section 3(a) if You Share 277 | all or a substantial portion of the contents of the database. 278 | 279 | For the avoidance of doubt, this Section 4 supplements and does not 280 | replace Your obligations under this Public License where the Licensed 281 | Rights include other Copyright and Similar Rights. 282 | 283 | 284 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 285 | 286 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 287 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 288 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 289 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 290 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 291 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 292 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 293 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 294 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 295 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 296 | 297 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 298 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 299 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 300 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 301 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 302 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 303 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 304 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 305 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 306 | 307 | c. The disclaimer of warranties and limitation of liability provided 308 | above shall be interpreted in a manner that, to the extent 309 | possible, most closely approximates an absolute disclaimer and 310 | waiver of all liability. 311 | 312 | 313 | Section 6 -- Term and Termination. 314 | 315 | a. This Public License applies for the term of the Copyright and 316 | Similar Rights licensed here. However, if You fail to comply with 317 | this Public License, then Your rights under this Public License 318 | terminate automatically. 319 | 320 | b. Where Your right to use the Licensed Material has terminated under 321 | Section 6(a), it reinstates: 322 | 323 | 1. automatically as of the date the violation is cured, provided 324 | it is cured within 30 days of Your discovery of the 325 | violation; or 326 | 327 | 2. upon express reinstatement by the Licensor. 328 | 329 | For the avoidance of doubt, this Section 6(b) does not affect any 330 | right the Licensor may have to seek remedies for Your violations 331 | of this Public License. 332 | 333 | c. For the avoidance of doubt, the Licensor may also offer the 334 | Licensed Material under separate terms or conditions or stop 335 | distributing the Licensed Material at any time; however, doing so 336 | will not terminate this Public License. 337 | 338 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 339 | License. 340 | 341 | 342 | Section 7 -- Other Terms and Conditions. 343 | 344 | a. The Licensor shall not be bound by any additional or different 345 | terms or conditions communicated by You unless expressly agreed. 346 | 347 | b. Any arrangements, understandings, or agreements regarding the 348 | Licensed Material not stated herein are separate from and 349 | independent of the terms and conditions of this Public License. 350 | 351 | 352 | Section 8 -- Interpretation. 353 | 354 | a. For the avoidance of doubt, this Public License does not, and 355 | shall not be interpreted to, reduce, limit, restrict, or impose 356 | conditions on any use of the Licensed Material that could lawfully 357 | be made without permission under this Public License. 358 | 359 | b. To the extent possible, if any provision of this Public License is 360 | deemed unenforceable, it shall be automatically reformed to the 361 | minimum extent necessary to make it enforceable. If the provision 362 | cannot be reformed, it shall be severed from this Public License 363 | without affecting the enforceability of the remaining terms and 364 | conditions. 365 | 366 | c. No term or condition of this Public License will be waived and no 367 | failure to comply consented to unless expressly agreed to by the 368 | Licensor. 369 | 370 | d. Nothing in this Public License constitutes or may be interpreted 371 | as a limitation upon, or waiver of, any privileges and immunities 372 | that apply to the Licensor or You, including from the legal 373 | processes of any jurisdiction or authority. 374 | 375 | 376 | ======================================================================= 377 | 378 | Creative Commons is not a party to its public 379 | licenses. Notwithstanding, Creative Commons may elect to apply one of 380 | its public licenses to material it publishes and in those instances 381 | will be considered the “Licensor.” The text of the Creative Commons 382 | public licenses is dedicated to the public domain under the CC0 Public 383 | Domain Dedication. Except for the limited purpose of indicating that 384 | material is shared under a Creative Commons public license or as 385 | otherwise permitted by the Creative Commons policies published at 386 | creativecommons.org/policies, Creative Commons does not authorize the 387 | use of the trademark "Creative Commons" or any other trademark or logo 388 | of Creative Commons without its prior written consent including, 389 | without limitation, in connection with any unauthorized modifications 390 | to any of its public licenses or any other arrangements, 391 | understandings, or agreements concerning use of licensed material. For 392 | the avoidance of doubt, this paragraph does not form part of the 393 | public licenses. 394 | 395 | Creative Commons may be contacted at creativecommons.org. 396 | --------------------------------------------------------------------------------