diff --git a/base.tex b/base.tex new file mode 100644 index 0000000..b1bca0e --- /dev/null +++ b/base.tex @@ -0,0 +1,34 @@ + +%% tikz setting +\tikzset{x=1pt,y=1pt} +\tikzset{elegant/.style={fill=main,draw=main}, + null/.style={fill=white,draw=none}} + +%% the triangle shape +\newcommand{\triz}[2]{ +\begin{scope}[xshift=#1,rotate=#2] + \draw[elegant] (0,0) -- (105,6) .. controls (119,21) and (132,13) .. (135,12) .. controls (124,15) and (110,8) .. (107,-12) -- cycle; + \draw[null] (40,-0.5) -- (101,-4) -- (103,1)--cycle; +\end{scope} +} + +%% the ellipse shape +127 +\newcommand{\ellz}[1]{ +\begin{scope}[xshift=#1,yshift=3] +\draw[elegant,rotate around={60:(0,-3)}](0,-3) ellipse (10.5 and 8.5); +\draw[null](-3,-10) .. controls (-10,-6) and (-2,6) .. (4.5,4) .. controls (0,3) and (-4,-6) .. (-3,-10)--cycle; +\end{scope} +} + +%% the integration shape+147 +\newcommand{\intz}[1]{ +\begin{scope}[xshift=#1,yshift=2] +\draw[elegant,draw=none,very thin] (-31,-14.5) .. controls (-17,-21) and (-9,-8) .. (-3,0) .. controls (10,19) and (22,17) .. (29,9) .. controls (21,13) and (13,13) .. (3,-1) .. controls (-4,-11) and (-18,-27) .. (-31,-14.5) -- cycle ; +\end{scope} +} + + + + + + diff --git a/elegantbook.cls b/elegantbook.cls index 5bec33b..826238f 100644 --- a/elegantbook.cls +++ b/elegantbook.cls @@ -6,6 +6,7 @@ %% available at http://elegantlatex.tk/download/ %% and http://ddswhu.com/download/ % % +%% Last Modification 2014-2-3 %%%%%%%%%%%%%%%%%%%%% % % !Mode:: "TeX:UTF-8" \NeedsTeXFormat{LaTeX2e} @@ -40,32 +41,45 @@ % ----- 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}% +% \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}% + % \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}% + % \base{bluebase.pdf}% }{\relax} +\AtBeginDocument{ +\input{base.tex} +} + +\providecommand{\base}{ +\begin{tikzpicture}[scale=0.3] +\triz{0}{0} +\ellz{128} +\intz{149} +\ellz{170} +\intz{191} +\ellz{212} +\triz{341}{180} +\end{tikzpicture}} +%\newcommand*{\base}{ +%} % ----- Handle Math option ----- \ifELEGANT@mathpazo @@ -85,8 +99,6 @@ \newtoks\enend \newtoks\zhend - - %%数学字体宏包 %% 常用宏包 @@ -113,6 +125,7 @@ } + %% 页面设置 \RequirePackage{hyperref} @@ -125,41 +138,40 @@ } \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 - } + 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 + 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] +{\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} @@ -185,7 +197,6 @@ \RequirePackage{caption} \captionsetup{labelfont = bf} - %%字体设置 \RequirePackage{fontenc} \RequirePackage[no-math,cm-default]{fontspec} @@ -197,7 +208,7 @@ \setmonofont{Inconsolata}%Palatino Linotype %-中文字体设置-% \RequirePackage{xeCJK} -\setCJKmainfont[BoldFont={黑体},ItalicFont={楷体}]{华文中宋}%方正书宋_GBK Adobe Song Std L +\setCJKmainfont[BoldFont={黑体},ItalicFont={楷体}]{HYShuSongYiJ}%方正书宋_GBK Adobe Song Std L华文中宋 \setCJKsansfont[BoldFont={黑体}]{方正中等线简体} \setCJKmonofont{方正中等线简体} \XeTeXlinebreaklocale "zh" @@ -245,10 +256,10 @@ \begin{tikzpicture} \node[newthemsty] (box){ \begin{minipage}{0.93\columnwidth} - \sffamily\refstepcounter{Newthem}\BODY + \sffamily\BODY \end{minipage}}; \node[newthemstytitle,right=10pt] at (box.north west){ - \bf\textsf{Theorem \theNewthem\; #1}}; + \bf\textsf{Theorem \stepcounter{Newthem}\theNewthem\; #1}}; \node[newthemstytitle, rounded corners] at (box.east) {$\clubsuit$}; \end{tikzpicture} \end{figure}} @@ -262,10 +273,10 @@ \begin{tikzpicture} \node[newthemsty] (box){ \begin{minipage}{0.93\columnwidth} - \sffamily \refstepcounter{Newlemma}\BODY + \sffamily\BODY \end{minipage}}; \node[newthemstytitle,right=10pt] at (box.north west){ - \bf\textsf{Lemma \theNewlemma\; #1}}; + \bf\textsf{Lemma \stepcounter{Newlemma}\theNewlemma\; #1}}; \node[newthemstytitle, rounded corners] at (box.east) {$\clubsuit$}; \end{tikzpicture} \end{figure}} @@ -279,10 +290,10 @@ \begin{tikzpicture} \node[newthemsty] (box){ \begin{minipage}{0.93\columnwidth} - \sffamily\refstepcounter{Newcorol}\BODY + \sffamily\BODY \end{minipage}}; \node[newthemstytitle,right=10pt] at (box.north west){ - \bf\textsf{Corollary \theNewcorol\; #1}}; + \bf\textsf{Corollary \stepcounter{Newcorol}\theNewcorol\; #1}}; \node[newthemstytitle, rounded corners] at (box.east) {$\clubsuit$}; \end{tikzpicture} \end{figure}} @@ -295,10 +306,10 @@ \begin{tikzpicture} \node[newpropositionsty] (box){ \begin{minipage}{0.93\columnwidth} - \sffamily\refstepcounter{Newprop}\BODY + \sffamily\BODY \end{minipage}}; \node[newpropositionstytitle,right=10pt] at (box.north west){ - \bf\textsf{Proposition \theNewprop\; #1}}; + \bf\textsf{Proposition \stepcounter{Newprop}\theNewprop\; #1}}; \node[newpropositionstytitle, rounded corners] at (box.east) {$\spadesuit$}; \end{tikzpicture} \end{figure}} @@ -310,8 +321,8 @@ \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 [newdefinitionsty] (dbox){\begin{minipage}{0.93\textwidth}\itshape\BODY\end{minipage}}; +\node[newdefinitionstytitle, right=10pt] at (dbox.north west) {\bf\textsf{Definition \stepcounter{Newdefinition}\theNewdefinition\; #1}}; \node[newdefinitionstytitle, rounded corners] at (dbox.east) {$\heartsuit$}; \end{tikzpicture} \end{figure}} @@ -320,12 +331,12 @@ %% Example with counter \newcounter{Newexam}[chapter] \renewcommand{\theNewexam}{\thechapter.\arabic{Newexam}} -\newenvironment{example}{\par\noindent\textbf{Example\,\refstepcounter{Newexam}\theNewexam: }\color{black!90}}{\par} +\newenvironment{example}{\par\noindent\textbf{Example\,\stepcounter{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} +\newenvironment{exercise}{\par\noindent{\makebox[0pt][r]{\color{main}\ding{50}\;\;}}\textbf{Exercise\,\stepcounter{Newexer}\theNewexer: }}{\par} %%define the note and newproof environment \RequirePackage{pifont,manfnt} @@ -353,7 +364,7 @@ \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} +\fancyfoot[c]{\base} \renewcommand{\headrule}{\color{main}\hrule width\textwidth} \pagestyle{fancy} diff --git a/figure/blackbase.pdf b/figure/blackbase.pdf deleted file mode 100644 index c9264ab..0000000 Binary files a/figure/blackbase.pdf and /dev/null differ diff --git a/figure/bluebase.pdf b/figure/bluebase.pdf deleted file mode 100644 index 2105472..0000000 Binary files a/figure/bluebase.pdf and /dev/null differ diff --git a/figure/cyanbase.pdf b/figure/cyanbase.pdf deleted file mode 100644 index baa246e..0000000 Binary files a/figure/cyanbase.pdf and /dev/null differ diff --git a/figure/greenbase.pdf b/figure/greenbase.pdf deleted file mode 100644 index 3055349..0000000 Binary files a/figure/greenbase.pdf and /dev/null differ diff --git a/figure/logo.jpg b/figure/logo.jpg deleted file mode 100644 index ffc344a..0000000 Binary files a/figure/logo.jpg and /dev/null differ diff --git a/figure/logo.png b/figure/logo.png index 0bfc297..7e530a5 100644 Binary files a/figure/logo.png and b/figure/logo.png differ diff --git a/figure/logo.zip b/figure/logo.zip deleted file mode 100644 index c21ce2b..0000000 Binary files a/figure/logo.zip and /dev/null differ diff --git a/figure/logo100x.png b/figure/logo100x.png deleted file mode 100644 index 56a6ffe..0000000 Binary files a/figure/logo100x.png and /dev/null differ diff --git a/figure/logo150x.png b/figure/logo150x.png deleted file mode 100644 index d7fd37e..0000000 Binary files a/figure/logo150x.png and /dev/null differ diff --git a/figure/logo200x.png b/figure/logo200x.png deleted file mode 100644 index 6d7ad30..0000000 Binary files a/figure/logo200x.png and /dev/null differ diff --git a/figure/logo250x.png b/figure/logo250x.png deleted file mode 100644 index 937a66f..0000000 Binary files a/figure/logo250x.png and /dev/null differ diff --git a/figure/logo300x.png b/figure/logo300x.png deleted file mode 100644 index 2942a43..0000000 Binary files a/figure/logo300x.png and /dev/null differ diff --git a/figure/logo400x.png b/figure/logo400x.png deleted file mode 100644 index e809baa..0000000 Binary files a/figure/logo400x.png and /dev/null differ diff --git a/figure/logo500x.png b/figure/logo500x.png deleted file mode 100644 index 32ba754..0000000 Binary files a/figure/logo500x.png and /dev/null differ diff --git a/figure/logo50x.png b/figure/logo50x.png deleted file mode 100644 index 04aa578..0000000 Binary files a/figure/logo50x.png and /dev/null differ diff --git a/figure/logox.png b/figure/logox.png deleted file mode 100644 index 3317fab..0000000 Binary files a/figure/logox.png and /dev/null differ diff --git a/guide.pdf b/guide.pdf index 5d100d4..4584035 100644 Binary files a/guide.pdf and b/guide.pdf differ diff --git a/guide.tex b/guide.tex index 0682486..93b9a4b 100644 --- a/guide.tex +++ b/guide.tex @@ -1,14 +1,13 @@ %!TEX program = xelatex - -\documentclass[color=green, mtpro,titlestyle=hang,mathpazo]{elegantbook} +\documentclass[color=green,mathpazo,titlestyle=hang,11pt]{elegantbook} \author{ddswhu \& LiamHuang0205} \email{elegantlatex2e@gmail.com} \zhtitle{优美的\LaTeX{} 书籍} -\zhend{模板} +\zhend{} \entitle{Elegant\LaTeX{} Book} \enend{Template} -\version{2.00} +\version{2.10} \myquote{Victory won\rq t come to us unless we go to it.} \logo{logo.pdf} \cover{cover.pdf} @@ -30,16 +29,10 @@ \usepackage{lipsum} \usepackage{texnames} -\usepackage{afterpage} - - \begin{document} - \maketitle -\tableofcontents - - +\tableofcontents \mainmatter \chapter{ElegantBook 模板的由来} @@ -65,7 +58,7 @@ \section{ElegantBook 的诞生} 在实际应用中,我们发现了一个比较重要的问题,因为在一般的笔记中,定义、定理经常一起出现,和课本区别比较大的是,通常是一堆定义之后,出现一堆性质或者定理。如果出现这种情况,使用 ElegantNote 模板会导致分块很严重,影响排版质量和美观。思前想后,我们决定将 ElegantNote 模板更新为 ElegantBook 模板,并在未来重新设计一个简洁版本的 ElegantNote。 至此ElegantBook 才横空出世,由于更名原因,ElegantBook 1.00 版本也即原来的 ElegantNote, 而ElegantBook 2.00 为目前的正式版本。 -\section{一张白纸折腾出一个模板} +\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{} 疑问解答网站,在此为无私奉献的组织和个人表示感谢! @@ -73,14 +66,14 @@ \section{一张白纸折腾出一个模板} \begin{figure}[!hbtp] \includegraphics[width=0.8\textwidth]{happy.jpg} -\caption{Happiness,We have it!\label{figur:happy}} +\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。 +值此版本发行之际,我们 Elegant\LaTeX{} 项目组向大家重新介绍一下我们的工作,我们的主页是 \href{http://elegantlatex.tk}{http://elegantlatex.tk},我们这个项目致力于打造一系列美观、优雅、简便的模板方便使用者记录学习历史。其中目前在实施或者在规划中的子项目有 书籍模板ElegantBook、笔记模板ElegantNote、幻灯片模板 ElegantSlide。这些子项目的名词是一体的,请在使用这些名词的时候不要将其断开(如 Elegant Note是不正确的写法)。并且,Elegant\LaTeX{} Book 指的即是 ElegantBook。 \section{关于字体} @@ -112,7 +105,6 @@ \subsection{选项设置} \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 的字体需要自己安装。 @@ -182,18 +174,17 @@ \section{灵魂不随便出卖,代码也不随便瞎写} 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} +\begin{newthem}[勾股定理] 勾股定理的数学表达(Expression)为 \[a^2+b^2=c^2\] 其中$a,b$为直角三角形的两条直角边长,$c$为直角三角形斜边长。 \end{newthem} - - \begin{note} 在本模板中,引理(lemma),推论(corollary )的样式和定理的样式一致,包括颜色,仅仅只有计数器的设置不一样。在这个例稿中,我们将不给出引理推论的例子。 \end{note} + \lipsum[4] \begin{newprop}[最优性原理] diff --git a/reference.bib b/reference.bib index 4289510..95a2f84 100644 --- a/reference.bib +++ b/reference.bib @@ -11,7 +11,7 @@ @misc{packagewriter } @misc{complete, title={{\LaTeXe} 完全学习手册}, - author={胡伟}, + author={胡大伟}, year={2011}, publisher={清华大学出版社} }