美赛 LaTex排版笔记
1.基础操作与总排版基础操作中文排版字体与字号调节首行缩进新开一页加粗序列(1)无序序列(2)有序序列(3)步骤描述分行与分段强制垂直距离2.数学公式(1)行间一个公式(2)行间多个公式矩阵或行列式分段函数假设检验引理等3.图表图片表格4.附录环境5.代码6. 参考文献7. 其他配置问题宏包安装美赛论文Latex简易模板 | 快速上手(附注释)
1.基础操作与总排版
基础操作
command+T
:注释
command+U
:反操作
中文排版
字体与字号调节
字体{\songti 宋体}{\heiti 黑体} {\fangsong 仿宋} {\kaishu 楷书}
字号
\zihao{0} 初号字
首行缩进
全局\setlength{\parindent}{0pt}
只针对某一行
\noindent
新开一页
\newpage
加粗
\textbf{Most of the drivers are rational. }
序列
(1)无序序列
\begin{itemize}\item \textbf{}\item \textbf{}\item \textbf{}\item \textbf{}\end{itemize}
(2)有序序列
\begin{enumerate}[\bfseries 1.] # 或者[1)]\item We do ...\item We do ...\item We do ...\end{enumerate}
(3)步骤描述
\begin{description}\item[Step 1] \item[Step 2] \item[Step 3] \end{description}
分行与分段
分行\\
分段\par
或者直接敲两个空格区别行间距小 段间距大
强制垂直距离
\vspace{0.3cm}
2.数学
公式
对齐使用&
简书:LaTex的公式输入
插入公式 (从MathType公式编辑器导入到LaTex中)
编号问题
(1)行间一个公式
\begin{equation}{T_{h,i}} \sim N(15,4)\nonumber #无序号\end{equation}
公式的引用
The detail can be described by equation \eqref{eq:heat}: #公式引用\eqref{label}\begin{equation}\label{eq:heat} #label在这里\frac{\partial u}{\partial t} - a^2 \left( \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} + \frac{\partial^2 u}{\partial z^2} \right) = f(x, y, z, t)\end{equation}
(2)行间多个公式
一个公式占两行\begin{equation}\begin{split}{{\rm{Z}}^ - } &= ({Z_1}^ - ,{Z_2}^ - , \cdots {Z_6}^ - )\\{\rm{&= (min}}\left\{{{z_{11}},{z_{21}}, \cdots ,{z_{n1}}} \right\},{\rm{min}}\left\{{{z_{12}},{z_{22}}, \cdots ,{z_{n2}}} \right\}\cdots ,{\rm{min}}\left\{{{z_{16}},{z_{26}}, \cdots ,{z_{n6}}} \right\}{\rm{)}}\end{split}\end{equation}
一次性插入多个只占一行的公式
\begin{align}{x^{(1)}} &= ({x^{(1)}}(1),{x^{(1)}}(2), \cdots ,{x^{(1)}}(7))\\{x^{(1)}}(m) &= \sum\limits_{i = 1}^m {{x^{(0)}}(i)} ,m = 1,2, \cdots ,7\end{align}
矩阵或行列式
\[\begin{pmatrix}{*{20}c}{a_{11} } & {a_{12} } & {a_{13} } \\{a_{21} } & {a_{22} } & {a_{23} } \\{a_{31} } & {a_{32} } & {a_{33} } \\\end{pmatrix}= \frac{{Opposite}}{{Hypotenuse}}\cos ^{- 1} \theta \arcsin \theta\]\lipsum[9]\[\left( {\begin{array}{*{20}{c}}{*20c{a_{11}}}&{{a_{12}}}&{{a_{13}}}\\{{a_{21}}}&{{a_{22}}}&{{a_{23}}}\\{{a_{31}}}&{{a_{32}}}&{{a_{33}}}\end{array}} \right) = \frac{{Opposite}}{{Hypotenuse}}{\cos ^{- 1}}\theta \arcsin \theta \]\[p_{j}=\begin{cases} 0,&\text{if $j$ is odd}\\r!\,(-1)^{j/2},&\text{if $j$ is even}\end{cases}\]
分段函数
\[p_{j}=\begin{cases} 0,&\text{if $j$ is odd}\\r!\,(-1)^{j/2},&\text{if $j$ is even}\end{cases}\]
假设检验
\begin{equation}\begin{split}{H_0:}\quad &\text{There is no di↵erence in average throughputs} \\&\text{in existing modeland control time model, i.e.} {\mu _1} = {\mu _2}\\{H_1:}\quad&\text{$H_0$ is wrong, i.e.} {\mu _1} \ne {\mu _2}\nonumber\end{split}\end{equation}
引理等
\begin{Theorem} \label{thm:latex}\LaTeX\end{Theorem}\begin{Lemma} \label{thm:tex}\TeX .\end{Lemma}\begin{proof}The proof of theorem.\end{proof}
3.图表
图片
Latex中插入多张图片,实现并排排列或者多行多列排列
有各自小标题
\begin{figure}[ht]\centering #居中包括自己的小标题\begin{minipage}[b]{0.45\linewidth}#三个图并排似乎是0.3\centering\includegraphics[width=6cm]{1}\caption{Either A or B is open}\label{fig:minipage1}\end{minipage}\quad\begin{minipage}[b]{0.45\linewidth}\centering\includegraphics[width=6cm]{2}\caption{Either C,D or E is open}\label{fig:minipage2}\end{minipage}\end{figure}
公用一个标题
\begin{figure}[ht]\centering\begin{minipage}[b]{0.45\linewidth}\centering\includegraphics[width=7cm]{3}\label{fig:minipage3}\end{minipage}\quad\begin{minipage}[b]{0.45\linewidth}\centering\includegraphics[width=7cm]{4}\label{fig:minipage4}\end{minipage}\caption{Two or three tollbooth egress lanes merge into one lane}\end{figure}
公用一个标题同时有小标题
\usepackage{graphicx}
\usepackage{subfigure}
\begin{figure}[htbp]\centering\subfigure[year ]{\includegraphics[width=7cm]{line.pdf}%\caption{fig1}}\quad\subfigure[year 2040]{\includegraphics[width=7cm]{2040line.pdf}}\caption{Trend of propotion of all levels}\label{2040}\end{figure}
三张图
\begin{figure}[htbp]\centering\subfigure[year ]{\includegraphics[width=4.5cm]{.pdf}%\caption{fig1}}\quad\subfigure[year 2028]{\includegraphics[width=4.5cm]{2028.pdf}}\quad\subfigure[year 2040]{\includegraphics[width=4.5cm]{2040.pdf}}\caption{Distribution of culture carriers}\end{figure}
四张图
\begin{figure}[htbp]\centering\subfigure[]{\includegraphics[width=7cm]{1.pdf} #[width=3cm]就是四张图缩小并排摆放%\caption{fig1}}\quad\subfigure[]{\includegraphics[width=7cm]{2.pdf}}\quad\subfigure[]{\includegraphics[width=7cm]{3.pdf}}\quad\subfigure[]{\includegraphics[width=7cm]{4.pdf}}\caption{Results of GM(1,1)}\end{figure}
表格
在线生成网站:Create LaTex table online
\begin{table}[]\begin{center} #表格居中 或者直接只有 \centering\begin{tabular}{|l|l|l|}\hline\multicolumn{1}{|r|}{Notation} & Definition & Unit \\ \hlineL & Number of outgoing lanes in highway & N/A \\B & Number of tollbooths & N/A \\D & Distance of the tollbooth and the end of the plaza & m \\ \hline\end{tabular}\end{center} #表格居中\end{table}
表格和图片的引用
\ref{label}
4.附录环境
\begin{subappendices} \section{Appendix : Code of Matlab}\end{subappendices}
5.代码
matlab\lstset{language=Matlab}
\begin{lstlisting}\end{lstlisting}
python
\usepackage{pythonhighlight}
\begin{python}\end{python}
6. 参考文献
简易版\begin{thebibliography}{00}\bibitem{r1} 华瑞博远. 5G产业链全景图\bibitem{r2} 李瑞龙 钱琪. 从分歧到共识:疫情下的5G发展思考. 腾讯研究院 \url{/article/rmydb_15608_290795.html}\end{thebibliography}
BibTex版本
\citep{evidence}
\nocite{*}\bibliographystyle{unsrtnat}\setcitestyle{numbers}\bibliography{ref.bib}
LaTex 论文排版(3): 插入参考文献
LaTex第七课:参考文献排版
简易版本
Latex(TEXStudio)中的引用文章(调用bib文件)的正确打开方式
natbib
各类cite引用格式Latex——natbib宏包使用说明中文版
转载
7. 其他配置问题
宏包安装
Mac texlive+texstudio 如何手动安装宏包