├── README.md └── latex ├── README.md └── format ├── CN.tex ├── EN.tex ├── latex模板 article.tex ├── latex模板 book.tex └── latex模板 article 10.26.tex /README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /latex/README.md: -------------------------------------------------------------------------------- 1 | ## LaTeX 模板介绍 🎨 2 | 3 | > 本文提供了 **中文 LaTeX 模板** 和 **英文 LaTeX 模板**,以帮助学术论文、报告、简历、演示文稿等文档的快速排版。 4 | 5 | ### 模板下载链接 📥 6 | 7 | - **[中文 LaTeX 模板](链接)** 8 | 该模板针对中文排版做了优化,支持中文字符、中文标点符号自动适配,提供了清晰的结构和专业的排版风格,适合撰写中文科研论文和报告。 9 | 10 | - **[英文 LaTeX 模板](链接)** 11 | 英文模板提供了符合国际标准的排版结构,包含常见的学术论文排版格式,如标题、摘要、正文、参考文献等,适合撰写课程笔记。 12 | 13 | 14 | ### 使用说明 📝 15 | 16 | - 下载并解压模板文件。 17 | - 根据具体需求修改文件中的章节、内容和格式。 18 | - 通过编辑 **`\usepackage{}`** 导入额外的 LaTeX 包,满足不同文档的排版需求。 19 | - 推荐使用 **Overleaf** 或本地 LaTeX 编译器进行文档编译和查看。 20 | 21 | 22 | 23 | > 如有任何问题,欢迎提出,我会及时更新和改进模板。 24 | 25 | -------------------------------------------------------------------------------- /latex/format/CN.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage{ctex,fontspec,geometry,xcolor} 3 | \geometry{left=2.2cm,right=2.2cm,top=2.4cm,bottom=2.4cm} 4 | 5 | % ---- 基础排版 ---- 6 | \setmainfont{Times New Roman} 7 | \setCJKmainfont{FandolSong} 8 | \usepackage{microtype,mathtools,bm,physics,enumitem} 9 | \usepackage{titlesec,setspace,fancyhdr,hyperref,cleveref} 10 | \setstretch{1.15} 11 | 12 | % ---- 彩色章节 ---- 13 | \titleformat{\section} 14 | {\Large\bfseries\color{teal}}{\thesection.}{0.6em}{}[\titlerule] 15 | % --- Algorithms --- 16 | \usepackage[ruled,vlined,linesnumbered]{algorithm2e} 17 | \renewcommand{\algorithmcfname}{Algorithm} 18 | \SetKwInput{KwInput}{Input} 19 | \SetKwInput{KwOutput}{Output} 20 | 21 | 22 | % cleveref already loaded earlier (if not): 23 | \usepackage[capitalize,nameinlink]{cleveref} 24 | 25 | % ---- 定理环境 ---- 26 | \definecolor{shadecolor}{rgb}{0.90,0.95,1} 27 | \definecolor{thmblue}{RGB}{35,116,190} 28 | \usepackage{tcolorbox,thmtools} 29 | \declaretheoremstyle[headfont=\bfseries\color{white}, 30 | headformat=\COLORBOX{thmblue}{\color{white}\thmname{#1}~\thmnumber{#2}}, 31 | shaded={bgcolor=shadecolor}]{thmbox} 32 | \declaretheorem[style=thmbox,numberwithin=section]{theorem} 33 | \declaretheorem[style=thmbox,sibling=theorem]{lemma} 34 | \declaretheorem[style=thmbox,sibling=theorem]{definition} 35 | 36 | % --- Extra boxes --- 37 | % 深浅蓝 & 深浅红 统一 38 | \newtcolorbox{analysisBox}{ 39 | colback=blue!8!white, colframe=blue!60!black, 40 | coltitle=white, title=Analysis, fonttitle=\bfseries, 41 | rounded corners=2pt, boxrule=0.6pt, breakable 42 | } 43 | \newtcolorbox{remarkBox}{ 44 | colback=red!8!white, colframe=red!60!black, 45 | coltitle=white, title=Remark, fonttitle=\bfseries, 46 | rounded corners=2pt, boxrule=0.6pt, breakable 47 | } 48 | 49 | 50 | % ---- 页眉页脚 ---- 51 | \fancyhf{}\renewcommand{\headrulewidth}{0pt} 52 | \fancyhead[L]{HD Probability} 53 | \fancyhead[R]{\leftmark} 54 | \fancyfoot[C]{\thepage} 55 | \pagestyle{fancy} 56 | 57 | \title{Suprema Expectation II (Enhanced)} 58 | \author{} 59 | \date{\today} 60 | \begin{document} 61 | \maketitle 62 | 63 | \begin{abstract} 64 | A pretty version of the previous notes … 65 | \end{abstract} 66 | 67 | \section{Introduction} 68 | \subsection{subsection} 69 | Text $\ldots$ 70 | 71 | \begin{definition}[ε–net] 72 | Given a metric space $(T,d)$, a set $N\subset T$ is an $\varepsilon$–net if … 73 | \end{definition} 74 | 75 | \begin{lemma} 76 | $N(T,d,\varepsilon)\le P(T,d,\varepsilon)$, etc. 77 | \end{lemma} 78 | \begin{algorithm}[H] 79 | \KwInput{Data $D$, step size $\eta$} 80 | \KwOutput{Optimal $x^\star$} 81 | Initialize $x^{(0)}$\; 82 | \For{$t=0$ \KwTo $T-1$}{ 83 | $g_t \gets \nabla f\bigl(x^{(t)}\bigr)$\; 84 | $x^{(t+1)} \gets x^{(t)} - \eta\,g_t$\; 85 | } 86 | \caption{Gradient Descent}\label{alg:gd} 87 | \end{algorithm} 88 | 89 | \begin{analysisBox} 90 | We prove \cref{thm:finite-approx} by decomposing the supremum into 91 | projection error and net maximum, then apply Lemma~\ref{lem:finite-max}. 92 | \end{analysisBox} 93 | 94 | \begin{remarkBox} 95 | Choosing $\varepsilon = 1/4$ balances the two terms and yields the 96 | optimal $\sqrt{d}$ rate. 97 | \end{remarkBox} 98 | 99 | \printbibliography % 若使用 biblatex 100 | \end{document} 101 | -------------------------------------------------------------------------------- /latex/format/EN.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper, 11pt]{article} 2 | 3 | % 页面设置 4 | \setlength{\oddsidemargin}{0.25 in} 5 | \setlength{\evensidemargin}{-0.25 in} 6 | \setlength{\topmargin}{-0.6 in} 7 | \setlength{\textwidth}{6.5 in} 8 | \setlength{\textheight}{8.5 in} 9 | \setlength{\headsep}{0.75 in} 10 | \setlength{\parindent}{0 in} 11 | \setlength{\parskip}{0.1 in} 12 | 13 | % 引入包 14 | \usepackage{tcolorbox}[colframe=black,colback=blue!5!white,title=Analysis Box] 15 | \tcbset{ 16 | analysisbox/.style={ 17 | colframe=blue!55!black, % 边框颜色 18 | colback=blue!5!white, % 背景颜色 19 | boxrule=0.5mm, % 边框厚度 20 | title=\textbf{Analysis}, % 标题为粗体的Analysis 21 | fonttitle=\bfseries % 设置标题为粗体 22 | } 23 | } 24 | 25 | \newtcolorbox{remark}{ 26 | colframe=red!45!black, % 边框颜色 27 | colback=red!10!white, % 背景颜色 28 | boxrule=0.5mm, % 边框厚度 29 | title=\textbf{Remark}, % 标题为粗体Remark 30 | fonttitle=\bfseries % 标题字体样式为粗体 31 | } 32 | 33 | \colorlet{shadecolor}{blue!12} 34 | \usepackage{framed} 35 | \usepackage{amsmath,amsfonts,amssymb,graphicx,mathtools,flexisym,amsthm} 36 | 37 | % 设置章节编号 38 | \newcounter{lecnum} 39 | \renewcommand{\thepage}{\thelecnum-\arabic{page}} 40 | \renewcommand{\thesection}{\thelecnum.\arabic{section}} 41 | \renewcommand{\theequation}{\thelecnum.\arabic{equation}} 42 | \renewcommand{\thefigure}{\thelecnum.\arabic{figure}} 43 | \renewcommand{\thetable}{\thelecnum.\arabic{table}} 44 | 45 | % 设置头部格式 46 | \newcommand{\lecture}[4]{ 47 | \pagestyle{myheadings} 48 | \thispagestyle{plain} 49 | \newpage 50 | \setcounter{lecnum}{#1} 51 | \setcounter{page}{1} 52 | \noindent 53 | \begin{center} 54 | \framebox{ 55 | \vbox{\vspace{2mm} 56 | \hbox to 6.28in { {\bf Optimization 57 | \hfill Fall 2024} } 58 | \vspace{4mm} 59 | \hbox to 6.28in { {\Large \hfill Lecture #1: #2 \hfill} } 60 | \vspace{2mm} 61 | \hbox to 6.28in { {\it Lecturer: #3 \hfill School: #4} } 62 | \vspace{2mm}} 63 | } 64 | \end{center} 65 | \markboth{Lecture #1: #2}{Lecture #1: #2} 66 | 67 | \vspace*{4mm} 68 | } 69 | 70 | % 自定义引用和参考文献样式 71 | \renewcommand{\cite}[1]{[#1]} 72 | \def\beginrefs{\begin{list}% 73 | {[\arabic{equation}]}{\usecounter{equation} 74 | \setlength{\leftmargin}{2.0truecm}\setlength{\labelsep}{0.4truecm}% 75 | \setlength{\labelwidth}{1.6truecm}}} 76 | \def\endrefs{\end{list}} 77 | \def\bibentry#1{\item[\hbox{[#1]}]} 78 | 79 | % 插入图片 80 | \newcommand{\fig}[3]{ 81 | \vspace{#2} 82 | \begin{center} 83 | Figure \thelecnum.#1:~#3 84 | \end{center} 85 | } 86 | 87 | % 定理、引理等环境 88 | \newtheorem{theorem}{Theorem}[section] 89 | \newtheorem{lemma}[theorem]{Lemma} 90 | \newtheorem{proposition}[theorem]{Proposition} 91 | \newtheorem{claim}[theorem]{Claim} 92 | \newtheorem{corollary}[theorem]{Corollary} 93 | \newtheorem{definition}{Definition}[section] 94 | \usepackage{enumerate} 95 | 96 | % 数学符号简化 97 | \newcommand\E{\mathbb{E}} 98 | 99 | \begin{document} 100 | 101 | % 填写课程信息 102 | \lecture{1}{Convex Function}{MIStatlE}{Fudan University} 103 | 104 | % 你的笔记内容 105 | This chapter introduces some definitions and basic results from measure theory. 106 | 107 | \section{Vector Space} 108 | \subsection{Affine Sets and Convex Sets} 109 | Given a real vector space $\mathbb{E}$, a set $S\subseteq \mathbb{E}$ is called an affine set if 110 | $$\lambda \textbf{x} +(1-\lambda)\textbf{y}\in S$$ 111 | $\forall \textbf{x,y}\in S$ and $\lambda\in \mathbb{R}$\\ 112 | e.g. A hyperplane is a subset of $\mathbb{E}$ given by 113 | $$H_{a,b}=\{x\in E:=b\}$$ 114 | 115 | % 继续你的笔记... 116 | \end{document} 117 | -------------------------------------------------------------------------------- /latex/format/latex模板 article.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{article} % 也支持 14pt/17pt/20pt 2 | 3 | % ==== Engine ==== 4 | \usepackage{ifxetex,ifluatex} 5 | \usepackage{everypage} 6 | \ifxetex\else\ifluatex\else 7 | \errmessage{Please compile with XeLaTeX or LuaLaTeX} 8 | \fi\fi 9 | 10 | % ==== Fonts & Page ==== 11 | \usepackage{ctex,fontspec,geometry,xcolor} 12 | \geometry{paperwidth=7.5in,paperheight=10in, margin=0.7in} 13 | \setmainfont{Times New Roman} 14 | \IfFontExistsTF{Noto Serif CJK SC}{ 15 | \setCJKmainfont{Noto Serif CJK SC} 16 | }{ 17 | \setCJKmainfont{FandolSong} 18 | } 19 | \linespread{1.4} 20 | \pagecolor{white}\color{black} 21 | 22 | % ==== Colors ==== 23 | \definecolor{brand}{HTML}{1A9D8F} 24 | \definecolor{brandD}{HTML}{2A7F6F} 25 | \definecolor{ink}{HTML}{1A1A1A} 26 | \definecolor{keybg}{HTML}{E8F4F1} 27 | \definecolor{keydark}{HTML}{2F5E58} 28 | \definecolor{accent}{HTML}{FF6B6B} 29 | \definecolor{accentD}{HTML}{D94F4F} 30 | \definecolor{soft}{HTML}{F3F8F7} 31 | \definecolor{xhsRed}{HTML}{FF4D4F} 32 | \definecolor{xhsDark}{HTML}{1F1F1F} 33 | \definecolor{xhsCream}{HTML}{FFF8F0} 34 | \definecolor{xhsBlue}{HTML}{2F54EB} 35 | \definecolor{xhsYellow}{HTML}{FFB800} 36 | 37 | % ==== Date macro ==== 38 | \newcommand{\padzero}[1]{\ifnum#1<10 0\fi\number#1} 39 | \newcommand{\BrandYMD}{{\the\year·\padzero{\the\month}·\padzero{\the\day}}} 40 | 41 | % ==== Section Titles ==== 42 | \usepackage{titlesec} 43 | \titleformat{\section}[block] 44 | {\centering\bfseries\color{keydark}\fontsize{24pt}{26pt}\selectfont} 45 | {\thesection}{0.6em}{} 46 | \titlespacing*{\section}{0pt}{0.9em}{0.5em} 47 | 48 | \titleformat{\subsection}{\Large\bfseries\color{brand}}{\thesubsection}{0.6em}{} 49 | \titlespacing*{\subsection}{0pt}{0.8em}{0.4em} 50 | 51 | % ==== Left bands on every page ==== 52 | \usepackage{tikz,eso-pic} 53 | \usetikzlibrary{positioning,calc} 54 | \newcommand{\LeftBandA}{0.12in} 55 | \newcommand{\LeftBandB}{0.28in} 56 | \newcommand{\PutLeftBands}{% 57 | \begin{tikzpicture}[remember picture, overlay] 58 | \fill[keydark] ([xshift=0cm]current page.north west) 59 | rectangle 60 | ([xshift=\LeftBandA]current page.south west); 61 | \fill[keybg] ([xshift=\LeftBandA]current page.north west) 62 | rectangle 63 | ([xshift=\LeftBandB]current page.south west); 64 | \end{tikzpicture}% 65 | } 66 | \AddEverypageHook{\PutLeftBands} 67 | 68 | % ==== Header / Footer ==== 69 | \usepackage{fancyhdr} 70 | \fancypagestyle{coverstyle}{% 71 | \fancyhf{}\renewcommand{\headrulewidth}{0pt}\renewcommand{\footrulewidth}{0pt} 72 | } 73 | \fancyhf{} 74 | \renewcommand{\headrulewidth}{0.4pt} 75 | \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} % 右上角:节号 + 节题 76 | \fancyhead[R]{\nouppercase{\rightmark}} 77 | \fancyfoot[L]{\textcolor{brand}{@MIStatlE}|集中不等式 \seriesnum} 78 | \fancyfoot[R]{\textcolor{brand}{\thepage}} 79 | \pagestyle{fancy} 80 | 81 | % ==== 参数:系列编号 ==== 82 | \newcommand{\seriesnum}{I} % 改为 I/II/III 或 1/2/3 83 | 84 | % ==== Highlight boxes ==== 85 | \usepackage[most]{tcolorbox} 86 | \tcbset{enhanced, boxrule=0.9pt, arc=3pt, left=10pt,right=10pt,top=10pt,bottom=10pt} 87 | \newtcolorbox{KeyBox}{ 88 | colback=keybg, colframe=brandD, 89 | colbacktitle=brandD, title=\textbf{\color{white}Key Idea}, 90 | fonttitle=\bfseries\large, coltitle=white, breakable 91 | } 92 | \newtcolorbox{Takeaway}{ 93 | colback=accent!12, colframe=accentD, 94 | colbacktitle=accentD, title=\textbf{\color{white}Takeaway}, 95 | fonttitle=\bfseries\large, coltitle=white, breakable 96 | } 97 | 98 | % ==== Flow sidebar ==== 99 | \usepackage{mdframed} 100 | \newmdenv[ 101 | topline=false, bottomline=false, rightline=false, 102 | linewidth=4pt, linecolor=brand, backgroundcolor=soft, 103 | innerleftmargin=10pt, innerrightmargin=10pt, 104 | skipabove=6pt, skipbelow=6pt 105 | ]{SideBar} 106 | 107 | % ==== Math & Theorems ==== 108 | \usepackage{amsmath,amssymb,bm,amsthm} 109 | \DeclareMathOperator{\Var}{Var} 110 | \newcommand{\E}{\mathbb{E}} 111 | 112 | % Shaded theorem 外框(可选) 113 | \usepackage{framed} 114 | \definecolor{shadecolor}{RGB}{235,245,255} 115 | \newenvironment{ShadedTheorem}[1][]{% 116 | \begin{shaded}\begin{theorem}[#1]}{\end{theorem}\end{shaded}} 117 | 118 | % 定理样式 & 按 section 编号 119 | \newtheoremstyle{customthm}{0.8em}{0.8em}{\itshape}{}{\bfseries}{.}{0.5em}{} 120 | \newtheoremstyle{customdef}{0.8em}{0.8em}{}{}{\bfseries}{.}{0.5em}{} 121 | \theoremstyle{customthm} 122 | \newtheorem{theorem}{定理}[section] 123 | \newtheorem{lemma}[theorem]{引理} 124 | \newtheorem{proposition}[theorem]{命题} 125 | \newtheorem{corollary}[theorem]{推论} 126 | \theoremstyle{customdef} 127 | \newtheorem{definition}[theorem]{定义} 128 | \newtheorem{remark}[theorem]{注释} 129 | 130 | % ==== 章节机制(自定义章号/章题,仅影响编号显示) ==== 131 | \newcounter{chapter} 132 | \newcommand{\setchapter}[2]{% 133 | \setcounter{chapter}{#1}% 134 | \setcounter{section}{0}% 135 | \def\ChapterTitle{#2}% 136 | } 137 | \renewcommand{\thesection}{\arabic{chapter}.\arabic{section}} 138 | \renewcommand{\thesubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}} 139 | \newcommand{\ChapterHeading}{% 140 | \vspace*{0.6cm} 141 | {\fontsize{26pt}{28pt}\selectfont\bfseries\color{keydark} 142 | 第\arabic{chapter}章\ \ChapterTitle\par} 143 | \vspace{0.6cm} 144 | } 145 | \newcommand{\BeginChapter}[2]{% 146 | \clearpage 147 | \setchapter{#1}{#2}% 148 | \ChapterHeading 149 | } 150 | 151 | % ==== Remark(非盒子风) ==== 152 | \newenvironment{RemarkNote}[1][]{% 153 | \par\smallskip 154 | \noindent{\bfseries\color{accentD}Remark}% 155 | \ifx\relax#1\relax\else{\bfseries\color{accentD} \ (#1)}\fi 156 | \ .\ % 157 | }{% 158 | \par\smallskip 159 | {\color{ink!60}\rule{\linewidth}{0.4pt}} 160 | \smallskip 161 | } 162 | 163 | % ==== Example 盒子 ==== 164 | \definecolor{exframe}{HTML}{6C5CE7} 165 | \definecolor{exbg}{HTML}{F2E9FF} 166 | \newtcolorbox{Example}[1][]{% 167 | enhanced, colback=exbg, colframe=exframe, 168 | coltitle=white, colbacktitle=exframe, 169 | title=\textbf{Example}, 170 | fonttitle=\bfseries, boxrule=1.1pt, arc=4pt, 171 | left=10pt,right=10pt,top=10pt,bottom=10pt, 172 | attach boxed title to top left = {yshift=-2mm, xshift=2mm}, 173 | breakable, #1 174 | } 175 | 176 | % ==== 证明环境 ==== 177 | \renewenvironment{proof}[1][证明]{\par 178 | \pushQED{\qed}% 179 | \normalfont \topsep6pt \partopsep0pt 180 | \trivlist 181 | \item[\hskip\labelsep\bfseries #1.]\ignorespaces 182 | }{\popQED\endtrivlist} 183 | 184 | % ==== 系列导航卡(页末信息块,可选) ==== 185 | \newcommand{\SeriesCardEnd}[3]{% 186 | \vspace{1.4em}\noindent 187 | \setlength{\fboxsep}{8pt}\setlength{\fboxrule}{0.8pt}% 188 | \fcolorbox{brand}{soft}{% 189 | \parbox{\dimexpr\linewidth-2\fboxsep-2\fboxrule\relax}{% 190 | \textbf{集中不等式系列 · 第 #1 篇}\par 191 | \vspace{0.3em}% 192 | \noindent 193 | \begin{minipage}[t]{0.49\linewidth}\raggedright 194 | \textit{上一篇:}#2 195 | \end{minipage}\hfill 196 | \begin{minipage}[t]{0.49\linewidth}\raggedleft 197 | \textit{下一篇:}#3 198 | \end{minipage}% 199 | }% 200 | }% 201 | } 202 | 203 | % ========================= 204 | % ======== 文档开始 ======== 205 | % ========================= 206 | \begin{document} 207 | 208 | % ====== 使用示例(请按需替换/删除) ====== 209 | % 设定章号与章标题(可选打印大标题) 210 | \setchapter{1}{示例章标题} 211 | %\ChapterHeading % 如不想显示章标题,可注释本行 212 | 213 | \section{xx不等式} 214 | \begin{SideBar} 215 | \textbf{背景/引言/要解决的问题} 216 | \end{SideBar} 217 | \subsection{预备知识} 218 | 219 | \begin{definition}[示例定义] 220 | 这是一个示例定义。\par 221 | \end{definition} 222 | \begin{ShadedTheorem}[示例定理] 223 | 这是一个示例定理陈述。 224 | \end{ShadedTheorem} 225 | 226 | 227 | \begin{proof} 228 | 这里是证明思路…… 229 | \end{proof} 230 | \begin{RemarkNote} 231 | 发现的奇妙的东西 232 | \end{RemarkNote} 233 | \begin{KeyBox} 234 | 关键想法要点总结…… 235 | \end{KeyBox} 236 | 237 | \begin{Takeaway} 238 | 简要总结内容 239 | \end{Takeaway} 240 | 241 | \section*{参考文献} 242 | \begin{enumerate} 243 | \item Rudelson, M.\ \& Vershynin, R. (2013). Hanson--Wright inequality and sub-gaussian concentration. \textit{Electronic Communications in Probability}, 18, 1--9. 244 | \end{enumerate} 245 | % 页末信息块(可选) 246 | %\SeriesCardEnd{I}{上一篇标题}{下一篇标题} 247 | 248 | \end{document} -------------------------------------------------------------------------------- /latex/format/latex模板 book.tex: -------------------------------------------------------------------------------- 1 | \documentclass[10pt,openany]{book} % 可改 11pt,openright 2 | 3 | % ==== Engine ==== 4 | \usepackage{ifxetex,ifluatex} 5 | \usepackage{everypage} 6 | \ifxetex\else\ifluatex\else 7 | \errmessage{Please compile with XeLaTeX or LuaLaTeX} 8 | \fi\fi 9 | % —— 让 plain 页式复用 fancy 的设置(章/部首页也有同样的页眉页脚)—— 10 | \makeatletter 11 | \let\ps@plain\ps@fancy 12 | \makeatother 13 | % ==== Fonts & Page ==== 14 | \usepackage{ctex,fontspec,geometry,xcolor} 15 | \geometry{paperwidth=6in,paperheight=9in, margin=0.8in} % 常见 6x9 16 | \setmainfont{Times New Roman} 17 | \IfFontExistsTF{Noto Serif CJK SC}{\setCJKmainfont{Noto Serif CJK SC}}{\setCJKmainfont{FandolSong}} 18 | \linespread{1.35} 19 | \pagecolor{white}\color{black} 20 | 21 | % ==== Colors ==== 22 | \definecolor{brand}{HTML}{1A9D8F} 23 | \definecolor{brandD}{HTML}{2A7F6F} 24 | \definecolor{ink}{HTML}{1A1A1A} 25 | \definecolor{keybg}{HTML}{E8F4F1} 26 | \definecolor{keydark}{HTML}{2F5E58} 27 | \definecolor{accent}{HTML}{FF6B6B} 28 | \definecolor{accentD}{HTML}{D94F4F} 29 | \definecolor{soft}{HTML}{F3F8F7} 30 | 31 | % ==== Date macro ==== 32 | \newcommand{\padzero}[1]{\ifnum#1<10 0\fi\number#1} 33 | \newcommand{\BrandYMD}{{\the\year·\padzero{\the\month}·\padzero{\the\day}}} 34 | 35 | % ==== Left bands on every page ==== 36 | \usepackage{tikz,eso-pic} 37 | \usetikzlibrary{positioning,calc} 38 | \newcommand{\LeftBandA}{0.12in} 39 | \newcommand{\LeftBandB}{0.28in} 40 | \newcommand{\PutLeftBands}{% 41 | \begin{tikzpicture}[remember picture, overlay] 42 | \fill[keydark] ([xshift=0cm]current page.north west) 43 | rectangle ([xshift=\LeftBandA]current page.south west); 44 | \fill[keybg] ([xshift=\LeftBandA]current page.north west) 45 | rectangle ([xshift=\LeftBandB]current page.south west); 46 | \end{tikzpicture}% 47 | } 48 | \AddEverypageHook{\PutLeftBands} 49 | 50 | % ==== Header / Footer ==== 51 | \usepackage{fancyhdr} 52 | \pagestyle{fancy} 53 | \fancyhf{} 54 | \renewcommand{\headrulewidth}{0.4pt} 55 | \fancyhead[LE]{\nouppercase{\leftmark}} % 偶数页:章标题 56 | \fancyhead[RO]{\nouppercase{\rightmark}} % 奇数页:节标题 57 | \fancyfoot[LE,RO]{\textcolor{brand}{\thepage}} 58 | \fancyfoot[LO,RE]{\textcolor{brand}{@MIStatlE|集中不等式 \seriesnum}} 59 | % 封面样式 60 | \fancypagestyle{coverstyle}{\fancyhf{}\renewcommand{\headrulewidth}{0pt}\renewcommand{\footrulewidth}{0pt}} 61 | 62 | % ==== Series number parameter ==== 63 | \newcommand{\seriesnum}{I} 64 | 65 | % ==== Titles (Part/Chapter/Section) ==== 66 | % —— Part 标题整块垂直居中 + 颜色/横线正确 —— 67 | \usepackage{titlesec} 68 | 69 | \titleformat{\part}[display] 70 | {\filcenter\bfseries\color{keydark}} % 颜色只作用于标题块内部 71 | {\Large Part \thepart} % 标签行(如:Part I) 72 | {0.6em} % 标签与标题的间距 73 | {\Huge} % 标题字号(开始标题) 74 | [\vspace{0.8em}{\color{brand}\rule{7cm}{1.2pt}}] % 结尾横线(在本地组里上色) 75 | 76 | % 关键:用 titlespacing 的 before/after = \fill 来垂直居中整个块 77 | \titlespacing*{\part}{0pt}{\fill}{\fill} 78 | % Chapter 79 | \titleformat{\chapter}[display] 80 | {\bfseries\color{keydark}} 81 | {\Large 第\thechapter 章} 82 | {0.4em} 83 | {\Huge} 84 | [\vspace{0.4em}{\color{brandD!45}\rule{6cm}{0.8pt}}] 85 | \titlespacing*{\chapter}{0pt}{1.2em}{0.8em} 86 | 87 | % Section / Subsection 88 | \titleformat{\section} 89 | {\Large\bfseries\color{keydark}} 90 | {\thesection}{0.6em}{} 91 | \titlespacing*{\section}{0pt}{0.9em}{0.5em} 92 | \titleformat{\subsection} 93 | {\large\bfseries\color{brand}} 94 | {\thesubsection}{0.6em}{} 95 | \titlespacing*{\subsection}{0pt}{0.8em}{0.4em} 96 | 97 | % ==== (Optional) Chapter mini-TOC interface ==== 98 | % 如需每章小目录,取消注释以下三行,并在 \begin{document} 后调用 \dominitoc, 99 | % 每个 \chapter 后面放 \minitoc 即可。 100 | % \usepackage{minitoc} 101 | % \setcounter{minitocdepth}{2} 102 | % \setlength{\mtcindent}{12pt} 103 | 104 | % ==== Boxes & Sidebars ==== 105 | \usepackage[most]{tcolorbox} 106 | \tcbset{enhanced, boxrule=0.9pt, arc=3pt, left=10pt,right=10pt,top=10pt,bottom=10pt} 107 | \newtcolorbox{KeyBox}{ 108 | colback=keybg, colframe=brandD, 109 | colbacktitle=brandD, title=\textbf{\color{white}Key Idea}, 110 | fonttitle=\bfseries\large, coltitle=white, breakable 111 | } 112 | \newtcolorbox{Takeaway}{ 113 | colback=accent!12, colframe=accentD, 114 | colbacktitle=accentD, title=\textbf{\color{white}Takeaway}, 115 | fonttitle=\bfseries\large, coltitle=white, breakable 116 | } 117 | \definecolor{exframe}{HTML}{6C5CE7} 118 | \definecolor{exbg}{HTML}{F2E9FF} 119 | \newtcolorbox{Example}[1][]{% 120 | enhanced, colback=exbg, colframe=exframe, 121 | coltitle=white, colbacktitle=exframe, 122 | title=\textbf{Example}, 123 | fonttitle=\bfseries, boxrule=1.1pt, arc=4pt, 124 | left=10pt,right=10pt,top=10pt,bottom=10pt, 125 | attach boxed title to top left = {yshift=-2mm, xshift=2mm}, 126 | breakable, #1 127 | } 128 | \usepackage{mdframed} 129 | \newmdenv[ 130 | topline=false, bottomline=false, rightline=false, 131 | linewidth=4pt, linecolor=brand, backgroundcolor=soft, 132 | innerleftmargin=10pt, innerrightmargin=10pt, 133 | skipabove=6pt, skipbelow=6pt 134 | ]{SideBar} 135 | 136 | % ==== Math & Theorems ==== 137 | \usepackage{amsmath,amssymb,bm,amsthm} 138 | \DeclareMathOperator{\Var}{Var} 139 | \newcommand{\E}{\mathbb{E}} 140 | \numberwithin{equation}{chapter} 141 | \theoremstyle{plain} 142 | \newtheorem{theorem}{定理}[chapter] 143 | \newtheorem{lemma}[theorem]{引理} 144 | \newtheorem{proposition}[theorem]{命题} 145 | \newtheorem{corollary}[theorem]{推论} 146 | \theoremstyle{definition} 147 | \newtheorem{definition}[theorem]{定义} 148 | \theoremstyle{remark} 149 | \newtheorem{remark}[theorem]{注释} 150 | 151 | % ==== Simple Cover Macro ==== 152 | % —— 极简封面(仅居中标题/副标题/日期)—— 153 | \newcommand{\MakeBookCoverUltraSimple}[3]{% 154 | % #1 主标题 #2 副标题 #3 标签(可空) 155 | \thispagestyle{coverstyle}% 156 | \vspace*{\fill} 157 | \begin{center} 158 | {\bfseries\fontsize{30}{36}\selectfont\color{keydark} #1\par} 159 | \vspace{0.45em} 160 | {\bfseries\fontsize{16}{22}\selectfont\color{ink!90} #2\par} 161 | \vspace{0.6em} 162 | \if\relax\detokenize{#3}\relax\else 163 | \vspace{0.2em} 164 | {\color{brandD}\fboxsep=6pt\colorbox{white}{\textbf{\textcolor{brandD}{#3}}}\par} 165 | \fi 166 | \vspace{0.8em} 167 | {\small\color{keydark!75}\BrandYMD} 168 | \end{center} 169 | \vspace*{\fill} 170 | \clearpage 171 | } 172 | 173 | % ==== Chapter Epigraph ==== 174 | \newcommand{\ChapterEpigraph}[2][]{% 175 | \par\vspace*{0.6em} 176 | \begin{flushright} 177 | \begin{minipage}{0.78\linewidth}\raggedleft 178 | {\itshape\color{ink!85}#2\par}% 179 | \if\relax\detokenize{#1}\relax\else 180 | \vspace{0.3em}{\color{ink!70}--- #1}\par 181 | \fi 182 | \end{minipage} 183 | \end{flushright} 184 | \vspace{0.6em} 185 | } 186 | 187 | % ==== Begin Document ==== 188 | \begin{document} 189 | % \dominitoc % ← 若启用每章小目录,在此行取消注释 190 | 191 | % 封面 192 | \MakeBookCoverUltraSimple{集中不等式(示例书名)}{高维概率与机器学习理论中的浓缩现象}{上册 · 预印本} 193 | 194 | % Frontmatter 195 | \frontmatter 196 | \thispagestyle{coverstyle} 197 | \vspace*{3cm} 198 | \begin{center} 199 | {\Large\bfseries 致谢(示例)}\\[1.2em] 200 | \parbox{0.75\linewidth}{\centering 201 | 感谢同行与读者的反馈……(此处放致谢内容占位)。} 202 | \end{center} 203 | \clearpage 204 | 205 | \setcounter{tocdepth}{2} % 目录显示到 subsection 206 | \tableofcontents 207 | \clearpage 208 | 209 | % Mainmatter 210 | \mainmatter 211 | 212 | \part{预备知识与工具} 213 | \chapter{概率预备(示例)} 214 | % \minitoc % ← 若启用 minitoc,这里放置 215 | \ChapterEpigraph[Kolmogorov]{The theory of probability as a mathematical discipline can 216 | and should be developed from axioms in exactly the same way as geometry and algebra.} 217 | 218 | \begin{SideBar} 219 | \textbf{阅读建议}:本章覆盖后续章节频繁使用的定义与工具。 220 | \end{SideBar} 221 | 222 | \section{Orlicz 范数与次高斯} 223 | \begin{definition}[Orlicz 范数] 224 | 随机变量 $Z$ 的 $\psi_2$ 范数定义为 225 | \[ 226 | \|Z\|_{\psi_2} := \inf\{s>0:\ \E e^{Z^2/s^2}\le 2\}. 227 | \] 228 | \end{definition} 229 | 230 | \begin{lemma}[基本性质(示例)] 231 | 若 $X$ 次高斯,则 $X^2-\E X^2$ 次指数。 232 | \end{lemma} 233 | 234 | \begin{KeyBox} 235 | \textbf{要点}:\(\psi_2\)-有界 $\Rightarrow$ 指数尾界;平方中心化 $\Rightarrow$ \(\psi_1\)-有界。 236 | \end{KeyBox} 237 | 238 | \section{Bernstein 不等式} 239 | \begin{theorem}[Bernstein(示例)] 240 | 设 $Z_i$ 独立、$\|Z_i\|_{\psi_1}\le v$,则…… 241 | \end{theorem} 242 | 243 | \begin{Takeaway} 244 | 小偏差 $\sim \|a\|_2$,大偏差 $\sim \|a\|_\infty$。 245 | \end{Takeaway} 246 | 247 | \part{主结果} 248 | \chapter{Hanson--Wright 不等式(示例)} 249 | % \minitoc 250 | \section{定理与讨论} 251 | \begin{Example} 252 | 这是一个示例环境,用于给出具体计算或反例。 253 | \end{Example} 254 | 255 | % Appendix 256 | \appendix 257 | \part{附录} 258 | \chapter{符号与记号(示例)} 259 | % \minitoc 260 | \begin{itemize} 261 | \item \(\E\):数学期望 262 | \item \(\Var\):方差算子 263 | \end{itemize} 264 | 265 | % Backmatter 266 | \backmatter 267 | \begin{thebibliography}{9} 268 | \bibitem{vershynin} 269 | Vershynin, R. \emph{High-Dimensional Probability}. CUP, 2018. 270 | \end{thebibliography} 271 | 272 | \end{document} -------------------------------------------------------------------------------- /latex/format/latex模板 article 10.26.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{article} % 也支持 14pt/17pt/20pt 2 | 3 | % ==== Engine ==== 4 | \usepackage{ifxetex,ifluatex} 5 | \usepackage{everypage} 6 | \ifxetex\else\ifluatex\else 7 | \errmessage{Please compile with XeLaTeX or LuaLaTeX} 8 | \fi\fi 9 | 10 | % ==== Fonts & Page ==== 11 | \usepackage{ctex,fontspec,geometry,xcolor} 12 | \geometry{paperwidth=7.5in,paperheight=10in, margin=0.7in} 13 | \setmainfont{Times New Roman} 14 | \IfFontExistsTF{Noto Serif CJK SC}{ 15 | \setCJKmainfont{Noto Serif CJK SC} 16 | }{ 17 | \setCJKmainfont{FandolSong} 18 | } 19 | \linespread{1.4} 20 | \pagecolor{white}\color{black} 21 | 22 | % ==== Colors ==== 23 | \definecolor{brand}{HTML}{1A9D8F} % teal 24 | \definecolor{brandD}{HTML}{2A7F6F} % dark teal 25 | \definecolor{ink}{HTML}{1A1A1A} 26 | \definecolor{keybg}{HTML}{E8F4F1} % light teal bg 27 | \definecolor{keydark}{HTML}{2F5E58} % dark teal text 28 | \definecolor{accent}{HTML}{FF6B6B} 29 | \definecolor{accentD}{HTML}{D94F4F} % strong red 30 | \definecolor{soft}{HTML}{F3F8F7} 31 | \definecolor{xhsRed}{HTML}{FF4D4F} 32 | \definecolor{xhsDark}{HTML}{1F1F1F} 33 | \definecolor{xhsCream}{HTML}{FFF8F0} 34 | \definecolor{xhsBlue}{HTML}{2F54EB} 35 | \definecolor{xhsYellow}{HTML}{FFB800} 36 | 37 | % for theorem color themes 38 | \definecolor{secblue}{HTML}{2B44C6} % deep blue 39 | \definecolor{thmBg}{RGB}{235,245,255} % light blue background for Theorem 40 | \definecolor{lemBg}{RGB}{255,240,240} % light warm pink for Lemma 41 | \definecolor{defBg}{RGB}{232,244,241} % same as keybg-ish for Definition 42 | % borders (left bars) 43 | \colorlet{thmBar}{secblue} % theorem left bar = blue 44 | \colorlet{lemBar}{accentD} % lemma left bar = red 45 | \colorlet{defBar}{brand} % definition left bar = teal 46 | 47 | % highlight helpers 48 | \definecolor{error}{HTML}{E53935} % 错误/存疑红 49 | \definecolor{info}{HTML}{64B5F6} % 信息提示蓝 50 | \definecolor{termblue}{HTML}{1A4C9A} % 专业名词深蓝 51 | 52 | % ==== Date macro ==== 53 | \newcommand{\padzero}[1]{\ifnum#1<10 0\fi\number#1} 54 | \newcommand{\BrandYMD}{{\the\year·\padzero{\the\month}·\padzero{\the\day}}} 55 | 56 | % ==== Section Titles ==== 57 | \usepackage{titlesec} 58 | \titleformat{\section}[block] 59 | {\centering\bfseries\color{keydark}\fontsize{24pt}{26pt}\selectfont} 60 | {\thesection}{0.6em}{} 61 | \titlespacing*{\section}{0pt}{0.9em}{0.5em} 62 | 63 | \titleformat{\subsection}{\Large\bfseries\color{brand}}{\thesubsection}{0.6em}{} 64 | \titlespacing*{\subsection}{0pt}{0.8em}{0.4em} 65 | 66 | % ==== Left bands on every page ==== 67 | \usepackage{tikz,eso-pic} 68 | \usetikzlibrary{positioning,calc} 69 | \newcommand{\LeftBandA}{0.12in} 70 | \newcommand{\LeftBandB}{0.28in} 71 | \newcommand{\PutLeftBands}{% 72 | \begin{tikzpicture}[remember picture, overlay] 73 | \fill[keydark] ([xshift=0cm]current page.north west) 74 | rectangle 75 | ([xshift=\LeftBandA]current page.south west); 76 | \fill[keybg] ([xshift=\LeftBandA]current page.north west) 77 | rectangle 78 | ([xshift=\LeftBandB]current page.south west); 79 | \end{tikzpicture}% 80 | } 81 | \AddEverypageHook{\PutLeftBands} 82 | 83 | % ==== Header / Footer ==== 84 | \usepackage{fancyhdr} 85 | \fancypagestyle{coverstyle}{% 86 | \fancyhf{}\renewcommand{\headrulewidth}{0pt}\renewcommand{\footrulewidth}{0pt} 87 | } 88 | \fancyhf{} 89 | \renewcommand{\headrulewidth}{0.4pt} 90 | \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} % 右上角:节号 + 节题 91 | \fancyhead[R]{\nouppercase{\rightmark}} 92 | \fancyfoot[L]{\textcolor{brand}{@MIStatlE}|集中不等式 \seriesnum} 93 | \fancyfoot[R]{\textcolor{brand}{\thepage}} 94 | \pagestyle{fancy} 95 | 96 | % ==== 参数:系列编号 ==== 97 | \newcommand{\seriesnum}{I} % 改为 I/II/III 或 1/2/3 98 | 99 | % ==== Highlight boxes ==== 100 | \usepackage[most]{tcolorbox} 101 | \tcbset{enhanced, boxrule=0.9pt, arc=3pt, left=10pt,right=10pt,top=10pt,bottom=10pt} 102 | \newtcolorbox{KeyBox}{ 103 | colback=keybg, colframe=brandD, 104 | colbacktitle=brandD, title=\textbf{\color{white}Key Idea}, 105 | fonttitle=\bfseries\large, coltitle=white, breakable 106 | } 107 | \newtcolorbox{Takeaway}{ 108 | colback=accent!12, colframe=accentD, 109 | colbacktitle=accentD, title=\textbf{\color{white}Takeaway}, 110 | fonttitle=\bfseries\large, coltitle=white, breakable 111 | } 112 | 113 | % ==== Flow sidebar ==== 114 | \usepackage{mdframed} 115 | \newmdenv[ 116 | topline=false, bottomline=false, rightline=false, 117 | linewidth=4pt, linecolor=brand, backgroundcolor=soft, 118 | innerleftmargin=10pt, innerrightmargin=10pt, 119 | skipabove=6pt, skipbelow=6pt 120 | ]{SideBar} 121 | 122 | % ==== Math & Theorems ==== 123 | \usepackage{amsmath,amssymb,bm,amsthm} 124 | \DeclareMathOperator{\Var}{Var} 125 | \newcommand{\E}{\mathbb{E}} 126 | 127 | % 定理样式 & 按 section 编号 128 | \newtheoremstyle{customthm}{0.8em}{0.8em}{\itshape}{}{\bfseries}{.}{0.5em}{} 129 | \newtheoremstyle{customdef}{0.8em}{0.8em}{}{}{\bfseries}{.}{0.5em}{} 130 | 131 | \theoremstyle{customthm} 132 | \newtheorem{theorem}{定理}[section] 133 | \newtheorem{lemma}[theorem]{引理} 134 | 135 | \theoremstyle{customdef} 136 | \newtheorem{definition}[theorem]{定义} 137 | 138 | % --- tcolorbox-wrapped theorem-like envs --- 139 | % 目标: 140 | % - theorems: 蓝条/蓝淡底 (secblue / thmBg) 141 | % - lemmas: 红条/暖粉底 (accentD / lemBg) 142 | % - defs: 绿条/浅绿底 (brand / defBg) 143 | % 144 | % 统一风格: 145 | % 左侧2pt彩条、圆角2pt、内边距一致、标题自动加粗 146 | % 可选标题 [] 为空则不显示括号 147 | 148 | % Theorem 149 | \let\oldtheorem\theorem 150 | \let\endoldtheorem\endtheorem 151 | \renewenvironment{theorem}[1][]{% 152 | \begin{tcolorbox}[ 153 | enhanced, 154 | breakable, 155 | colback=thmBg, 156 | colframe=thmBar, 157 | boxrule=0pt, 158 | borderline west={2pt}{0pt}{thmBar}, 159 | sharp corners, 160 | arc=2pt, 161 | left=10pt,right=10pt,top=8pt,bottom=8pt, 162 | before skip=10pt,after skip=10pt 163 | ]% 164 | \if\relax\detokenize{#1}\relax 165 | \begin{oldtheorem}\itshape 166 | \else 167 | \begin{oldtheorem}[\textbf{#1}]\itshape 168 | \fi 169 | }{% 170 | \end{oldtheorem}% 171 | \end{tcolorbox}% 172 | } 173 | 174 | % Lemma 175 | \let\oldlemma\lemma 176 | \let\endoldlemma\endlemma 177 | \renewenvironment{lemma}[1][]{% 178 | \begin{tcolorbox}[ 179 | enhanced, 180 | breakable, 181 | colback=lemBg, 182 | colframe=lemBar, 183 | boxrule=0pt, 184 | borderline west={2pt}{0pt}{lemBar}, 185 | sharp corners, 186 | arc=2pt, 187 | left=10pt,right=10pt,top=8pt,bottom=8pt, 188 | before skip=10pt,after skip=10pt 189 | ]% 190 | \if\relax\detokenize{#1}\relax 191 | \begin{oldlemma}\itshape 192 | \else 193 | \begin{oldlemma}[\textbf{#1}]\itshape 194 | \fi 195 | }{% 196 | \end{oldlemma}% 197 | \end{tcolorbox}% 198 | } 199 | 200 | % Definition 201 | \let\olddefinition\definition 202 | \let\endolddefinition\enddefinition 203 | \renewenvironment{definition}[1][]{% 204 | \begin{tcolorbox}[ 205 | enhanced, 206 | breakable, 207 | colback=defBg, 208 | colframe=defBar, 209 | boxrule=0pt, 210 | borderline west={2pt}{0pt}{defBar}, 211 | sharp corners, 212 | arc=2pt, 213 | left=10pt,right=10pt,top=8pt,bottom=8pt, 214 | before skip=10pt,after skip=10pt 215 | ]% 216 | \if\relax\detokenize{#1}\relax 217 | \begin{olddefinition}\itshape 218 | \else 219 | \begin{olddefinition}[\textbf{#1}]\itshape 220 | \fi 221 | }{% 222 | \end{olddefinition}% 223 | \end{tcolorbox}% 224 | } 225 | 226 | % ==== 章节机制(自定义章号/章题,仅影响编号显示) ==== 227 | \newcounter{chapter} 228 | \newcommand{\setchapter}[2]{% 229 | \setcounter{chapter}{#1}% 230 | \setcounter{section}{0}% 231 | \def\ChapterTitle{#2}% 232 | } 233 | \renewcommand{\thesection}{\arabic{chapter}.\arabic{section}} 234 | \renewcommand{\thesubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}} 235 | \newcommand{\ChapterHeading}{% 236 | \vspace*{0.6cm} 237 | {\centering 238 | {\fontsize{26pt}{28pt}\selectfont\bfseries\color{keydark} 239 | 第\arabic{chapter}章\ \ChapterTitle\par} 240 | }% 241 | \vspace{0.6cm} 242 | } 243 | \newcommand{\BeginChapter}[2]{% 244 | \clearpage 245 | \setchapter{#1}{#2}% 246 | \ChapterHeading 247 | } 248 | 249 | 250 | 251 | % ==== Example 盒子 ==== 252 | \definecolor{exframe}{HTML}{6C5CE7} 253 | \definecolor{exbg}{HTML}{F2E9FF} 254 | \newtcolorbox{Example}[1][]{% 255 | enhanced, colback=exbg, colframe=exframe, 256 | coltitle=white, colbacktitle=exframe, 257 | title=\textbf{Example}, 258 | fonttitle=\bfseries, boxrule=1.1pt, arc=4pt, 259 | left=10pt,right=10pt,top=10pt,bottom=10pt, 260 | attach boxed title to top left = {yshift=-2mm, xshift=2mm}, 261 | breakable, #1 262 | } 263 | 264 | % ==== 证明环境(保持你的样式) ==== 265 | \renewenvironment{proof}[1][证明]{\par 266 | \pushQED{\qed}% 267 | \normalfont \topsep6pt \partopsep0pt 268 | \trivlist 269 | \item[\hskip\labelsep\bfseries #1.]\ignorespaces 270 | }{\popQED\endtrivlist} 271 | 272 | 273 | 274 | % ==== 高亮系统(自动换行友好版) ==== 275 | % ==== 高亮系统 ==== 276 | \usepackage{xcolor,tikz} 277 | \newcommand{\hltext}[2][yellow!30]{% 278 | \tikz[baseline=(X.base)] \node[rectangle, rounded corners=2pt, 279 | fill=#1, inner sep=2pt, anchor=base] (X) {#2};% 280 | } 281 | 282 | 283 | 284 | % ==== Semantic Shortcuts ==== 285 | \newcommand{\KeyIdea}[1]{\hltext[keybg]{\textbf{#1}}} % 关键想法:浅绿底 286 | \newcommand{\Term}[1]{\textcolor{termblue}{\textbf{#1}}} % 专业名词:品牌深绿字 287 | \newcommand{\Emph}[1]{\textcolor{accentD}{\textbf{#1}}} % 强调词汇:红 288 | \newcommand{\Confuse}[1]{\hltext[error!20]{\textcolor{error}{#1}}} % 不懂/存疑处 289 | 290 | \newcommand{\Info}[1]{\textcolor{info!90!black}{#1}} % 说明或注解 291 | %一侧笔记 292 | % ========================= 293 | % ======== 文档开始 ======== 294 | % ========================= 295 | \begin{document} 296 | 297 | % 设定章号 298 | \setchapter{1}{示例章标题} 299 | \ChapterHeading 300 | 301 | \section{xx不等式} 302 | 303 | \begin{SideBar} 304 | \textbf{背景/引言/要解决的问题} 305 | \end{SideBar} 306 | 307 | \subsection{预备知识} 308 | 309 | \begin{definition}[随机变量的集中] 310 | 设 $X$ 为随机变量。我们说 $X$ 满足集中,如果它的偏差概率呈指数级衰减。 311 | \end{definition} 312 | 313 | \begin{lemma}[子高斯性质] 314 | 若 $X$ 是次高斯,则对一切 $\lambda \in \mathbb{R}$ 有 315 | \[ 316 | \mathbb{E}\big[e^{\lambda X}\big] 317 | \le 318 | \exp\!\left(\frac{\lambda^2\sigma^2}{2}\right). 319 | \] 320 | \end{lemma} 321 | 322 | \begin{theorem}[Hanson--Wright 型] 323 | 对独立次高斯向量 $X$,二次型 $X^\top A X$ 具有指数尾界。 324 | \end{theorem} 325 | 326 | \begin{proof} 327 | 这里是证明思路…… 328 | \end{proof} 329 | 330 | \begin{Example} 331 | 这是一个栗子 332 | \end{Example} 333 | 334 | 335 | 336 | \KeyIdea{尾部指数衰减} $\Rightarrow$ \Emph{大偏差极少发生} $\Rightarrow$ 高维统计的稳定性。 337 | 338 | \Info{直觉:如果随机变量的尾部概率下降得足够快,即使我们在高维空间中做成千上万次尝试,仍几乎不可能遇到极端值。} 339 | 340 | 341 | \Info{在高维统计中,我们常用 \Term{Hoeffding 不等式} 或 \Term{Bernstein 不等式} 来刻画这种指数尾。它们保证样本均值 $\bar X$ 满足} 342 | \[ 343 | \Pr(|\bar X - \E[X]| \ge t) \le 2 e^{-c n t^2/\sigma^2}. 344 | \] 345 | 346 | \Confuse{为什么 mgf 上界能推出尾界?} 347 | 348 | 349 | 350 | \section*{参考文献} 351 | \begin{enumerate} 352 | \item Rudelson, M.\ \& Vershynin, R. (2013). Hanson--Wright inequality and sub-gaussian concentration. \textit{Electronic Communications in Probability}, 18, 1--9. 353 | \end{enumerate} 354 | 355 | \end{document} --------------------------------------------------------------------------------