This commit is contained in:
EthanDeng
2019-01-15 15:17:45 +08:00
parent 26e099f735
commit dc8d927cc5
3 changed files with 82 additions and 119 deletions

View File

@@ -5,11 +5,11 @@
%% This work may be distributed and/or modified freely
%% available at https://ddswhu.me/resource/
% %
%% Last Modification 2018-12-16
%% Last Modification 2018-12-31
%%%%%%%%%%%%%%%%%%%%%
% % !Mode:: "TeX:UTF-8"
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{elegantbook}[2018/12/06 v3.00 ElegantBook document class]
\ProvidesClass{elegantbook}[2018/12/31 v3.02 ElegantBook document class]
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
@@ -113,11 +113,11 @@
\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}}
\renewcommand{\listfigurename}{}
\renewcommand{\listtablename}{}
\renewcommand{\bibname}{}
\renewcommand{\appendixname}{\hspace{2em}}
\renewcommand{\indexname}{\hspace{2em}}
% more pretty font
\linespread{1.3}
@@ -207,7 +207,7 @@
{\hspace{-2.45em}\Large\bfseries{\color{main}\thesection}\enspace}{1pt}{\color{main}\Large\bfseries\filright}
\titleformat{\subsection}[hang]{\bfseries}
{\large\bfseries\color{main}\thesubsection\enspace}{1pt}{\color{main}\large\bfseries\filright}
{\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}
@@ -247,6 +247,7 @@
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,
@@ -268,34 +269,34 @@
},
}
\newtcbtheorem[auto counter,number within=chapter]{definition}{Definition}{defstyle}{def}
\newtcbtheorem[auto counter,number within=chapter]{theorem}{Theorem}{thmstyle}{thm}
\newtcbtheorem[auto counter,number within=chapter]{proposition}{Proposition}{propstyle}{prop}
\newtcbtheorem[auto counter,number within=chapter]{corollary}{Corollary}{thmstyle}{cor}
\newtcbtheorem[auto counter,number within=chapter]{lemma}{Lemma}{thmstyle}{lemma}
\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{Example\,\refstepcounter{example}\theexample: }\color{black!90}}{\par}
\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{Exercise\,\refstepcounter{exercise}\theexercise: }}{\par}
\newenvironment{exercise}{\par\noindent\textbf{\,\refstepcounter{exercise}\theexercise}}{\par}
%%define the note and proof environment
\RequirePackage{pifont,manfnt}
\newenvironment{note}{\par\itshape\noindent{\makebox[0pt][r]{\scriptsize\color{red!90}\textdbend\quad}\textbf{Note:}}}{\par}
\newenvironment{proof}{\par\noindent\textbf{Proof:}\color{black!90}\small}{\hfill$\Box$\quad\par}
\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{Remarks:}}{\par}
\newenvironment{assumption}{\par\noindent\textbf{Assumptions:}}{\par}
\newenvironment{conclusion}{\par\noindent\textbf{Conclusions:}}{\par}
\newenvironment{solution}{\par\noindent\textbf{Solution:}}{\par}
\newenvironment{property}{\par\noindent\textbf{Properties:}}{\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}
@@ -373,7 +374,7 @@
\end{flushright}
\vfill
\begin{center}
\color{second} Version: \the\version
\color{second} : \the\version
\end{center}
\vfil\eject
}
@@ -383,4 +384,4 @@
\RequirePackage{natbib}
\setlength{\bibsep}{0.0pt}
\def\bibfont{\footnotesize}
\def\bibfont{\footnotesize}