diff --git a/elegantbook.cls b/elegantbook.cls index 047a359..ffa9683 100644 --- a/elegantbook.cls +++ b/elegantbook.cls @@ -1,387 +1,395 @@ -%%%%%%%%%%%%%%%%%%%%%% -%% start of file `elegantbook.cls'. -%% Copyright 2013-2019 ElegantLaTeX (ddswhu@126.com) -%% -%% This work may be distributed and/or modified freely -%% available at https://ddswhu.me/resource/ -% % -%% Last Modification 2018-01-08 -%%%%%%%%%%%%%%%%%%%%% -% % !Mode:: "TeX:UTF-8" -\NeedsTeXFormat{LaTeX2e} -\ProvidesClass{elegantbook}[2018/01/08 v3.03 ElegantBook document class] - -\RequirePackage{kvoptions} -\RequirePackage{etoolbox} -\SetupKeyvalOptions{family=ELEGANT, prefix=ELEGANT@, setkeys=\kvsetkeys} -\newcommand{\ekv}[1]{\kvsetkeys{ELEGANT}{#1}} - -% ----- Colors ----- -\DeclareStringOption[green]{color} -% ----- backward compatibility -\DeclareVoidOption{green}{\ekv{color = green}} -\DeclareVoidOption{cyan}{\ekv{color = cyan}} -\DeclareVoidOption{blue}{\ekv{color = blue}} -\DeclareVoidOption{nocolor}{\ekv{color = none}} - -% ----- Math option ----- -\newcommand\mailto[1]{\href{mailto:#1}{\nolinkurl{#1}}} - -% ----- 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} - - -\usepackage[UTF8,space=auto,scheme=plain]{ctex} -\usepackage{indentfirst} -\setlength\parindent{2em} - -% font setting for text and math -\RequirePackage[T1]{fontenc} -\RequirePackage{newtxtext} -\RequirePackage{newtxmath} -\RequirePackage[scale=0.85]{newtxtt} -\RequirePackage{type1cm} - - -% ----- Handle Colors ----- -%% 章节以及页脚图形 - -\RequirePackage{xcolor} -\ifdefstring{\ELEGANT@color}{green}{ - \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}% -}{\relax} - -\ifdefstring{\ELEGANT@color}{blue}{ - \definecolor{main}{RGB}{20,50,104}% - \definecolor{second}{RGB}{180,50,131}% - \definecolor{third}{RGB}{7,127,128}% -}{\relax} - -\definecolor{winered}{rgb}{0.5,0,0} - -\AtBeginDocument{ -\input{base.tex} -} - -\providecommand{\base}{ -\begin{tikzpicture}[scale=0.2] -\triz{0}{0} -\ellz{128} -\intz{149} -\ellz{170} -\intz{191} -\ellz{212} -\triz{341}{180} -\end{tikzpicture}} -%\newcommand*{\base}{ -%} - -% ----- 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 - -%%数学字体宏包 - - - -%%中文结构名字 -\renewcommand{\contentsname}{目\hspace{2em}录} -\renewcommand{\figurename}{图} -\renewcommand{\tablename}{表} -\renewcommand{\partname}{部分} -\renewcommand{\listfigurename}{插图目录} -\renewcommand{\listtablename}{表格目录} -\renewcommand{\bibname}{参考文献} -\renewcommand{\appendixname}{附录} -\renewcommand{\indexname}{索\hspace{2em}引} - -% more pretty font -\linespread{1.3} -\RequirePackage{microtype} - - -\RequirePackage{booktabs} -\RequirePackage{multicol} -\RequirePackage{xcolor} -\RequirePackage{graphicx} -\RequirePackage{fancyvrb} -\graphicspath{{image/}{figure/}{fig/}{img/}} - -%% 常用宏包 -\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[width=0.3\textwidth]{#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, - linktoc=all, - bookmarksnumbered=true, - bookmarksopen=true, - pdfsubject=\@author \@title Book, - pdfkeywords={ElegantBook}, - pdfcreator={XeLaTeX with ElegantBook class}, - colorlinks, - linkcolor=main, - citecolor=winered, - 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} -\RequirePackage{apptools} -\RequirePackage[toc,page]{appendix} - -\renewcommand{\chaptername}{第 \thechapter\;章} -\titleformat{\chapter}[\style]{\bfseries} -{\filcenter\LARGE\enspace\bfseries{\color{main}\IfAppendix{\appendixname}{\chaptername}\enspace}}{1pt}{\bfseries\color{main}\LARGE\filcenter}[\filcenter\base] - - -\titleformat{\section}[hang]{\bfseries} -{\hspace{-2.45em}\Large\bfseries{\color{main}\thesection}\enspace}{1pt}{\color{main}\Large\bfseries\filright} - -\titleformat{\subsection}[hang]{\bfseries} -{\hspace{-2.45em}\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} - - - - -\RequirePackage{caption} -\captionsetup{labelfont = bf} - -% list/itemize/enumerate setting -\RequirePackage[shortlabels]{enumitem} -\setlist{nolistsep} - -% caption settings -\RequirePackage[font=small,labelfont={bf}]{caption} -\captionsetup[table]{skip=3pt} -\captionsetup[figure]{skip=3pt} - - -\definecolor{bule}{RGB}{18,29,57} - - - -\RequirePackage[most]{tcolorbox} - -\tcbset{ - common/.style={ - fontupper=\kaishu, - lower separated=false, - coltitle=white, - colback=gray!10, - fonttitle=\bfseries, - enhanced, - breakable, - top=8pt, - 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={:}, - }, - defstyle/.style={ - common, - colframe=main, - 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, - 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, - colbacktitle=third, - overlay unbroken and last={\node[anchor=south east, outer sep=6pt] at (\textwidth-width,0) {\textcolor{third}{$\spadesuit$}}; } - }, -} - -\newtcbtheorem[auto counter,number within=chapter]{definition}{定义}{defstyle}{def} -\newtcbtheorem[auto counter,number within=chapter]{theorem}{定理}{thmstyle}{thm} -\newtcbtheorem[auto counter,number within=chapter]{proposition}{命题}{propstyle}{prop} -\newtcbtheorem[auto counter,number within=chapter]{corollary}{推论}{thmstyle}{cor} -\newtcbtheorem[auto counter,number within=chapter]{lemma}{引理}{thmstyle}{lemma} - - - -%% Example with counter -\newcounter{example}[chapter] -\renewcommand{\theexample}{\thechapter.\arabic{example}} -\newenvironment{example}{\par\noindent\textbf{示例\,\refstepcounter{example}\theexample:}\color{black!90}}{\par} - -%% Exercise with counter -\newcounter{exercise}[chapter] -\renewcommand{\theexercise}{\thechapter.\arabic{exercise}} -\newenvironment{exercise}{\par\noindent\textbf{练习\,\refstepcounter{exercise}\theexercise:}}{\par} - -%%define the note and proof environment -\RequirePackage{pifont,manfnt} -\newenvironment{note}{\par\noindent{\makebox[0pt][r]{\scriptsize\color{red!90}\textdbend\quad}\textbf{注意:}}\itshape}{\par} -\newenvironment{proof}{\par\noindent\textbf{证明:}\color{black!90}\small}{\hfill$\Box$\quad\par} - -\newenvironment{remark}{\noindent\textbf{备注:}}{\par} -\newenvironment{assumption}{\par\noindent\textbf{假设:}}{\par} -\newenvironment{conclusion}{\par\noindent\textbf{结论:}}{\par} -\newenvironment{solution}{\par\noindent\textbf{答案:}}{\par} -\newenvironment{property}{\par\noindent\textbf{性质:}}{\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\;}{}} - - - - - -\DeclareSymbolFont{cmlargesymbols}{OMX}{cmex}{m}{n} -\DeclareMathSymbol{\intop}{\mathop}{cmlargesymbols}{"5A} - \def\int{\intop\nolimits} -\DeclareMathSymbol{\ointop}{\mathop}{cmlargesymbols}{"49} - \def\oint{\ointop\nolimits} -\DeclareMathSymbol{\sumop}{\mathop}{cmlargesymbols}{"58} - \let\sum\sumop -\DeclareMathSymbol{\prodop}{\mathop}{cmlargesymbols}{"59} - \let\prod\prodop - -\newcommand\figref[1]{\textbf{Figure}~\ref{#1}} -\newcommand\tabref[1]{\textbf{Table}~\ref{#1}} - - - -%%封面 - -\def\maketitle{% -\thispagestyle{empty} -% \@cover -\vfill -\vspace*{2cm} -\begin{center} -\color{second} -\rule{0.8\textwidth}{2pt}\\ -\Huge {\color{main} \bfseries \the\entitle } {\color{second} \bfseries \the\enend}\\ -{\Huge \bfseries{\color{main} \the\zhtitle } \the\zhend}\\ -\rule{0.8\textwidth}{2pt} -\end{center} -\vfill -\vskip5ex -\centerline{\@logo} -\begin{center} -\begin{minipage}{0.65\textwidth} -\indent\centering\color{bule}\@myquote -\end{minipage} -\end{center} -\vfill -\begin{flushright} -\color{second} -\rule{0.45\textwidth}{1pt}\\ -作者:{\color{main}\@author}\\ -时间:{\color{main}\today}\\ -邮箱: \hyperlink{\the\email}{\the\email}\\ -\rule{0.45\textwidth}{1pt} -\end{flushright} -\vfill -\begin{center} -\color{second} 版本: \the\version -\end{center} -\vfil\eject -} - - - - -\RequirePackage{natbib} -\setlength{\bibsep}{0.0pt} -\def\bibfont{\footnotesize} +%%%%%%%%%%%%%%%%%%%%%% +%% start of file `elegantbook.cls'. +%% Copyright 2013-2019 ElegantLaTeX (elegantlatex2e@gmail.com) +%% +%% This work may be distributed and/or modified freely +%% available at https://github.com/ElegantLaTeX +% % +%% Last Modification 2019-01-15 +%%%%%%%%%%%%%%%%%%%%% +% % !Mode:: "TeX:UTF-8" +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{elegantbook}[2019/01/15 v3.04 ElegantBook document class] + +\RequirePackage{kvoptions} +\RequirePackage{etoolbox} +\SetupKeyvalOptions{family=ELEGANT, prefix=ELEGANT@, setkeys=\kvsetkeys} +\newcommand{\ekv}[1]{\kvsetkeys{ELEGANT}{#1}} + +% ----- Colors ----- +\DeclareStringOption[green]{color} +% ----- backward compatibility +\DeclareVoidOption{green}{\ekv{color = green}} +\DeclareVoidOption{cyan}{\ekv{color = cyan}} +\DeclareVoidOption{blue}{\ekv{color = blue}} +\DeclareVoidOption{nocolor}{\ekv{color = none}} + +% ----- Math option ----- +\newcommand\mailto[1]{\href{mailto:#1}{\nolinkurl{#1}}} + +% ----- 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} + + +\usepackage[UTF8,space=auto,scheme=plain]{ctex} +\usepackage{indentfirst} +\setlength\parindent{2em} + +% font setting for text and math +\RequirePackage[T1]{fontenc} +\RequirePackage{newtxtext} +\RequirePackage{newtxmath} +\RequirePackage[scale=0.85]{newtxtt} +\RequirePackage{type1cm} + + +% ----- Handle Colors ----- +%% 章节以及页脚图形 + +\RequirePackage{xcolor} +\ifdefstring{\ELEGANT@color}{green}{ + \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}% +}{\relax} + +\ifdefstring{\ELEGANT@color}{blue}{ + \definecolor{main}{RGB}{20,50,104}% + \definecolor{second}{RGB}{180,50,131}% + \definecolor{third}{RGB}{7,127,128}% +}{\relax} + +\definecolor{winered}{rgb}{0.5,0,0} + +\AtBeginDocument{ +\input{base.tex} +} + +\providecommand{\base}{ +\begin{tikzpicture}[scale=0.2] +\triz{0}{0} +\ellz{128} +\intz{149} +\ellz{170} +\intz{191} +\ellz{212} +\triz{341}{180} +\end{tikzpicture}} +%\newcommand*{\base}{ +%} + +% ----- 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 + +%%数学字体宏包 + + + +%%中文结构名字 +\renewcommand{\contentsname}{目\hspace{2em}录} +\renewcommand{\figurename}{图} +\renewcommand{\tablename}{表} +\renewcommand{\partname}{部分} +\renewcommand{\listfigurename}{插图目录} +\renewcommand{\listtablename}{表格目录} +\renewcommand{\bibname}{参考文献} +\renewcommand{\appendixname}{附录} +\renewcommand{\indexname}{索\hspace{2em}引} + +% more pretty font +\linespread{1.3} +\RequirePackage{microtype} + + +\RequirePackage{booktabs} +\RequirePackage{multicol} +\RequirePackage{xcolor} +\RequirePackage{graphicx} +\RequirePackage{fancyvrb} +\graphicspath{{image/}{figure/}{fig/}{img/}} + +%% 常用宏包 +\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[width=0.3\textwidth]{#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, + linktoc=all, + bookmarksnumbered=true, + bookmarksopen=true, + pdfsubject=\@author \@title Book, + pdfkeywords={ElegantBook}, + pdfcreator={XeLaTeX with ElegantBook class}, + colorlinks, + linkcolor=main, + citecolor=winered, + 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} +\RequirePackage{apptools} +\RequirePackage[toc,page]{appendix} + +\renewcommand{\chaptername}{第 \thechapter\;章} +\titleformat{\chapter}[\style]{\bfseries} +{\filcenter\LARGE\enspace\bfseries{\color{main}\IfAppendix{\appendixname}{\chaptername}\enspace}}{1pt}{\bfseries\color{main}\LARGE\filcenter}[\filcenter\base] + + +\titleformat{\section}[hang]{\bfseries} +{\hspace{-2.45em}\Large\bfseries{\color{main}\thesection}\enspace}{1pt}{\color{main}\Large\bfseries\filright} + +\titleformat{\subsection}[hang]{\bfseries} +{\hspace{-2.45em}\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} + + + + +\RequirePackage{caption} +\captionsetup{labelfont = bf} + +% list/itemize/enumerate setting +\RequirePackage[shortlabels]{enumitem} +\setlist{nolistsep} + +% caption settings +\RequirePackage[font=small,labelfont={bf}]{caption} +\captionsetup[table]{skip=3pt} +\captionsetup[figure]{skip=3pt} + + +\definecolor{bule}{RGB}{18,29,57} + + + +\RequirePackage[most]{tcolorbox} + +\tcbset{ + common/.style={ + fontupper=\kaishu, + lower separated=false, + coltitle=white, + colback=gray!10, + fonttitle=\bfseries, + enhanced, + breakable, + top=8pt, + 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={:}, + }, + defstyle/.style={ + common, + colframe=main, + 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, + 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, + colbacktitle=third, + overlay unbroken and last={\node[anchor=south east, outer sep=6pt] at (\textwidth-width,0) {\textcolor{third}{$\spadesuit$}}; } + }, +} + +\newtcbtheorem[auto counter,number within=chapter]{definition}{定义}{defstyle}{def} +\newtcbtheorem[auto counter,number within=chapter]{theorem}{定理}{thmstyle}{thm} +\newtcbtheorem[auto counter,number within=chapter]{proposition}{命题}{propstyle}{pro} +\newtcbtheorem[auto counter,number within=chapter]{corollary}{推论}{thmstyle}{cor} +\newtcbtheorem[auto counter,number within=chapter]{lemma}{引理}{thmstyle}{lem} + + +%% Example with counter +\newcounter{exam}[chapter] +\setcounter{exam}{0} +\renewcommand{\theexam}{\thechapter.\arabic{exam}} +\newenvironment{example}[1][]{ + \refstepcounter{exam}\par\medskip\noindent \textbf{\color{main}{示例}~\theexam #1:}\rmfamily % + }{ + \par\medskip\ignorespacesafterend % + } + +%% Exercise with counter +\newcounter{exer}[chapter] +\setcounter{exer}{0} +\renewcommand{\theexer}{\thechapter.\arabic{exer}} +\newenvironment{exercise}[1][]{ + \refstepcounter{exer}\par\medskip\noindent \textbf{\color{main}{练习}~\theexer #1:}\rmfamily % + }{ + \par\medskip\ignorespacesafterend % + } + + + +%%define the note and proof environment +\RequirePackage{pifont,manfnt} +\newenvironment{note}{\par\noindent{\makebox[0pt][r]{\scriptsize\color{red!90}\textdbend\quad}\textbf{\color{main}{注意:}}}\itshape}{\par} +\newenvironment{proof}{\par\noindent\textbf{\color{main}{证明:}}\color{black!90}\small}{\hfill$\Box$\quad\par} + +\newenvironment{remark}{\noindent\textbf{\color{main}{备注:}}}{\par} +\newenvironment{assumption}{\par\noindent\textbf{\color{main}{假设:}}}{\par} +\newenvironment{conclusion}{\par\noindent\textbf{\color{main}{结论:}}}{\par} +\newenvironment{solution}{\par\noindent\textbf{\color{main}{答案:}}}{\par} +\newenvironment{property}{\par\noindent\textbf{\color{main}{性质:}}}{\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\;}{}} + + + + + +\DeclareSymbolFont{cmlargesymbols}{OMX}{cmex}{m}{n} +\DeclareMathSymbol{\intop}{\mathop}{cmlargesymbols}{"5A} + \def\int{\intop\nolimits} +\DeclareMathSymbol{\ointop}{\mathop}{cmlargesymbols}{"49} + \def\oint{\ointop\nolimits} +\DeclareMathSymbol{\sumop}{\mathop}{cmlargesymbols}{"58} + \let\sum\sumop +\DeclareMathSymbol{\prodop}{\mathop}{cmlargesymbols}{"59} + \let\prod\prodop + +\newcommand\figref[1]{\textbf{Figure}~\ref{#1}} +\newcommand\tabref[1]{\textbf{Table}~\ref{#1}} + + + +%%封面 + +\def\maketitle{% +\thispagestyle{empty} +% \@cover +\vfill +\vspace*{2cm} +\begin{center} +\color{second} +\rule{0.8\textwidth}{2pt}\\ +\Huge {\color{main} \bfseries \the\entitle } {\color{second} \bfseries \the\enend}\\ +{\Huge \bfseries{\color{main} \the\zhtitle } \the\zhend}\\ +\rule{0.8\textwidth}{2pt} +\end{center} +\vfill +\vskip5ex +\centerline{\@logo} +\begin{center} +\begin{minipage}{0.65\textwidth} +\indent\centering\color{bule}\@myquote +\end{minipage} +\end{center} +\vfill +\begin{flushright} +\color{second} +\rule{0.45\textwidth}{1pt}\\ +作者:{\color{main}\@author}\\ +时间:{\color{main}\today}\\ +邮箱: \hyperlink{\the\email}{\the\email}\\ +\rule{0.45\textwidth}{1pt} +\end{flushright} +\vfill +\begin{center} +\color{second} 版本: \the\version +\end{center} +\vfil\eject +} + + + + +\RequirePackage{natbib} +\setlength{\bibsep}{0.0pt} +\def\bibfont{\footnotesize} diff --git a/guide.pdf b/elegantbook.pdf similarity index 90% rename from guide.pdf rename to elegantbook.pdf index 1e37a5d..b3d58bd 100644 Binary files a/guide.pdf and b/elegantbook.pdf differ diff --git a/guide.tex b/elegantbook.tex similarity index 89% rename from guide.tex rename to elegantbook.tex index 37fcdaf..cc9d9dd 100644 --- a/guide.tex +++ b/elegantbook.tex @@ -1,13 +1,13 @@ \documentclass{elegantbook} \author{ddswhu \& Liam Huang} -\email{ddswhu@outlook.com} - +\email{elegantlatex2e@gmail.com} +\usepackage{ntheorem} \zhtitle{优美的 \LaTeX{} 书籍} \zhend{模板} \entitle{Elegant\LaTeX{} Book} \enend{Template} -\version{3.03} +\version{3.04} \myquote{Victory won\rq t come to us unless we go to it.} \logo{ElegantLaTeX_green.pdf} \cover{cover.pdf} @@ -35,30 +35,31 @@ \mainmatter \chapter{Elegant\LaTeX{} 系列模板介绍} -值此版本发行之际,我们 Elegant\LaTeX{} 项目组向大家重新介绍一下我们的工作,我们致力于打造一系列美观、优雅、简便的模板方便用户使用。Elegant\LaTeX{} 系列模板目前由 ElegantNote,ElegantBook,ElegantPaper,ElegantBeamer 组成,分别用于排版笔记,书籍,工作论文和幻灯片讲稿。这些子项目的名词是一体的,请在使用这些名词的时候不要将其断开(如 Elegant Note 是不正确的写法)。并且,Elegant\LaTeX{} Book 指的即是 ElegantBook。 +值此版本发行之际,我们 Elegant\LaTeX{} 项目组向大家重新介绍一下我们的工作,我们致力于打造一系列美观、优雅、简便的模板方便用户使用。Elegant\LaTeX{} 系列模板目前由 \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote},\href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook},\href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} 组成,分别用于排版笔记,书籍和工作论文。这些子项目的名词是一体的,请在使用这些名词的时候不要将其断开(如 Elegant Note 是不正确的写法)。并且,Elegant\LaTeX{} Book 指的即是 ElegantBook。 -请用户在作者的主页下载最新版本,下载地址:\href{https://ddswhu.me/resource/}{https://ddswhu.me/resource/}。本文将介绍本模板的一些设置内容以及基本使用方法。如果您在使用此模板,欢迎把您使用此模板制作的成品发一份给我们,谢谢!如果您有其他问题,建议或者意见,欢迎联系我:\mailto{ddswhu@outlook.com}。 +请用户在作者的主页下载最新版本,下载地址:\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Github/ElegantBook/Releases}。本文将介绍本模板的一些设置内容以及基本使用方法。如果您在使用此模板,欢迎把您使用此模板制作的成品发一份给我们,谢谢!如果您有其他问题,建议或者意见,欢迎联系我们。 \section{ElegantBook 更新说明} -在这几年间,我们收到了很多用户的反馈,主要的问题涉及到字体安装,编码支持,定理浮动,定理跨页,交叉引用等等。我们思前想后,原先让用户安装字体以追求视觉上的美观并不完美,用户陷入了巨大的麻烦,这违背了我们的模板初衷。因此我们在新版中删除了这部分,用户无需安装任何字体。让我们来看下此次 ElegantBook 模板 3.0 更新的主要内容有: +在这几年间,我们收到了很多用户的反馈,主要的问题涉及到字体安装,编码支持,定理浮动,定理跨页,交叉引用等等。我们思前想后,原先让用户安装字体以追求视觉上的美观并不完美,用户陷入了巨大的麻烦,这违背了我们的模板初衷。因此我们在新版中删除了这部分,用户无需安装任何字体。让我们来看下此次 ElegantBook 模板 3.x 更新的主要内容有: \begin{enumerate}[noitemsep] - \item 删除了自定义字体设置,改用 \texttt{ctex} 宏包用以支持中文。 - \item 使用 \texttt{tcolorbox} 宏包改写了原先的定理类环境,目前定理环境等均可以跨页。 - \item 重新命名了定理类环境的名称(theorem,definition,proposition 等)。 - \item 重新命名了颜色的名字(first,second,third)。 + \item 删除了自定义字体设置,改用 \texttt{ctex} 宏包用以支持中文; + \item 使用 \texttt{tcolorbox} 宏包改写了原先的定理类环境,目前定理环境等均可以跨页; + \item 重新命名了定理类环境的名称(theorem,definition,proposition 等); + \item 重新命名了颜色的名字(first,second,third); + \item 重新绘制 ElegantLaTeX 的 Logo; + \item 更新类定理环境,包括其交叉引用; + \item 特别修正附录相关内容。 \end{enumerate} \section{未来更新计划} \begin{enumerate}[noitemsep] - \item 设计一个适合的 LOGO; \item 重新设计 base 图标; \item 重新设计一个好看的封面。 \item 将基础模板改为英文模板,添加选项使其支持中文。 - \item 将最早的 ElegantNote 重新设计为简版发布。 \item 添加一个简化风格(plain)的颜色主题。 \end{enumerate} @@ -138,7 +139,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 我们将通过三个步骤定义可测函数的积分。首先定义非负简单函数的积分。以下设 $E$ 是 $\mathcal{R}^n$ 中的可测集。 -\begin{definition}{可积性}{inter} +\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$ 上的积分为 \begin{equation} \label{inter} @@ -155,9 +156,9 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 即 $D(x)$ 在 $[0,1]$ 上是 Lebesgue 可积的并且积分值为零。但 $D(x)$ 在 $[0,1]$ 上不是 Riemann 可积的。 -有界变差函数是与单调函数有密切联系的一类函数。有界变差函数可以表示为两个单调递增函数之差。与单调函数一样,有界变差函数几乎处处可导。与单调函数不同,有界变差函数类对线性运算是封闭的,它们构成一线空间。 +有界变差函数是与单调函数有密切联系的一类函数。有界变差函数可以表示为两个单调递增函数之差。与单调函数一样,有界变差函数几乎处处可导。与单调函数不同,有界变差函数类对线性运算是封闭的,它们构成一线空间。练习题 \ref{exer:43} 是一个性质的证明。 -\begin{exercise} +\begin{exercise}\label{exer:43} 设 $f\in L(\mathcal{R}^1)$,$g$ 是 $\mathcal{R}^1$ 上的有界可测函数。证明函数 \begin{equation} \label{ex:1} @@ -166,7 +167,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 是 $\mathcal{R}^1$ 上的连续函数。 \end{exercise} -\begin{theorem}{Fubini 定理}{31} +\begin{theorem}{Fubini 定理}{fubi} (1)若 $f(x,y)$ 是 $\mathcal{R}^p\times\mathcal{R}^q$ 上的非负可测函数,则对几乎处处的 $x\in \mathcal{R}^p$,$f(x,y)$ 作为 $y$ 的函数是 $\mathcal{R}^q$ 上的非负可测函数,$g(x)=\int_{\mathcal{R}^q}f(x,y) dy$ 是 $\mathcal{R}^p$ 上的非负可测函数。并且 \begin{equation} \label{eq:461} @@ -176,7 +177,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 \end{theorem} \begin{note} -在本模板中,引理(lemma),推论(corollary )的样式和定理的样式一致,包括颜色,仅仅只有计数器的设置不一样。 +在本模板中,引理(lemma),推论(corollary )的样式和定理~\ref{thm:fubi} 的样式一致,包括颜色,仅仅只有计数器的设置不一样。 \end{note} 我们说一个实变或者复变量的实值或者复值函数是在区间上平方可积的,如果其绝对值的平方在该区间上的积分是有限的。所有在勒贝格积分意义下平方可积的可测函数构成一个希尔伯特空间,也就是所谓的 $L^2$ 空间,几乎处处相等的函数归为同一等价类。形式上,$L^2$ 是平方可积函数的空间和几乎处处为 0 的函数空间的商空间。