用Latex写IEEE论文

时间:2022-06-01 20:49:34

如果在搞科研,想在IEEE上发表文章,那么就不得不用IEEE的论文模板,分为doc版本和Tex版本。Tex是高德纳·纳什所写,大牛级的任务,写过《计算机程序设计艺术》,曾经是美国最年轻的科学院院士(入院年龄),三十多岁。Tex写论文排版十分容易,擅长公式编辑。然而,由于Tex是基于命令式的文本编辑器,不是“所见即所得”的模式,并且包含了大量的内容,所以学习起来比较吃力,但是一旦掌握了会发现word太弱了。本文主要介绍在IEEE模板下如何进行编写。


首先安装CTEX,其是Latex的中文套件,包含了丰富的package,易于使用。当然之后就是漫长的学习了,跟学习编程一样,边学习,边编程,事半功倍。

然后,应当看IEEE给出的IEEEtran_HOWTO.pdf,其中详细介绍了如何在该模板下进行论文排版。


最后,有恒心,有毅力,有耐心地解决碰到的问题。


下面介绍几种常用的,并且容易犯错的。

(一)插入图片

Latex对于eps格式的图片支持的很好,而其它格式却没有这样幸运,所以建议使用eps的图片,这样对于图片操作就简单多了。

包含\usepackage{graphicx}

插入一个图片

\begin{figure}
\centering
\includegraphics[width=2.5in]{pic/BOIN_node.eps}
\caption{The architecture of a network node}
\end{figure}

如果想并排插入多个图片,并且进行编号:

\begin{figure}[!t]
\centering
\subfigure[switch]{\includegraphics[width=1.0in]{pic/os/a.eps}
\label{fig_first_case}}
\subfigure[$ST$(switch)=$ON$]{\includegraphics[width=1.0in]{pic/os/b.eps}
\label{fig_second_case}}
\subfigure[$ST$(switch)=$OFF$]{\includegraphics[width=1.0in]{pic/os/c.eps}
\label{fig_third_case}}
\caption{$2\times2$ optical switch}
\label{fig_sim}
\end{figure}

用Latex写IEEE论文

(二)公式

Latex对于公式的处理主要有三种方法

a. 使用$符号,对于公式y=x^2+z,可以写成$y=x^2+z$。其中^表示上标,_表示下表。

b.采用displaymath,提供公式环境

\begin{displaymath}
E = \left\{ \begin{array}{ll}
 \{(R,T0)\} & \textrm{if $ST = ON$}\\
 \{(R,T1)\} & \textrm{if $ST = OFF$}\\
 \end{array} \right.
\end{displaymath}

c. 采用enquation,displaymath没有公式编号,而enquation有。

(三)算法(伪代码)

一般来说,只需要如下形式就可以了

\documentclass{article}
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
\begin{document}


\begin{algorithm}
\caption{Euclid’s algorithm}\label{euclid}
\begin{algorithmic}[1]
\Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}
   \State $r\gets a\bmod b$
   \If{sfdfdsa}
   \State sdfsadf
   \EndIf
   \While{$r\not=0$}\Comment{We have the answer if r is 0}
      \State $a\gets b$
      \State $b\gets r$
      \State $r\gets a\bmod b$
   \EndWhile\label{euclidendwhile}
   \State \textbf{return} $b$\Comment{The gcd is b}
\EndProcedure
\end{algorithmic}
\end{algorithm}


\end{document} 


然而对于IEEE的模板,就不能同时使用

\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}

会报一个algorithmic重复定义的错误,猜想有可能是包含的package冲突,所以就不能使用\If等等一些列的宏,只能供使用\IF,\ENDIF等全大写的宏。

例子如下:

\usepackage{algorithm}
\usepackage{algorithmicx}

\begin{algorithm}[!h]
\caption{Routing algorithm}
\begin{algorithmic}[1]
\IF{there is a packet Px coming from X-}
    \IF{$x\neq x_t(Px)$}
        \STATE $ST(S_X)=ON$
        \STATE $ST(S_F)=ON$

   \ENDIF

\ENDIF

\end{algorithmic}

\end{algorithm}

这里一定要注意IF和ENDIF要匹配,否则会报错。