├── Figure └── 1.png ├── assets ├── 1.png └── 2.png ├── Content ├── logo.jpg ├── titlepage.tex └── gallery.tex ├── Style ├── README.md ├── mathsetting.tex └── style.tex ├── Ref └── Collection.bib ├── main.tex ├── README.md └── Code └── 1.m /Figure/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Saltsmart/Latex-homowork/HEAD/Figure/1.png -------------------------------------------------------------------------------- /assets/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Saltsmart/Latex-homowork/HEAD/assets/1.png -------------------------------------------------------------------------------- /assets/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Saltsmart/Latex-homowork/HEAD/assets/2.png -------------------------------------------------------------------------------- /Content/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Saltsmart/Latex-homowork/HEAD/Content/logo.jpg -------------------------------------------------------------------------------- /Style/README.md: -------------------------------------------------------------------------------- 1 | 以下字体涉及商用,请自行在本文件夹中添加: 2 | 1. simfang.ttf 3 | 2. simhei.ttf 4 | 3. simkai.ttf 5 | 4. simsun.ttc 6 | -------------------------------------------------------------------------------- /Ref/Collection.bib: -------------------------------------------------------------------------------- 1 | % Encoding: UTF-8 2 | 3 | @article{Runge, 4 | title={Research on Runge Phenomenon}, 5 | author={佘嘉博}, 6 | journal={Advances in Applied Mathematics}, 7 | volume={08(08)}, 8 | pages={1500-1510}, 9 | year={2019}, 10 | } -------------------------------------------------------------------------------- /main.tex: -------------------------------------------------------------------------------- 1 | \input{Style/style} 2 | \begin{document} 3 | \title{标题设置见Style/style.tex中的标题样式} 4 | \author{张三浦} 5 | 6 | \input{Content/titlepage.tex} % 这个是封面,不需要刻意注释掉 7 | \maketitle 8 | 9 | % \begin{abstract} 10 | % 摘要。 11 | % \\\\ 12 | % \textbf{关键词:}关键词1;关键词2 13 | % \end{abstract} 14 | 15 | \section{引言} 16 | 17 | 这里是引言\cite{Runge}。 18 | 19 | \begin{figure}[H] 20 | \center 21 | \includegraphics*[width=12cm]{Figure/1.png} 22 | \centering 23 | \caption{图片示例}\label{g1-1} 24 | \end{figure} 25 | 26 | \printbibliography%[heading=bibliography,title=参考文献] 27 | \end{document} -------------------------------------------------------------------------------- /Content/titlepage.tex: -------------------------------------------------------------------------------- 1 | \begin{titlepage} 2 | %本页为自定义的封面 3 | % \title{作业标题} 4 | % \author{作者} 5 | \newcommand{\ID}{{\Large 000000000}} 6 | \newcommand{\supervisor}{{\Large 李田所}} 7 | \newcommand{\class}{{\Large 班级}} 8 | 9 | \center 10 | \quad\\[1cm] 11 | \includegraphics[width=12cm]{Content/logo.jpg}\\[1.5cm] 12 | % {\Large 题目1}\\[0.5cm] 13 | % {\Large 题目2}\\[1.5cm] 14 | \quad\\[1cm] 15 | \makeatletter 16 | {\linespread{4}\Huge\bfseries\@title}\\[2cm] 17 | \begin{table}[H] 18 | \centering 19 | \begin{tabular}{rl} 20 | {\Large 姓名:}&{\Large 张三浦}\\[0.5cm] 21 | {\Large 学号:}&\ID\\[0.5cm] 22 | {\Large 班级:}&\class\\[0.5cm] 23 | {\Large 导师:}&\supervisor 24 | \end{tabular}\\ 25 | \end{table} 26 | \makeatother 27 | \quad\\[1cm] 28 | {\Large \today}\\[2cm] % 日期 29 | \vfill 30 | \end{titlepage} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 自己做一个Latex模板:114514篇论文的明智选择 2 | 很多论文投稿的地方都提供了Latex模板,大家只要套用得当就没有问题了。而平时写一些小论文和作业的时候,提前准备一个模板,相比Word在保证格式上也能少操心不少 3 | 4 | 支持中文,页面细节都放在Style\style.tex当中 5 | ![style.tex](/assets/1.png) 6 | 7 | 有一个简单的封面: 8 | ![title page](/assets/2.png) 9 | 10 | 这个模板中还有这些文件: 11 | ``` 12 | Latex Homowork: 13 | │ main.tex //正文的内容写在/begin{document}和/end{document}之间 14 | │ 15 | ├─Code //这个目录放代码和一些辅助文本 16 | │ 1.m 17 | │ 18 | ├─Content 19 | │ gallery.tex //这里存了一些算法框图之类的,需要的时候可以放到正文里 20 | │ logo.jpg //封面上面那个Logo 21 | │ titlepage.tex //封面的内容 22 | │ 23 | ├─Figure //这个目录放图 24 | │ 1.png 25 | │ 26 | ├─Ref //这个目录放bibtex格式的参考文献 27 | │ Collection.bib 28 | │ 29 | └─Style 30 | mathsetting.tex //一些数学符号,特别是粗体的简写 31 | //以下四个文件分别是Windows系统的仿宋、黑体、楷体和宋体,由于涉及商用请自行添加 32 | * simfang.ttf 33 | * simhei.ttf 34 | * simkai.ttf 35 | * simsun.ttc 36 | style.tex //格式设定 37 | ``` 38 | -------------------------------------------------------------------------------- /Code/1.m: -------------------------------------------------------------------------------- 1 | function T1_1 2 | clear;clc;close all; %清零命令行窗口和工作区,关闭图窗 3 | format compact; %设置命令行窗口不显示空行 4 | diary('T1_1.txt');diary on; %使用文本记录输出值 5 | for N=[10^2 10^4 10^6] 6 | SN_se=single(0); %按照从大到小顺序的S_N,single函数用于产生单精度数值 7 | SN_ab=single(0); %按照从小到大顺序的S_N 8 | %累加计算S_N 9 | for j=2:N 10 | SN_se=single(SN_se+f(j)); %从大到小累加计算,注意用单精度 11 | SN_ab=single(SN_ab+f(N-j+2)); %从小到大累加计算 12 | end 13 | %注意到S_N<1,设置为显示10位小数,对应10位有效数字 14 | fprintf('当N=10^%d时\n从大到小计算的S_N为%.10f\n',log10(N),SN_se); 15 | fprintf('从小到大计算的S_N为%.10f\n',SN_ab); 16 | 17 | %求解有效位数 18 | SN_precise=1/2*(3/2-1/N-1/(N+1)); %S_N的精确值 19 | error_se=abs(SN_precise-SN_se); 20 | error_ab=abs(SN_precise-SN_ab); 21 | %注意到S_N<1,有效位数计算中的k=0,从10位有效数字的高精度逐渐过渡到低精度 22 | %i=10时,无有效位数 23 | for i=0:10 24 | if error_se<=1/2*10^-(10-i) %检查n是否为10-i 25 | fprintf('从大到小计算的S_N有效位数为%d\n',10-i); 26 | break 27 | end 28 | if i==10 29 | fprintf('从大到小计算的S_N无有效位数\n'); 30 | end 31 | end 32 | for i=0:10 33 | if error_ab<=1/2*10^-(10-i) 34 | fprintf('从小到大计算的S_N有效位数为%d\n',10-i); 35 | break 36 | end 37 | if i==10 38 | fprintf('从小到大计算的S_N无有效位数\n'); 39 | end 40 | end 41 | end 42 | diary off; %停止记录 43 | 44 | %定义数列和的通项公式 45 | function y=f(x) 46 | y=1/(x^2-1); -------------------------------------------------------------------------------- /Style/mathsetting.tex: -------------------------------------------------------------------------------- 1 | \renewcommand{\frac}{\dfrac} 2 | \renewcommand{\leq}{\leqslant} 3 | \renewcommand{\geq}{\geqslant} 4 | \renewcommand{\le}{\leqslant} 5 | \renewcommand{\ge}{\geqslant} 6 | \renewcommand{\epsilon}{\varepsilon} 7 | 8 | \newcommand{\tran}{^T} 9 | \newcommand{\conj}[1]{{\overline{#1}}} 10 | \newcommand{\hermconj}{^H} 11 | 12 | \newcommand{\va}{{\bm{a}}} 13 | \newcommand{\vb}{{\bm{b}}} 14 | \newcommand{\vc}{{\bm{c}}} 15 | \newcommand{\vd}{{\bm{d}}} 16 | \newcommand{\ve}{{\bm{e}}} 17 | \newcommand{\vf}{{\bm{f}}} 18 | \newcommand{\vg}{{\bm{g}}} 19 | \newcommand{\vh}{{\bm{h}}} 20 | \newcommand{\vi}{{\bm{i}}} 21 | \newcommand{\vj}{{\bm{j}}} 22 | \newcommand{\vk}{{\bm{k}}} 23 | \newcommand{\vl}{{\bm{l}}} 24 | \newcommand{\vm}{{\bm{m}}} 25 | \newcommand{\vn}{{\bm{n}}} 26 | \newcommand{\vo}{{\bm{o}}} 27 | \newcommand{\vp}{{\bm{p}}} 28 | \newcommand{\vq}{{\bm{q}}} 29 | \newcommand{\vr}{{\bm{r}}} 30 | \newcommand{\vs}{{\bm{s}}} 31 | \newcommand{\vt}{{\bm{t}}} 32 | \newcommand{\vu}{{\bm{u}}} 33 | \newcommand{\vv}{{\bm{v}}} 34 | \newcommand{\vw}{{\bm{w}}} 35 | \newcommand{\vx}{{\bm{x}}} 36 | \newcommand{\vy}{{\bm{y}}} 37 | \newcommand{\vz}{{\bm{z}}} 38 | \newcommand{\vzero}{{\bm{0}}} 39 | 40 | \newcommand{\vepsilon}{{\bm{\epsilon}}} 41 | \newcommand{\vtheta}{{\bm{\theta}}} 42 | \newcommand{\vpsi}{{\bm{\psi}}} 43 | \newcommand{\vpi}{{\bm{\pi}}} 44 | \newcommand{\vphi}{{\bm{\phi}}} 45 | 46 | \newcommand\bigO{{\mathcal{O}}} 47 | 48 | \newcommand{\vA}{{\bm{A}}} 49 | \newcommand{\vB}{{\bm{B}}} 50 | \newcommand{\vC}{{\bm{C}}} 51 | \newcommand{\vD}{{\bm{D}}} 52 | \newcommand{\vE}{{\bm{E}}} 53 | \newcommand{\vF}{{\bm{F}}} 54 | \newcommand{\vG}{{\bm{G}}} 55 | \newcommand{\vH}{{\bm{H}}} 56 | \newcommand{\vI}{{\bm{I}}} 57 | \newcommand{\vJ}{{\bm{J}}} 58 | \newcommand{\vK}{{\bm{K}}} 59 | \newcommand{\vL}{{\bm{L}}} 60 | \newcommand{\vM}{{\bm{M}}} 61 | \newcommand{\vN}{{\bm{N}}} 62 | \newcommand{\vO}{{\bm{O}}} 63 | \newcommand{\vP}{{\bm{P}}} 64 | \newcommand{\vQ}{{\bm{Q}}} 65 | \newcommand{\vR}{{\bm{R}}} 66 | \newcommand{\vS}{{\bm{S}}} 67 | \newcommand{\vT}{{\bm{T}}} 68 | \newcommand{\vU}{{\bm{U}}} 69 | \newcommand{\vV}{{\bm{V}}} 70 | \newcommand{\vW}{{\bm{W}}} 71 | \newcommand{\vX}{{\bm{X}}} 72 | \newcommand{\vY}{{\bm{Y}}} 73 | \newcommand{\vZ}{{\bm{Z}}} 74 | 75 | \newcommand{\ones}[1]{{\bm{1}_{#1}}} 76 | \newcommand{\zeros}[1]{{\bm{0}_{#1}}} 77 | \newcommand{\eye}[1]{{\bm{E}_{#1}}} 78 | 79 | \newcommand{\vect}[1]{{\bm{#1}}} 80 | \newcommand{\mat}[1]{{\bm{#1}}} 81 | 82 | \renewcommand{\d}{{\mathrm{d}}} 83 | \newcommand{\pder}[2]{{\frac{\partial #1}{\partial #2}}} 84 | \newcommand{\oder}[2]{{\frac{\mathrm{d} #1}{\mathrm{d} #2}}} 85 | \newcommand{\npder}[2]{{\nicefrac{\partial #1}{\partial #2}}} 86 | \newcommand{\popt}[2]{{\frac{\partial}{\partial #2}#1}} 87 | \newcommand{\oopt}[2]{{\frac{\mathrm{d}}{\mathrm{d} #2}#1}} 88 | \newcommand{\inte}[4]{{\int_{#1}^{#2}#3\mathrm{d}#4}} 89 | 90 | \newcommand{\argmin}{{\operatornamewithlimits{argmin}}} 91 | \newcommand{\argmax}{{\operatornamewithlimits{argmax}}} 92 | \newcommand{\tr}{{\mathrm{tr}}} 93 | \newcommand{\Prob}{{\mathrm{P}}} 94 | \newcommand{\E}{{\mathrm{E}}} 95 | \newcommand{\D}{{\mathrm{D}}} 96 | 97 | \newcommand{\<}{{\langle}} 98 | \renewcommand{\>}{{\rangle}} 99 | 100 | -------------------------------------------------------------------------------- /Content/gallery.tex: -------------------------------------------------------------------------------- 1 | %算法 2 | 3 | % \begin{algorithm} 4 | % \caption{My algorithm}\label{euclid} 5 | % \begin{algorithmic}[1] 6 | % \Procedure{MyProcedure}{} 7 | % abc 8 | % \State $\textit{stringlen} \gets \text{length of }\textit{string}$ 9 | % \State $i \gets \textit{patlen}$ 10 | % \BState \emph{top}: 11 | % \If {$i > \textit{stringlen}$} \Return false 12 | % \EndIf 13 | % \State $j \gets \textit{patlen}$ 14 | % \BState \emph{loop}: 15 | % \If {$\textit{string}(i) = \textit{path}(j)$} 16 | % \State $j \gets j-1$. 17 | % \State $i \gets i-1$. 18 | % \State \textbf{goto} \emph{loop}. 19 | % \State \textbf{close}; 20 | % \EndIf 21 | % \State $i \gets i+\max(\textit{delta}_1(\textit{string}(i)),\textit{delta}_2(j))$. 22 | % \State \textbf{goto} \emph{top}. 23 | % \EndProcedure 24 | % \end{algorithmic} 25 | % \end{algorithm} 26 | 27 | % \begin{algorithm}[h] 28 | % \caption{An example for format For \& While Loop in Algorithm} 29 | % \begin{algorithmic}[1] 30 | % \For{each $i\in [1,9]$} 31 | % \State initialize a tree $T_{i}$ with only a leaf (the root); 32 | % \State $T=T\cup T_{i};$ 33 | % \EndFor 34 | % \ForAll {$c$ such that $c\in RecentMBatch(E_{n-1})$} 35 | % \label{code:TrainBase:getc} 36 | % \State $T=T\cup PosSample(c)$; 37 | % \label{code:TrainBase:pos} 38 | % \EndFor; 39 | % \For{$i=1$; $i=latex',thin,start chain=going below,every join/.style={norm},] 68 | % %start chain=going below指明了流程图的默认方向,node distance=8mm则指明了默认的node距离。这些可以在定义node的时候更改,比如说 69 | % %\node[point,right of=n3,node distance=10mm] (p0){}; 70 | % %这里声明了node p0,它在node n3 的右边,距离是10mm。 71 | % %第一个node \node[样式] (标号){内容} 72 | % \node[format] (start){Start}; 73 | % %后面的node,使用below of=标号,right of=标号,left of=标号,表示位置,可以加上node distance=xmm调节位置. 74 | % \node[format,below of=start,node distance=7mm] (define){Some defines}; 75 | % \node[format,below of=define,node distance=7mm] (PCFinit){PCF8563 Initialize}; 76 | % \node[format,below of=PCFinit,node distance=7mm] (DS18init){DS18 Initialize}; 77 | % \node[format,below of=DS18init,node distance=7mm] (LCDinit){LCD Initialize}; 78 | % \node[format,below of=LCDinit,node distance=7mm] (processtime){Processtime}; 79 | % \node[format,below of=processtime,node distance=7mm] (keyinit){Key Initialize}; 80 | % \node[test,below of=keyinit,node distance=15mm](setkeycheck){Check Set Key}; 81 | % \node[point,left of=setkeycheck,node distance=18mm](point3){}; 82 | % \node[format,below of=setkeycheck,node distance=15mm](readtime){Read Time}; 83 | % \node[point,right of=readtime,node distance=15mm](point4){}; 84 | % \node[format,below of=readtime](processtime1){Processtime}; 85 | % \node[format,below of=processtime1](gettemp){Get Temperature}; 86 | % \node[format,below of=gettemp](display){Display All Data}; 87 | % \node[format,right of=setkeycheck,node distance=40mm](setsetflag){Set SetFlag=1}; 88 | % \node[format,below of=setsetflag](setinit){Set Mode Initialize}; 89 | % \node[format,below of=setinit](checksetting){Checksetting()}; 90 | % \node[test,below of=checksetting,node distance=15mm](savecheck){Check Save Key}; 91 | % \node[format,below of=savecheck,node distance=15mm](clearsetflag){Clear SetFlag=0}; 92 | % \node[format,below of=clearsetflag](settime){Set Time}; 93 | % \node[point,below of=display,node distance=7mm](point1){}; 94 | % \node[point,below of=settime,node distance=7mm](point2){}; 95 | % %\node[format] (n0) at(4,4){A}; 直接指定位置 96 | % %定义完node之后进行连线, 97 | % %\draw[->] (n0.south) -- (n1); 带箭头实线 98 | % %\draw[-] (n0.south) -- (n1); 不带箭头实线 99 | % %\draw[<->] (n0.south) -- (n1.north); 双箭头 100 | % %\draw[<-,dashed] (n1.south) -- (n2.north); 带箭头虚线 101 | % %\draw[<-] (n0.south) to node{Yes} (n1.north); 带字,字在箭头方向右边 102 | % %\draw[->] (n1.north) to node{Yes} (n0.south); 带字,字在箭头方向左边 103 | % %\draw[->] (n1.north) to[out=60,in=300] node{Yes} (n0.south); 曲线 104 | % %\draw[->,draw=red](n2)--(n1); 带颜色的线 105 | % \draw[->] (start)--(define); 106 | % \draw[->] (define)--(PCFinit); 107 | % \draw[->](PCFinit)--(DS18init); 108 | % \draw[->](DS18init)--(LCDinit); 109 | % \draw[->](LCDinit)--(processtime); 110 | % \draw[->](processtime)--(keyinit); 111 | % \draw[->](keyinit)--(setkeycheck); 112 | % \draw[->](setkeycheck)--node[above]{Yes}(setsetflag); 113 | % \draw[->](setkeycheck) --node[left]{No} (readtime); 114 | % \draw[->](readtime)--(processtime1); 115 | % \draw[->](processtime1)--(gettemp); 116 | % \draw[->](gettemp)--(display); 117 | % \draw[-](display)--(point1); 118 | % \draw[-](point1)-|(point3); 119 | % \draw[->](point3)--(setkeycheck.west); 120 | % \draw[->](setsetflag)--(setinit); 121 | % \draw[->](setinit)--(checksetting); 122 | % \draw[->](checksetting)--(savecheck); 123 | % \draw[->](savecheck)--node[left]{Yes}(clearsetflag); 124 | % \draw[->](savecheck.west)|-node[left]{No}(checksetting); 125 | % \draw[->](clearsetflag)--(settime); 126 | % \draw[-](settime)--(point2); 127 | % \draw[-](point2)-|(point4); 128 | % \draw[->](point4)--(readtime.east); 129 | % \end{tikzpicture} 130 | % \end{figure} 131 | 132 | % \begin{tikzpicture} 133 | % [every node/.style={align=center}] 134 | % \foreach \x in{1,2,3,4,5} 135 | % \fill[red!60](0,\x)circle(5pt)node(a\x){}; 136 | % \fill[blue!60](-2,1.5)circle(5pt)node(b1){}; 137 | % \fill[blue!60](-2,2.5)circle(5pt)node(b2){}; 138 | % \fill[blue!60](-2,3.5)circle(5pt)node(b3){}; 139 | % \fill[blue!60](-2,4.5)circle(5pt)node(b4){}; 140 | % \fill[blue](2,3)circle(5pt)node(c){}; 141 | % \node(y4)at(-3,4.5){$x_1$}; 142 | % \node(y3)at(-3,3.5){$\vdots$}; 143 | % \node(y2)at(-3,2.5){$x_n$}; 144 | % \node(y1)at(-3,1.5){bias:1}; 145 | % \node at(-2,6){Input\\layer}; 146 | % \node at(0,6){Hidden\\layer}; 147 | % \node at(2,6){Output\\layer}; 148 | % \node(d)at(3.5,3){$N(x,p)$}; 149 | % \draw[-stealth](c)--(d); 150 | % \foreach \x in{1,2,3,4} 151 | % \draw[-{stealth[sep=2pt]}](y\x)--(b\x); 152 | % \foreach \x in{1,2,3,4} 153 | % {\foreach \y in{1,2,3,4,5} 154 | % {\draw[-{stealth[sep=2pt]}](b\x)--(a\y); 155 | % \draw[-{stealth[sep=4pt]}](a\y)--(c.west); 156 | % } 157 | % } 158 | % \end{tikzpicture} 159 | 160 | % 水印 161 | % \AddToShipoutPicture{\BackgroundPicture} % 开始加入水印 162 | % \ClearShipoutPicture % 停止使用水印 163 | 164 | % 为避免矩阵求逆运算,$(\bm D-\bm L)^{-1}$也可以不求,写成 165 | % $$ 166 | % \left\{\begin{array}{l} 167 | % x_{1}^{(k+1)}=\dfrac{1}{4}\left(3+x_{2}^{(k)}\right) \\ 168 | % x_{2}^{(k+1)}=-1+x_{1}^{(k+1)}+x_{3}^{(k)} \\ 169 | % x_{3}^{(k+1)}=x_{2}^{(k+1)} 170 | % \end{array}\right. 171 | % ,\quad 172 | % \left(\begin{array}{ccc} 173 | % 4 & 0 & 0 \\ 174 | % -1 & 1 & 0 \\ 175 | % 0 & -1 & 1 176 | % \end{array}\right)\left(\begin{array}{c} 177 | % x_{1}^{(k+1)} \\ 178 | % x_{2}^{(k+1)} \\ 179 | % x_{3}^{(k+1)} 180 | % \end{array}\right)=\left(\begin{array}{c} 181 | % 3 \\ 182 | % -1 \\ 183 | % 0 184 | % \end{array}\right)+\left(\begin{array}{ccc} 185 | % 0 & -1 & 0 \\ 186 | % 0 & 0 & -1 \\ 187 | % 0 & 0 & 0 188 | % \end{array}\right)\left(\begin{array}{c} 189 | % x_{1}^{(k)} \\ 190 | % x_{2}^{(k)} \\ 191 | % x_{3}^{(k)} 192 | % \end{array}\right) 193 | % $$ 194 | 195 | % \begin{table}[H] 196 | % \centering 197 | % % \caption{三线表示例} 198 | % \begin{tabular}{cccccc} 199 | % \toprule 200 | % $t_i$ & 1 & 2 & 3 & 4 & 5\\ 201 | % \midrule 202 | % $z_i$ & 2 & 4 & 6.4 & 8 & 8.6\\ 203 | % \bottomrule 204 | % \end{tabular} 205 | % % \label{tab:three-line} 206 | % \end{table} -------------------------------------------------------------------------------- /Style/style.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper,12pt]{article} 2 | \usepackage[fontset=none]{ctex} 3 | 4 | % 数学公式和化学方程式 5 | \usepackage{amsmath, amsthm, amssymb, amsfonts} 6 | \usepackage{latexsym,bm} 7 | \usepackage[version=4]{mhchem} 8 | \makeatletter 9 | \newcommand{\rmnum}[1]{\romannumeral #1}%小写罗马数字 10 | \newcommand{\Rmnum}[1]{\expandafter\@slowromancap\romannumeral #1@}%大写罗马数字 11 | \makeatother 12 | \input{Style/mathsetting.tex} 13 | 14 | % 插入PDF文件 15 | \usepackage[final]{pdfpages} 16 | 17 | % 引文使用 18 | \usepackage[backend=biber,style=gb7714-2015,gbpub=false] 19 | {biblatex}%align=gb7714-2015 20 | \addbibresource[location=local]{Ref/Collection.bib} 21 | % \usepackage[colorlinks=true,pdfstartview=FitH,% 22 | % linkcolor=blue,anchorcolor=violet,citecolor=magenta]{hyperref}%加载hyperref宏包,使用超链接 23 | 24 | % 插图使用 25 | \usepackage{graphicx} 26 | \usepackage{float} 27 | % \usepackage{epstopdf} 28 | \usepackage{caption} 29 | \usepackage{subfigure} %插入多图时用子图显示的宏包 30 | 31 | % 表格使用 32 | \usepackage{bigstrut} 33 | \usepackage{booktabs} 34 | \usepackage{multicol} 35 | \usepackage{multirow} 36 | 37 | % LaTeX距离设置: 38 | % mm 毫米 1 mm = 2.845 pt 39 | % pt 点 1 pt = 0.351 mm 40 | % bp 大点 1 bp = 0.353 mm > 1 pt 41 | % dd 迪多 1 dd = 0.376 mm = 1.07 pt 42 | % pc 排卡 1 pc = 4.218 mm = 12 pt 43 | % sp 定标点 65536 sp = 1 pt 44 | % cm 厘米 1 cm= 10 mm= 28.453 pt 45 | % cc 西塞罗 1 cc= 4.513 mm= 12 dd = 12.84 pt 46 | % in 英寸 1 in = 25.4 mm = 72.27 pt 47 | % ex ex 1 ex = 当前字体尺寸中 x 的高度 48 | % em em 1 em = 当前字体尺寸中 M 的宽度 49 | 50 | % 字体大小: 51 | % \newcommand{\chuhao}{\fontsize{42.2pt}{\baselineskip}\selectfont} 52 | % \newcommand{\xiaochu}{\fontsize{36.1pt}{\baselineskip}\selectfont} 53 | % \newcommand{\yihao}{\fontsize{26.1pt}{\baselineskip}\selectfont} 54 | % \newcommand{\xiaoyi}{\fontsize{24.1pt}{\baselineskip}\selectfont} 55 | % \newcommand{\erhao}{\fontsize{22.1pt}{\baselineskip}\selectfont} 56 | % \newcommand{\xiaoer}{\fontsize{18.1pt}{\baselineskip}\selectfont} 57 | % \newcommand{\sanhao}{\fontsize{16.1pt}{\baselineskip}\selectfont} 58 | % \newcommand{\xiaosan}{\fontsize{15.1pt}{\baselineskip}\selectfont} 59 | % \newcommand{\sihao}{\fontsize{14.1pt}{\baselineskip}\selectfont} 60 | % \newcommand{\xiaosi}{\fontsize{12.1pt}{\baselineskip}\selectfont} 61 | % \newcommand{\wuhao}{\fontsize{10.5pt}{\baselineskip}\selectfont} 62 | % \newcommand{\xiaowu}{\fontsize{9.0pt}{\baselineskip}\selectfont} 63 | % \newcommand{\liuhao}{\fontsize{7.5pt}{\baselineskip}\selectfont} 64 | % \newcommand{\xiaoliu}{\fontsize{6.5pt}{\baselineskip}\selectfont} 65 | % \newcommand{\qihao}{\fontsize{5.5pt}{\baselineskip}\selectfont} 66 | % \newcommand{\bahao}{\fontsize{5pt}{\baselineskip}\selectfont} 67 | 68 | % 字体 69 | % \usepackage{fontspec, xunicode, xltxtra} 70 | % \usepackage{xeCJK} 71 | \setmainfont{Times New Roman} 72 | \setsansfont{Droid Sans} 73 | \setmonofont{Courier New} 74 | \setCJKmainfont[Path="Style/",AutoFakeBold,ItalicFont=simkai.ttf]{simsun.ttc} 75 | \setCJKsansfont[Path="Style/",AutoFakeBold]{simhei.ttf} 76 | \setCJKmonofont[Path="Style/",AutoFakeBold]{simfang.ttf} 77 | % 需要的话 78 | % \setCJKfamilyfont{zhfs}[AutoFakeBold]{simfang.ttc} 79 | % \setCJKfamilyfont{zhkai}[AutoFakeBold]{simkai.ttf} 80 | % \setCJKfamilyfont{zhsong}[AutoFakeBold]{simsun.ttc} 81 | % \setCJKfamilyfont{zhhei}[AutoFakeBold]{simhei.ttf} 82 | 83 | \usepackage{titlesec} 84 | %section等前后间距 85 | \titlespacing*{\section}{0pt}{1ex plus .0ex minus .0ex}{1ex plus .0ex} 86 | \titlespacing*{\subsection}{0pt}{0ex plus .0ex minus .0ex}{0ex plus .0ex} 87 | %section等字体设置和字号大小 88 | \titleformat*{\section}{\large\bfseries} 89 | \titleformat*{\subsection}{\normalsize\bfseries} 90 | 91 | %纸张和页边距 92 | \usepackage[a4paper,left=1.5cm,right=1cm,top=1cm,bottom=1cm]{geometry} 93 | 94 | %行间距 95 | \usepackage{setspace} 96 | \renewcommand{\baselinestretch}{1.5} 97 | \AtBeginDocument{ 98 | \setlength{\abovedisplayskip}{3pt}%公式前后间距,强行在导言区中设置 99 | \setlength{\belowdisplayskip}{3pt}% 100 | \setlength{\abovedisplayshortskip}{2pt}% 101 | \setlength{\belowdisplayshortskip}{2pt}% 102 | %图片和浮动对象间距 103 | \setlength{\floatsep}{2pt plus 2pt minus 2pt}%出现在页面的顶部或底部的浮动对象之间的垂直距离。 缺省为 12pt plus 2pt minus 2pt 104 | \setlength{\textfloatsep}{2pt plus 2pt minus 2pt}%出现在页面的顶部或底部的浮动对象与文本之间的垂直距离。缺省为 20pt plus 2pt minus 4pt 105 | \setlength{\intextsep}{2pt plus 2pt minus 2pt}%出现在页面中间的浮动对象(如使用了 h 选项 的浮动对象)与上下方文本之间的垂直距离。 缺省为 12pt plus 2pt minus 2pt 106 | } 107 | % 间距有关变量: 108 | % \baselineskip:行基线间距。 109 | % \lineskip:行间距。 110 | % \baselinestretch:伸展因子。 111 | % \parskip:部分段间距。 112 | % \lineskiplimit:当两行字之间的距离小于\lineskiplimit时,行距自动设为\lineskip。 113 | % 段间距:\lineskip + \parskip 114 | % 行间距:\lineskip = \baselineskip * \baselinestretch 115 | 116 | %首行缩进 117 | \usepackage{indentfirst} 118 | \setlength{\parindent}{2pt} 119 | 120 | %文本和图片等浮动对象占比 121 | \renewcommand{\floatpagefraction}{.85}%浮动页中浮动对象最大占比 122 | \renewcommand{\textfraction}{.15}%文本页中文本最小占比 123 | \renewcommand{\topfraction}{.65}%页面顶部可以用来放置浮动对象的高度与整个页面高度的最大比例 124 | \renewcommand{\bottomfraction}{.60} 125 | 126 | %符号列表间距设置 127 | % \setlength{\leftmargin}{1.2em}%左边界 128 | % \setlength{\parsep}{0ex}%段落间距 129 | % \setlength{\topsep}{1ex}%列表到上下文的垂直距离 130 | % \setlength{\itemsep}{0.5ex}%条目间距 131 | % \setlength{\labelsep}{0.3em}%标号和列表项之间的距离,默认0.5em 132 | % \setlength{\itemindent}{1.1em}%标签缩进量 133 | % \setlength{\listparindent}{0em} %段落缩进量 134 | 135 | % 列表格式 136 | \usepackage{enumitem} 137 | \setenumerate{itemsep=0pt,partopsep=0pt,parsep=\parskip,topsep=5pt,itemindent=2em} 138 | \setitemize{itemsep=0pt,partopsep=0pt,parsep=\parskip,topsep=5pt,itemindent=2em} 139 | \setdescription{itemsep=0pt,partopsep=0pt,parsep=\parskip,topsep=5pt,itemindent=2em} 140 | 141 | % 代码设置 142 | \usepackage{framed} 143 | \usepackage{listings} 144 | \usepackage{color,xcolor} 145 | \definecolor{DarkBlue}{rgb}{0.05,0,1} 146 | \definecolor{DarkGreen}{rgb}{0.01,0.5,0.04} 147 | \definecolor{DarkPurple}{rgb}{0.67,0.02,0.98} 148 | % 定义一个新的语言 149 | \lstdefinelanguage{MATLAB} 150 | {morekeywords={if,else,end,for,while,break,continue,function}, %定义关键字 151 | sensitive=true, %是否大小写敏感 152 | morecomment=[l]{\%}, 153 | morecomment=[l]{\%\%}, 154 | morestring=[b]", 155 | morestring=[d]',} 156 | % 代码本体设置 157 | \lstdefinestyle{MATLAB}{ 158 | language=MATLAB, 159 | basicstyle=\footnotesize\ttfamily, 160 | backgroundcolor=\color{yellow!10},%背景色淡黄 161 | frame=shadowbox, 162 | rulesepcolor=\color{red!20!green!20!blue!20}, 163 | keywordstyle=[1]\color{DarkBlue}, 164 | keywordstyle=[2]\color{purple}, 165 | keywordstyle=[3]\color{orange}\underbar, 166 | stringstyle=\color{DarkPurple}, 167 | commentstyle=\color{DarkGreen}, 168 | numbers=left, 169 | keepspaces=false, 170 | numberstyle=\footnotesize, 171 | % firstnumber=1, 172 | % stepnumber=1, 173 | } 174 | \lstset{ 175 | basicstyle=\small\ttfamily,%基本样式+小号字体 176 | frame=trbl, 177 | %t-top,r-right,b-bottom,l-left 178 | frameround=tttt, 179 | %第一个字母表示右上角的拐角,然后顺时针地依次代表各个拐角。f表示方形,t表示弧形 180 | % showstringspaces=false, 181 | % identifierstyle=, 182 | tabsize=4, 183 | breaklines=true,%自动换行 184 | % breakautoindent=true,%换行自动缩进 185 | % breakindent=2em, %缩进距离 186 | columns=fixed,%固定字间距 187 | flexiblecolumns, 188 | xleftmargin=2pt,%左边距 189 | xrightmargin=0pt, 190 | aboveskip=5pt, 191 | belowskip=0pt, 192 | lineskip=-1pt,%行距增加值 193 | } 194 | 195 | % 算法框图 196 | \usepackage{algorithm} 197 | \usepackage{algpseudocode} 198 | \makeatletter 199 | \def\BState{\State\hskip-\ALG@thistlm} 200 | \makeatother 201 | \floatname{algorithm}{Procedure} 202 | \renewcommand{\algorithmicrequire}{\textbf{Input:}} 203 | \renewcommand{\algorithmicensure}{\textbf{Output:}} 204 | 205 | % Tikz流程图 206 | \usepackage{tikz} 207 | \usetikzlibrary{arrows,shapes,chains} 208 | \usetikzlibrary{calc} 209 | % 流程图定义基本形状 210 | \tikzstyle{startstop} = [rectangle, rounded corners, minimum width = 2cm, minimum height=1cm,text centered, draw = black] 211 | \tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=2cm, minimum height=1cm, text centered, draw=black] 212 | \tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black] 213 | \tikzstyle{decision} = [diamond, aspect = 3, text centered, draw=black] 214 | % 箭头形式 215 | \tikzstyle{arrow} = [->,>=stealth] 216 | 217 | % 页码设置 218 | \pagestyle{empty} 219 | 220 | % 水印 221 | \usepackage{eso-pic} 222 | \newcommand\BackgroundPicture{% 223 | \put(0,0){% 224 | \parbox[b][\paperheight]{\paperwidth}{% 225 | \vfill 226 | \centering% 227 | \begin{tikzpicture}[remember picture,overlay] 228 | \node [rotate=45,scale=6,text opacity=0.3] at (current page.center) {水印样例}; %中括号内是旋转角度,字体大小 229 | \end{tikzpicture}% 230 | \vfill 231 | }}} 232 | 233 | % 标题样式 234 | % \newcommand\subtitle[1]{{\Large #1}} % 定义副标题 235 | \makeatletter % change default title style 236 | \renewcommand*\maketitle{% 237 | \begin{center}% 居中标题 238 | % \bfseries % 默认粗体 239 | {\LARGE\bfseries\@title \par} % LARGE字号,默认粗体 240 | \vskip 1em% %%% 标题下面只有1em的缩进或margin 241 | {\@author \par} 242 | % {\global\let\author\@empty}% 243 | {\global\let\date\@empty}% 244 | \thispagestyle{empty} % 不设置页面样式 245 | \end{center}% 246 | \setcounter{footnote}{0}% 247 | } 248 | \makeatother --------------------------------------------------------------------------------