diff --git a/elegantnote.cls b/elegantnote.cls index 4c25365..2b8da00 100644 --- a/elegantnote.cls +++ b/elegantnote.cls @@ -1,427 +1,232 @@ -%% start of file `elegantnote.cls'. -%% Copyright 2013-2019 ddswhu (ddswhu@gmail.com). -% -% % !Mode:: "TeX:UTF-8" -\NeedsTeXFormat{LaTeX2e} -\ProvidesClass{elegantnote}[2013/07/18 v1.00 elegant note document class] - -\RequirePackage{color,xcolor} - -\newcommand*{\base}[1]{ - \def\@base{\includegraphics[scale=0.3]{#1} - } -} - -\DeclareOption{green}{ - \definecolor{main}{RGB}{210,168,75} - \definecolor{seco}{RGB}{9,80,3} - \definecolor{thid}{RGB}{0,175,152} - \base{greenbase.pdf} -} - -\DeclareOption{cyan}{ - \definecolor{main}{RGB}{239,126,30} - \definecolor{seco}{RGB}{0,175,152} - \definecolor{thid}{RGB}{236,74,53} - \base{cyanbase.pdf} -} - -\DeclareOption{blue}{ - \definecolor{main}{RGB}{127,191,51} - \definecolor{seco}{RGB}{0,145,215} - \definecolor{thid}{RGB}{180,27,131} - \base{bluebase} -} - -\DeclareOption{times}{ - \AtBeginDocument{ - \RequirePackage{times} - } -} - -\DeclareOption{mtpro}{ - \AtBeginDocument{ - \RequirePackage{mtpro2} - } -} - - -%%载入基础类 -\DeclareOption*{% - \PassOptionsToClass{\CurrentOption}{book} -} - -\ExecuteOptions{green} - -\ProcessOptions\relax - -\LoadClass[12pt,a4paper,openany]{book} - - -\newtoks\zhtitle -\newtoks\entitle -\newtoks\email -\newtoks\version - -%%数学字体宏包 - -%% 常用宏包 -\RequirePackage{graphicx} -\RequirePackage{enumerate} -\RequirePackage{amsmath,mathrsfs,amsfonts} -\RequirePackage{booktabs} -\linespread{1.3} - -\graphicspath{{./figure/}{./figures/}{./image/}{./graphics/}{./graphic/}{./pictures/}{./picture/}} - -\newcommand*{\myquote}[1]{\def\@myquote{#1}} - -\newcommand*{\logo}[1]{ - \def\@logo{\includegraphics[height=5.8cm]{#1} - } -} - -%\newcommand*{\base}[1]{ -% \def\@base{\includegraphics[scale=0.3]{#1} -% } -%} - -% -%\newsavebox{\mylogo} -%\sbox{\mylogo}{% -%\centering -%\includegraphics[scale=0.3]{base.pdf}} - -\newcommand*{\cover}[1]{\def\@cover{ - \ThisTileWallPaper{\paperwidth}{\paperheight}{#1} - } -} - - -%% 页面设置 -\RequirePackage{hyperref} - -\hypersetup{ - breaklinks, - baseurl =http://, - unicode, - bookmarksnumbered =true, - bookmarksopen =true, - pdfauthor =\@author, - pdftitle =\@title note, - pdfsubject =\@author \@title note, - pdfkeywords ={notes}, - pdfcreator ={XeLaTeX with elegantnote class}, - colorlinks, - linkcolor =seco, - 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 -} - -%%% base -%\newsavebox{\mylogo} -%\sbox{\mylogo}{% -%\centering -%\includegraphics[scale=0.3]{base.pdf}} %需要修改尺寸和文件名 - -\RequirePackage{wallpaper} - -%% 章节设置 -\RequirePackage[center,pagestyles]{titlesec} -\renewcommand{\chaptername}{第 \thechapter 章} - -\titleformat{\chapter}[display]{\normalfont} -{\bfseries\filcenter\LARGE\enspace \color{seco}\chaptername\enspace}{1pt}{\color{seco}\LARGE\bfseries\filcenter}[\@base] - -\titleformat{\section}[hang]{\sffamily} -{\hspace{-2.45em}\Large\bfseries{\color{seco}\thesection}\enspace}{1pt}{\color{seco}\Large\bfseries\filright} - -\titleformat{\subsection}[hang]{\sffamily} -{\large\bfseries\color{seco}\thesubsection\enspace}{1pt}{\color{seco}\large\bfseries\filright} - -\titlespacing{\chapter}{0pt}{0pt}{1.5\baselineskip} -%\titlespacing{\subsection}{0pt}{0.5\baselineskip}{-\baselineskip} - - -%%中文结构名字 -\renewcommand{\contentsname}{\bfseries 目\hspace{2em}录} -\renewcommand{\figurename}{\textbf{图}} -\renewcommand{\tablename}{\text{表}} -\renewcommand{\partname}{部分} -\renewcommand{\listfigurename}{\bfseries 插图目录} -\renewcommand{\listtablename}{\bfseries 表格目录} -\renewcommand{\bibname}{\bfseries 参考文献} -\renewcommand{\appendixname}{\bfseries 附\hspace{2em}录} -\renewcommand{\indexname}{\bfseries 索\hspace{2em}引} - - - -%%字体设置 -%\RequirePackage{lmodern,fix-cm,type1cm} -\RequirePackage{fontenc} -\RequirePackage[no-math,cm-default]{fontspec} -\defaultfontfeatures{Mapping=tex-text} -\RequirePackage{xunicode} -\RequirePackage{xltxtra} -\setmainfont[Ligatures=TeX]{Minion Pro} % (\textrm) -\setsansfont{Myriad Pro} % (\textsf) -\setmonofont{Adobe Garamond Pro}%Palatino Linotype -%-中文字体设置-% -\RequirePackage{xeCJK} -\setCJKmainfont[BoldFont={黑体},ItalicFont={楷体}]{华文中宋}%方正书宋_GBK Adobe Song Std L -\setCJKsansfont[BoldFont={黑体}]{方正中等线简体} -\setCJKmonofont{方正启体简体} -\XeTeXlinebreaklocale "zh" -\XeTeXlinebreakskip = 0pt plus 1pt - -\setCJKfamilyfont{new}{方正苏新诗柳楷简体} - -%% 定理\引理\定义样式设置 -\RequirePackage{environ} -\RequirePackage{tikz} -\usetikzlibrary{shapes,decorations} - -%define the main and seco color in document -%\definecolor{main}{RGB}{210,168,75} -%\definecolor{seco}{RGB}{9,80,3} -%\definecolor{thid}{RGB}{0,175,152} - - -%\definecolor{main}{RGB}{239,126,30} -%\definecolor{seco}{RGB}{0,175,152} -%\definecolor{thid}{RGB}{236,74,53} - -%\definecolor{main}{RGB}{127,191,51} -%\definecolor{seco}{RGB}{0,145,215} -%\definecolor{thid}{RGB}{180,27,131} - - - - - -\definecolor{bule}{RGB}{18,29,57} -\definecolor{bablue}{RGB}{248,248,248} - -%define the style of tikz newthemsty - -\tikzstyle{newthemsty} - =[draw=seco, fill=blue!10,very thick,rectangle, - rounded corners, inner sep=10pt, inner ysep=20pt] -\tikzstyle{newthemstytitle} - =[fill=seco, text=blue!10] - -\tikzstyle{newdefinitionsty} - =[draw=main, fill=yellow!20,very thick,rectangle, - rounded corners, inner sep=10pt, inner ysep=20pt, - text=black,fill opacity=0.9] -\tikzstyle{newdefinitionstytitle} - =[fill=main, text=white] - -\tikzstyle{newpropositionsty} - =[draw=thid, fill=bablue,very thick,rectangle, - rounded corners, inner sep=10pt, inner ysep=20pt, - text=black,fill opacity=0.9] -\tikzstyle{newpropositionstytitle} - =[fill=thid, text=white] - -%%define the "newthem" environment -\newcounter{Newthem}[chapter] -\renewcommand{\theNewthem}{\thechapter.\arabic{Newthem}} -\NewEnviron{newthem}[1][{}]{% -\noindent\centering -\begin{tikzpicture} -\node[newthemsty] (box){ - \begin{minipage}{0.93\columnwidth} - \sffamily\BODY - \end{minipage}}; -\node[newthemstytitle,right=10pt] at (box.north west){ - \bf\textsf{Theorem \stepcounter{Newthem}\theNewthem\; #1}}; -\node[newthemstytitle, rounded corners] at (box.east) {$\clubsuit$}; -\end{tikzpicture} -}[\par\vspace{.5\baselineskip}] - -%%define the "newlemma" environment -\newcounter{Newlemma}[chapter] -\renewcommand{\theNewlemma}{\arabic{Newlemma}} -\NewEnviron{newlemma}[1][{}]{% -\noindent\centering -\begin{tikzpicture} -\node[newthemsty] (box){ - \begin{minipage}{0.93\columnwidth} - \sffamily\BODY - \end{minipage}}; -\node[newthemstytitle,right=10pt] at (box.north west){ - \bf\textsf{Lemma \stepcounter{Newlemma}\theNewlemma\; #1}}; -\node[newthemstytitle, rounded corners] at (box.east) {$\clubsuit$}; -\end{tikzpicture} -}[\par\vspace{.5\baselineskip}] - -%%define the "newcorol" environment -\newcounter{Newcorol}[chapter] -\renewcommand{\theNewcorol}{\arabic{Newcorol}} -\NewEnviron{newcorol}[1][{}]{% -\noindent\centering -\begin{tikzpicture} -\node[newthemsty] (box){ - \begin{minipage}{0.93\columnwidth} - \sffamily\BODY - \end{minipage}}; -\node[newthemstytitle,right=10pt] at (box.north west){ - \bf\textsf{Corollary \stepcounter{Newcorol}\theNewcorol\; #1}}; -\node[newthemstytitle, rounded corners] at (box.east) {$\clubsuit$}; -\end{tikzpicture} -}[\par\vspace{.5\baselineskip}] - -%% define the "proposition" environment -\newcounter{Newprop}[chapter] -\renewcommand{\theNewprop}{\thechapter.\arabic{Newprop}} -\NewEnviron{newprop}[1][{}]{% -\noindent\centering -\begin{tikzpicture} -\node[newpropositionsty] (box){ - \begin{minipage}{0.93\columnwidth} - \sffamily\BODY - \end{minipage}}; -\node[newpropositionstytitle,right=10pt] at (box.north west){ - \bf\textsf{Proposition \stepcounter{Newprop}\theNewprop\; #1}}; -\node[newpropositionstytitle, rounded corners] at (box.east) {$\spadesuit$}; -\end{tikzpicture} -}[\par\vspace{.5\baselineskip}] - - -%%define the "newdef" environment -\newcounter{Newdefinition}[chapter] -\renewcommand{\theNewdefinition}{\thechapter.\arabic{Newdefinition}} -\NewEnviron{newdef}[1][{}]{% -\noindent\centering -\begin{tikzpicture} -\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} -}[\par\vspace{.5\baselineskip}] - - - -%%define the note and newproof environment -\RequirePackage{pifont,manfnt} -\newenvironment{note}{\par\ttfamily\itshape\noindent{\makebox[0pt][r]{\scriptsize\color{red!90}\textdbend\quad}\textbf{Note:}}}{\par\vspace{.5\baselineskip}} - -\newenvironment{example}{\par\noindent\textbf{Example: }\color{black!90}}{\par\vspace{.5\baselineskip}} - -\newenvironment{assumption}{\par\noindent\textbf{Assumptions: }\color{black!90}}{\par\vspace{.5\baselineskip}} - -\newenvironment{conclusion}{\par\noindent\textbf{Conclusions: }\color{black!90}}{\par\vspace{.5\baselineskip}} - -\newenvironment{newproof}{\par\noindent{\makebox[0pt][r]{\color{seco}\ding{43}\;\;}\textbf{Proof:}}\color{black!90}\small}{\hfill$\Box$\quad\par\vspace{.5\baselineskip}} - -%页眉页脚 - -\RequirePackage{fancyhdr} -\RequirePackage{lastpage} -\fancyhf{} -\fancyhead[EL,OR]{\color{seco}--\thepage/\pageref{LastPage}--} -\fancyhead[ER]{\color{seco}\em\nouppercase\leftmark{}} -\fancyhead[OL]{\color{seco}\em\nouppercase\rightmark} -\fancyfoot[c]{\@base} -\renewcommand{\headrule}{\color{seco}\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\;}{}} - - -%\let\origdoublepage\cleardoublepage -%\newcommand{\clearemptydoublepage}{% -% \clearpage -% {\pagestyle{empty}\origdoublepage}% -%} -%\let\cleardoublepage\clearemptydoublepage - -%\RequirePackage{nextpage} -%\cleartooddpage[\thispagestyle{empty}] -%\cleartoevenpage[\thispagestyle{empty}] -%%封面 - -\def\maketitle{% -\thispagestyle{empty} -\@cover -\vfill -\vspace*{2cm} -\begin{center} -\color{main} -\rule{0.8\textwidth}{2pt}\\ -\Huge {\color{seco} \bfseries \the\entitle } {\color{main} \bfseries Note}\\ -{\Huge \CJKfamily{new}{\color{seco} \the\zhtitle } 笔记}\\ -\rule{0.8\textwidth}{2pt} -\end{center} -\vskip3ex -\begin{figure}[htp] -\centering -\@logo -\end{figure} -\begin{center} -\begin{minipage}{0.65\textwidth} -\Eindent\color{bule}\@myquote -\end{minipage} -\end{center} -\vfill -\vspace{2cm} -\begin{flushright} -\color{main} -\rule{0.45\textwidth}{1pt}\\ -整理:{\color{seco}\@author}\\ -整理时间:{\color{seco}\today}\\ -Email: \hyperlink{\the\email}{\the\email}\\ -\rule{0.45\textwidth}{1pt} -\end{flushright} -\vfill -\begin{center} -\color{main} Version: \the\version -\end{center} -\vfil\eject -} - - -%%中文两个字符缩进 -%----字宽/缩进----- -%----CJK字符宽度 -%\f@size = 当前字符大小数值(pt/pt) -%\p@ = 1pt -\def\elegant@CJKChar@size{\hskip \f@size \p@} -%----定义字宽 -%字宽 = 字符宽度 + 字符间距 = 相邻字符中心的间距 -\newdimen\elegant@CJKChar@size@dimen -\settowidth\elegant@CJKChar@size@dimen{\elegant@CJKChar@size\CJKglue} -%----用户接口 -%负责刷新字宽和段落缩进 -\newcommand{\CJKsetfontspace}{% -%刷新字宽 -\settowidth\elegant@CJKChar@size@dimen{\elegant@CJKChar@size\CJKglue}% -%刷新段落缩进 -%判断段落缩进是否被设置为0(如果是表示要求不缩进) -\ifdim\parindent=0pt% -\relax% -\else% -\parindent2\elegant@CJKChar@size@dimen% -\fi% -} -\newcommand{\Eindent}{\CJKsetfontspace\parindent2\elegant@CJKChar@size@dimen} -\newcommand{\Enoindent}{\parident\z@} -%----自动执行 -\AtBeginDocument{\Eindent} - +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{elegantnote}[2018/01/06 ElegantNote v2.00 class] +\LoadClass[12pt,final]{article} + +\RequirePackage{kvoptions} +\RequirePackage{ifthen} +\RequirePackage{ifxetex} +\RequirePackage{etoolbox} +\RequirePackage{calc} +\AtEndOfClass{\RequirePackage{microtype}} + + +\SetupKeyvalOptions{family=ELEGANT, prefix=ELEGANT@, setkeys=\kvsetkeys} +\newcommand{\ekv}[1]{\kvsetkeys{ELEGANT}{#1}} + +% ----- Colors ----- +\DeclareStringOption[green]{color} +\DeclareStringOption[pad]{device} +\DeclareStringOption[cn]{lang} +\DeclareStringOption{mode} +% ----- backward compatibility +\DeclareVoidOption{green}{\ekv{color = green}} +\DeclareVoidOption{cyan}{\ekv{color = cyan}} +\DeclareVoidOption{blue}{\ekv{color = blue}} +\DeclareVoidOption{sakura}{\ekv{color = sakura}} +\DeclareVoidOption{black}{\ekv{color = black}} + +\DeclareVoidOption{pc}{\ekv{device = pc}} +\DeclareVoidOption{pad}{\ekv{device = pad}} +\DeclareVoidOption{kindle}{\ekv{device = kindle}} +\DeclareVoidOption{normal}{\ekv{device = normal}} + +\DeclareVoidOption{cn}{\ekv{lang = cn}} +\DeclareVoidOption{en}{\ekv{lang = en}} + +\DeclareVoidOption{geye}{\ekv{mode = geye}} + +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} +%\ExecuteOptions{12pt} +\ProcessKeyvalOptions*\relax +\ProcessOptions* + +% 字体设置 +\RequirePackage{ifxetex} +\ifxetex + \RequirePackage{fontspec} + \RequirePackage{type1cm} + \setmainfont{Times New Roman} + \setsansfont{Arial} + \setmonofont{Microsoft YaHei} + \RequirePackage{xeCJK} + \RequirePackage{fontspec, xunicode, xltxtra} + \setCJKmainfont[BoldFont={黑体},ItalicFont={楷体}]{宋体} + \setCJKsansfont[BoldFont={黑体},ItalicFont={楷体}]{楷体} + \setCJKmonofont[BoldFont={黑体},ItalicFont={楷体}]{微软雅黑} + \XeTeXlinebreaklocale "zh" + \XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt +\else + \RequirePackage[UTF8, scheme=plain]{ctex} + \RequirePackage{newtxtext} +\fi + +% 常用宏包 +\RequirePackage{indentfirst} +\RequirePackage{anyfontsize} +\RequirePackage{amsmath} +\RequirePackage{graphicx} +\RequirePackage{booktabs} +\RequirePackage{amsthm} +\RequirePackage{newtxmath} +\RequirePackage{xcolor} +\RequirePackage{hyperref} +\RequirePackage{xpatch} +\definecolor{winered}{rgb}{0.5,0,0} + +\hypersetup{% + pdfborder = {0 0 0}, + colorlinks, + citecolor=ecolor, + filecolor=ecolor, + linkcolor=ecolor, + urlcolor=ecolor +} +% 行距设置 +\linespread{1.3} +\setlength{\parskip}{3mm} +\setlength{\parindent}{2em} +% 定义护眼模式 geye = true +\RequirePackage{xcolor} + +% good for eye color +\ifdefstring{\ELEGANT@mode}{geye}{ + \definecolor{geyecolor}{RGB}{199,237,204}% + \pagecolor{geyecolor} +}{\relax} + +% graphics path +\graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}} + + +\newtheoremstyle{plain}{3pt}{3pt}{\itshape}{}{\color{ecolor}\bfseries}{}{0.5em}{\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}} +\newtheoremstyle{definition}{3pt}{3pt}{\itshape}{}{\color{ecolor}\bfseries}{}{0.5em}{} +\newtheoremstyle{remark}{3pt}{3pt}{\itshape}{}{\color{ecolor}\bfseries}{}{0.5em}{} + +\ifdefstring{\ELEGANT@lang}{cn}{ + \theoremstyle{plain}% default + \newtheorem{theorem}{定理}[section] % + \newtheorem{lemma}[theorem]{引理} % + \newtheorem{proposition}[theorem]{性质} % + \newtheorem*{corollary}{推论} % + \theoremstyle{definition} % + \newtheorem{definition}{定义}[section] % + \newtheorem{conjecture}{猜想}[section] % + \newtheorem{example}{例}[section] % + \theoremstyle{remark} % + \newtheorem*{remark}{\normalfont\bfseries 评论} % + \newtheorem*{note}{\normalfont\bfseries 注} % + \newtheorem{case}{\normalfont\bfseries 案例} % + \renewcommand*{\proofname}{\normalfont\bfseries\color{ecolor}证明} % + \renewcommand\contentsname{\color{ecolor}目录} + \renewcommand\refname{\color{ecolor}参考文献} % + \renewcommand\figurename{图} % + \renewcommand\tablename{表} +}{\relax} +\ifdefstring{\ELEGANT@lang}{en}{ + \theoremstyle{plain}% default + \newtheorem{theorem}{Theorem}[section] % + \newtheorem{lemma}[theorem]{Lemma} % + \newtheorem{proposition}[theorem]{Proposition} % + \newtheorem*{corollary}{Corollary} % + \theoremstyle{definition} % + \newtheorem{definition}{Definition}[section] % + \newtheorem{conjecture}{Conjecture}[section] % + \newtheorem{example}{Example}[section] % + \theoremstyle{remark} % + \newtheorem*{remark}{Remark} % + \newtheorem*{note}{Note} % + \newtheorem{case}{Case} + \renewcommand*{\proofname}{\normalfont\bfseries\color{ecolor}Proof} +}{\relax} + + +% caption settings +\RequirePackage[font=small,labelfont={bf,color=ecolor}]{caption} +\captionsetup[table]{skip=3pt} +\captionsetup[figure]{skip=3pt} + +% list/itemize/enumerate setting +\RequirePackage[shortlabels]{enumitem} +\setlist{nolistsep} + + +% headings +\RequirePackage{fancyhdr} +\fancyhf{} +\pagestyle{fancy} +\cfoot{\footnotesize\textcolor{gray}{\thepage}} +\renewcommand{\headrulewidth}{0pt} +\renewcommand{\footrulewidth}{0pt} + +\fancypagestyle{plain}{% + \renewcommand{\headrulewidth}{0pt}% + \fancyhf{}% + \fancyfoot[C]{\footnotesize \textcolor{gray}{\thepage}}% +} + +% bib-settings +\RequirePackage{natbib} +\setlength{\bibsep}{0.0pt} +\def\bibfont{\footnotesize} + +\RequirePackage{sectsty} + +\ifdefstring{\ELEGANT@color}{green}{ + \definecolor{ecolor}{RGB}{0,120,2}% +}{\relax} +\ifdefstring{\ELEGANT@color}{cyan}{ + \definecolor{ecolor}{RGB}{0,175,152}% +}{\relax} +\ifdefstring{\ELEGANT@color}{blue}{ + \definecolor{ecolor}{RGB}{20,50,104}% +}{\relax} +\ifdefstring{\ELEGANT@color}{sakura}{ + \definecolor{ecolor}{RGB}{255,183,197}% +}{\relax} +\ifdefstring{\ELEGANT@color}{black}{ + \definecolor{ecolor}{RGB}{0,0,0}% +}{\relax} + +%% device settings +%% default = pad +\ifdefstring{\ELEGANT@device}{pc}{ + \RequirePackage[margin=8mm, paperwidth=6.2in, paperheight=6in,includefoot]{geometry} +}{\relax} +\ifdefstring{\ELEGANT@device}{pad}{ + \RequirePackage[margin=8mm, paperwidth=6in, paperheight=8in,includefoot]{geometry} + %197mm*148mm +}{\relax} +\ifdefstring{\ELEGANT@device}{kindle}{ + \RequirePackage[margin=8mm, paperwidth=3.68in, paperheight=4.92in]{geometry} + % 160mm*115mm +}{\relax} +\ifdefstring{\ELEGANT@device}{normal}{ + \RequirePackage[margin=1in, a4paper]{geometry} +}{\relax} + +\allsectionsfont{\color{ecolor}} +%\sectionfont{\color{ecolor}} +%\subsectionfont{\color{ecolor}} + +\RequirePackage{tikz} +\usetikzlibrary{shadows} +\newcommand*{\eBall}{\tikz \draw [baseline, ball color=ecolor, draw=ecolor] circle (2pt);} +\newcommand*{\eShadow}{\tikz \draw [baseline, fill=ecolor,draw=ecolor,circular drop shadow] circle (2pt);} +\setlist[enumerate,1]{label=\color{ecolor}(\arabic*).} +\setlist[enumerate,2]{label=\color{ecolor}(\Roman*).} +\setlist[enumerate,3]{label=\color{ecolor}(\Alph*).} +\setlist[enumerate,4]{label=\color{ecolor}(\roman*).} +\setlist[itemize,1]{label={\eBall}} +\setlist[itemize,2]{label={\eShadow}} +%source1: https://tex.stackexchange.com/questions/41408/a-five-level-deep-list +%source2: https://tex.stackexchange.com/questions/318199/change-color-of-itemize-bullet + +\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 diff --git a/elegantnote.pdf b/elegantnote.pdf new file mode 100644 index 0000000..e99f26d Binary files /dev/null and b/elegantnote.pdf differ diff --git a/elegantnote.tex b/elegantnote.tex new file mode 100644 index 0000000..2018789 --- /dev/null +++ b/elegantnote.tex @@ -0,0 +1,179 @@ +\documentclass[geye,green,pad,cn]{elegantnote} + +\title{\bfseries ElegantNote:一个优美的 \LaTeX{} 笔记模板} + +\author{\href{https://ddswhu.me/}{\itshape 邓东升} \\ + Elegant\LaTeX{} Group \thanks{Elegant\LaTeX{} 其他模板下载地址:\href{https://ddswhu.me/resource/}{https://ddswhu.me/resource/}} } +\date{\small\itshape 版本:2.00 \\ 更新时间:\today} + +\usepackage{listings} +\lstset{language=[LaTeX]{TeX},basicstyle=\footnotesize\ttfamily} + + +\begin{document} +{\color{ecolor}{\maketitle}} +% logo +\centerline{\includegraphics[width=0.25\textwidth]{ElegantLaTeX_green.pdf}} + +\section{模板设计} +此模板设计的初衷是为了记录笔记,在 2013 年开始构想,初版我们设计了非常美观的定理环境,并设计了 3 套不同的颜色主题。但我们发现在实际记笔记的时候,过多的定理区块使得整个文章并不是非常美观,所以我们把 ElegantNote 更新为 ElegantBook 模板,在后面被用户熟知。而 ElegantNote 的设计自此停止。 + +2018 年,在被一些用户“催更”之后,ElegantBook 迎来重大更新,原先浮动的定理环境用 tcolorbox 全部改写。时至今日,ElegantBook 版本为 3.02。之后,我们便想把 ElegantNote 也彻底更新下,放弃 ElegantBook 中的定理环境设计,改用更为紧凑,更加朴素的定理环境,设计更适合笔记记录和笔记阅读的 \LaTeX{} 模板。 + +在一些朋友的建议和启发下,我们基于标准的 \LaTeX{} 文类 article 重新设计了新版 ElegantNote 模板,在此特别感谢!新模板有下面几个特性: +\begin{itemize} +\item 添加护眼模式,颜色为绿豆沙颜色; +\item 适配不同设备,包括 Pad(默认),Kindle,PC(双页),通用(A4); +\item 5 套颜色主题,分别是:green(默认),cyan,blue,sakura,black; +\item 语言模式支持:中文(默认),英文; +\item 支持 pdflatex 和 xelatex 编译; +\item 更加美观的图表标题格式,列表环境,数学字体等。 +\end{itemize} + +\subsection{护眼模式} +本模板增加了护眼模式,默认为不开启,开启的方法如下(2 选 1): +\begin{lstlisting}[frame=none] +\documentclass[geye]{elegantnote} +\documentclass[mode=geye]{elegantnote} +\end{lstlisting} + +\begin{remark} +此次更新只添加了护眼模式,也即只添加了一个背景颜色,如果您有希望增加其他颜色,可以和我们反馈! +\end{remark} + +\subsection{设备选择} +本模板适配不同的屏幕大小,分别为 Pad,Kindle,PC,A4。不同屏幕的选择为 +\begin{lstlisting}[frame=none] +\documentclass[device=pad]{elegantnote} +\documentclass[device=kindle]{elegantnote} +\documentclass[device=pc]{elegantnote} +\documentclass[device=normal]{elegantnote} +\end{lstlisting} +\begin{note} +也可以采取直接赋值的方法选择屏幕,比如: +\end{note} +\begin{lstlisting}[frame=none] +\documentclass[pad]{elegantnote} +\end{lstlisting} + +需要注意的是,如果想要得到普通的 A4 纸张大小的 PDF,需要选择 \lstinline{device=normal},而不是选择 \lstinline{device=pc},因为 \lstinline{device=pc} 实际上设置的是电脑双页模式。 + +\subsection{颜色主题} +本模板内置 5 套颜色主题,分别是 green,cyan,blue,sakura,black。其中 green 为默认颜色主题,如果用户不需要彩色,可以选择 black 主题。颜色主题的启用方法和之前一样: +\begin{lstlisting}[frame=none] +\documentclass[green]{elegantnote} +\documentclass[color=green]{elegantnote} +\end{lstlisting} + +\subsection{语言模式} +本模板内含两套语言环境,改变语言环境会改变图表标题的引导词(图,表),文章结构词(比如目录,参考文献等),以及定理环境中的引导词(比如定理,引理等)。不同语言模式的启用如下: +\begin{lstlisting}[frame=none] +\documentclass[cn]{elegantnote} +\documentclass[lang=cn]{elegantnote} +\documentclass[en]{elegantnote} +\documentclass[lang=en]{elegantnote} +\end{lstlisting} +\begin{note} +不管选用中文环境还是英文环境均可输入中文。 +\end{note} + +\subsection{编译方式} + +本模板支持两种编译方式,\lstinline{pdflatex} 和 \lstinline{xelatex},选用 \lstinline{pdflatex} 编译的话,如果用到了中文,则会调用 \lstinline{ctex} 宏包,而如果选用 \lstinline{xelatex} 编译的话,则会调用 \lstinline{xeCJK} 宏包。模板测试环境为 Win10 + TeX Live 2018,设定的字体为 Windows 中的宋体、楷体、黑体等。如果你的电脑是 Mac 系统,而且采用 \lstinline{xelatex} 编译的话,请把 \lstinline{elegantnote.cls} 中字体改为自己系统的字体。 + +\subsection{类定理环境} +此模板采用了 \lstinline{amsthm} 中的定理格式,使用了 4 类定理格式,所包含的环境分别为 +\begin{itemize} +\item \textbf{定理类}:theorem,lemma,proposition,corollary; +\item \textbf{定义类}:definition,conjecture,example; +\item \textbf{备注类}:remark,note,case; +\item \textbf{证明类}:proof。 +\end{itemize} + +\begin{remark} +在选用 \lstinline{lang=cn} 时,类定理环境的引导词全部会改为中文。 +\end{remark} + +\section{写作示例} + +我们将通过三个步骤定义可测函数的积分。首先定义非负简单函数的积分。以下设 $E$ 是 $\mathcal{R}^n$ 中的可测集。 + +\begin{definition}[可积性] +设 $ 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). +\end{equation} +一般情况下 $0 \leq \int_{E} f dx \leq \infty$。若 $\int_{E} f dx < \infty$,则称 $f$ 在 $E$ 上可积。 +\end{definition} + +一个自然的问题是,Lebesgue 积分与我们所熟悉的 Riemann 积分有什么联系和区别?之后我们将详细讨论 Riemann 积分与 Lebesgue 积分的关系。这里只看一个简单的例子。设 $D(x)$ 是区间 $[0,1]$ 上的 Dirichlet 函数。即 $D(x)=\chi_{Q_0}(x)$,其中 $Q_0$ 表示 $[0,1]$ 中的有理数的全体。根据非负简单函数积分的定义,$D(x)$ 在 $[0,1]$ 上的 Lebesgue 积分为 +\begin{equation} + \label{inter2} + \int_0^1 D(x)dx = \int_0^1 \chi_{Q_0} (x) dx = m(Q_0) = 0 +\end{equation} +即 $D(x)$ 在 $[0,1]$ 上是 Lebesgue 可积的并且积分值为零。但 $D(x)$ 在 $[0,1]$ 上不是 Riemann 可积的。 + +\begin{theorem}[Fubini 定理] +若 $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} + \int_{\mathcal{R}^p\times\mathcal{R}^q} f(x,y) dxdy=\int_{\mathcal{R}^p}\left(\int_{\mathcal{R}^q}f(x,y)dy\right)dx. +\end{equation} +\end{theorem} + +\begin{proof} +Let $z$ be some element of $xH \cap yH$. Then $z = xa$ for some $a \in H$, and $z = yb$ for some $b \in H$. If $h$ is any element of $H$ then $ah \in H$ and $a^{-1}h \in H$, since $H$ is a subgroup of $G$. But $zh = x(ah)$ and $xh = z(a^{-1}h)$ for all $h \in H$. Therefore $zH \subset xH$ and $xH \subset zH$, and thus $xH = zH$. Similarly $yH = zH$, and thus $xH = yH$, as required. +\end{proof} + + +回归分析(regression analysis) 是确定两种或两种以上变量间相互依赖的定量关系的一种统计分析方法。运用十分广泛,回归分析按照涉及的变量的多少,分为一元回归和多元回归分析;按照因变量的多少,可分为简单回归分析和多重回归分析;按照自变量和因变量之间的关系类型,可分为线性回归分析和非线性回归分析。如果在回归分析中,只包括一个自变量和一个因变量,且二者的关系可用一条直线近似表示,这种回归分析称为一元线性回归分析。如果回归分析中包括两个或两个以上的自变量,且自变量之间存在线性相关,则称为多重线性回归分析。 + +\begin{figure}[!htbp] + \centering + \includegraphics[width=0.6\textwidth]{scatter.pdf} + \caption{Matplotlib: Scatter Plot Example\label{fig:mpg}} +\end{figure} + +考虑函数 $y=a+bx$, 其中 $a$ 和 $b$ 是待定常数。如果离散点完全的在一直线上,可以认为变量之间的关系为一元函数。但一般说来,这些点不可能在同一直线上。但是它只能用直线来描述时,计算值与实际值会产生偏差。当然要求偏差越小越好,但由于偏差可正可负,因此不能认为总偏差时,拟合函数很好地反映了变量之间的关系,但是因为此时每个偏差的绝对值可能很大。为了改进这一缺陷,就考虑用平均值来代替。但是由于绝对值不易作解析运算,因此,进一步用残差平方和函数来度量总偏差。偏差的平方和最小可以保证每个偏差都不会很大。于是问题归结为确定拟合函数中的常数和使残差平方和函数最小。 + + + +\begin{table}[!htbp] + \small + \centering + \caption{Regression Result Example} + \begin{tabular}{lll} + \toprule + & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} \\ + & \multicolumn{1}{c}{price} & \multicolumn{1}{c}{price} \\ + \midrule + mpg & \multicolumn{1}{c}{-238.9***} & \multicolumn{1}{c}{-49.51} \\ + & \multicolumn{1}{c}{(53.08)} & \multicolumn{1}{c}{(86.16)} \\ + weight & \multicolumn{1}{c}{} & \multicolumn{1}{c}{1.747***} \\ + & \multicolumn{1}{c}{} & \multicolumn{1}{c}{(0.641)} \\ + constant & \multicolumn{1}{c}{11,253***} & \multicolumn{1}{c}{1,946} \\ + & \multicolumn{1}{c}{(1,171)} & \multicolumn{1}{c}{(3,597)} \\ + observations & \multicolumn{1}{c}{74} & \multicolumn{1}{c}{74} \\ + R-squared & \multicolumn{1}{c}{0.220} & \multicolumn{1}{c}{0.293} \\ + \midrule + \multicolumn{3}{l}{\scriptsize Standard errors in parentheses} \\ + \multicolumn{3}{l}{\scriptsize *** p<0.01, ** p<0.05, * p<0.1} \\ + \end{tabular}% + \label{tab:reg}% +\end{table}% + + +\begin{itemize}[noitemsep] + \item Routing and resource discovery; + \begin{itemize} + \item Language Models + \item Vector Space Models + \end{itemize} + \item Resilient and scalable computer networks; + \item Distributed storage and search. +\end{itemize} + + + +\end{document} diff --git a/figure/bluebase.pdf b/figure/bluebase.pdf deleted file mode 100644 index e71f961..0000000 Binary files a/figure/bluebase.pdf and /dev/null differ diff --git a/figure/cover.pdf b/figure/cover.pdf deleted file mode 100644 index ef841fc..0000000 Binary files a/figure/cover.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 05b43b1..0000000 Binary files a/figure/greenbase.pdf and /dev/null differ diff --git a/figure/logo.pdf b/figure/logo.pdf deleted file mode 100644 index 5775d07..0000000 Binary files a/figure/logo.pdf and /dev/null differ diff --git a/guide.pdf b/guide.pdf deleted file mode 100644 index 9db551c..0000000 Binary files a/guide.pdf and /dev/null differ diff --git a/guide.tex b/guide.tex deleted file mode 100644 index 3507122..0000000 --- a/guide.tex +++ /dev/null @@ -1,201 +0,0 @@ -\documentclass[cyan]{elegantnote} - -\author{ddswhu \& 小L} -\email{ddswhu@gmail.com} -\zhtitle{优美的\LaTeX{}模板} -\entitle{Elegant \LaTeX{}} -\version{1.00} -\myquote{Victory won\rq t come to us unless we go to it.} -\logo{logo.pdf} -\cover{cover.pdf} - -%green color - \definecolor{main1}{RGB}{210,168,75} - \definecolor{seco1}{RGB}{9,80,3} - \definecolor{thid1}{RGB}{0,175,152} -%cyan color - \definecolor{main2}{RGB}{239,126,30} - \definecolor{seco2}{RGB}{0,175,152} - \definecolor{thid2}{RGB}{236,74,53} -%cyan color - \definecolor{main3}{RGB}{127,191,51} - \definecolor{seco3}{RGB}{0,145,215} - \definecolor{thid3}{RGB}{180,27,131} - -\usepackage{makecell} -\usepackage{lipsum} - - - - - -\begin{document} -\maketitle -\tableofcontents -\chapter{Elegant Note模板的由来} - -只有当自己想去做一件事的时候才能把事情做好! - -\section{长长的历史,长长的期待} - -写这个模板的初衷是为了简化我在写笔记中的工作,因为我不会写类文件和包文件,所以,最当初是想拜托小L做出一个简洁,清爽的\LaTeX{}模板,最好是类文件,而且因为这样可以简化导言区复杂的内容。后来,和小L一拍即合,遂开始一起做Elegant\LaTeX{}的设计。 - -在学校的时候,搞定了定理环境样式的代码。因为不想重复 ChinaTeX 那个经典的页眉页脚,我找到了计量书上的一个图案,小L拿 Ti\emph{k}Z 一点一点把那个画出来了,不过我最后还是用的截取的方式得到的图案。然后慢慢地,我们把初步的样子做出来了。 - -2013年的暑假开始后,我对那个初步的模板做了一点改动,然后用它写了Dynamic Programing 的笔记,并且,在写的过程中,对模板加了封面,也就是模板现在的封面。至此,模板的大致样子终于出来了,不过也在写笔记的过程中知道了某些不足,比如 -\begin{enumerate} -\item 定理类的环境在我们这个模板中不能浮动,也不能跨页,在我们这个1.00版本中,这个功能仍然没有得到解决。 -\item 某些环境不足,比如例子、假设、性质、结论等环境,在1.00版本中已经增加了这几个环境。 -\item 一些我们不可预知的错误将会不期而遇。 -\item 一些我们目前没有需求,但是可以继续改进的地方,比如表格样式,比如抄录样式等。 -\end{enumerate} - -写完那个笔记之后越发让我对Elegant\LaTeX{}模板的制作更有激情,在和小L相互讨论的几天里,我们终于得到了现在这个版本的ElegantNote模板。 - - - - -\section{一张白纸折腾出一个模板} - -我以前从未写过类文件,所以,写这个模板的过程必然是折腾的过程,在写模板的过程中,最主要参考了moderncv.cls文件、武汉大学黄正华老师的论文模板,以及 -各大\LaTeX{}疑问解答网站。 - -{\color{thid}这章还有这么大空间,忍不住插个图!} - -\begin{figure}[!hbtp] -\includegraphics[width=0.8\textwidth]{happy.jpg} -\caption{Happiness,We have it!\label{figur:happy}} -\end{figure} - -\chapter{Elegant Note开服说明} - -\section{关于字体} - -首先呢?基于本模板追求视觉上的美观的角度,强烈建议使用者安装./fonts/文件夹下的字体。出于版权的考虑,务必不能将此模板用于涉及盈利目的的商业行为,否则,后果自负,本模板带的字体仅供学习使用,如果您喜欢某种字体,请自行购买正版。本文主要使用的字体如下 -\begin{itemize} -\itemsep=3pt -\parskip=0pt -\item Adobe Garamond Pro -\item Minion Pro \& Myriad Pro -\item 方正字体 -\item 华文中宋 -\end{itemize} - -并且,如果系统内安装了Adobe字体,建议大家把模板中的黑体,楷体,宋体等字替换成Adobe字体,这样可以达到最佳效果。 - -\begin{note} -需要特别注意的是,如果笔记需要使用到抄录环境的,请重新修改字体,此版本并未为抄录环境设置合适字体,本note环境的字体即为抄录环境使用到的字体。 -\end{note} - -\section{文档说明} -\subsection{编译方式} -本模板基于book文类,所以book的选项对于本模板也是有效的。但是,只支持 \XeLaTeX{},编码为 UTF-8,推荐使用 \TeX{}live编译。作者编写环境为Win8(64bit)+\TeX{}live 2013。 - -本文特殊选项设置共有2类,分为{\color{main}颜色}和{\color{main}数学字体}。 - -\subsection{选项设置} -第一类为{\color{main}颜色}主题设置,内置3组颜色主题,分别为green(default),cyan,blue。默认为green颜色主题。需要改变颜色的话请自行到elegantnote.cls文件内对颜色的RGB值进行修改。 - -第二类为{\color{main}数学字体}设置,有两个可选项,分别是computer modern 和 mtpro2字体,默认使用cm字体,无需在类文件前加选项,调用mtpro2字体的方法为\verb|\documentclass[mtpro]{elegantnote}| - -\begin{table}[htp] -\centering -\begin{tabular}{ccccc} -\toprule - & green & cyan & blue & 主要使用的环境\\ -\midrule -main & \makecell{{\color{main1}\rule{1cm}{1cm}}}& \makecell{{\color{main2}\rule{1cm}{1cm}}}&\makecell{ {\color{main3}\rule{1cm}{1cm}}}& newdef\\ - -seco &\makecell{ {\color{seco1}\rule{1cm}{1cm}}}& \makecell{{\color{seco2}\rule{1cm}{1cm}}}&\makecell{ {\color{seco3}\rule{1cm}{1cm}}}&newthem \ newlemma \ newcorol\\ - -thid &\makecell{ {\color{thid1}\rule{1cm}{1cm}}}& \makecell{{\color{thid2}\rule{1cm}{1cm}}}&\makecell{ {\color{thid3}\rule{1cm}{1cm}}}&newprop\\ -\bottomrule -\end{tabular} -\caption{Elegant note 模板中的三套颜色主题\label{tab:color thm}} -\end{table} - -\subsection{数学环境简介} -在我们这个模板中,定义了三大类环境 -\begin{enumerate} -\item 定理类环境,包含标题和内容两部分。根据格式的不同分为3种 -\begin{itemize} -\item {\color{main} newdef} 环境,含有一个可选项,编号以章节为单位; -\item {\color{main}newthem、newlemma、newcorol} 环境,三者颜色一致,但是定理环境编号以章节为单位,引理和推论为全文编号; -\item newprop 环境,含有可选项,编号以章节为单位。 -\end{itemize} -\item 证明类环境,有{\color{main}newproof、note} 环境,特点是,有引导符和引导词,并且证明环境有结束标志。 -\item 示例环境,有{\color{main} example、assumption、conclusion} 环境,三者均以粗体的引导词为开头,字体以灰色,和普通段落格式一致。 -\end{enumerate} - -\subsection{可编辑的字段} -在模板中,可以编辑的字段分别为作者\verb|\author|、\verb|\email|、\verb|\zhtitle|、\verb|\entitle|、\verb|\version|。并且,可以根据自己的喜好把封面水印效果的\verb|cover.pdf|替换掉,以及封面中用到的\verb|logo.pdf|。 - -\chapter{笔记写作示例} - -\section{灵魂不随便出卖,代码也不随便瞎写} -\lipsum[3] -考虑如下的随机动态规划问题 -\begin{align*} -&\max(\min)\quad \mathbb{E}\int_{t_0}^{t_1}f(t,x,u)\,dt\\ -&\quad\mbox{s.t.} \quad dx=g(t,x,u)dt+\sigma(t,x,u)dz\\ -&\quad \hspace{2.em} k(0)=k_0\;\text{given} -\end{align*} - -where $z$ is stochastic process or white noise or wiener process. - -\begin{newdef}[Wiener Process] -If $z$ is wiener process, then for any partition $t_0,t_1,t_2,\ldots$ of time interval, the random variables $z(t_1)-z(t_0),z(t_2)-z(t_1),\ldots$ are independently and normally distributed with zero means and variance $t_1-t_0,t_2-t_1,\ldots$ -\end{newdef} - -\lipsum[1-2] - -\begin{newthem}[勾股定理] -勾股定理的数学表达为 -\[a^2+b^2=c^2\] -其中$a,b$为直角三角形的两条直角边长,$c$为直角三角形斜边长。 -\end{newthem} - -\begin{note} -因为引理,推论的样式和定理的样式一致,仅仅只有计数器的设置不一样,在这里,我们就不写引理和推论的例子了。 -\end{note} - - -\lipsum[4] - -\begin{newprop}[最优性原理] -如果$u^*$在$[s,T]$上为最优解,则$u^*$在$[s,T]$任意子区间都是最优解,假设区间为$[t_0,t_1]$的最优解为$u^*$,则$u(t_0)=u^{*}(t_0)$,即初始条件必须还是在$u^*$上。 -\end{newprop} - -\lipsum[5-6] -\begin{newcorol} -假设$V(\cdot,\cdot)$为值函数,则跟据最大值原理,有如下推论 -\[ -V(k,z)=\max\Big\{u\big(zf(k)-y\big)+\beta \mathbb{E}V(y,z^\prime)\Big\} -\] -\end{newcorol} - -\begin{newproof} -因为 $y^*=\alpha\beta z k^\alpha$,$V(k,z)=\alpha/1-\alpha\beta\ln k_0+1/1-\alpha\beta \ln z_0+\Delta$。 -\begin{align*} -\text{右边}&=\Big\{u\big(zf(k)-y\big)+\beta \mathbb{E}V(y,z^\prime)\Big\}\\ -&=\ln(zk^\alpha-\alpha\beta zk^\alpha)+\beta\mathbb{E}\Big[\frac{\alpha}{1-\alpha\beta}\ln y+\frac{1}{1-\alpha\beta}\ln z^\prime+\Delta\Big]\\ -&=\ln(1-\alpha\beta)zk^\alpha+\beta\Big\{\mathbb{E}\big[\frac{\alpha}{1-\alpha\beta}\ln \alpha\beta z k^\alpha\big]+\frac{1}{1-\alpha\beta}\mathbb{E}[\ln z^\prime]+\Delta\Big\} -\end{align*} -利用$\mathbb{E}[\ln z^\prime]=0$,并将对数展开得 -\begin{align*} -\text{右边}&=\ln (1-\alpha\beta)+\ln z+\alpha\ln k+\frac{\alpha\beta}{1-\alpha\beta}\big[\ln \alpha\beta+\ln z+\alpha\ln k\big]+\frac{\beta}{1-\alpha\beta}\mu+\beta \Delta\\ -&=\frac{\alpha}{1-\alpha\beta}\ln k+\frac{1}{1-\alpha\beta}\ln z+\Delta -\end{align*} -所以$\text{左边}=\text{右边}$,证毕。 -\end{newproof} - - - - -\begin{conclusion} -今天看到一则小幽默,是这样说的:{\color{main} 别人都关心你飞的有多高,只有我关心你的翅膀好不好吃!}说多了都是泪啊! -\end{conclusion} - -最后祝大家\LaTeX{}的学习之路快乐精彩! - -\end{document} diff --git a/image/ElegantLaTeX_green.pdf b/image/ElegantLaTeX_green.pdf new file mode 100644 index 0000000..3203221 Binary files /dev/null and b/image/ElegantLaTeX_green.pdf differ diff --git a/image/happy.jpg b/image/happy.jpg deleted file mode 100644 index 407dc43..0000000 Binary files a/image/happy.jpg and /dev/null differ diff --git a/image/logo.png b/image/logo.png new file mode 100644 index 0000000..c5d81c6 Binary files /dev/null and b/image/logo.png differ diff --git a/image/scatter.pdf b/image/scatter.pdf new file mode 100644 index 0000000..b217cdc Binary files /dev/null and b/image/scatter.pdf differ diff --git a/image/scatter.py b/image/scatter.py new file mode 100644 index 0000000..576e6b0 --- /dev/null +++ b/image/scatter.py @@ -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)