ctrl+T:注释快捷键
ctrl+U:取消注释
%:注释
如果要添加%,如99.2%可以用99.2\%,\可以取消%的作用
1. 换页: \newpage
2. 换行: 用回车键空两格,或者、\par
3. 添加缩进:\indent
4. 取消缩进:\noindent
5. 添加图片,centering:居中对齐,width=150控制图片大小(可以根据实际需要更改),imgname就是图片的名字(不需要名字后缀(如ios.png直接填ios),但是需要把图片放到tex文件同目录下,caption是设置图片名字,label是给图片加标签方便引用,示范的代码引用方式为 \ref{imgs} )
如果要一次性添加两/多个图片,
就直接加一行 \includegraphics[width=150mm]{imgName2}
\includegraphics[width=150mm]{imgName3}.........
\begin{figure}[!htb]\centering
\includegraphics[width=150mm]{imgName}
\caption{img}
\label{imgs}
\end{figure}
6. 添加代码code
%添加code,language根据实际语言可以更改JAVA,Python........
%引用
\ref{name of Python code}
\begin{lstlisting}[language=C, caption=Your caption for this Python, label= name of Python code]
public static void main(String[] args)
{
System.out.println("Hello World !");
while ((ch = fr.read()) != -1) { //read characters
System.out.print((char)ch);
}
fr.close();
}
\end{lstlisting}
7. 添加列表
% 无数字编号列表
\begin{itemize}
\item This is a list without numbering.
\item This is a list without numbering.
\end{itemize}
% 有数字编号列表
The following is an example of using \textbf{enumerate} environment:
\begin{enumerate}%[1.]
\item This is a list with numbering.
\item This is a list with numbering.
\end{enumerate}
8. 添加三线表
\begin{table}[!htb]\centering
\caption{Caption of Tables Should Be Above the Table}
\label{tabIDyouNameIt}
\setlength{\tabcolsep}{1ex}% 列间距加宽
\begin{tabular}{p{0.3\textwidth}p{0.2\textwidth} p{0.4\textwidth}} % p{width} 控制列宽
\toprule
Donec & Etiam & Etiam suscipi \\
\midrule
Maec & Maece & Donec vel pede \\
Maec & column & Maecenas non \\
\bottomrule
\end{tabular}
\end{table}
9. 添加公式,推荐使用mathpix软件,可以截图识别公式转换为latex格式
% 段落内数学式,放在 $...$ 之间
The following are examples of in-line mathematical expressions:
$\alpha \leq \beta$ in-line math $a_i \times b_{min} = c^{567}$ in-line math $70 \sim 80Hz$
% 段落之间的公式
The following is an example of using \textbf{equation} environment:
Refer to the equation: Equation~\ref{eqID}
\begin{equation}\label{eqID}
H(Y|X) = \sum_{i=1}^s \sum_{j=1}^t P(x_i, y_j) \log_2 \Big(\frac{1}{ P(y_j|x_i) } \Big)
\end{equation}
\begin{equation}
\begin{aligned}\label{eqIDanother}
H(Y|X) =& \sum_{i=1}^s P(x_i) H(Y|x_i) \\
=& \sum_{i=1}^s \sum_{j=1}^t P(x_i) P(y_j|x_i) \log_2 \Big(\frac{1}{ P(y_j|x_i) } \Big)
\end{aligned}
\end{equation}
10. 添加文献
引用方式:\cite{surnameyear}
需要添加bib文件,可以到论文发表网址直接复制代码,然后添加到bib文件中。不过不是所有的网址都可以复制,部分是直接下载bib文件。
注意:论文引用作者名字相同的时候第二次引用时候名字会被破折号——代替
有两个方法解决:
1. 打开IEEEtran.bst文件,
修改 FUNCTION {default.is.dash.repeated.names} { #1 }
为 FUNCTION {default.is.dash.repeated.names} { #0 }
也就是把1改成0
2. 在第二次添加的时候,给作者名字多加{},但是这种方法在引用的时候不会再把作者名字缩写了
@ARTICLE{one,
author={Xiao, ming},
}
@ARTICLE{two,
author={{Xiao, ming}},
}