mirror of
https://github.com/ElegantLaTeX/ElegantBook.git
synced 2026-01-26 12:24:36 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9fbc62984 | ||
|
|
d3ddd4f232 | ||
|
|
7d4c6673ad | ||
|
|
8f09be2d61 | ||
|
|
d79866f1cb | ||
|
|
ec862e0bf6 |
11
README.md
Normal file
11
README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
<!-- Author : ddswhu & Liam Huang-->
|
||||
<!-- Program Email: elegantlatex2e@gmail.com -->
|
||||
|
||||
# Introduction
|
||||
|
||||
ElegantNote is designed for Books. Just enjoy it! If you have any questions, suggestions or bug reports, you can visit [ElegantBook/issues](https://github.com/ElegantLaTeX/ElegantBook/issues). Looking for other templates designed by ElegantLaTeX Group? Please visit: [https://github.com/ElegantLaTeX](https://github.com/ElegantLaTeX).
|
||||
|
||||
|
||||
如果你有其他问题、建议或者报告 bug,可以在 [ElegantBook/issues](https://github.com/ElegantLaTeX/ElegantBook/issues) 留言。如果你想了解更多由 ElegantLaTeX 项目组设计的模板,请访问 [https://github.com/ElegantLaTeX](https://github.com/ElegantLaTeX)。
|
||||
|
||||
This work is released under the LaTeX Project Public License, v1.3c or later.
|
||||
2
base.tex
2
base.tex
@@ -1,6 +1,4 @@
|
||||
|
||||
%% tikz setting
|
||||
\tikzset{x=1pt,y=1pt}
|
||||
\tikzset{elegant/.style={fill=main,draw=main},
|
||||
null/.style={fill=white,draw=none}}
|
||||
|
||||
|
||||
771
elegantbook.cls
771
elegantbook.cls
@@ -1,387 +1,384 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% 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-12-31
|
||||
%%%%%%%%%%%%%%%%%%%%%
|
||||
% % !Mode:: "TeX:UTF-8"
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesClass{elegantbook}[2018/12/31 v3.02 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 -----
|
||||
\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}{附\hspace{2em}录}
|
||||
\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,
|
||||
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}
|
||||
\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]{\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}
|
||||
\vskip3ex
|
||||
\begin{figure}[htp]
|
||||
\centering
|
||||
\@logo
|
||||
\end{figure}
|
||||
\begin{center}
|
||||
\begin{minipage}{0.65\textwidth}
|
||||
\indent\centering\color{bule}\@myquote
|
||||
\end{minipage}
|
||||
\end{center}
|
||||
\vfill
|
||||
\vspace{2cm}
|
||||
\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-22
|
||||
%%%%%%%%%%%%%%%%%%%%%
|
||||
% % !Mode:: "TeX:UTF-8"
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesClass{elegantbook}[2019/01/22 v3.05 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}
|
||||
|
||||
\RequirePackage{indentfirst}
|
||||
\setlength\parindent{2em}
|
||||
|
||||
\RequirePackage{ifxetex}
|
||||
\ifxetex
|
||||
\RequirePackage{fontenc}
|
||||
\RequirePackage[no-math]{fontspec}
|
||||
\setmainfont{Times New Roman}[NFSSFamily=ntxtlf]
|
||||
\setsansfont{Arial}
|
||||
%\setmonofont[Scale=0.9]{Courier New}
|
||||
\RequirePackage{xeCJK}
|
||||
\RequirePackage{xunicode}
|
||||
\setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun}
|
||||
\setCJKsansfont[BoldFont={SimHei},ItalicFont={KaiTi}]{KaiTi}
|
||||
\setCJKmonofont[BoldFont={SimHei},ItalicFont={KaiTi},Scale=0.9]{Microsoft YaHei}
|
||||
\XeTeXlinebreaklocale "zh"
|
||||
\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt
|
||||
\RequirePackage{newtxmath}
|
||||
%\DeclareSymbolFont{operators}{OT1}{ntxtlf}{m}{n}
|
||||
%\SetSymbolFont{operators}{bold}{OT1}{ntxtlf}{b}{n}
|
||||
\else
|
||||
\RequirePackage{fontenc}
|
||||
\RequirePackage{newtxtext}
|
||||
\RequirePackage{newtxmath}
|
||||
\RequirePackage[UTF8, scheme=plain]{ctex}
|
||||
\fi
|
||||
\RequirePackage[scale=0.8]{FiraMono}
|
||||
%
|
||||
|
||||
% font setting for text and math
|
||||
% \RequirePackage[T1]{fontenc}
|
||||
% \RequirePackage{newtxtext}
|
||||
% \RequirePackage{newtxmath}
|
||||
% \RequirePackage[scale=0.85]{newtxtt}
|
||||
\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 -----
|
||||
%% 章节以及页脚图形
|
||||
|
||||
\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}
|
||||
|
||||
% corlor definition
|
||||
\definecolor{winered}{rgb}{0.5,0,0}
|
||||
\definecolor{bule}{RGB}{18,29,57}
|
||||
|
||||
\AtBeginDocument{
|
||||
\input{base.tex}
|
||||
}
|
||||
|
||||
\providecommand{\base}{
|
||||
\begin{tikzpicture}[x=1pt,y=1pt,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
|
||||
|
||||
\RequirePackage{enumerate}
|
||||
% list/itemize/enumerate setting
|
||||
\RequirePackage[shortlabels]{enumitem}
|
||||
\setlist{nolistsep}
|
||||
|
||||
|
||||
%%中文结构名字
|
||||
\renewcommand{\contentsname}{目\hspace{2em}录}
|
||||
\renewcommand{\figurename}{图}
|
||||
\renewcommand{\tablename}{表}
|
||||
\renewcommand{\partname}{部分}
|
||||
\renewcommand{\listfigurename}{插图目录}
|
||||
\renewcommand{\listtablename}{表格目录}
|
||||
\renewcommand{\bibname}{参考文献}
|
||||
\renewcommand{\appendixname}{附录}
|
||||
\renewcommand{\indexname}{索\hspace{2em}引}
|
||||
|
||||
%% 常用宏包
|
||||
\linespread{1.3}
|
||||
\RequirePackage{microtype}
|
||||
\RequirePackage{graphicx}
|
||||
\RequirePackage{enumerate}
|
||||
\RequirePackage{amsmath,mathrsfs,amsfonts}
|
||||
\RequirePackage{booktabs}
|
||||
\RequirePackage{multicol}
|
||||
\RequirePackage{xcolor}
|
||||
\RequirePackage{fancyvrb}
|
||||
|
||||
\graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}}
|
||||
|
||||
|
||||
\RequirePackage{natbib}
|
||||
\setlength{\bibsep}{0.0pt}
|
||||
\def\bibfont{\footnotesize}
|
||||
|
||||
|
||||
%% 页面设置
|
||||
\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{hyperref}
|
||||
\hypersetup{
|
||||
breaklinks,
|
||||
unicode,
|
||||
linktoc=all,
|
||||
bookmarksnumbered=true,
|
||||
bookmarksopen=true,
|
||||
pdfkeywords={ElegantBook},
|
||||
colorlinks,
|
||||
linkcolor=main,
|
||||
citecolor=winered,
|
||||
plainpages=false,
|
||||
pdfstartview=FitH,
|
||||
pdfborder={0 0 0},
|
||||
linktocpage
|
||||
}
|
||||
|
||||
|
||||
%% 章节设置
|
||||
\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}
|
||||
|
||||
|
||||
% caption settings
|
||||
\RequirePackage{caption}
|
||||
\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
|
||||
\RequirePackage[shortlabels]{enumitem}
|
||||
\setlist{nolistsep}
|
||||
|
||||
\RequirePackage[most]{tcolorbox}
|
||||
|
||||
\tcbset{
|
||||
common/.style={
|
||||
fontupper=\itshape,
|
||||
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\;}{}}
|
||||
|
||||
%%封面
|
||||
\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{%
|
||||
\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}\@date}\\
|
||||
邮箱: \hyperlink{\the\email}{\the\email}\\
|
||||
\rule{0.45\textwidth}{1pt}
|
||||
\end{flushright}
|
||||
\vfill
|
||||
\begin{center}
|
||||
\color{second} 版本: \the\version
|
||||
\end{center}
|
||||
\vfil\eject
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
BIN
elegantbook.pdf
Normal file
BIN
elegantbook.pdf
Normal file
Binary file not shown.
@@ -1,15 +1,16 @@
|
||||
\documentclass{elegantbook}
|
||||
|
||||
\author{ddswhu \& Liam Huang}
|
||||
\email{ddswhu@outlook.com}
|
||||
|
||||
\date{\today}
|
||||
\email{elegantlatex2e@gmail.com}
|
||||
\usepackage{ntheorem}
|
||||
\zhtitle{优美的 \LaTeX{} 书籍}
|
||||
\zhend{模板}
|
||||
\entitle{Elegant\LaTeX{} Book}
|
||||
\enend{Template}
|
||||
\version{3.02}
|
||||
\version{3.05}
|
||||
\myquote{Victory won\rq t come to us unless we go to it.}
|
||||
\logo{logo.png}
|
||||
\logo{logo.pdf}
|
||||
\cover{cover.pdf}
|
||||
|
||||
%green color
|
||||
@@ -29,38 +30,37 @@
|
||||
\usepackage{lipsum}
|
||||
\usepackage{texnames}
|
||||
|
||||
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\tableofcontents
|
||||
\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)。
|
||||
\begin{enumerate}
|
||||
\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;
|
||||
\begin{enumerate}
|
||||
\item 重新设计 base 图标;
|
||||
\item 重新设计一个好看的封面。
|
||||
\item 将基础模板改为英文模板,添加选项使其支持中文。
|
||||
\item 将最早的 ElegantNote 重新设计为简版发布。
|
||||
\item 添加一个简化风格(plain)的颜色主题。
|
||||
\end{enumerate}
|
||||
|
||||
@@ -108,9 +108,9 @@ third &\makecell{ {\color{third1}\rule{1cm}{1cm}}}& \makecell{{\color{third2}\ru
|
||||
|
||||
在我们这个模板中,定义了三大类环境
|
||||
|
||||
\begin{enumerate}[noitemsep]
|
||||
\begin{enumerate}
|
||||
\item 定理类环境,包含标题和内容两部分。根据格式的不同分为3种
|
||||
\begin{itemize}[noitemsep]
|
||||
\begin{itemize}
|
||||
\item {\color{main}\bfseries definition} 环境,含有一个可选项,编号以章节为单位,颜色为 {\color{main}main};
|
||||
\item {\color{second}\bfseries theorem、lemma、corollary} 环境,颜色为主颜色 {\color{second}second},编号均以章节为单位;
|
||||
\item {\color{third}\bfseries proposition} 环境,含有一个可选项,编号以章节为单位,颜色为 {\color{third}{third}}。
|
||||
@@ -140,11 +140,11 @@ 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}
|
||||
\int_{E} f dx = \sum_{i=1}^k a_i m(A_i).
|
||||
\int_{E} f dx = \sum_{i=1}^k a_i m(A_i) .
|
||||
\end{equation}
|
||||
一般情况下 $0 \leq \int_{E} f dx \leq \infty$。若 $\int_{E} f dx < \infty$,则称 $f$ 在 $E$ 上可积。
|
||||
\end{definition}
|
||||
@@ -157,9 +157,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}
|
||||
@@ -168,7 +168,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}
|
||||
@@ -178,13 +178,13 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
|
||||
\end{theorem}
|
||||
|
||||
\begin{note}
|
||||
在本模板中,引理(lemma),推论(corollary )的样式和定理的样式一致,包括颜色,仅仅只有计数器的设置不一样。
|
||||
在本模板中,引理(lemma),推论(corollary )的样式和定理~\ref{thm:fubi} 的样式一致,包括颜色,仅仅只有计数器的设置不一样。
|
||||
\end{note}
|
||||
|
||||
我们说一个实变或者复变量的实值或者复值函数是在区间上平方可积的,如果其绝对值的平方在该区间上的积分是有限的。所有在勒贝格积分意义下平方可积的可测函数构成一个希尔伯特空间,也就是所谓的 $L^2$ 空间,几乎处处相等的函数归为同一等价类。形式上,$L^2$ 是平方可积函数的空间和几乎处处为 0 的函数空间的商空间。
|
||||
|
||||
\begin{proposition}{最优性原理}{max}
|
||||
如果 $u^*$ 在 $[s,T]$ 上为最优解,则 $u^*$ 在 $[s,T]$ 任意子区间都是最优解,假设区间为 $[t_0,t_1]$ 的最优解为 $u^*$ ,则 $u(t_0)=u^{*}(t_0)$,即初始条件必须还是在 $u^*$ 上。
|
||||
如果 $u^*$ 在 $[s,T]$ 上为最优解,则 $u^*$ 在 $[s,T]$ 任意子区间都是最优解,假设区间为 $[t_0,t_1]$ 的最优解为 $u^*$ ,则 $u(t_0)=u^{*}(t_0)$,即初始条件必须还是在 $u^*$ 上。
|
||||
\end{proposition}
|
||||
|
||||
我们知道最小二乘法可以用来处理一组数据,可以从一组测定的数据中寻求变量之间的依赖关系,这种函数关系称为经验公式。本课题将介绍最小二乘法的精确定义及如何寻求点与点之间近似成线性关系时的经验公式。假定实验测得变量之间的 $n$ 个数据,则在平面上,可以得到 $n$ 个点,这种图形称为 “散点图”,从图中可以粗略看出这些点大致散落在某直线近旁, 我们认为其近似为一线性函数,下面介绍求解步骤。
|
||||
@@ -192,37 +192,55 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
|
||||
|
||||
考虑函数 $y=a+bx$, 其中 $a$ 和 $b$ 是待定常数。如果离散点完全的在一直线上,可以认为变量之间的关系为一元函数。但一般说来,这些点不可能在同一直线上。但是它只能用直线来描述时,计算值与实际值会产生偏差。当然要求偏差越小越好,但由于偏差可正可负,因此不能认为总偏差时,拟合函数很好地反映了变量之间的关系,但是因为此时每个偏差的绝对值可能很大。为了改进这一缺陷,就考虑用平均值来代替。但是由于绝对值不易作解析运算,因此,进一步用残差平方和函数来度量总偏差。偏差的平方和最小可以保证每个偏差都不会很大。于是问题归结为确定拟合函数中的常数和使残差平方和函数最小。
|
||||
|
||||
\begin{figure}[!htbp]
|
||||
\begin{figure}[htbp]
|
||||
\centering
|
||||
\includegraphics[width=0.6\textwidth]{mpg.png}
|
||||
\caption{MPG 和 Weight 的关系图\label{fig:mpg}}
|
||||
\includegraphics[width=0.6\textwidth]{scatter.pdf}
|
||||
\caption{散点图示例 $\hat{y}=a+bx$ \label{fig:scatter}}
|
||||
\end{figure}
|
||||
|
||||
|
||||
|
||||
以最简单的一元线性模型来解释最小二乘法。什么是一元线性模型呢?监督学习中,如果预测的变量是离散的,我们称其为分类(如决策树,支持向量机等),如果预测的变量是连续的,我们称其为回归。回归分析中,如果只包括一个自变量和一个因变量,且二者的关系可用一条直线近似表示,这种回归分析称为一元线性回归分析。如果回归分析中包括两个或两个以上的自变量,且因变量和自变量之间是线性关系,则称为多元线性回归分析。对于二维空间线性是一条直线;对于三维空间线性是一个平面,对于多维空间线性是一个超平面。
|
||||
|
||||
|
||||
\begin{property}
|
||||
柯西列的性质
|
||||
\begin{enumerate}[noitemsep]
|
||||
\begin{enumerate}
|
||||
\item $\{x_k\}$ 是柯西列,则其子列 $\{x_k^i\}$ 也是柯西列。
|
||||
\item $x_k\in \mathcal{R}^n$,$\rho(x,y)$ 是欧几里得空间,则柯西列是收敛的,$(\mathcal{R}^n,\rho)$ 空间是完备的。
|
||||
\end{enumerate}
|
||||
\end{property}
|
||||
|
||||
|
||||
\begin{conclusion}
|
||||
回归分析(regression analysis) 是确定两种或两种以上变量间相互依赖的定量关系的一种统计分析方法。运用十分广泛,回归分析按照涉及的变量的多少,分为一元回归和多元回归分析;按照因变量的多少,可分为简单回归分析和多重回归分析;按照自变量和因变量之间的关系类型,可分为线性回归分析和非线性回归分析。如果在回归分析中,只包括一个自变量和一个因变量,且二者的关系可用一条直线近似表示,这种回归分析称为一元线性回归分析。如果回归分析中包括两个或两个以上的自变量,且自变量之间存在线性相关,则称为多重线性回归分析。
|
||||
\end{conclusion}
|
||||
|
||||
The arts refers to the theory and physical expression of creativity found in human societies and cultures. Major constituents of the arts include literature (including drama, poetry, and prose), performing arts (among them dance, music, and theatre), and visual arts (including drawing, painting, filmmaking, architecture, ceramics, sculpting, and photography).
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
\draw[->] (-3,0) -- (4.2,0) node[right] {$x$};
|
||||
\draw[->] (0,-3) -- (0,4.2) node[above] {$y$};
|
||||
\draw[scale=0.5,domain=-3:3,smooth,variable=\x,blue] plot ({\x},{\x*\x});
|
||||
\draw[scale=0.5,domain=-3:3,smooth,variable=\y,red] plot ({\y*\y},{\y});
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
\nocite{EINAV2010,Havrylchyk2018}
|
||||
|
||||
\bibliographystyle{aer}
|
||||
\bibliography{reference}
|
||||
|
||||
\addcontentsline{toc}{chapter}{参考文献}
|
||||
\appendix
|
||||
\chapter{线性代数}
|
||||
|
||||
\section{矩阵的分块}
|
||||
|
||||
\begin{equation}
|
||||
\begin{vmatrix}
|
||||
A_1 & 0\\
|
||||
C & A_2
|
||||
\end{vmatrix}
|
||||
=|A_1|\times |A_2|
|
||||
\end{equation}
|
||||
|
||||
由矩阵 $A$ 的若干行、若干列的交叉位置元素按照原来顺序排成的矩阵称为 $A$ 的一个\textbf{子矩阵}。
|
||||
|
||||
\end{document}
|
||||
4349
figure/logo.pdf
4349
figure/logo.pdf
File diff suppressed because one or more lines are too long
BIN
figure/logo.png
BIN
figure/logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 353 KiB After Width: | Height: | Size: 90 KiB |
BIN
image/mpg.png
BIN
image/mpg.png
Binary file not shown.
|
Before Width: | Height: | Size: 91 KiB |
BIN
image/scatter.pdf
Normal file
BIN
image/scatter.pdf
Normal file
Binary file not shown.
27
image/scatter.py
Normal file
27
image/scatter.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# This file is the source file of the scatter.pdf
|
||||
# source page: https://matplotlib.org/gallery/shapes_and_collections/scatter.html
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
# Fixing random state for reproducibility
|
||||
np.random.seed(19680801)
|
||||
|
||||
|
||||
N = 50
|
||||
x = np.random.rand(N)
|
||||
y = np.random.rand(N)
|
||||
colors = np.random.rand(N)
|
||||
area = (30 * np.random.rand(N))**2 # 0 to 15 point radii
|
||||
|
||||
ax = plt.subplot(111)
|
||||
ax.scatter(x, y, s=area, c=colors, alpha=0.5)
|
||||
|
||||
# Hide the right and top spines
|
||||
ax.spines['right'].set_visible(False)
|
||||
ax.spines['top'].set_visible(False)
|
||||
|
||||
# Only show ticks on the left and bottom spines
|
||||
ax.yaxis.set_ticks_position('left')
|
||||
ax.xaxis.set_ticks_position('bottom')
|
||||
|
||||
plt.savefig('scatter.pdf', transparent=True)
|
||||
Reference in New Issue
Block a user