mirror of
https://github.com/ElegantLaTeX/ElegantBook.git
synced 2026-01-26 20:34:36 +08:00
format
This commit is contained in:
140
elegantbook.cls
140
elegantbook.cls
@@ -40,8 +40,8 @@
|
|||||||
\LoadClass[12pt,a4paper,openany]{book}
|
\LoadClass[12pt,a4paper,openany]{book}
|
||||||
|
|
||||||
|
|
||||||
\usepackage[UTF8,space=auto,scheme=plain]{ctex}
|
\RequirePackage[UTF8,space=auto,scheme=plain]{ctex}
|
||||||
\usepackage{indentfirst}
|
\RequirePackage{indentfirst}
|
||||||
\setlength\parindent{2em}
|
\setlength\parindent{2em}
|
||||||
|
|
||||||
% font setting for text and math
|
% font setting for text and math
|
||||||
@@ -51,6 +51,16 @@
|
|||||||
\RequirePackage[scale=0.85]{newtxtt}
|
\RequirePackage[scale=0.85]{newtxtt}
|
||||||
\RequirePackage{type1cm}
|
\RequirePackage{type1cm}
|
||||||
|
|
||||||
|
\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
|
||||||
|
|
||||||
|
|
||||||
% ----- Handle Colors -----
|
% ----- Handle Colors -----
|
||||||
%% 章节以及页脚图形
|
%% 章节以及页脚图形
|
||||||
@@ -74,7 +84,9 @@
|
|||||||
\definecolor{third}{RGB}{7,127,128}%
|
\definecolor{third}{RGB}{7,127,128}%
|
||||||
}{\relax}
|
}{\relax}
|
||||||
|
|
||||||
|
% corlor definition
|
||||||
\definecolor{winered}{rgb}{0.5,0,0}
|
\definecolor{winered}{rgb}{0.5,0,0}
|
||||||
|
\definecolor{bule}{RGB}{18,29,57}
|
||||||
|
|
||||||
\AtBeginDocument{
|
\AtBeginDocument{
|
||||||
\input{base.tex}
|
\input{base.tex}
|
||||||
@@ -104,9 +116,6 @@
|
|||||||
\newtoks\enend
|
\newtoks\enend
|
||||||
\newtoks\zhend
|
\newtoks\zhend
|
||||||
|
|
||||||
%%数学字体宏包
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%%中文结构名字
|
%%中文结构名字
|
||||||
\renewcommand{\contentsname}{目\hspace{2em}录}
|
\renewcommand{\contentsname}{目\hspace{2em}录}
|
||||||
@@ -119,54 +128,38 @@
|
|||||||
\renewcommand{\appendixname}{附录}
|
\renewcommand{\appendixname}{附录}
|
||||||
\renewcommand{\indexname}{索\hspace{2em}引}
|
\renewcommand{\indexname}{索\hspace{2em}引}
|
||||||
|
|
||||||
% more pretty font
|
%% 常用宏包
|
||||||
\linespread{1.3}
|
\linespread{1.3}
|
||||||
\RequirePackage{microtype}
|
\RequirePackage{microtype}
|
||||||
|
|
||||||
|
|
||||||
\RequirePackage{booktabs}
|
|
||||||
\RequirePackage{multicol}
|
|
||||||
\RequirePackage{xcolor}
|
|
||||||
\RequirePackage{graphicx}
|
|
||||||
\RequirePackage{fancyvrb}
|
|
||||||
\graphicspath{{image/}{figure/}{fig/}{img/}}
|
|
||||||
|
|
||||||
%% 常用宏包
|
|
||||||
\RequirePackage{graphicx}
|
\RequirePackage{graphicx}
|
||||||
\RequirePackage{enumerate}
|
\RequirePackage{enumerate}
|
||||||
\RequirePackage{amsmath,mathrsfs,amsfonts}
|
\RequirePackage{amsmath,mathrsfs,amsfonts}
|
||||||
\RequirePackage{booktabs}
|
\RequirePackage{booktabs}
|
||||||
\linespread{1.3}
|
\RequirePackage{multicol}
|
||||||
|
\RequirePackage{xcolor}
|
||||||
|
\RequirePackage{fancyvrb}
|
||||||
|
|
||||||
\graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}}
|
\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{natbib}
|
||||||
|
\setlength{\bibsep}{0.0pt}
|
||||||
|
\def\bibfont{\footnotesize}
|
||||||
|
|
||||||
|
|
||||||
%% 页面设置
|
%% 页面设置
|
||||||
|
\RequirePackage{geometry}
|
||||||
\RequirePackage{hyperref}
|
\geometry{
|
||||||
|
a4paper,
|
||||||
\AtBeginDocument{
|
left=27mm, %% or inner=23mm
|
||||||
\hypersetup{
|
right=27mm, %% or outer=18mm
|
||||||
pdftitle = {\the\zhtitle\the\zhend},
|
top=25.4mm, bottom=25.4mm,
|
||||||
pdfauthor = {\@author}
|
headheight=2.17cm,
|
||||||
}
|
headsep=4mm,
|
||||||
|
footskip=12mm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\RequirePackage{hyperref}
|
||||||
\hypersetup{
|
\hypersetup{
|
||||||
breaklinks,
|
breaklinks,
|
||||||
unicode,
|
unicode,
|
||||||
@@ -174,6 +167,8 @@
|
|||||||
bookmarksnumbered=true,
|
bookmarksnumbered=true,
|
||||||
bookmarksopen=true,
|
bookmarksopen=true,
|
||||||
pdfsubject=\@author \@title Book,
|
pdfsubject=\@author \@title Book,
|
||||||
|
pdftitle = {\the\zhtitle\the\zhend},
|
||||||
|
pdfauthor = {\@author}
|
||||||
pdfkeywords={ElegantBook},
|
pdfkeywords={ElegantBook},
|
||||||
pdfcreator={XeLaTeX with ElegantBook class},
|
pdfcreator={XeLaTeX with ElegantBook class},
|
||||||
colorlinks,
|
colorlinks,
|
||||||
@@ -185,16 +180,6 @@
|
|||||||
linktocpage
|
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[center,pagestyles]{titlesec}
|
||||||
@@ -216,25 +201,20 @@
|
|||||||
%\titlespacing{\subsection}{0pt}{0.5\baselineskip}{-\baselineskip}
|
%\titlespacing{\subsection}{0pt}{0.5\baselineskip}{-\baselineskip}
|
||||||
|
|
||||||
|
|
||||||
|
% caption settings
|
||||||
|
|
||||||
\RequirePackage{caption}
|
\RequirePackage{caption}
|
||||||
\captionsetup{labelfont = bf}
|
\captionsetup{labelfont = bf}
|
||||||
|
\RequirePackage[font=small,labelfont={bf}]{caption}
|
||||||
|
\captionsetup[table]{skip=3pt}
|
||||||
|
\captionsetup[figure]{skip=3pt}
|
||||||
|
\newcommand\figref[1]{\textbf{Figure}~\ref{#1}}
|
||||||
|
\newcommand\tabref[1]{\textbf{Table}~\ref{#1}}
|
||||||
|
|
||||||
|
|
||||||
% list/itemize/enumerate setting
|
% list/itemize/enumerate setting
|
||||||
\RequirePackage[shortlabels]{enumitem}
|
\RequirePackage[shortlabels]{enumitem}
|
||||||
\setlist{nolistsep}
|
\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}
|
\RequirePackage[most]{tcolorbox}
|
||||||
|
|
||||||
\tcbset{
|
\tcbset{
|
||||||
@@ -299,8 +279,6 @@
|
|||||||
\par\medskip\ignorespacesafterend %
|
\par\medskip\ignorespacesafterend %
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%%define the note and proof environment
|
%%define the note and proof environment
|
||||||
\RequirePackage{pifont,manfnt}
|
\RequirePackage{pifont,manfnt}
|
||||||
\newenvironment{note}{\par\noindent{\makebox[0pt][r]{\scriptsize\color{red!90}\textdbend\quad}\textbf{\color{main}{注意:}}}\itshape}{\par}
|
\newenvironment{note}{\par\noindent{\makebox[0pt][r]{\scriptsize\color{red!90}\textdbend\quad}\textbf{\color{main}{注意:}}}\itshape}{\par}
|
||||||
@@ -312,10 +290,7 @@
|
|||||||
\newenvironment{solution}{\par\noindent\textbf{\color{main}{答案:}}}{\par}
|
\newenvironment{solution}{\par\noindent\textbf{\color{main}{答案:}}}{\par}
|
||||||
\newenvironment{property}{\par\noindent\textbf{\color{main}{性质:}}}{\par}
|
\newenvironment{property}{\par\noindent\textbf{\color{main}{性质:}}}{\par}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%页眉页脚
|
%页眉页脚
|
||||||
|
|
||||||
\RequirePackage{fancyhdr}
|
\RequirePackage{fancyhdr}
|
||||||
\RequirePackage{lastpage}
|
\RequirePackage{lastpage}
|
||||||
\fancyhf{}
|
\fancyhf{}
|
||||||
@@ -330,26 +305,19 @@
|
|||||||
\renewcommand{\sectionmark}[1]{\markright{\thesection\; #1}{} }
|
\renewcommand{\sectionmark}[1]{\markright{\thesection\; #1}{} }
|
||||||
\renewcommand{\chaptermark}[1]{\markboth{\chaptername \; #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}}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%%封面
|
%%封面
|
||||||
|
\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}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
\def\maketitle{%
|
\def\maketitle{%
|
||||||
\thispagestyle{empty}
|
\thispagestyle{empty}
|
||||||
@@ -389,7 +357,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\RequirePackage{natbib}
|
|
||||||
\setlength{\bibsep}{0.0pt}
|
|
||||||
\def\bibfont{\footnotesize}
|
|
||||||
|
|||||||
BIN
elegantbook.pdf
BIN
elegantbook.pdf
Binary file not shown.
Reference in New Issue
Block a user