mirror of
https://github.com/ElegantLaTeX/ElegantBook.git
synced 2026-01-26 04:14:35 +08:00
elegantbook 3.07
This commit is contained in:
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
\documentclass[cn,fancy,11pt]{elegantbook}
|
||||
\documentclass[cn,simple,blue,11pt]{elegantbook}
|
||||
|
||||
|
||||
\title{ElegantBook:优美的 \LaTeX{} 书籍模板}
|
||||
@@ -7,13 +7,14 @@
|
||||
\author{Ethan Deng \& Liam Huang}
|
||||
\institute{Elegant\LaTeX{} Program}
|
||||
\date{\today}
|
||||
|
||||
|
||||
\version{3.07}
|
||||
|
||||
\equote{Victory won\rq t come to us unless we go to it. --- M. Moore}
|
||||
|
||||
\logo{logo.png}
|
||||
\cover{cover.jpg}
|
||||
|
||||
\usepackage{gbt7714}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
@@ -62,7 +63,7 @@
|
||||
|
||||
\section{语言模式}
|
||||
本模板内含两套语言环境,改变语言环境会改变图表标题的引导词(图,表),文章结构词(比如目录,参考文献等),以及定理环境中的引导词(比如定理,引理等)。不同语言模式的启用如下:
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\documentclass[cn]{elegantbook}
|
||||
\documentclass[lang=cn]{elegantbook}
|
||||
\documentclass[en]{elegantbook}
|
||||
@@ -76,13 +77,13 @@
|
||||
|
||||
\section{颜色主题}
|
||||
本模板内置 4 组颜色主题,分别为 \textcolor{main1}{\lstinline{green}}(默认)、\textcolor{main2}{\lstinline{cyan}}、\textcolor{main3}{\lstinline{blue}}、\textcolor{gray}{\lstinline{plain}},另外还有一个自定义的选项 \lstinline{nocolor}。调用颜色主题 \lstinline{green} 的方法为
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\documentclass[green]{elegantbook} %or
|
||||
\documentclass[color=green]{elegantbook}
|
||||
\end{lstlisting}
|
||||
|
||||
其中 \textcolor{gray}{plain} 主题为全灰色。如果需要自定义颜色的话请选择 \lstinline{nocolor} 选项或者使用 \lstinline{color=none},然后在导言区定义 main、second、third 颜色,具体方法如下:
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\definecolor{main}{RGB}{70,70,70}
|
||||
\definecolor{second}{RGB}{115,45,2}
|
||||
\definecolor{third}{RGB}{0,80,80}
|
||||
@@ -107,7 +108,7 @@ third &\makecell{ {\color{third1}\rule{1cm}{1cm}}}& \makecell{{\color{third2}\ru
|
||||
\section{章标题显示风格}
|
||||
|
||||
本模板内置 2 套\textit{章标题显示风格},包含 \lstinline{hang}(默认)与 \lstinline{display} 两种风格,区别在于章标题单行显示(\lstinline{hang})与双行显示(\lstinline{display}),本说明使用了 \lstinline{hang}。调用方式为
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\documentclass[hang]{elegantbook} %or
|
||||
\documentclass[titlestyle=hang]{elegantbook}
|
||||
\end{lstlisting}
|
||||
@@ -130,17 +131,13 @@ third &\makecell{ {\color{third1}\rule{1cm}{1cm}}}& \makecell{{\color{third2}\ru
|
||||
|
||||
\subsection{定理类环境的使用}
|
||||
由于本模板使用了 \lstinline{tcolorbox} 宏包来定制定理类环境,所以和普通的定理环境的使用有些许区别,定理的使用方法如下:
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\begin{theorem}{<theorem name>}{<label>}
|
||||
The content of theorem.
|
||||
\end{theorem}
|
||||
\end{lstlisting}
|
||||
|
||||
第一个必选项 \lstinline{<theorem name>} 是定理的名字,第二个必选项 \lstinline{<label>} 是交叉引用时所用到的标签,交叉引用的方法为 \verb|\ref{thm:label}|。请注意,交叉引用时必须加上前缀 \lstinline{thm:}。效果如下:
|
||||
|
||||
\begin{theorem}{<theorem name>}{<label>}
|
||||
The content of theorem.
|
||||
\end{theorem}
|
||||
第一个必选项 \lstinline{<theorem name>} 是定理的名字,第二个必选项 \lstinline{<label>} 是交叉引用时所用到的标签,交叉引用的方法为 \verb|\ref{thm:label}|。请注意,交叉引用时必须加上前缀 \lstinline{thm:}。
|
||||
|
||||
其他相同用法的定理类环境有:
|
||||
|
||||
@@ -164,7 +161,7 @@ The content of theorem.
|
||||
|
||||
\subsection{其他数学环境的使用}
|
||||
其他三种数学环境因为没有选项,可以直接使用,比如 \lstinline{example} 环境的使用:
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\begin{example}
|
||||
This is the content of example environment.
|
||||
\end{example}
|
||||
@@ -236,7 +233,7 @@ This is the content of example environment.
|
||||
\section{添加序章}
|
||||
|
||||
如果你想在第一章前面添加序章,不改变原本章节序号,你可以在第一章内容前面使用
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\chapter*{Introduction}
|
||||
\addcontentsline{toc}{chapter}{Introduction}
|
||||
\markboth{Introduction}{}
|
||||
@@ -256,6 +253,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
|
||||
|
||||
我们将通过三个步骤定义可测函数的积分。首先定义非负简单函数的积分。以下设 $E$ 是 $\mathcal{R}^n$ 中的可测集。
|
||||
|
||||
|
||||
\begin{definition}{可积性}{int}
|
||||
设 $ f(x)=\sum\limits_{i=1}^{k} a_i \chi_{A_i}(x)$ 是 $E$ 上的非负简单函数,其中 $\{A_1,A_2,\ldots,A_k\}$ 是 $E$ 上的一个可测分割,$a_1,a_2,\ldots,a_k$ 是非负实数。定义 $f$ 在 $E$ 上的积分为 $\int_{a}^b f(x)$
|
||||
\begin{equation}
|
||||
@@ -303,7 +301,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
|
||||
\end{theorem}
|
||||
|
||||
\begin{note}
|
||||
在本模板中,引理(lemma),推论(corollary )的样式和定理~\ref{thm:fubi} 的样式一致,包括颜色,仅仅只有计数器的设置不一样。
|
||||
在本模板中,引理(lemma),推论(corollary)的样式和定理~\ref{thm:fubi} 的样式一致,包括颜色,仅仅只有计数器的设置不一样。
|
||||
\end{note}
|
||||
|
||||
我们说一个实变或者复变量的实值或者复值函数是在区间上平方可积的,如果其绝对值的平方在该区间上的积分是有限的。所有在勒贝格积分意义下平方可积的可测函数构成一个希尔伯特空间,也就是所谓的 $L^2$ 空间,几乎处处相等的函数归为同一等价类。形式上,$L^2$ 是平方可积函数的空间和几乎处处为 0 的函数空间的商空间。
|
||||
@@ -354,7 +352,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
|
||||
|
||||
\chapter{最小示例}
|
||||
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\documentclass{elegantbook}
|
||||
% title info
|
||||
\title{Title}
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
\documentclass[noanswer,fancy,hide]{elegantbook}
|
||||
\documentclass[noanswer,fancy,blue,11pt]{elegantbook}
|
||||
|
||||
\title{An Elegant \LaTeX{} Template for Books}
|
||||
\subtitle{Classic Elegant\LaTeX{} Template}
|
||||
@@ -6,25 +6,23 @@
|
||||
\author{Ethan Deng \& Liam Huang}
|
||||
\institute{Elegant\LaTeX{} Program}
|
||||
\date{\today}
|
||||
|
||||
\version{3.07}
|
||||
|
||||
\equote{Victory won\rq t come to us unless we go to it. --- M. Moore}
|
||||
|
||||
\logo{logo.png}
|
||||
\cover{cover.jpg}
|
||||
|
||||
\setcitestyle{sectionbib}
|
||||
\usepackage{chapterbib}
|
||||
%\excludecomment{solution}
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
\tableofcontents
|
||||
\clearpage
|
||||
\thispagestyle{empty}
|
||||
\mainmatter
|
||||
\hypersetup{pageanchor=true}
|
||||
\include{test}
|
||||
|
||||
\chapter{Elegant\LaTeX{} Templates}
|
||||
|
||||
@@ -54,56 +52,15 @@ Over these years, we've received \cite{EINAV2010} a lot of feedback from users,
|
||||
|
||||
\chapter{ElegantBook Settings}
|
||||
|
||||
\begin{solution}
|
||||
This text will only be displayed, if \includecomment{mysection} was given
|
||||
\end{solution}
|
||||
|
||||
\begin{proof}
|
||||
This text will only be displayed, if \includecomment{mysection} was given
|
||||
\end{proof}
|
||||
|
||||
\section{Compilation Methods}
|
||||
This template is based on the Standard LaTeX book class, so the options of book class also work. The default encoding is UTF-8, and \TeX{} Live is recommended. The test environment is Win10 + \TeX{} Live 2018.
|
||||
\subsection[Compile with PDFLaTeX]{Compile with \lstinline{PDFLaTeX}}
|
||||
|
||||
If you choose \lstinline{PDFLaTeX} to process your book, the default article font computer modern has changed to \lstinline{newtx} series, and the default font size is set to \lstinline{12pt}. The fonts are settings with:
|
||||
|
||||
\begin{itemize}
|
||||
\item \lstinline{newtxtext} package for text fonts, similar to times new roman font.
|
||||
\item \lstinline{newtxmath} package for math fonts, close to \lstinline{times} package.
|
||||
\item \lstinline{FiraMono} package for typewriter fonts, with option \lstinline{scale=0.7}.
|
||||
\item \lstinline{ctex} package for Chinese fonts, with option \lstinline{scheme=plain}.
|
||||
\end{itemize}
|
||||
|
||||
A full compilation chain:\lstinline[breaklines]{PDFLaTeX -> BibTeX -> PDFLaTeX*2}.
|
||||
|
||||
|
||||
\subsection[Compile with XeLaTeX]{Compile with \lstinline{XeLaTeX}}
|
||||
If you choose \lstinline{XeLaTeX} to process your book, we use \lstinline{fontspec} package and \lstinline{xeCJK} package. we used fonts available in Windows, if you are using Linux or Mac OS, please substitute these fonts with that of your system.
|
||||
|
||||
\begin{lstlisting}[frame=single]
|
||||
\RequirePackage{fontenc}
|
||||
\RequirePackage[no-math]{fontspec}
|
||||
\setmainfont{Times New Roman}[NFSSFamily=ntxtlf]
|
||||
\setsansfont{Arial}
|
||||
%\setmonofont[Scale=0.7]{Courier New}
|
||||
\RequirePackage{xeCJK}
|
||||
\RequirePackage{xunicode}
|
||||
\setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun}
|
||||
\setCJKsansfont[BoldFont={SimHei},ItalicFont={KaiTi}]{KaiTi}
|
||||
\setCJKmonofont[BoldFont={SimHei},ItalicFont={KaiTi},Scale=0.7]{Microsoft YaHei}
|
||||
\XeTeXlinebreaklocale "zh"
|
||||
\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt
|
||||
\RequirePackage{newtxmath}
|
||||
\end{lstlisting}
|
||||
|
||||
A full compilation chain:\lstinline[breaklines]{XeLaTeX -> BibTeX -> XeLaTeX*2}.
|
||||
|
||||
|
||||
\section{Languages}
|
||||
We defined one option named \lstinline{lang}, this option has two alternative values, \lstinline{lang=en} (default) or \lstinline{lang=cn}. \lstinline{lang=cn} will make the caption of figure/table, abstract name, refname etc. Chinese, while \lstinline{lang=en} will keep all these stuff English, as the default article class sets. You can use this option as
|
||||
|
||||
\begin{lstlisting}[frame=none]
|
||||
We defined one option named \lstinline{lang}, this option has two alternative values, \lstinline{lang=en} (default) or \lstinline{lang=cn}. \lstinline{lang=cn} will make the caption of figure/table, abstract name, refname etc. Chinese, while \lstinline{lang=en} will keep all these stuff English, as the default article class sets. You can use this option as
|
||||
\begin{lstlisting}
|
||||
\documentclass[cn]{elegantbook}
|
||||
\documentclass[lang=cn]{elegantbook}
|
||||
\documentclass[en]{elegantbook}
|
||||
@@ -117,8 +74,7 @@ You can input Chinese Character in either \lstinline{lang=en} or \lstinline{lang
|
||||
|
||||
\section{Color Themes}
|
||||
This template contains 4 color themes,they are \textcolor{main1}{\lstinline{green}} (default), \textcolor{main2}{\lstinline{cyan}}, \textcolor{main3}{\lstinline{blue}}, \textcolor{gray}{\lstinline{plain}}, and there is a customization color option \lstinline{nocolor}. You can choose \lstinline{green} with
|
||||
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\documentclass[green]{elegantbook} %or
|
||||
\documentclass[color=green]{elegantbook}
|
||||
\end{lstlisting}
|
||||
@@ -151,8 +107,7 @@ third &\makecell{ {\color{third1}\rule{1cm}{1cm}}}& \makecell{{\color{third2}\ru
|
||||
This template contains 2 sets of \textit{title display styles},which including \lstinline{hang}(default) and \lstinline{display} style,
|
||||
|
||||
The difference is that the chapter heading is displayed on a single line (\lstinline{hang}) and on a double line (\lstinline{display}) , and this guide uses \lstinline{hang} . To change display style
|
||||
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\documentclass[hang]{elegantbook} %or
|
||||
\documentclass[titlestyle=hang]{elegantbook}
|
||||
\end{lstlisting}
|
||||
@@ -175,8 +130,7 @@ In this template, we defined four categories of theorem class environments
|
||||
|
||||
\subsection{Theorem Class Environments}
|
||||
The template uses the \lstinline{tcolorbox} package to customize the theorem class environments, it is slightly different from the normal theorem environments. The usage is as follows:
|
||||
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\begin{theorem}{<theorem name>}{<label>}
|
||||
The content of theorem.
|
||||
\end{theorem}
|
||||
@@ -210,8 +164,7 @@ Other theorem class environments with the same usage are:
|
||||
|
||||
\subsection{Other Customized Environments}
|
||||
The other three math environments can be used directly since there are no options for them, the \lstinline{example} environment usage:
|
||||
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\begin{example}
|
||||
This is the content of example environment.
|
||||
\end{example}
|
||||
@@ -274,7 +227,6 @@ This template uses \lstinline{tikz} to customize \lstinline{itemize} and \lstinl
|
||||
This template uses \BibTeX{} to generate the bibliography, the default bibliography style is \lstinline{aer}. Let's take a glance at the citation effect, ~\cite{Chen2018} use data from a major peer-to-peer lending marketplace in China to study whether female and male investors evaluate loan performance differently.
|
||||
|
||||
If you want to use \BibTeX{}, you must create a file named \lstinline{reference.bib}, and add bib items (from Google Scholar, Mendeley, EndNote, and etc.) to \lstinline{reference.bib} file, and cite the bibkey in the \lstinline{tex} file. The Bib\TeX{} will automatically generate the bibliography for you for the reference you cited. If you want to add some noncited reference to the bibliography, you can use
|
||||
|
||||
\begin{lstlisting}
|
||||
\nocite{EINAV2010, Havrylchyk2018}
|
||||
\end{lstlisting}
|
||||
@@ -282,8 +234,7 @@ If you want to use \BibTeX{}, you must create a file named \lstinline{reference.
|
||||
\section{Preface}
|
||||
|
||||
If you want to add a preface before the first chapter without changing the number of chapter, you can use it before the first chapter
|
||||
|
||||
\begin{lstlisting}[frame=single]
|
||||
\begin{lstlisting}
|
||||
\chapter*{Preface}
|
||||
\addcontentsline{toc}{chapter}{Preface}
|
||||
\markboth{Preface}{}
|
||||
@@ -421,4 +372,5 @@ The content of chapter one.
|
||||
\end{document}
|
||||
\end{lstlisting}
|
||||
|
||||
\bibliographystyle{aer}
|
||||
\end{document}
|
||||
|
||||
149
elegantbook.cls
149
elegantbook.cls
@@ -23,6 +23,7 @@
|
||||
\DeclareStringOption[fancy]{mode}
|
||||
\DeclareStringOption[show]{base}
|
||||
|
||||
|
||||
% ----- backward compatibility
|
||||
\DeclareVoidOption{green}{\ekv{color = green}}
|
||||
\DeclareVoidOption{cyan}{\ekv{color = cyan}}
|
||||
@@ -113,27 +114,31 @@
|
||||
|
||||
\RequirePackage{xcolor}
|
||||
\ifdefstring{\ELEGANT@color}{green}{
|
||||
\definecolor{structurecolor}{RGB}{0,120,2}%
|
||||
\definecolor{main}{RGB}{0,120,2}%
|
||||
\definecolor{second}{RGB}{230,90,7}%
|
||||
\definecolor{third}{RGB}{0,160,152}%
|
||||
}{\relax}
|
||||
|
||||
\ifdefstring{\ELEGANT@color}{cyan}{
|
||||
\definecolor{main}{RGB}{0,175,152}%
|
||||
\definecolor{second}{RGB}{239,126,30}%
|
||||
\definecolor{third}{RGB}{120,8,13}%
|
||||
\definecolor{structurecolor}{RGB}{31,186,190}%
|
||||
\definecolor{main}{RGB}{59,180,5}%
|
||||
\definecolor{second}{RGB}{175,153,8}%
|
||||
\definecolor{third}{RGB}{244,105,102}%
|
||||
}{\relax}
|
||||
\ifdefstring{\ELEGANT@color}{blue}{
|
||||
\definecolor{main}{RGB}{20,50,104}%
|
||||
\definecolor{second}{RGB}{180,50,131}%
|
||||
\definecolor{third}{RGB}{7,127,128}%
|
||||
\definecolor{structurecolor}{RGB}{60,113,183}
|
||||
\definecolor{main}{RGB}{0,166,82}%
|
||||
\definecolor{second}{RGB}{255,134,24}%
|
||||
\definecolor{third}{RGB}{0,174,247}%
|
||||
}{\relax}
|
||||
\ifdefstring{\ELEGANT@color}{gray}{
|
||||
\definecolor{main}{RGB}{50,50,50}%
|
||||
\definecolor{second}{RGB}{50,50,50}%
|
||||
\definecolor{third}{RGB}{50,50,50}%
|
||||
\definecolor{structurecolor}{RGB}{0,0,0}
|
||||
\definecolor{main}{RGB}{150,150,150}%
|
||||
\definecolor{second}{RGB}{150,150,150}%
|
||||
\definecolor{third}{RGB}{150,150,150}%
|
||||
}{\relax}
|
||||
\ifdefstring{\ELEGANT@color}{black}{
|
||||
\definecolor{structurecolor}{RGB}{0,0,0}
|
||||
\definecolor{main}{RGB}{0,0,0}%
|
||||
\definecolor{second}{RGB}{0,0,0}%
|
||||
\definecolor{third}{RGB}{0,0,0}%
|
||||
@@ -191,7 +196,7 @@
|
||||
% caption settings
|
||||
\RequirePackage{caption}
|
||||
\captionsetup{labelfont = bf}
|
||||
\RequirePackage[font=small,labelfont={bf,color=main}]{caption}
|
||||
\RequirePackage[font=small,labelfont={bf,color=structurecolor}]{caption}
|
||||
\captionsetup[table]{skip=3pt}
|
||||
\captionsetup[figure]{skip=3pt}
|
||||
|
||||
@@ -214,7 +219,7 @@
|
||||
\renewcommand{\chaptername}{Chapter \thechapter}
|
||||
}{\relax}
|
||||
\ifdefstring{\ELEGANT@lang}{cn}{
|
||||
\renewcommand{\contentsname}{目录}
|
||||
\renewcommand{\contentsname}{目\hspace{2em}录}
|
||||
\renewcommand{\figurename}{图}
|
||||
\renewcommand{\tablename}{表}
|
||||
\renewcommand{\partname}{第 \thepart\; 部分}
|
||||
@@ -222,7 +227,7 @@
|
||||
\renewcommand{\listtablename}{表格目录}
|
||||
\renewcommand{\bibname}{参考文献}
|
||||
\renewcommand{\appendixname}{附录}
|
||||
\renewcommand{\indexname}{索引}
|
||||
\renewcommand{\indexname}{索\hspace{2em}引}
|
||||
\newcommand\figref[1]{\textbf{图}~\ref{#1}}
|
||||
\newcommand\tabref[1]{\textbf{表}~\ref{#1}}
|
||||
\renewcommand{\chaptername}{第 \thechapter\;章}
|
||||
@@ -236,13 +241,13 @@
|
||||
\usetikzlibrary{backgrounds,calc,shadows}
|
||||
\usepackage[object=vectorian]{pgfornament} %%
|
||||
|
||||
\newcommand*{\eitemi}{\tikz \draw [baseline, ball color=main, draw=none] circle (2pt);}
|
||||
\newcommand*{\eitemii}{\tikz \draw [baseline, fill=main,draw=none,circular drop shadow] circle (2pt);}
|
||||
\newcommand*{\eitemiii}{\tikz \draw [baseline, fill=main,draw=none] circle (2pt);}
|
||||
\setlist[enumerate,1]{label=\color{main}\arabic*.}
|
||||
\setlist[enumerate,2]{label=\color{main}(\alph*).}
|
||||
\setlist[enumerate,3]{label=\color{main}\Roman*.}
|
||||
\setlist[enumerate,4]{label=\color{main}\Alph*.}
|
||||
\newcommand*{\eitemi}{\tikz \draw [baseline, ball color=structurecolor, draw=none] circle (2pt);}
|
||||
\newcommand*{\eitemii}{\tikz \draw [baseline, fill=structurecolor,draw=none,circular drop shadow] circle (2pt);}
|
||||
\newcommand*{\eitemiii}{\tikz \draw [baseline, fill=structurecolor,draw=none] circle (2pt);}
|
||||
\setlist[enumerate,1]{label=\color{structurecolor}\arabic*.}
|
||||
\setlist[enumerate,2]{label=\color{structurecolor}(\alph*).}
|
||||
\setlist[enumerate,3]{label=\color{structurecolor}\Roman*.}
|
||||
\setlist[enumerate,4]{label=\color{structurecolor}\Alph*.}
|
||||
\setlist[itemize,1]{label={\eitemi}}
|
||||
\setlist[itemize,2]{label={\eitemii}}
|
||||
\setlist[itemize,3]{label={\eitemiii}}
|
||||
@@ -252,7 +257,8 @@
|
||||
\def\bibfont{\footnotesize}
|
||||
|
||||
|
||||
%% 页面设置
|
||||
%% device settings
|
||||
|
||||
\RequirePackage{geometry}
|
||||
\geometry{
|
||||
a4paper,
|
||||
@@ -264,6 +270,7 @@
|
||||
footskip=12mm
|
||||
}
|
||||
|
||||
|
||||
\RequirePackage{hyperref}
|
||||
\hypersetup{
|
||||
breaklinks,
|
||||
@@ -288,21 +295,22 @@
|
||||
\RequirePackage{apptools}
|
||||
\RequirePackage[toc,page]{appendix}
|
||||
|
||||
\setcounter{secnumdepth}{5}
|
||||
|
||||
\titleformat{\chapter}[\style]{\bfseries}
|
||||
{\filcenter\LARGE\enspace\bfseries{\color{main}\IfAppendix{\appendixname}{\chaptername}\enspace}}{1pt}{\bfseries\color{main}\LARGE\filcenter}[\ifdefstring{\ELEGANT@base}{hide}{}{\filcenter\base{main}{88}}]
|
||||
{\filcenter\LARGE\enspace\bfseries{\color{structurecolor}\IfAppendix{\appendixname}{\chaptername}\enspace}}{1pt}{\bfseries\color{structurecolor}\LARGE\filcenter}[\ifdefstring{\ELEGANT@base}{hide}{}{\filcenter\base{structurecolor}{88}}]
|
||||
|
||||
\titleformat{\section}[hang]{\bfseries}
|
||||
{\hspace{-2.45em}\Large\bfseries{\color{main}\thesection}\enspace}{1pt}{\color{main}\Large\bfseries\filright}
|
||||
{\hspace{-2.45em}\Large\bfseries{\color{structurecolor}\thesection}\enspace}{1pt}{\color{structurecolor}\Large\bfseries\filright}
|
||||
|
||||
\titleformat{\subsection}[hang]{\bfseries}
|
||||
{\hspace{-2.45em}\large\bfseries\color{main}\thesubsection\enspace}{1pt}{\color{main}\large\bfseries\filright}
|
||||
{\hspace{-2.45em}\large\bfseries\color{structurecolor}\thesubsection\enspace}{1pt}{\color{structurecolor}\large\bfseries\filright}
|
||||
|
||||
\titleformat{\subsubsection}[hang]{\bfseries}
|
||||
{\hspace{-2.45em}\large\bfseries\color{main}\thesubsection\enspace}{1pt}{\color{main}\large\bfseries\filright}
|
||||
{\hspace{-2.45em}\large\bfseries\color{structurecolor}\thesubsubsection\enspace}{1pt}{\color{structurecolor}\large\bfseries\filright}
|
||||
|
||||
|
||||
\titlespacing{\chapter}{0pt}{0pt}{1.5\baselineskip}
|
||||
\titlespacing{\chapter}{0pt}{-20pt}{1.3\baselineskip}
|
||||
%\titlespacing{\subsection}{0pt}{0.5\baselineskip}{-\baselineskip}
|
||||
|
||||
|
||||
@@ -321,7 +329,8 @@
|
||||
fontupper=\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\upshape\kaishu},
|
||||
lower separated=false,
|
||||
coltitle=white,
|
||||
colback=gray!10,
|
||||
colback=gray!5,
|
||||
boxrule=0.5pt,
|
||||
fonttitle=\bfseries,
|
||||
enhanced,
|
||||
breakable,
|
||||
@@ -329,26 +338,26 @@
|
||||
before skip=8pt,
|
||||
attach boxed title to top left={yshift=-0.11in,xshift=0.15in},
|
||||
boxed title style={boxrule=0pt,colframe=white,arc=0pt,outer arc=0pt},
|
||||
% separator sign={:},
|
||||
separator sign={.},
|
||||
},
|
||||
defstyle/.style={
|
||||
common,
|
||||
colframe=main,
|
||||
colback=main!10,
|
||||
colback=main!5,
|
||||
colbacktitle=main,
|
||||
overlay unbroken and last={\node[anchor=south east, outer sep=6pt] at (\textwidth-width,0) {\textcolor{main}{$\clubsuit$}}; }
|
||||
},
|
||||
thmstyle/.style={
|
||||
common,
|
||||
colframe=second,
|
||||
colback=second!10,
|
||||
colback=second!5,
|
||||
colbacktitle=second,
|
||||
overlay unbroken and last={\node[anchor=south east, outer sep=6pt] at (\textwidth-width,0) {\textcolor{second}{$\heartsuit$}}; }
|
||||
},
|
||||
propstyle/.style={
|
||||
common,
|
||||
colframe=third,
|
||||
colback=third!10,
|
||||
colback=third!5,
|
||||
colbacktitle=third,
|
||||
overlay unbroken and last={\node[anchor=south east, outer sep=6pt] at (\textwidth-width,0) {\textcolor{third}{$\spadesuit$}}; }
|
||||
},
|
||||
@@ -420,12 +429,16 @@
|
||||
{\endeproposition}
|
||||
}{\relax}
|
||||
|
||||
% main(green-def): example exercise problem solution
|
||||
% second(orange-thm): proof note remark
|
||||
% third(blue-prop): assumptions property conclusion custom
|
||||
|
||||
%% Example with counter
|
||||
\newcounter{exam}[chapter]
|
||||
\setcounter{exam}{0}
|
||||
\renewcommand{\theexam}{\thechapter.\arabic{exam}}
|
||||
\newenvironment{example}[1][]{
|
||||
\refstepcounter{exam}\par\noindent \textbf{\color{main}{
|
||||
\refstepcounter{exam}\par\noindent\textbf{\color{main}{
|
||||
\ifdefstring{\ELEGANT@lang}{en}{Example}{例}
|
||||
}~\theexam #1: }\rmfamily %
|
||||
}{
|
||||
@@ -449,7 +462,7 @@
|
||||
\setcounter{prob}{0}
|
||||
\renewcommand{\theprob}{\thechapter.\arabic{prob}}
|
||||
\newenvironment{problem}[1][]{
|
||||
\refstepcounter{prob}\par\noindent \textbf{\color{main}{
|
||||
\refstepcounter{prob}\par\noindent\textbf{\color{main}{%
|
||||
\ifdefstring{\ELEGANT@lang}{en}{Problem}{例题}
|
||||
}~\theprob #1: }\rmfamily %
|
||||
}{
|
||||
@@ -458,31 +471,31 @@
|
||||
|
||||
|
||||
|
||||
\newenvironment{note}{\par\noindent{\makebox[0pt][r]{\scriptsize\color{red!90}\textdbend\quad}\textbf{\color{main}
|
||||
\newenvironment{note}{\par\noindent{\makebox[0pt][r]{\scriptsize\color{red!90}\textdbend\quad}\textbf{\color{second}
|
||||
\ifdefstring{\ELEGANT@lang}{en}{Note:}{注意:}
|
||||
}}\itshape}{\par}
|
||||
}}\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\kaishu}}{\par}
|
||||
|
||||
\newenvironment{proof}{\par\noindent\textbf{\color{main}
|
||||
\newenvironment{proof}{\par\noindent\textbf{\color{second}
|
||||
\ifdefstring{\ELEGANT@lang}{en}{Proof:}{证明:}
|
||||
}\color{black!90}\small}{
|
||||
%\hfill$\Box$\quad
|
||||
\par}
|
||||
\newenvironment{remark}{\noindent\textbf{\color{main}
|
||||
\newenvironment{remark}{\noindent\textbf{\color{second}
|
||||
\ifdefstring{\ELEGANT@lang}{en}{Remark:}{注:}
|
||||
}}{\par}
|
||||
\newenvironment{assumption}{\par\noindent\textbf{\color{main}
|
||||
\newenvironment{assumption}{\par\noindent\textbf{\color{third}
|
||||
\ifdefstring{\ELEGANT@lang}{en}{Assumption:}{假设:}
|
||||
}}{\par}
|
||||
\newenvironment{conclusion}{\par\noindent\textbf{\color{main}
|
||||
\newenvironment{conclusion}{\par\noindent\textbf{\color{third}
|
||||
\ifdefstring{\ELEGANT@lang}{en}{Conclusion:}{结论:}
|
||||
}}{\par}
|
||||
\newenvironment{solution}{\par\noindent\textbf{\color{main}
|
||||
\ifdefstring{\ELEGANT@lang}{en}{Solution:}{解:}
|
||||
}}{\par}
|
||||
\newenvironment{property}{\par\noindent\textbf{\color{main}
|
||||
\newenvironment{property}{\par\noindent\textbf{\color{third}
|
||||
\ifdefstring{\ELEGANT@lang}{en}{Property:}{性质:}
|
||||
}}{\par}
|
||||
\newenvironment{custom}[1]{\par\noindent\textbf{\color{main}
|
||||
\newenvironment{custom}[1]{\par\noindent\textbf{\color{third}
|
||||
\ifdefstring{\ELEGANT@lang}{en}{#1:}{#1:}
|
||||
}}{\par}
|
||||
|
||||
@@ -499,19 +512,21 @@
|
||||
\RequirePackage{fancyhdr}
|
||||
\RequirePackage{lastpage}
|
||||
\fancyhf{}
|
||||
|
||||
\if@twoside
|
||||
\fancyhead[EL,OR]{\color{main}--\thepage/\pageref*{LastPage}--}
|
||||
\fancyhead[ER]{\color{main}\itshape\leftmark{}}
|
||||
\fancyhead[OL]{\color{main}\itshape\rightmark}
|
||||
\fancyhead[EL,OR]{\color{structurecolor}\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\kaishu}--\thepage/\pageref*{LastPage}--}
|
||||
\fancyhead[ER]{\color{structurecolor}\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\kaishu}\leftmark{}}
|
||||
\fancyhead[OL]{\color{structurecolor}\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\kaishu}\rightmark}
|
||||
\else
|
||||
\fancyhead[R]{\color{main}--\itshape\thepage/\pageref*{LastPage}--}
|
||||
\fancyhead[L]{\color{main}\itshape\rightmark}
|
||||
\fancyhead[R]{\color{structurecolor}\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\kaishu}--\thepage/\pageref*{LastPage}--}
|
||||
\fancyhead[L]{\color{structurecolor}\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\kaishu}\rightmark}
|
||||
\fi
|
||||
|
||||
\fancyfoot[c]{\base{main}{88}}
|
||||
\renewcommand{\headrule}{\color{main}\hrule width\textwidth}
|
||||
\fancyfoot[c]{\base{structurecolor}{88}}
|
||||
\renewcommand{\headrule}{\color{structurecolor}\hrule width\textwidth}
|
||||
\pagestyle{fancy}
|
||||
|
||||
\renewcommand{\headrulewidth}{1pt}
|
||||
% \renewcommand{\headrule}{}
|
||||
\fancypagestyle{plain}{\renewcommand{\headrulewidth}{0pt}\fancyhf{}\renewcommand{\headrule}{}}
|
||||
\renewcommand{\sectionmark}[1]{\markright{\thesection\; #1}{} }
|
||||
\renewcommand{\chaptermark}[1]{\markboth{\chaptername \; #1\;}{}}
|
||||
@@ -519,8 +534,14 @@
|
||||
%%封面
|
||||
\newcommand*{\equote}[1]{\def\@equote{#1}}
|
||||
|
||||
\def\IfEmpty#1{%
|
||||
\edef\1{\the#1}
|
||||
\ifx\1\empty
|
||||
}
|
||||
\def \ifempty#1{\def\temp{#1} \ifx\temp\empty }
|
||||
|
||||
\newcommand*{\logo}[1]{
|
||||
\def\@logo{\includegraphics[width=4.5cm]{#1}
|
||||
\def\@logo{\includegraphics[width=4.2cm]{#1}
|
||||
}
|
||||
}
|
||||
\newcommand*{\cover}[1]{
|
||||
@@ -528,29 +549,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
\renewcommand{\baselinestretch}{1.35}
|
||||
|
||||
\renewcommand*{\maketitle}{%
|
||||
\hypersetup{pageanchor=false}
|
||||
\begin{titlepage}
|
||||
\newgeometry{margin = 0in}
|
||||
\parindent=0pt
|
||||
\setstretch{2.5}
|
||||
\@cover
|
||||
% \includegraphics[width=\linewidth]{cover.jpg}
|
||||
\setlength{\fboxsep}{0pt}
|
||||
\colorbox{second}{\makebox[\linewidth][c]{\shortstack[c]{\vspace{0.5in}}}}
|
||||
\vfill
|
||||
\hfill
|
||||
\vskip-2ex
|
||||
\hspace{2em}
|
||||
\parbox{0.8\textwidth}{
|
||||
\bfseries\Huge \@title\par
|
||||
}
|
||||
\vfill
|
||||
\vspace{-1.0cm}
|
||||
\setstretch{2.5}
|
||||
\hspace{2.5em}
|
||||
\begin{minipage}[c]{0.68\linewidth}
|
||||
{\bfseries\Huge \@title\\}
|
||||
{\color{darkgray}\bfseries\Large \the\subtitle\\[2ex]}
|
||||
\color{gray}\kaishu\normalsize
|
||||
{\renewcommand{\arraystretch}{0.618}
|
||||
\begin{tabular}{l}
|
||||
\ifdefstring{\ELEGANT@lang}{en}{\textbf{Author: }}{\textbf{作者:}}\@author \\
|
||||
\ifdefstring{\ELEGANT@lang}{en}{\textbf{Institute: }}{\textbf{组织:}}\the\institute\\
|
||||
\ifdefstring{\ELEGANT@lang}{en}{\textbf{Update: }}{\textbf{更新:}}\@date\\
|
||||
\ifdefstring{\ELEGANT@lang}{en}{\textbf{Version: }}{\textbf{版本:}}\the\version \\
|
||||
\ifdefstring{\ELEGANT@lang}{en}{\textbf{Author: }}{\textbf{作者:}} \@author \\
|
||||
\ifdefstring{\ELEGANT@lang}{en}{\textbf{Institute: }}{\textbf{组织:}} \the\institute\\
|
||||
\ifdefstring{\ELEGANT@lang}{en}{\textbf{Date: }}{\textbf{时间:}} \@date\\
|
||||
\ifdefstring{\ELEGANT@lang}{en}{\textbf{Version: }}{\textbf{版本:}} \the\version\\
|
||||
\end{tabular}}
|
||||
\end{minipage}
|
||||
\begin{minipage}[c]{0.27\linewidth}
|
||||
@@ -592,8 +620,11 @@
|
||||
emph={elegantpaper,fontenc,fontspec,xeCJK,FiraMono,xunicode,newtxmath,figure,fig,image,img,table,itemize,enumerate,newtxtext,newtxtt,ctex,microtype,description,times,newtx,booktabs,tabular,PDFLaTeX,XeLaTeX,type1cm,BibTeX,device,color,mode,lang,amsthm,tcolorbox,titlestyle},
|
||||
emphstyle={\color{frenchplum}},
|
||||
morekeywords={DeclareSymbolFont,SetSymbolFont,toprule,midrule,bottomrule,institute,version,includegraphics,setmainfont,setsansfont,setmonofont ,setCJKmainfont,setCJKsansfont,setCJKmonofont,RequirePackage,figref,tabref,email,maketitle,keywords,definecolor,equote,logo,cover,subtitle,appendix,chapter,hypersetup,mainmatter,tableofcontents},
|
||||
frame=none,
|
||||
frame=single,
|
||||
tabsize=2,
|
||||
rulecolor=\color{structurecolor},
|
||||
framerule=0.2pt,
|
||||
columns=flexible,
|
||||
% backgroundcolor=\color{lightgrey}
|
||||
}
|
||||
|
||||
|
||||
BIN
figure/cover.jpg
BIN
figure/cover.jpg
Binary file not shown.
|
Before Width: | Height: | Size: 476 KiB After Width: | Height: | Size: 416 KiB |
Reference in New Issue
Block a user