IEEE Trans Latex模板使用

0. 模板的编译(以tex studio为例)

记住,IEEE trans需要进行PDF模式的编译。你可以拿trans的文章看看啥格式,看看你构建并查看出来是啥格式,看看你PDF编译时啥格式,你就知道为什么要进行PDF模式的编译了。

方法如下:

首先,点击构建并查看(可能报错,也可能不会)。

报错了先不管,执行完毕,再点击:工具–》命令–》PDFLatex,执行PDF编译。

如果此时还报错,您的问题;如果此时没报错,但正常构建并查看报错了,模板的问题。

1.论文开头的准备代码段(package、PDF编译支持等等)

\documentclass[journal]{
    
    IEEEtran}

%% 表格包
\usepackage{
    
    tabularx,booktabs}

%% PDF编译包
\usepackage{
    
    ifpdf}
 \ifpdf
   % pdf code
 \else
   % dvi code
 \fi

%% 引用包
\usepackage{
    
    cite}

%% PDF编译包
\ifCLASSINFOpdf
   \usepackage[pdftex]{
    
    graphicx}
  % declare the path(s) where your graphic files are
  % \graphicspath{
    
    {
    
    ../pdf/}{
    
    ../jpeg/}}
  % and their extensions so you won't have to specify these with
  % every instance of \includegraphics
  % \DeclareGraphicsExtensions{
    
    .pdf,.jpeg,.png}
\else
  % or other class option (dvipsone, dvipdf, if not using dvips). graphicx
  % will default to the driver specified in the system graphics.cfg if no
  % driver is specified.
  % \usepackage[dvips]{
    
    graphicx}
  % declare the path(s) where your graphic files are
  % \graphicspath{
    
    {
    
    ../eps/}}
  % and their extensions so you won't have to specify these with
  % every instance of \includegraphics
  % \DeclareGraphicsExtensions{
    
    .eps}
\fi

%%数学包
\usepackage{
    
    amsmath}

%%%%%算法包
\usepackage{
    
    algorithmic}
\usepackage{
    
    algorithm}
\renewcommand{
    
    \algorithmicrequire}{
    
    \textbf{
    
    Input:}}
\renewcommand{
    
    \algorithmicensure}{
    
    \textbf{
    
    Output:}}


%%%排列包(创建排列,123这种排列)
\usepackage{
    
    array}


%% 子图包
\ifCLASSOPTIONcompsoc
  \usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{
    
    subfig}
\else
  \usepackage[caption=false,font=footnotesize]{
    
    subfig}
\fi

%% 插入网页链接包
\usepackage{
    
    url}

%% HYPERLINK 将引文、公式变成超链接,能自动跳转
\makeatletter
\let\NAT@parse\undefined
\makeatother
\usepackage{
    
    hyperref}  %hyperref still needs to be put at the end!

\hyphenation{
    
    op-tical net-works semi-conduc-tor}

2.解决IEEE 原始模板中公式、引用没有超链接的问题的方法:

只要使用上面的开头代码即可。如果不想整段复制,只需要复制下面这段到你的usepackage的地方就行:

%% HYPERLINK
\makeatletter
\let\NAT@parse\undefined
\makeatother
\usepackage{
    
    hyperref}  %hyperref still needs to be put at the end!

3.普通表格的插入

\begin{
    
    table}[!t] %%经典三线表
  \centering
  \caption{
    
    标题}
  \begin{
    
    tabular}{
    
    ccccc} %有多少列打多少个c
    \hline
    Network &    N&    L &    Z &    B\\ \cline{
    
    1-5}
    S   &0   &0   &0    &0\\
    A  &0   &0    &0   &0\\
    C    &0   &0    &0   &0\\
    \hline
  \end{
    
    tabular}
  \label{
    
    标签}
\end{
    
    table}

4.多子图与单图

图片不想写路径,一定要放在和.tex相同的文件夹里面。使用时直接文件名.eps即可。

4.1 三子图(二上一下)

