目录
4.微分
3.附录(选用)
利用本文的内容可以复现美赛的O奖论文的排版!!!
一、公式
(一)简单公式
1.基本操作
首先要知道用 ①$公式$ ②\(公式\) ③$$公式$$ ④\[公式\] 表示公式 其中\\表示换行
We give a rectangle $x$ and $x+1$,this is a index:$y=x+1$\\
We give a rectangle $x$ and $x+1$,this is a index:\(y=x+1\)\\
We give a rectangle $x$ and $x+1$,this is a index:$$y=x+1$$
We give a rectangle $x$ and $x+1$,this is a index:\[y=x+1\]
2.公式编号
%第一种方式
\begin{eqnarray}
y=x+1
\end{eqnarray}
%第二种方式
\begin{equation}
y=x+2
\end{equation}
3.n次方
用^表示次方,具体是几次方用{}括起来,下面看具体的例子
$$2x^3$$
$$2x^{34}$$
$$2x^{3x+4}$$
$$2x^{3x^{20}+4}$$
4.n次根式
格式:\sqrt[几次方根]{根号里面的内容},下面看具体的例子
$$\sqrt{2}$$
$$\sqrt[3]{2}$$
$$\sqrt{x^2+y^2}$$
$$\sqrt{1+{\sqrt{x+1}}}$$
5.分式
格式:\frac{分子}{分母},下面看具体的例子
$$\frac{x}{x+1}$$
$$\frac{x}{x^2+x+1}$$
$$\frac{1}{1+{\sqrt{x+1}}}$$
6.希腊字母
格式:$\字母的名字$,下面看具体的例子
$\alpha$,$\vartheta$,$\theta$
7.括号
格式:小括号、中括号正常,打括号需要在前面加上\,下面看具体的例子
$$(x+1)$$
$$x[2+(x+2)]$$
$$\{x,y,z\}$$
如果想要全包的括号,就需要这样的括号:\left( 和 \right),而且必须成对使用
$$3\left(\frac{2}{5}\right)$$ %\left( 这种左括号会把数字包全了
$$3\left[\frac{2}{5}\right]$$
$$\left|\frac{x}{x+1}\right|$$\\
$$\left\{x^2\right.$$ %\left\{ 和 \right.
8.下标
格式:字母_{下标},下面看具体的例子
$$x_1$$ %下标只有一个数字时,可以不用带{}
$$x_{12}$$
$$(a_1+a_2)a_3=a_1a_3 + a_2a_3$$
(二)复杂公式
特别提醒⏰:使用复杂公式要导入 \usepackage{amsmath} 宏包!!!
1.三角函数
格式:\三角函数名,下面看具体的例子
注意⚠️:\quad是空一格,\qquad是空两格
$$\cos \alpha=\frac{1}{2} \qquad \sin \beta=\frac{\sqrt{3}}{2}$$
2.特殊符号
正负号:\pm 不等号:\neq 小于等于:\leq 大于等于:\geq
$$y^2=4 \qquad y=\pm2$$ %正负号\pm
$$a^x+y \neq a^{x+y}$$ %不等号\neq
3.积分
一重积分:\int 二重积分:\iint 三重积分:\iiint 定积分:\int_{积分下限}^{积分上限}
特别注意⚠️:写dx时注意使用这种格式:\mathrm{d}x,这样d是正体而x是斜体
$$\int x^2$$ %不定积分号\int
$$\int x^2 \mathrm{d}x = \frac{x^3}{3}+C$$ %斜体换正体\mathrm,通常这样\mathrm{d}x
$$\int_0^1 x^2 \mathrm{d}x = \frac{2}{3}$$ %\int_0^1,积分上下限
$$\iint(x^2+y^2) \mathrm{d}x \mathrm{d}y$$ %二重积分\iint
$$\iiint(x^2+y^2+z^2) \mathrm{d}x \mathrm{d}y \mathrm{d}z$$ %三重积分\iiint
4.微分
写微分本质就是分式,还是要使用\frac{}{},特别注意求偏导的符号:\partial
$$y'+p(x)+q(x)=0$$
$$y''+py'+qy=0$$
$$\frac{\mathrm{d}y}{\mathrm{d}x} = 2x$$
$$\frac{\mathrm{d}^2 y}{\mathrm{d}x^2} - x\frac{\mathrm{d}y}{\mathrm{d}x}+u=0$$
$$\frac{\partial u}{\partial t} + t\frac{\partial u}{\partial x} =0$$ %\partial偏导数
5.求和
求和符号:\sum_{下标}^{上标} 极限符号:\lim_{a \to b}
%求和符号\sum
$$\sum_{k=1}^{n}k^2=\frac{1}{5}n^3 + \frac{1}{3}n^2 + n$$
%极限\lim 无穷\infty
$$\lim_{n \to \infty} \sum_{k=1}^{n} \frac{1}{k^2} = \frac{\pi^2}{6}$$
6.矩阵
首先要清楚写矩阵的框架,下面给出了这个框架。
%矩阵
\begin{displaymath}
\left[\begin{array}{ccc} %ccc表示有三列,并且每一列的内容都会居中对齐
%
%矩阵的内容
%
\end{array}\right]
\end{displaymath}
在了解几个省略号:①\cdots 横省略号 ②\vdots 竖省略号 ③\ddots斜省略号
下面让我们开始表示几个矩阵!
%矩阵
\begin{displaymath}
\left[\begin{array}{ccc}%列数
1&2&3\\
4&5&6
\end{array}\right]
\end{displaymath}
%矩阵
\begin{displaymath}
\left[\begin{array}{cccc}
1&2& \cdots &9\\ %\cdots 横省略号
4&5& \cdots &10\\
\vdots & \vdots & \ddots & \vdots\\ %\vdots 竖省略号 \ddots斜省略号
8&9& \cdots &20
\end{array}\right]
\end{displaymath}
%矩阵
\begin{displaymath}
\mathrm{f}(x) = \frac{1}{3} \times % \times乘号x
\left[\begin{array}{ccc}
1&2&3\\
4&5&6
\end{array}\right]
\end{displaymath}
7.分段函数
首先要清楚写分段函数的框架,下面给出了这个框架。
%分段函数
\begin{displaymath}
y=\left\{ \begin{array}{ll}
函数表达式1 & 条件1\\
函数表达式2 & 条件2\\
函数表达式3 & 条件3
\end{array}\right.
\end{displaymath}
下面让我们开始表示一个分段函数!
%分段函数
\begin{displaymath}
y=\left\{ \begin{array}{ll}
a & x>1\\
a+n & x < 1 \\%\leq 小于等于
a^2 & x=1
\end{array}\right.
\end{displaymath}
8.长公式分割成多行
现在想把下面的长公式分两行写,我们应该怎么办?
$$\sin x = \frac{x^4}{4} + \frac{x^3}{3} + \frac{x^2}{2} + x + \frac{x^4}{4} + \frac{x^3}{3} + \frac{x^2}{2} + x$$
下面给出将长公式分割成多行的格式:
%给每一行都编号
\begin{eqnarray}
%公式分割成多行
表达式 &=& 第一行公式\\
&&第二行公式\\
&&第三行公式
\end{eqnarray}
%都不编号
\begin{eqnarray*}
%公式分割成多行
表达式 &=& 第一行公式\\
&&第二行公式\\
&&第三行公式
\end{eqnarray*}
%只有第一行有编号
\begin{eqnarray}
%公式分割成多行
表达式 &=& 第一行公式\\ \nonumber%取消标号
&&第二行公式\\ \nonumber
&&第三行公式
\end{eqnarray}
下面通过一个例子依次展示上面所说的三种情况和对应的效果
\begin{eqnarray}
%公式分割成两行
\sin x &=& \frac{x^4}{4} + \frac{x^3}{3} + \frac{x^2}{2} + x + \\
&&\frac{x^4}{4} + \frac{x^3}{3} + \frac{x^2}{2} + x
\end{eqnarray}
\begin{eqnarray*}
%公式分割成两行
\sin x &=& \frac{x^4}{4} + \frac{x^3}{3} + \frac{x^2}{2} + x + \\
&&\frac{x^4}{4} + \frac{x^3}{3} + \frac{x^2}{2} + x
\end{eqnarray*}
\begin{eqnarray}
%公式分割成两行
\sin x &=& \frac{x^4}{4} + \frac{x^3}{3} + \frac{x^2}{2} + x + \\ \nonumber %取消标号
&&\frac{x^4}{4} + \frac{x^3}{3} + \frac{x^2}{2} + x
\end{eqnarray}
9.脱式
首先要清楚写脱式的框架,下面给出了这个框架,对于编号,可以类比上面的方法去控制编号
%对齐环境
\begin{align}
表达式 &= 第一步计算 \\
& = 第二步计算 \\
& = 第三步计算
\end{align}
下面通过一个例子来展示我们想要的效果:
%对齐环境 加上* 取消编号
\begin{align*}
y&=(x-y)(x+y) \\
&=x^2 - y^2
\end{align*}
\begin{align}
y&=(x-y)(x+y) \\ \nonumber
&=x^2 - y^2
\end{align}
10.排列组合
排列:A_{下标}^{上标} 组合:C_{下标}^{上标}
$$C_{5}^{2}$$
$$A_{5}^{2}$$
二、论文结构
学习完本部分,可以写出论文的结构
1.基本框架
\documentclass[12pt]{article}
%在这里写宏包
\begin{document}
%论文部分
\end{document}
2.标题(选用)
\documentclass[12pt]{article}
\begin{document}
\title{This is my first document}
\author{Peter Chen}
\date{} % 加上这句就不现实日期
\maketitle % 一定要加上\maketitle,这样才能显示出标题
\end{document}
3.附录(选用)
\newpage %另起一页
\appendix %附录
\appendixpage %给附录页
\section{Data}
\section{Code}
4.目录
使用目录就要加入目录的宏包:\usepackage{appendix}
加上这句:\tableofcontents 就可以直接生成目录!
\documentclass[12pt]{article}
\usepackage{appendix}
\begin{document}
\tableofcontents %直接生成目录
\newpage
\section{Introduction}
This is Introduction.
\section{background}
This is background.
\section{our work}
This is our work.
\newpage %另起一页
\appendix %附录
\appendixpage %给附录页
\addappheadtotoc %在目录中正确显示附录
\section{Data}
This is data.
\section{Code}
This is code.
\end{document}
4.摘要
在下面的环境下写摘要即可,不过美赛不常用
%摘要
\begin{abstract}
From here,begin my abstract.
\end{abstract}
5.分级
(1)数字分级
先看效果,这也是最常见到的格式
如何实现的呢?一级标题 \section{}、二级标题 \subsection{}、三级标题 \subsubsection{}
如果不想将标题加入到目录中,就在section后面加*,例如:\subsubsection*{}
\newpage
%\section{}一级标题
\section{Introduction}
This is Introduction.
%\subsection{}二级标题
\subsection{intro1.1}
This is Introduction1.1
%\subsubsection{}三级标题
\subsubsection*{intro1.1.1}
This is Introduction1.1.1
\section{background}
This is background.
\section{our work}
This is our work.
(2)·和-分级
先看效果
需要用到的环境
\begin{itemize}
\item 第一点
%可以嵌套
\begin{itemize}
\item 第一点
\item 第二点
……
\end{itemize}
\item 第二点
\item 第三点
……
\end{itemize}
下面的代码就是实现上面图片的代码
%·和-表示
\begin{itemize}
\item book
\begin{itemize}
\item Chinese
\item Math
\end{itemize}
\item dog
\item cat
\end{itemize}
(3)数字和字母分级
先看效果
需要用到的环境
\begin{enumerate}
\item 第一点
%可以嵌套
\begin{enumerate}
\item 第一点
\item 第二点
……
\end{enumerate}
\item 第二点
\item 第三点
……
\end{enumerate}
下面的代码就是实现上面图片的代码
%标题的形式
\begin{enumerate}
\item book
\begin{enumerate}
\item Chinese
\item Math
\end{enumerate}
\item dog
\item cat
\end{enumerate}
6.定理环境
需要用到的环境
\newtheorem{theorem}{Theorem}
%%%%%%%%%%%固定格式 名字 [section]
\begin{theorem}
定理一内容
\end{theorem}
\begin{theorem}
定理二内容
\end{theorem}
\begin{theorem}
定理三内容
\end{theorem}
……
不加[section]的效果:不加就从1、2、3··· 开始给定理编号
\section{theorem}
We defined a new theorem
\newtheorem{theorem}{Theorem}
%%%%%%%%%%%固定格式 名字 [section]
\begin{theorem}
This is a new theorem called $a^2+b^2=c^2$
\end{theorem}
\begin{theorem}
This is a new theorem called $1+1=2$
\end{theorem}
加[section]的效果:用大标题.1、大标题.2、大标题.3 给定理编号
\section{theorem}
We defined a new theorem
\newtheorem{theorem}{Theorem}[section]
%%%%%%%%%%%固定格式 名字 [section]
\begin{theorem}
This is a new theorem called $a^2+b^2=c^2$
\end{theorem}
\begin{theorem}
This is a new theorem called $1+1=2$
\end{theorem}
7.参考文献
需要用到的环境
\begin{thebibliography}{9} % 参考文献数量,10个以下就写9,100个以下就写99
\bibitem{} 第一个参考文献
\bibitem{} 第二个参考文献
\bibitem{} 第三个参考文献
……
\end{thebibliography}
下面展示效果
\begin{thebibliography}{9} % 参考文献数量,10个以下就写9,100个以下就写99
\bibitem{} Dermatologist-level classification of skin cancer with deep neural networks. Nature, 542(7639), 115-118.
\bibitem{} Tableau, “Number of available applications in the google
play store from December 2009 to March 2023”, Available
at: https://www.statista.com/statistics/266210/number,
2023-06-19
\bibitem{} J. Jang, S. Choi, and J. Hong,
\bibitem{} H. Flake, “Structural comparison of executable objects, ”
\bibitem{} abccccccccccccccccc [J/OL]. def, 1-15[2024-01-24] http://kns.cnki.net/kcms/detail/11.1946.TQ.20240123.1510.004.html.
\end{thebibliography}
8.页眉页脚
\usepackage{fancyhdr}%页眉
\usepackage{lastpage}
\pagestyle{fancy}
\lhead{Team \# 2024} %设置页眉左边的内容
\chead{America Model} %设置页眉中边的内容
\rhead{\thepage \ of \pageref{LastPage}} %设置页眉右边的内容(设置页数)
\cfoot{} %取消下面的页数
9.页边距
\usepackage[left=1.5in,right=1.5in,top=1in,bottom=1in]{geometry} %页边距
\linespread{1.2} %行间距
10.字体设置
介绍常用的字体形状和大小的设置
\section{font}
This is a new book.\\
This is a \textbf{new} book.\\ %字体加粗
This is a \textit{new} book.\\ %意大利斜体
This is a $new$ book.\\
This is a \textsc{new} book.\\ %全都大写
This is a \texttt{new} book.\\ %等宽字体
\section{size}
This is a new book.\\
This is a {\tiny new} book.\\
This is a {\scriptsize new} book.\\
This is a {\footnotesize new} book.\\
This is a {\normalsize new} book.\\
This is a {\large new} book.\\
This is a {\Large new} book.\\
This is a {\LARGE new} book.\\
三、图片
使用图片就要加入图片的宏包:\usepackage{graphicx},下面是图片需要用到的环境
1.插入单张照片
插入单张照片的格式
\begin{figure}[htb]
\centering %让图片居中
\includegraphics[scale=原图的几倍 ]{图片的目录}
\caption{图片标题}\label{图片标签}
\end{figure}
这是效果
实现这个效果的代码
%图片部分
\section{picture}
There are many beautiful picture.\ref{road}
\begin{figure}[htb]
\centering %让图片居中
\includegraphics[scale=0.1]{forLaTex.jpg}
\caption{road}\label{road}
\end{figure}
2.插入两张并排的照片
(1)插入两张并排的照片,并且一个图对应一个名字
实现这个格式的代码
\begin{figure}[htb]
%插入第一张图片
\begin{minipage}[t]{0.48\textwidth}
\centering
\includegraphics[scale=原图的倍数]{图片的路径}
\caption{图片一的名字}
\end{minipage}
%插入第二张图片
\begin{minipage}[t]{0.48\textwidth}
\centering
\includegraphics[scale=原图的倍数]{图片的路径}
\caption{图片二的名字}
\end{minipage}
\end{figure}
实现上图效果的代码
\section{picture}
There are two picture.
\begin{figure}[htb]
%插入第一张图片
\begin{minipage}[t]{0.48\textwidth}
\centering
\includegraphics[scale=0.1]{forLaTex.jpg}
\caption{road}
\end{minipage}
%插入第二张图片
\begin{minipage}[t]{0.48\textwidth}
\centering
\includegraphics[scale=0.1]{flower.jpg}
\caption{flower}
\end{minipage}
\end{figure}
(2)插入两张并排的照片,并且两个图是一个名字
实现这个格式的代码
\begin{figure}[htb]
%插入第一张图片
\begin{minipage}[t]{0.48\textwidth}
\centering
\includegraphics[scale=原图的倍数]{图片的路径}
\end{minipage}
%插入第二张图片
\begin{minipage}[t]{0.48\textwidth}
\centering
\includegraphics[scale=原图的倍数]{图片的路径}
\end{minipage}
\caption{图片名字}
\end{figure}
实现上图效果的代码
\section{picture}
There are two picture.
\begin{figure}[htb]
%插入第一张图片
\begin{minipage}[t]{0.48\textwidth}
\centering
\includegraphics[scale=0.1]{forLaTex.jpg}
\end{minipage}
%插入第二张图片
\begin{minipage}[t]{0.48\textwidth}
\centering
\includegraphics[scale=0.1]{flower.jpg}
\end{minipage}
\caption{nature}
\end{figure}
四、表格
绘制表格依然需要宏包:\usepackage{graphicx},下面是图片需要用到的环境
\begin{table}[htb]
\centering %让表格居中
\caption{表格名称}\label{表格标签}
%画表格的竖线直接在这里画,四个c代表表格有四列
\begin{tabular} {|c|c|c|c|}
画表格
\end{tabular}
\end{table}
这是效果:注意划横线需要 \hline 画竖线就直接在\begin{tabular}{在这里画}
每一行的写法:内容1 & 内容2 & ······ & 内容n \\(\\是换行)
实现上图表格的代码
%表格
\section{table}
This table presents us GDP.\ref{biao1}
\begin{table}[htb]
\centering
\caption{country index}\label{biao1}
\begin{tabular} {|c|c|c|c|} %画表格的竖线直接在这里画
\hline %画表格的横线的
country&population&GDP&index\\
\hline
China&13.6&13000&5\\
\hline
Japan&13.6&13000&5\\
\hline
\end{tabular}
\end{table}
-----------------------------------------------------------------------------------------------在这里给大家推荐一个画表格的网站:Create LaTeX tables online – TablesGenerator.com
功能:在这个网站上面直接画出我们想要的表格,他会直接生成对应的LaTeX代码。
这篇文章只是介绍美赛论文所需要的LaTeX技巧,如果大家在实际使用过程中遇到了其他的问
题,在推荐给大家一个网站:https://www.latexstudio.net
里面不仅有一些问题的解决办法,还有许多LaTeX模版!!!