This commit is contained in:
EthanDeng
2019-01-15 15:02:32 +08:00
commit 5b961ac901
23 changed files with 4305 additions and 0 deletions

447
elegantbook.cls Normal file
View File

@@ -0,0 +1,447 @@
%%%%%%%%%%%%%%%%%%%%%%
%% start of file `elegantbook.cls'.
%% Copyright 2013-2019 ElegantLaTeX (ElegantLaTeX2e@gmail.com)
%%
%% This work may be distributed and/or modified freely
%% available at http://elegantlatex.tk/download/
%% and http://ddswhu.com/download/
% %
%%%%%%%%%%%%%%%%%%%%%
% % !Mode:: "TeX:UTF-8"
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{elegantbook}[2014/01/20 v2.00 ElegantBook document class]
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
\SetupKeyvalOptions{family=ELEGANT, prefix=ELEGANT@, setkeys=\kvsetkeys}
\newcommand{\ekv}[1]{\kvsetkeys{ELEGANT}{#1}}
% ----- Colors -----
\DeclareStringOption[green]{color}[green]
% ----- backward compatibility
\DeclareVoidOption{green}{\ekv{color = green}}
\DeclareVoidOption{cyan}{\ekv{color = cyan}}
\DeclareVoidOption{blue}{\ekv{color = blue}}
\DeclareVoidOption{nocolor}{\ekv{color = none}}
% ----- Math option -----
\DeclareBoolOption[true]{mathpazo}
\DeclareComplementaryOption{mtpro}{mathpazo}
% ----- Title Style -----
\DeclareStringOption[hang]{titlestyle}[hang]
% ----- backward compatibility
\DeclareVoidOption{hang}{\ekv{titlestyle = hang}}
\DeclareVoidOption{display}{\ekv{titlestyle = display}}
% ----- Default Options -----
\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessKeyvalOptions*\relax
% \ProcessOptions*\relax
\LoadClass[12pt,a4paper,openany]{book}
% ----- Handle Colors -----
%%
\newcommand*{\base}[1]{
\def\@base{\includegraphics[scale=0.3]{#1}
}
}
\RequirePackage{xcolor}
\ifdefstring{\ELEGANT@color}{green}{
\definecolor{main}{RGB}{0,120,2}%
\definecolor{seco}{RGB}{230,90,7}%
\definecolor{thid}{RGB}{0,160,152}%
\base{greenbase.pdf}%
}{\relax}
\ifdefstring{\ELEGANT@color}{cyan}{
\definecolor{main}{RGB}{0,175,152}%
\definecolor{seco}{RGB}{239,126,30}%
\definecolor{thid}{RGB}{120,8,13}%
\base{cyanbase.pdf}%
}{\relax}
\ifdefstring{\ELEGANT@color}{blue}{
\definecolor{main}{RGB}{20,50,104}%
\definecolor{seco}{RGB}{180,50,131}%
\definecolor{thid}{RGB}{7,127,128}%
\base{bluebase.pdf}%
}{\relax}
% ----- Handle Math option -----
\ifELEGANT@mathpazo
\RequirePackage{mathpazo}
\newcommand{\mbf}{\mathbf}
\else
\AtBeginDocument{\usepackage{mtpro2}}
\fi
% ----- Title Style -----
\ifdefstring{\ELEGANT@titlestyle}{hang}{\def\style{hang}}{\relax}
\ifdefstring{\ELEGANT@titlestyle}{display}{\def\style{display}}{\relax}
\newtoks\zhtitle
\newtoks\entitle
\newtoks\email
\newtoks\version
\newtoks\enend
\newtoks\zhend
%%
%%
\RequirePackage{graphicx}
\RequirePackage{enumerate}
\RequirePackage{amsmath,mathrsfs,amsfonts}
\RequirePackage{booktabs}
\linespread{1.3}
\graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}}
\newcommand*{\myquote}[1]{\def\@myquote{#1}}
\newcommand*{\logo}[1]{
\def\@logo{\includegraphics[height=5.8cm]{#1}
}
}
%%
\RequirePackage{wallpaper}
\newcommand*{\cover}[1]{\def\@cover{
\ThisTileWallPaper{\paperwidth}{\paperheight}{#1}
}
}
%%
\RequirePackage{hyperref}
\AtBeginDocument{
\hypersetup{
pdftitle = {\the\zhtitle\the\zhend},
pdfauthor = {\@author}
}
}
\hypersetup{
breaklinks,
unicode,
bookmarksnumbered =true,
bookmarksopen =true,
pdfsubject =\@author \@title Book,
pdfkeywords ={ElegantBook},
pdfcreator ={XeLaTeX with ElegantBook class},
colorlinks,
linkcolor =main,
plainpages =false,
pdfstartview =FitH,
pdfborder={0 0 0},
linktocpage
}
\RequirePackage{geometry}
\geometry{
a4paper,
left=27mm, %% or inner=23mm
right=27mm, %% or outer=18mm
top=25.4mm, bottom=25.4mm,
headheight=2.17cm,
headsep=4mm,
footskip=12mm
}
%%
\RequirePackage[center,pagestyles]{titlesec}
\renewcommand{\chaptername}{ \thechapter }
\titleformat{\chapter}[\style]{\bfseries}
{\filcenter\LARGE\enspace\bfseries{\color{main}\chaptername}\enspace}{1pt}{\bfseries\color{main}\LARGE\filcenter}[\filcenter\@base]
\titleformat{\section}[hang]{\sffamily}
{\hspace{-2.45em}\Large\bfseries{\color{main}\thesection}\enspace}{1pt}{\color{main}\Large\bfseries\filright}
\titleformat{\subsection}[hang]{\sffamily}
{\large\bfseries\color{main}\thesubsection\enspace}{1pt}{\color{main}\large\bfseries\filright}
\titlespacing{\chapter}{0pt}{0pt}{1.5\baselineskip}
%\titlespacing{\subsection}{0pt}{0.5\baselineskip}{-\baselineskip}
%%
\renewcommand{\contentsname}{\hspace{2em}}
\renewcommand{\figurename}{}
\renewcommand{\tablename}{}
\renewcommand{\partname}{}
\renewcommand{\listfigurename}{\bfseries }
\renewcommand{\listtablename}{\bfseries }
\renewcommand{\bibname}{\bfseries }
\renewcommand{\appendixname}{\bfseries \hspace{2em}}
\renewcommand{\indexname}{\bfseries \hspace{2em}}
\RequirePackage{caption}
\captionsetup{labelfont = bf}
%%
\RequirePackage{fontenc}
\RequirePackage[no-math,cm-default]{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\RequirePackage{xunicode}
\RequirePackage{xltxtra}
\setmainfont[Ligatures=TeX]{Minion Pro} % (\textrm)
\setsansfont{Myriad Pro} % (\textsf)
\setmonofont{Inconsolata}%Palatino Linotype
%--%
\RequirePackage{xeCJK}
\setCJKmainfont[BoldFont={},ItalicFont={}]{}%_GBK Adobe Song Std L
\setCJKsansfont[BoldFont={}]{线}
\setCJKmonofont{线}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
\setCJKfamilyfont{new}{}
\setCJKfamilyfont{note}{}
\newfontfamily\gara{Adobe Garamond Pro}
%% \\
\RequirePackage{environ}
\RequirePackage{tikz}
\usetikzlibrary{shapes,decorations}
\definecolor{bule}{RGB}{18,29,57}
\definecolor{bablue}{RGB}{248,248,248}
%define the style of tikz newthemsty
\tikzstyle{newthemsty}
=[draw=main, fill=blue!10,very thick,rectangle,
rounded corners, inner sep=10pt, inner ysep=20pt]
\tikzstyle{newthemstytitle}
=[fill=main, text=blue!10]
\tikzstyle{newdefinitionsty}
=[draw=seco, fill=yellow!20,very thick,rectangle,
rounded corners, inner sep=10pt, inner ysep=20pt,
text=black,fill opacity=0.9]
\tikzstyle{newdefinitionstytitle}
=[fill=seco, text=white]
\tikzstyle{newpropositionsty}
=[draw=thid, fill=bablue,very thick,rectangle,
rounded corners, inner sep=10pt, inner ysep=20pt,
text=black,fill opacity=0.9]
\tikzstyle{newpropositionstytitle}
=[fill=thid, text=white]
%%define the "newthem" environment
\newcounter{Newthem}[chapter]
\renewcommand{\theNewthem}{\thechapter.\arabic{Newthem}}
\NewEnviron{newthem}[1][{}]{%
\begin{figure}[!htb]
\noindent\centering
\begin{tikzpicture}
\node[newthemsty] (box){
\begin{minipage}{0.93\columnwidth}
\sffamily\refstepcounter{Newthem}\BODY
\end{minipage}};
\node[newthemstytitle,right=10pt] at (box.north west){
\bf\textsf{Theorem \theNewthem\; #1}};
\node[newthemstytitle, rounded corners] at (box.east) {$\clubsuit$};
\end{tikzpicture}
\end{figure}}
%%define the "newlemma" environment
\newcounter{Newlemma}[chapter]
\renewcommand{\theNewlemma}{\thechapter.\arabic{Newlemma}}
\NewEnviron{newlemma}[1][{}]{%
\begin{figure}[!htb]
\noindent\centering
\begin{tikzpicture}
\node[newthemsty] (box){
\begin{minipage}{0.93\columnwidth}
\sffamily \refstepcounter{Newlemma}\BODY
\end{minipage}};
\node[newthemstytitle,right=10pt] at (box.north west){
\bf\textsf{Lemma \theNewlemma\; #1}};
\node[newthemstytitle, rounded corners] at (box.east) {$\clubsuit$};
\end{tikzpicture}
\end{figure}}
%%define the "newcorol" environment
\newcounter{Newcorol}[chapter]
\renewcommand{\theNewcorol}{\thechapter.\arabic{Newcorol}}
\NewEnviron{newcorol}[1][{}]{%
\begin{figure}[!htb]
\noindent\centering
\begin{tikzpicture}
\node[newthemsty] (box){
\begin{minipage}{0.93\columnwidth}
\sffamily\refstepcounter{Newcorol}\BODY
\end{minipage}};
\node[newthemstytitle,right=10pt] at (box.north west){
\bf\textsf{Corollary \theNewcorol\; #1}};
\node[newthemstytitle, rounded corners] at (box.east) {$\clubsuit$};
\end{tikzpicture}
\end{figure}}
%% define the "proposition" environment
\newcounter{Newprop}[chapter]
\renewcommand{\theNewprop}{\thechapter.\arabic{Newprop}}
\NewEnviron{newprop}[1][{}]{%
\begin{figure}[!htb]\noindent\centering
\begin{tikzpicture}
\node[newpropositionsty] (box){
\begin{minipage}{0.93\columnwidth}
\sffamily\refstepcounter{Newprop}\BODY
\end{minipage}};
\node[newpropositionstytitle,right=10pt] at (box.north west){
\bf\textsf{Proposition \theNewprop\; #1}};
\node[newpropositionstytitle, rounded corners] at (box.east) {$\spadesuit$};
\end{tikzpicture}
\end{figure}}
%%define the "newdef" environment
\newcounter{Newdefinition}[chapter]
\renewcommand{\theNewdefinition}{\thechapter.\arabic{Newdefinition}}
\NewEnviron{newdef}[1][{}]{%
\begin{figure}[!htb]\noindent\centering
\begin{tikzpicture}
\node [newdefinitionsty] (dbox){\begin{minipage}{0.93\textwidth}\itshape\refstepcounter{Newdefinition}\BODY\end{minipage}};
\node[newdefinitionstytitle, right=10pt] at (dbox.north west) {\bf\textsf{Definition \theNewdefinition\; #1}};
\node[newdefinitionstytitle, rounded corners] at (dbox.east) {$\heartsuit$};
\end{tikzpicture}
\end{figure}}
%% Example with counter
\newcounter{Newexam}[chapter]
\renewcommand{\theNewexam}{\thechapter.\arabic{Newexam}}
\newenvironment{example}{\par\noindent\textbf{Example\,\refstepcounter{Newexam}\theNewexam: }\color{black!90}}{\par}
%% Exercise with counter
\newcounter{Newexer}[chapter]
\renewcommand{\theNewexer}{\thechapter.\arabic{Newexer}}
\newenvironment{exercise}{\par\noindent{\makebox[0pt][r]{\color{main}\ding{50}\;\;}}\textbf{Exercise\,\refstepcounter{Newexer}\theNewexer: }}{\par}
%%define the note and newproof environment
\RequirePackage{pifont,manfnt}
\newenvironment{note}{\par\itshape\CJKfamily{note}\gara\noindent{\makebox[0pt][r]{\scriptsize\color{red!90}\textdbend\quad}\textbf{Note:}}}{\par}
\newenvironment{remark}{\par\itshape\CJKfamily{note}\gara\noindent{\makebox[0pt][r]{\color{red!90}\ding{96}\quad}\textbf{Remarks:}}}{\par}
\newenvironment{assumption}{\par\noindent\textbf{Assumptions: }\color{black!90}}{\par}
\newenvironment{conclusion}{\par\noindent\textbf{Conclusions: }}{\par}
\newenvironment{property}{\par\noindent\textbf{Properties: }}{\par}
\newenvironment{newproof}{\par\noindent{\makebox[0pt][r]{\color{main}\ding{43}\;\;}\textbf{Proof:}}\color{black!90}\small}{\hfill$\Box$\quad\par}
\newenvironment{solution}{\par\noindent{\makebox[0pt][r]{\color{main}\ding{46}\;\;}\textbf{Solution:}}\small}{\hfill$\Box$\quad\par}
\newenvironment{custom}[1]{\par\noindent{\makebox[0pt][r]{\color{main}\ding{34}\;\;}\textbf{#1:}}\small}{\par}
%
\RequirePackage{fancyhdr}
\RequirePackage{lastpage}
\fancyhf{}
\fancyhead[EL,OR]{\color{main}--\thepage/\pageref{LastPage}--}
\fancyhead[ER]{\color{main}\em\nouppercase\leftmark{}}
\fancyhead[OL]{\color{main}\em\nouppercase\rightmark}
\fancyfoot[c]{\@base}
\renewcommand{\headrule}{\color{main}\hrule width\textwidth}
\pagestyle{fancy}
\fancypagestyle{plain}{\renewcommand{\headrulewidth}{0pt}\fancyhf{}\renewcommand{\headrule}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\; #1}{} }
\renewcommand{\chaptermark}[1]{\markboth{\chaptername \; #1\;}{}}
%\let\origdoublepage\cleardoublepage
%\newcommand{\clearemptydoublepage}{%
% \clearpage
% {\pagestyle{empty}\origdoublepage}%
%}
%\let\cleardoublepage\clearemptydoublepage
%\RequirePackage{nextpage}
%\cleartooddpage[\thispagestyle{empty}]
%\cleartoevenpage[\thispagestyle{empty}]
%%
\def\maketitle{%
\thispagestyle{empty}
\@cover
\vfill
\vspace*{2cm}
\begin{center}
\color{seco}
\rule{0.8\textwidth}{2pt}\\
\Huge {\color{main} \bfseries \the\entitle } {\color{seco} \bfseries \the\enend}\\
{\Huge \CJKfamily{new}{\color{main} \the\zhtitle } \the\zhend}\\
\rule{0.8\textwidth}{2pt}
\end{center}
\vskip3ex
\begin{figure}[htp]
\centering
\@logo
\end{figure}
\begin{center}
\begin{minipage}{0.65\textwidth}
\Eindent\color{bule}\@myquote
\end{minipage}
\end{center}
\vfill
\vspace{2cm}
\begin{flushright}
\color{seco}
\rule{0.45\textwidth}{1pt}\\
{\color{main}\@author}\\
{\color{main}\today}\\
Email: \hyperlink{\the\email}{\the\email}\\
\rule{0.45\textwidth}{1pt}
\end{flushright}
\vfill
\begin{center}
\color{seco} Version: \the\version
\end{center}
\vfil\eject
}
%%
%----/-----
%----CJK
%\f@size = pt/pt
%\p@ = 1pt
\def\elegant@CJKChar@size{\hskip \f@size \p@}
%----
% = + =
\newdimen\elegant@CJKChar@size@dimen
\settowidth\elegant@CJKChar@size@dimen{\elegant@CJKChar@size\CJKglue}
%----
%
\newcommand{\CJKsetfontspace}{%
%
\settowidth\elegant@CJKChar@size@dimen{\elegant@CJKChar@size\CJKglue}%
%
%0
\ifdim\parindent=0pt%
\relax%
\else%
\parindent2\elegant@CJKChar@size@dimen%
\fi%
}
\newcommand{\Eindent}{\CJKsetfontspace\parindent2\elegant@CJKChar@size@dimen}
\newcommand{\Enoindent}{\parident\z@}
%----
\AtBeginDocument{\Eindent}

482
figure/blackbase.pdf Normal file

File diff suppressed because one or more lines are too long

505
figure/bluebase.pdf Normal file

File diff suppressed because one or more lines are too long

BIN
figure/cover.pdf Normal file

Binary file not shown.

480
figure/cyanbase.pdf Normal file

File diff suppressed because one or more lines are too long

473
figure/greenbase.pdf Normal file

File diff suppressed because one or more lines are too long

BIN
figure/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

1629
figure/logo.pdf Normal file

File diff suppressed because one or more lines are too long

BIN
figure/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

BIN
figure/logo.zip Normal file

Binary file not shown.

BIN
figure/logo100x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
figure/logo150x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
figure/logo200x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
figure/logo250x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
figure/logo300x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
figure/logo400x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
figure/logo500x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
figure/logo50x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
figure/logox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
guide.pdf Normal file

Binary file not shown.

271
guide.tex Normal file
View File

@@ -0,0 +1,271 @@
%!TEX program = xelatex
\documentclass[color=green, mtpro,titlestyle=hang,mathpazo]{elegantbook}
\author{ddswhu \& LiamHuang0205}
\email{elegantlatex2e@gmail.com}
\zhtitle{优美的\LaTeX{} 书籍}
\zhend{模板}
\entitle{Elegant\LaTeX{} Book}
\enend{Template}
\version{2.00}
\myquote{Victory won\rq t come to us unless we go to it.}
\logo{logo.pdf}
\cover{cover.pdf}
%green color
\definecolor{main1}{RGB}{0,120,2}
\definecolor{seco1}{RGB}{230,90,7}
\definecolor{thid1}{RGB}{0,160,152}
%cyan color
\definecolor{main2}{RGB}{0,175,152}
\definecolor{seco2}{RGB}{239,126,30}
\definecolor{thid2}{RGB}{120,8,13}
%blue color
\definecolor{main3}{RGB}{20,50,104}
\definecolor{seco3}{RGB}{180,50,131}
\definecolor{thid3}{RGB}{7,127,128}
\usepackage{makecell}
\usepackage{lipsum}
\usepackage{texnames}
\usepackage{afterpage}
\begin{document}
\maketitle
\tableofcontents
\mainmatter
\chapter{ElegantBook 模板的由来}
只有当自己想去做一件事的时候才能把事情做好!
\section{ElegantNote 的前世今生}
写 ElegantNote 模板的初衷是为了简化我在写笔记中的工作因为我不会写类文件和包文件所以最当初是想拜托小L做出一个华丽清爽的 \LaTeX{} 模板最好是类文件而且因为这样可以简化导言区复杂的内容。后来和小L一拍即合遂开始一起做Elegant\LaTeX{}的设计。
在学校的时候,搞定了定理环境样式的代码。因为不想重复 China\TeX{} 那个经典的页眉页脚我找到了计量书上的一个图案小L拿 Ti\emph{k}Z 一点一点把那个画出来了,不过我最后还是用的截取的方式得到的图案。慢慢地,我们把初步的样子做出来了。
2013年的暑假开始后我对那个初步的模板做了一点改动然后用它写了Dynamic Programing 的笔记并且在写的过程中对模板加了封面也就是模板现在的封面logo 在Version 2.00中已经改了)。至此,模板的大致样子终于出来了,不过当时也在写笔记的过程中知道了某些不足,比如
\begin{enumerate}
\item 定理类的环境在我们这个模板中不能浮动也不能跨页在Version 2.00 版本中已经添加。
\item 某些环境不足比如例子、假设、性质、结论等环境在1.00版本中已经增加了这几个环境在2.00版本中,环境设置更加全面。
\item 一些我们不可预知的错误将会不期而遇。
\item 一些我们目前没有需求,但是可以继续改进的地方,比如表格样式,比如抄录样式等。
\end{enumerate}
写完那个笔记之后越发让我对 Elegant\LaTeX{} 模板的制作更有激情在和小L相互讨论的几天里我们终于得到了1.00 版本的 ElegantNote 模板。
\section{ElegantBook 的诞生}
在实际应用中,我们发现了一个比较重要的问题,因为在一般的笔记中,定义、定理经常一起出现,和课本区别比较大的是,通常是一堆定义之后,出现一堆性质或者定理。如果出现这种情况,使用 ElegantNote 模板会导致分块很严重,影响排版质量和美观。思前想后,我们决定将 ElegantNote 模板更新为 ElegantBook 模板,并在未来重新设计一个简洁版本的 ElegantNote。 至此ElegantBook 才横空出世由于更名原因ElegantBook 1.00 版本也即原来的 ElegantNote 而ElegantBook 2.00 为目前的正式版本。
\section{一张白纸折腾出一个模板}
我以前从未写过类文件,所以,写这个模板的过程必然是折腾的过程,在写模板的过程中,最主要参考了《写给\LaTeXe{} 类与宏包的作者》\cite{packagewriter}、moderncv.cls 文件、\href{http://aff.whu.edu.cn/huangzh/}{武汉大学黄正华老师的论文模板}、《\LaTeXe{} 完全学习手册》\cite{complete}{\itshape The Not So Short Introduction to \LaTeXe{}}\cite{oetiker2010not}以及各大\LaTeX{} 疑问解答网站,在此为无私奉献的组织和个人表示感谢!
{\color{thid}忍不住插个图!}
\begin{figure}[!hbtp]
\includegraphics[width=0.8\textwidth]{happy.jpg}
\caption{Happiness,We have it!\label{figur:happy}}
\end{figure}
\chapter{ElegantBook 开服说明}
\section{关于我们}
我们目前都是学生,接触 \LaTeX{} 的时间也不是很长,因此,对于此模板的错误还请多多包涵! 目前,模板的拓展性或者可移植性有待完善,所以,我们强烈建议用户不要大幅修改模板文件,我们的初衷是提供一套模板,让初学者能够使用一些比较美观,优雅的模板。如果在使用过程中,想修改一些简单的东西需要帮忙,请联系我们,我们的邮箱是:\href{elegantlatex2e@gmail.com}{elegantlatex2e@gmail.com}。我们将竭尽全力提供帮助!
值此版本发行之际,我们 Elegant\LaTeX{} 项目组向大家重新介绍一下我们的工作,我们的主页是 \url{http://elegantlatex.tk},我们这个项目致力于打造一系列美观、优雅、简便的模板方便使用者记录学习历史。其中目前在实施或者在规划中的子项目有 书籍模板ElegantBook、笔记模板ElegantNote、幻灯片模板 ElegantSlide。这些子项目的名词是一体的请在使用这些名词的时候不要将其断开如 Elegant Note是不正确的写法。并且Elegant\LaTeX{} Book 指的即是 ElegantBook。
\section{关于字体}
基于本模板追求视觉上的美观的角度,强烈建议使用者安装./fonts/文件夹下的字体。出于版权的考虑,务必不能将此模板用于涉及盈利目的的商业行为,否则,后果自负,本模板带的字体仅供学习使用,如果您喜欢某种字体,请自行购买正版。本文主要使用的字体如下
\begin{itemize}
\itemsep=3pt
\parskip=0pt
\item Adobe Garamond Pro
\item Minion Pro \& Myriad Pro \& Inconsolata
\item 方正字体
\item 华文中宋
\end{itemize}
\begin{note}
中文正文使用了华文中宋Minion Pro为英文衬线字体\verb|\rmfamily|Myriad Pro为英文非衬线字体\verb|\sffamily|Inconsolata 为英文打字机字体(\verb|\ttfamily|)。
并且如果系统内安装了Adobe 字体,大家可以把模板中使用到的黑体,楷体,宋体等字替换成 Adobe 字体,这样可以达到最佳效果。
\end{note}
\section{文档说明}
\subsection{编译方式}
本模板基于book文类所以book的选项对于本模板也是有效的。但是只支持 \XeLaTeX{},编码为 UTF-8推荐使用 \TeX{}live编译。作者编写环境为Win8.1(64bit)+\TeX{}live 2013由于使用了参考文献所以编译顺序为\XeLaTeX->\BibTeX->\XeLaTeX->\XeLaTeX
本文特殊选项设置共有3类分为{\color{main}颜色}{\color{main} 数学字体 }以及{\color{main} 章标题显示风格}
\subsection{选项设置}
第一类为{\color{main}颜色}主题设置,内置 3 组颜色主题,分别为 \verb|green|(默认),\verb|cyan|\verb|blue|,另外还有一个自定义的选项 \verb|nocolor|,用户\textbf{必须}在使用模板的时候选择某个颜色主题或选择 \verb|nocolor|选项。调用颜色主题 \verb|green| 的方法为\verb|\documentclass[green]{elegantbook}|或者使用\verb|\documentclass[color=green]{elegantbook}|。需要改变颜色的话请选择 \verb|nocolor|选项或者使用 \verb|color=none|然后在导言区定义main、seco、thid颜色具体的方法如下
\begin{verbatim}
\definecolor{main}{RGB}{70,70,70} %定义main颜色值
\definecolor{seco}{RGB}{115,45,2} %定义seco颜色值
\definecolor{thid}{RGB}{0,80,80} %定义thid颜色值
\base{blackbase.pdf} %可以改为自己想要的图案
\end{verbatim}
第二类为{\color{main}数学字体}设置,有两个可选项,分别是 mathpazo默认 和 mtpro2 字体调用mathpazo 字体使用 \verb|\documentclass[mathpazo]{elegantbook}|,调用 mtpro2 字体时需要把 \verb|mathpazo|换成 \verb|mtpro|mathpazo 不需要用户自己安装字体mtpro2 的字体需要自己安装。
\begin{table}[htp]
\centering
\begin{tabular}{ccccc}
\toprule
& green & cyan & blue & 主要使用的环境\\
\midrule
main & \makecell{{\color{main1}\rule{1cm}{1cm}}}& \makecell{{\color{main2}\rule{1cm}{1cm}}}&\makecell{ {\color{main3}\rule{1cm}{1cm}}}& newthem \ newlemma \ newcorol\\
seco &\makecell{ {\color{seco1}\rule{1cm}{1cm}}}& \makecell{{\color{seco2}\rule{1cm}{1cm}}}&\makecell{ {\color{seco3}\rule{1cm}{1cm}}}&newdef\\
thid &\makecell{ {\color{thid1}\rule{1cm}{1cm}}}& \makecell{{\color{thid2}\rule{1cm}{1cm}}}&\makecell{ {\color{thid3}\rule{1cm}{1cm}}}&newprop\\
\bottomrule
\end{tabular}
\caption{ElegantBook 模板中的三套颜色主题\label{tab:color thm}}
\end{table}
第三类为{\color{main} 章标题显示风格},包含 \verb|hang|(默认)与 \verb|display|两种风格,区别在于章标题单行显示(\verb|hang|)与双行显示(\verb|display|),本说明使用了 \verb|hang|。调用方式为 \verb|\documentclass[hang]{elegantbook}|或者 \verb|\documentclass[titlestyle=hang]{elegantbook}|。
综合起来,同时调用三个选项使用 \verb|\documentclass[color=X,Y,titlestyle=Z]{elegantbook}|。其中 \verb|X| 可以选择 \verb|green|,\verb|cyan|,\verb|blue|,\verb|none|\verb|Y| 可以选择 \verb|mathpazo|或者 \verb|mtpro|\verb|Z|可以选择 \verb|hang| 或者 \verb|display|。
\subsection{数学环境简介}
在我们这个模板中,定义了三大类环境
\begin{enumerate}
\item 定理类环境包含标题和内容两部分。根据格式的不同分为3种
\begin{itemize}
\item {\color{main} newthem、newlemma、newcorol} 环境颜色为主颜色main三者编号均以章节为单位
\item {\color{main} newdef} 环境含有一个可选项编号以章节为单位颜色为seco
\item {\color{main} newprop} 环境含有一个可选项编号以章节为单位颜色为thid。
\end{itemize}
\item 证明类环境,有 {\color{main} newproof、note、remark、solution} 环境,特点是,有引导符和引导词,并且 newproof、solution 环境有结束标志。
\item 结论类环境,有 {\color{main} conclusion、assumption、property} 环境,三者均以粗体的引导词为开头,和普通段落格式一致。
\item 示例类环境--- {\color{main} example、exercise}环境编号以章节为单位其中exercise环境有引导符。
\item 自定义环境--- {\color{main} custom}带一个必选参数格式与conclusion 环境很类似。
\end{enumerate}
\subsection{可编辑的字段}
在模板中,可以编辑的字段分别为作者\verb|\author|、\verb|\email|、\verb|\zhtitle|、\verb|\zhend|、\verb|\entitle|、\verb|\enend|、\verb|\version|。并且,可以根据自己的喜好把封面水印效果的\verb|cover.pdf|替换掉,以及封面中用到的\verb|logo.pdf|。
\chapter{ElegantBook 写作示例}
\section{灵魂不随便出卖,代码也不随便瞎写}
\lipsum[3]
考虑如下的随机动态规划问题
\begin{align*}
&\max(\min)\quad \mathbb{E}\int_{t_0}^{t_1}f(t,x,u)\,dt\\
&\quad\mbox{s.t.} \quad dx=g(t,x,u)dt+\sigma(t,x,u)dz\\
&\quad \hspace{2.em} k(0)=k_0\;\text{given}
\end{align*}
where $z$ is stochastic process or white noise or wiener process.
\begin{newdef}[Wiener Process]
If $z$ is wiener process, then for any partition $t_0,t_1,t_2,\ldots$ of time interval, the random variables $z(t_1)-z(t_0),z(t_2)-z(t_1),\ldots$ are independently and normally distributed with zero means and variance $t_1-t_0,t_2-t_1,\ldots$
\end{newdef}
\lipsum[5]
\begin{example}
$E$ and $F$ be two events such that $\mbf{P}(E)=\mbf{P}(F)=1/2$, and $\mbf{P}(E\cap F)=1/3$, let $\mathscr{F}=\sigma(Y)$, $X$ and $Y$ be the indicate function of $E$ and $F$ respectively. How to compute $\mathbb{E}[ X\mid \mathscr{F} ]$?
\end{example}
\lipsum[4]
\begin{exercise}
let $S=l^\infty=\big\{(x_n)\mid \exists\, M \text{ such that } \forall n, |x_n|\leq M,x_n\in \mathbb{R}\big\}$, $\rho_{\infty}(x,y)=\sup\limits_{n\geq 1}|x_n-y_n|$, show that $\big(l^\infty,\rho_{\infty}\big)$ is complete.
\end{exercise}
\begin{newthem}[勾股定理]\label{thm:3.1}
勾股定理的数学表达Expression
\[a^2+b^2=c^2\]
其中$a,b$为直角三角形的两条直角边长,$c$为直角三角形斜边长。
\end{newthem}
\begin{note}
在本模板中引理lemma推论corollary )的样式和定理的样式一致,包括颜色,仅仅只有计数器的设置不一样。在这个例稿中,我们将不给出引理推论的例子。
\end{note}
\lipsum[4]
\begin{newprop}[最优性原理]
如果$u^*$$[s,T]$上为最优解,则$u^*$$[s,T]$任意子区间都是最优解,假设区间为$[t_0,t_1]$的最优解为$u^*$,则$u(t_0)=u^{*}(t_0)$,即初始条件必须还是在$u^*$上。
\end{newprop}
\lipsum[5-6]
\begin{newcorol}
假设$V(\cdot,\cdot)$为值函数,则跟据最大值原理,有如下推论
\[
V(k,z)=\max\Big\{u\big(zf(k)-y\big)+\beta \mathbb{E}V(y,z^\prime)\Big\}
\]
\end{newcorol}
\begin{newproof}
因为 $y^*=\alpha\beta z k^\alpha$$V(k,z)=\alpha/1-\alpha\beta\ln k_0+1/1-\alpha\beta \ln z_0+\Delta$
\begin{align*}
\text{右边}&=\Big\{u\big(zf(k)-y\big)+\beta \mathbb{E}V(y,z^\prime)\Big\}\\
&=\ln(zk^\alpha-\alpha\beta zk^\alpha)+\beta\mathbb{E}\Big[\frac{\alpha}{1-\alpha\beta}\ln y+\frac{1}{1-\alpha\beta}\ln z^\prime+\Delta\Big]\\
&=\ln(1-\alpha\beta)zk^\alpha+\beta\Big\{\mathbb{E}\big[\frac{\alpha}{1-\alpha\beta}\ln \alpha\beta z k^\alpha\big]+\frac{1}{1-\alpha\beta}\mathbb{E}[\ln z^\prime]+\Delta\Big\}
\end{align*}
利用$\mathbb{E}[\ln z^\prime]=0$,并将对数展开得
\begin{align*}
\text{右边}&=\ln (1-\alpha\beta)+\ln z+\alpha\ln k+\frac{\alpha\beta}{1-\alpha\beta}\big[\ln \alpha\beta+\ln z+\alpha\ln k\big]+\frac{\beta}{1-\alpha\beta}\mu+\beta \Delta\\
&=\frac{\alpha}{1-\alpha\beta}\ln k+\frac{1}{1-\alpha\beta}\ln z+\Delta
\end{align*}
所以$\text{左边}=\text{右边}$,证毕。
\end{newproof}
\begin{property}
Properties of Cauchy Sequence
\begin{enumerate}\parskip=0pt \itemsep=0pt
\item $\{x_k\}$ is cauchy sequence then $\{x_k^i\}$ is cauchy sequence.
\item $x_k\in \mathbb{R}^n$, $\rho(x,y)$ is Euclidean, then cauchy is equivalent to convergent, $(\mathbb{R}^n,\rho)$ metric space is complete.
\end{enumerate}
\end{property}
\lipsum[7]
\begin{custom}{Application}
This is one example of the custom environment, the key word is given by the option of custom environment.
\end{custom}
\lipsum[6]
\begin{newdef}[Contraction mapping]
$(S,\rho)$ is the metric space, $T: S\to S$, If there exists $\alpha\in(0,1)$ such that for any $x$ and $y\in S$, the distance
\begin{equation}
\rho(Tx,Ty)\leq \alpha\rho(x,y)
\end{equation}
Then $T$ is a {\color{main} contraction mapping}.
\end{newdef}
\begin{remark}
\begin{enumerate}
\parskip=0pt \itemsep=0pt
\item $T:S\to S$, where $S$ is a metric space, if for any $x,y\in S$, $\rho(Tx,Ty)<\rho(x,y)$ is not contraction mapping.
\item Contraction mapping is continuous map.
\end{enumerate}
\end{remark}
\begin{conclusion}
看到一则小幽默,是这样说的:{\color{main} 别人都关心你飞的有多高,只有我关心你的翅膀好不好吃!}说多了都是泪啊!
\end{conclusion}
\bibliographystyle{ieeetr}
\bibliography{reference}
\addcontentsline{toc}{chapter}{参考文献}
\end{document}

BIN
image/happy.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

18
reference.bib Normal file
View File

@@ -0,0 +1,18 @@
@misc{oetiker2010not,
title={The Not So Short Introduction to {\LaTeXe}},
author={Oetiker, Tobias and Partl, Hubert and Hyna, Irene and Schlegl, Elisabeth},
year={2010}
}
@misc{packagewriter,
title={{\LaTeXe} for class and package writers},
author={The {\LaTeX} 3 Project},
year={1999},
}
@misc{complete,
title={{\LaTeXe} 完全学习手册},
author={胡伟},
year={2011},
publisher={清华大学出版社}
}