一、公式编写:
因为我习惯用MathType打公式,所以选择在Word 中直接进行转换,导入LaTex的方法
在 word 中选中公式,通过快捷键“Alt+\”键,即可将MathType公式转换成 Latex 格式。
注意:此时转换后的LaTeX公式,行内公式是以“$”开始和结尾的,行间公式则是以“\[”和“\]”开始和结尾的,在我们复制到LaTeX编辑器中的时候,需要将开头结尾的这两处删掉。
对于行内公式,其格式为:
$公式$
对于行间公式,并加label方便引用,其格式为:
\begin{equation}
%公式
\label{eq:1}
\end{equation}
其他常见公式编写:
LaTeX数学公式-详细教程_latex公式怎么打-CSDN博客
二、在Latex中插入Visio图:
1. 将visio导入到Word中,在图上右键,“Visio”对象,打开。
这时会创建一个新的Visio文件,原Visio文件中的边界空白已被删去,新图已自动占满新的Visio文件。
【2023-2-26更新】该步骤可修改为:在Visio中,设计-->页面设置-->大小-->适应绘图,这样会自动去除多余空白,保留部分空白作为边界,无需使用Word。
2. 将新的Visio文件另存为pdf格式文件。
3. 将pdf格式文件放到Latex项目目录下,以figure格式插入Latex即可。
单栏:
\begin{figure}[h]
\centering # 中心位置
\includegraphics[width=0.9\columnwidth]{1.pdf}
\caption{ } # 题目
\label{fig:1}
\end{figure}
双栏: 后面加个* 可以拓宽成双栏格式
\begin{figure*}[h]
\centering
\includegraphics[width=1.9\columnwidth]{1.pdf}
\caption{ }
\label{fig:1}
\end{figure*}
三、表格
单栏:\begin{table}不带星号
第一种格式:cccc表明有几列
\begin{table}[h!]
\begin{center} % 中心
\begin{tabular}{c c c c }
\hline
\textbf{a} & \textbf{b} &\textbf{c} & \textbf{d} \\
\hline
a &b &c &d \\ % 换行
\hline % 横线
\end{tabular}
\caption{ }% 题目
\end{center}
\end{table}
第二种格式:在\begin{tabular*}{\linewidth}{@{}LLLL@{}}中使用“\linewidth”这个东西 LLLL表明有几列
\begin{table}
\caption{This is a table with full width in double column.}
\label{tab_fwdc}
\begin{tabular*}{\linewidth}{@{}LLLL@{}}
\toprule
Col 1 & Col 2 & Col 3 & Col4\\
\midrule
12345 & 12345 & 123 & 12345 \\
12345 & 12345 & 123 & 12345 \\
12345 & 12345 & 123 & 12345 \\
12345 & 12345 & 123 & 12345 \\
12345 & 12345 & 123 & 12345 \\
\bottomrule
\end{tabular*}
\end{table}
双栏:\begin{table*}中的“*”表示这个表格在两栏模板中使用一栏。
第一种格式:
\begin{table*}[h!]
\begin{center} % 中心
\begin{tabular}{c c c c }
\hline
\textbf{a} & \textbf{b} &\textbf{c} & \textbf{d} \\
\hline
a &b &c &d \\ % 换行
\hline % 横线
\end{tabular}
\caption{ }% 题目
\end{center}
\end{table*}
第二种格式:实现整页宽度的思路是\begin{tabular*}{\linewidth}{@{}LLLL@{}}中的“\linewidth”,另外
\begin{table*}
\caption{This is a table with full width in single column.}
\label{tab_fwsc}
\begin{tabular*}{\linewidth}{@{}LLLL@{}}
\toprule
Col 1 & Col 2 & Col 3 & Col4\\
\midrule
12345 & 12345 & 123 & 12345 \\
12345 & 12345 & 123 & 12345 \\
12345 & 12345 & 123 & 12345 \\
12345 & 12345 & 123 & 12345 \\
12345 & 12345 & 123 & 12345 \\
\bottomrule
\end{tabular*}
\end{table*}
其他见:LaTeX之双栏模板表格布局(单双栏满宽+不满宽)_latex双栏表格-CSDN博客
LaTeX之双栏模板表格布局(单双栏满宽+不满宽)_latex双栏表格-CSDN博客
四、注释
1. 在命令行前面加%,批量注释:ctrl+"/"
2. 多行注释
\iffalse
... (需要被注释段落)
\fi