Latex论文排版
1. 常用符号表示
符号 | 指令 | 符号 | 指令 | 符号 | 指令 |
---|---|---|---|---|---|
单竖线 | \vert | 点乘 | \cdot | 公式不编号 | equation* |
双竖线 | \Vert | 叉乘 | \times | 章节不编号 | \section* |
小于等于 | \leq | 下划线 | \underline | 撇 | \prime |
大于等于 | \geq | 上划线 | \bar | 证毕 | \hfill $\Box$ |
2. 常用字体、排版格式
格式 | 指令 | 格式 | 指令 | 格式 | 指令 |
---|---|---|---|---|---|
正体 | \rm | 斜体加粗 | \bm (\usepackage{bm}) | 粗体 | \mathbf |
花体 | \mathcal | 黑板粗体 | \mathbb | 文本 | \text |
段落顶格 | \noindent | 换行 | \\ | 间距调整 | \vspace{-10pt} |
大写罗马数字 | \Roman {1} | 小写罗马数字 | \romannumeral 1 | 新起一页 | \newpage |
章节不编号 | \section* | 公式不编号 | equation* | 增大间距 | \: |
缩小间距 | \! | 小空格 | \, | 大空格 | \; |
3. 矩阵(行内小矩阵)
- 在行内插入矩阵,若想缩小矩阵大小,可在
bmatrix
或pmatrix
等内使用\smallmatrix
包,其中,bmatrix
对应方框,pmatrix
对应括号,Bmatrix
对应花括号,vmatrix
对应单竖线,Vmatrix
对应双竖线。 若无需缩小矩阵,删除代码中\smallmatrix
指令即可。
\begin{bmatrix}
\begin{smallmatrix}
1 & 2 & 3\\
4& 5 & 6
\end{smallmatrix}
\end{matrix}
- 若想调整矩阵中元素对齐方式,可使用
array
插入矩阵,外层按需使用\left( \right)
、\left[ \right]
、\left\{ \right\}
,如果使用单括号,右侧替换为\right.
,具体如下
\begin{equation}
\left[
\begin{array}{ccc}%三列,居中对齐c;左对齐l;右对齐r。如需列之间竖线分隔,则为{c|c|c}
111 & xyz & x-y\\ %如需增加横线分隔,此处增加 \hline
4x+y& 112 & 6
\end{array}
\right]
\end{equation}
4. 公式(多行公式、分段函数、公式上下间距调整)
- 多行公式:
aligned
环境下编写,单个公式编号
\begin{align}\label{eq1}%公式标签,引用\cite{eq1}
\begin{aligned} %aligned环境允许公式内换行
k=&k_1+k_2\\ % &公式对齐处
&+k_3+k_4
\end{aligned}
\end{align}
- 分段函数:
array
内编写,可设置对齐方式
\begin{equation}\label{model8-Quantizer}
f(t)=\left\{
\begin{array}{ll}%左对齐l;居中c;右对齐r
1, & 0<t<1 or \\
\; & 2<t<3\\ %较大空格\;,较小空格\,
3, & t>5\\
0, others
\end{array}
\right.
\end{equation}
此外,还可以使用cases
编写条件结构/分段函数。equation*
表示不对此公式编号
\begin{equation*}
{z_m(t)} = \begin{cases}
1,&{\text{if}}\ {\beta }_m(t) \\
{0,}&{\text{otherwise.}}
\end{cases}
\end{equation*}
- 公式上下间距调整: 通过调整公式上下空白的距离,使得公式和上下文更加紧凑:
\setlength{\abovedisplayskip}{5pt} % 调整公式上方间距
\setlength{\belowdisplayskip}{5pt} % 调整公式下方间距
%在文档的导言区添加上述设置即可全局生效。放在\begin{document}前
5. 插图(单个图、多个子图)
\usepackage{graphicx}
- 单个图
\begin{figure}[!t]
\centering
\includegraphics[width=3.5in]{fig1}
\caption{Schematic diagram of 3D flexible spacecraft.}
\label{fig_1}
\end{figure}
- 多个子图
\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
注: 子图的\label
命令应设置在每个\subfloat
命令中,而整体图的\label
命令必须放在\caption
之后。使用\hfil
作为分隔符以实现均等间距。图中各部分的总宽度不应超过文本宽度,否则会导致换行。
\begin{figure*}[!t]
\centering
\subfloat[]{\includegraphics[width=0.33\textwidth]{Fig1a}%
\label{fig:1a}}
\hfil
\subfloat[]{\includegraphics[width=0.33\textwidth]{Fig1b}%
\label{fig:1b}}
\hfil
\subfloat[]{\includegraphics[width=0.33\textwidth]{Fig1c}%
\label{fig:1c}}
\caption{\hl{Control performance. (a) Case 1. (b) Case 2. (c) Case 3.}}
\label{fig:1}
\end{figure*}
6. 表格(Tablesgenerator )
- 简单的表格代码如下。复杂表格可以到Tablesgenerator 创建表格,并导出代码,超实用。
\begin{table}[!t]
\caption{An Example of a Table\label{tab:table1}}
\centering
\begin{tabular}{|c||c|}
\hline
One & Two\\
\hline
Three & Four\\
\hline
\end{tabular}
\end{table}
7. 文本高亮——论文修改必备
- 可使用颜色:black, blue, brown, cyan, darkgray, gray, green, lightgray,lime, magenta, olive, orange, pink, purple, red, teal, violet, white, yellow.
\usepackage{xcolor}
\color{blue}{待高亮的文本}
%也可用于公式内,{\color{blue}{待高亮}}加外层括号限制高亮区域