\begin{
    
    figure*} %%跨栏图为:figure*而单栏图为 figure
  \centering
  \subfloat[子图名字]{
    
     \includegraphics[width=3.5in%想要的尺寸]{
    
    文件名.eps} \label{
    
    标签}}
  \subfloat[子图名字]{
    
     \includegraphics[width=3.5in%想要的尺寸]{
    
    文件名.eps} \label{
    
    标签}}

  \quad  %用于子图换行 即这个上面是并列两子图 这个下面是另一子图
  \subfloat[子图名字]{
    
     \includegraphics[width=3.5in%想要的尺寸]{
    
    文件名.eps} \label{
    
    标签}}
  \caption{
    
    大图名字}
  \label{
    
    大图标签}
\end{
    
    figure*}  %%跨栏图为:figure*而单栏图为 figure

4.2 双子图 (两个并列,中间空隙还能调整)

\begin{
    
    figure*}
  \centering
  \subfloat[子图名字]{
    
      \includegraphics[width=0.3\textwidth%子图大小命令]{
    
    子图文件名.eps}}\hspace{
    
    0.8in} %% \hspace{
    
    0.8in}  在两个子图中插入0.8in的空间 自己调
  \subfloat[子图名字]{
    
      \includegraphics[width=0.3\textwidth%子图大小命令]{
    
    子图文件名.eps}}
  \caption{
    
    大图名字}
  \label{
    
    标签}
\end{
    
    figure*} %%同样,单栏用figure;跨栏figure*

4.3 单图插入

%\begin{
    
    figure}[!t]
\centering
\includegraphics[width=2.5in%大小命令]{
    
    myfigure.eps/pdf/其他支持的文件类型}
\caption{
    
    名字}
\label{
    
    标签}
\end{
    
    figure}

5.算法(伪代码)插入

5.1 符合IEEE格式的伪代码
如果你没抄我第一点的开头准备代码段,你想你的伪代码符合格式,要在你的文件开头usepackage{algorithm}那里改成:

%%%%%算法包
\usepackage{
    
    algorithmic}
\usepackage{
    
    algorithm}
\renewcommand{
    
    \algorithmicrequire}{
    
    \textbf{
    
    Input:}}
\renewcommand{
    
    \algorithmicensure}{
    
    \textbf{
    
    Output:}}

5.2 算法插入

\begin{
    
    algorithm}[h]
  \caption{
    
    算法名字}
  \label{
    
    标签}
  \begin{
    
    algorithmic}[1]
    \STATE {
    
    //Initialization part.....}
    \STATE {
    
    ......}
    \REPEAT
    \STATE  .......
    \STATE  ........ %带无标号公式的statement
    \begin{
    
    center}
      \begin{
    
    equation*}
      .......
      \end{
    
    equation*}
    \end{
    
    center}
    \UNTIL{
    
    The given termination criterion is met.}
  \end{
    
    algorithmic}
\end{
    
    algorithm}

5.3 算法过大,老是跑到最后一页?
解决方法如下: 在algorithmic块中使用small控制算法字体大小,其他字体大小命令自行百度(比如tiny,footnodesize等),根据需要微调。

\begin{
    
    algorithm}[h]
  \caption{
    
    算法名字}
  \label{
    
    标签}
  \begin{
    
    algorithmic}[1]
        \begin{
    
    small}
    \STATE {
    
    //Initialization part.....}
    \STATE {
    
    ......}
    \REPEAT
    \STATE  .......
    \STATE  ........ %带无标号公式的statement
    \begin{
    
    center}
      \begin{
    
    equation*}
      .......
      \end{
    
    equation*}
    \end{
    
    center}
    \UNTIL{
    
    The given termination criterion is met.}
        \end{
    
    small}
  \end{
    
    algorithmic}
\end{
    
    algorithm}

6. 无标号的排列插入(用于列举)(要显示标号请百度)

\begin{
    
    itemize}
  \item .....
  \item .....
  \item .....
\end{
    
    itemize}

7.公式(这个简单,高级操作百度就行)

\begin{
    
    equation}
........
\label{
    
    eq.4}
\end{
    
    equation}

8.参考文献(使用bib文件)(改动bib编译报错处理方式见8.4)

8.1 参考文献部分的代码为:

\bibliographystyle{
    
    IEEEtran}
\bibliography{
    
    bib文件名}

%%举例 bib叫 hello.bib 代码如下

\bibliographystyle{
    
    IEEEtran}
\bibliography{
    
    hello}

8.2 引用参考文献的代码为 (使用人名/不使用):

%%没有人名只有论文的引用,如 \cite{
    
    论文标签}

%%想要某某某et al的那种引用 Zhang
\textit{
    
    et al.} \cite{
    
    论文标签}

8.3 bib文件创建
这个简单。首先,找到你这次写作用的.tex文件在的文件夹,在那里创建一个记事本,另存为“bib文件名.bib”,属性中选择打开方式为记事本即可。
找bib,请到谷歌#@%¥#@%学术@¥%¥#@镜像@%%@#,或者web of SCI 导出, 或者翻山越岭直接学术。
谷歌#@%¥学术#¥@的bib引用是最好的,没有之一,即使你用menledey搜索之后导出的bib也不行,格式参差不齐的。
把你找到的bib复制到记事本中,一个常见的bib:
%%用遗传算法的文章举个栗子 %%你从学术上复制过来的bib代码,只需要改 GA这里,换成你想要的标签就行,因为你引用的时候也是引用标签的

@article{
    
    GA,  %%论文标签(记得删掉这个 @article{
    
    }中间最好不要有特殊符号)
title={
    
    Genetic algorithms},
author={
    
    Holland, John H},
journal={
    
    Scientific american},
volume={
    
    267},
number={
    
    1},
pages={
    
    66--73},
year={
    
    1992},
publisher={
    
    JSTOR} }

打开这个bib,边写论文边复制引用文献进去就行,只要按一下保存,tex studio就会自动编译这个bib。
8.4 改动bib报错怎么办?
上面说自动编译这个bib,但是结合IEEE 玄学模板+软件日常抽风,会有时候报错,找不到参考文献“没有什么entry”之类的报错。
我们实施三步走战略:
1.点击:工具–》清理辅助文件–》确定
2.点击:构建并编译 (报错不管,等他结束)
3.点击:工具–》命令–》PDFlatex
玄学问题完美解决。再报错,就查代码吧。

9. 作者 (首页作者(天坑问题)、尾页介绍)

9.1 首页作者 (空格一定要用~代替,否则玄学问题)

%% 代码为IEEE trans模板原始的代码
\author{
    
    Michael~Shell,~\IEEEmembership{
    
    Member,~IEEE,}
        John~Doe,~\IEEEmembership{
    
    Fellow,~OSA,}
        and~Jane~Doe,~\IEEEmembership{
    
    Life~Fellow,~IEEE}% <-this % stops a space

%% 此处的空格不是键盘的空格,而要用“~”这个符号。
%%比如他叫:Michael Shell, 打进去就是“Michael~Shell”
%% 可以试一下不用这个,就用空格,你会发现文章莫名其妙第一页是只有一个乱码字符的页面。

9.2 尾页介绍
.jpg要放在和你的.tex一样的文件夹里面
这里的人名就直接空格就OK,没有玄学问题。

%%带照片的人物介绍 %%\includegraphics 里面涉及的尺寸的东西一点都不能改
\begin{
    
    IEEEbiography}[{
    
    \includegraphics[width=1in,height=1.25in,clip,keepaspectratio]{
    
    ***.jpg}}]{
    
    名字}
is.........
\end{
    
    IEEEbiography}

10. 网站插入

%% 插入网页链接包 \usepackage{
    
    url}

\url{
    
    https://github.com.....}  %%插入网站命令

参考文献:IEEE模板使用

猜你喜欢

转载自blog.csdn.net/qq_27353621/article/details/127170340