Latex相关——IEEE英文模板

1、参考文献

可以从外部引入参考文献,不用在latex模板中一个个添加,容易格式出错导致引用参考文献处出现“?”。

1.1 制作.bib文件

参考链接:https://blog.csdn.net/tmylzq187/article/details/51355261
例如:
在这里插入图片描述

1.2 slatex模板中引入.bib文件

在 \end{document} 前面加上下面两句:

\bibliographystyle{IEEEtran}//默认为plain
\bibliography{ref} //ref是自己的bib文件

1.3 文中引用文献

\cite{ref1}

注意:一开始点击 ”pdfLaTex“ 运行时,文章引用文献的地方会变成 “[?]”。需要先点击 “BibTex”,生成一些拓展文件,再点击 " pdfLaTex"运行 即可

2、TeXworks注释快捷键

(1)多行注释:ctrl+shift+]
(2)取消多行注释:ctrl+shift+[

3、插入图片

3.1 半栏:单张图片

\begin{figure}[htbp]
\centerline{\includegraphics{unnorm2.png}}
\caption{Example of a figure caption.}
\label{fig}
\end{figure}

效果:
在这里插入图片描述

3.2 半栏:两图并列

\begin{figure}[htbp]	%半栏中两图并列
    \subfigure{
       \centering
        \includegraphics[width=0.23\textwidth]{unnorm2.png}
    }\subfigure{
        \centering
        \includegraphics[width=0.23\textwidth]{unnorm3.png}
    }
	\caption{ Comparison between the original image and its low-frequency and high-frequency components after haar wavelet transform. The ImageNet 2012 validation dataset was used in the experiment.}
\end{figure}

效果:
在这里插入图片描述

3.3 不分栏:单张图片

\begin{figure*}[htb]
\centering
\includegraphics{unnorm2.png}
\caption{Comparison between the original image and its low-frequency and high-frequency components after haar wavelet transform. The ImageNet 2012 validation dataset was used in the experiment}
\label{Figure}
\end{figure*}

效果:
在这里插入图片描述

3.4 不分栏:多张图片并列

\begin{figure*}[htb]
\centering
\includegraphics[scale=0.8]{unnorm2.png} %可通过scale设置图片尺寸
\includegraphics{unnorm2.png}
\caption{Comparison between the original image and its low-frequency and high-frequency components after haar wavelet transform. The ImageNet 2012 validation dataset was used in the experiment}
\label{Figure}
\end{figure*}

效果:
在这里插入图片描述

3.5 不分栏:多行多列图片,仅在最下面那行的图片下方添加文字

\begin{figure*}[htb]
	\centering
	\subfigure{
		\begin{minipage}[t]{0.23\linewidth}
			\centering
			\includegraphics[width=1\linewidth]{unnorm2.png}
		\end{minipage}
	}
	\subfigure{
		\begin{minipage}[t]{0.23\linewidth}
			\centering
			\includegraphics[width=1\linewidth]{input_ll2.png}
		\end{minipage}
	}
	\subfigure{
		\begin{minipage}[t]{0.23\linewidth}
			\centering
			\includegraphics[width=1\linewidth]{input_high2.png}
		\end{minipage}
	}
	%想让上面三张图片单独一行,需要加一行空白行,表示下面的图片另起一行。即便上面的图片尺寸小,也不会自动将下面的图片添加到第一行末尾

	\setcounter{subfigure}{0} %清零,从 a 重新编号。
	\subfigure[Original image]{
		\begin{minipage}[t]{0.23\linewidth}
			\centering
			\includegraphics[width=1\linewidth]{unnorm3.png}
		\end{minipage}
	}
	\subfigure[Low-frequency]{
		\begin{minipage}[t]{0.23\linewidth}
			\centering
			\includegraphics[width=1\linewidth]{input_ll3.png}
		\end{minipage}
	}
	\subfigure[High-frequency]{
		\begin{minipage}[t]{0.23\linewidth}
			\centering
			\includegraphics[width=1\linewidth]{input_high3.png}
		\end{minipage}
	}
	\caption{Comparison between the original image and its low-frequency and high-frequency components after haar wavelet transform. The ImageNet 2012 validation dataset was used in the experiment}
	\label{Figure}
\end{figure*}

效果:
在这里插入图片描述

3.5 图片标题caption居中(换行居中)显示

(1)添加宏包

\usepackage{caption}
\captionsetup[figure]{font={small},singlelinecheck=false}

(2)图片标题

	\caption{\centering{Comparison between the original image and its low-frequency and high-frequency components after haar wavelet transform.\\The ImageNet 2012 validation dataset was used in the experiment}}

(3)前后效果对比
前:\centering{} 中使用 \\ 会报错,如果去掉 \centering{},则效果为左对齐(未居中)
在这里插入图片描述
后:
在这里插入图片描述

4、添加邮箱

(1)添加宏包:

\usepackage{hyperref}		%添加邮箱时使用

(2)用法

\href{mailto:xxx@xxx.com}{E-mail:xxx@xxx}

完整示例:

\title{Paper Title}

\author{\IEEEauthorblockN{Author1\textsuperscript{1},Author2\textsuperscript{2},Author3\textsuperscript{*}}
\IEEEauthorblockA{\textit{1. Address1}
\href{mailto:xxx@xxx.com}{E-mail:xxx@xxx}} %此处添加邮箱
\IEEEauthorblockA{\textit{2. Address2}}
\IEEEauthorblockA{*	Correspondence:\href{mailto:xxx@xxx}{xxx@xxx}}
}
\maketitle

效果:
在这里插入图片描述

5、latex绘制表格

在线绘制表格,再将相应的latex代码复制粘贴
在这里插入图片描述
别忘了添加宏包:\usepackage{booktabs}

5.1 可能出现的问题

5.1.1 表格不居中

% Please add the following required packages to your document preamble:
% \usepackage{booktabs}
\begin{table}[]
\begin{tabular}{@{}cccc@{}}
\toprule
class & math & chinese & english \\ \midrule
1     & 77   & 90      & 89      \\
2     & 82   & 87      & 91      \\
3     & 87   & 88      & 84      \\ \bottomrule
\end{tabular}
\caption{Table test}
\label{tab:my-table}
\end{table}

![在这里插入图片描述](https://img-blog.csdnimg.cn/2d6b14d395b943dda9f13e2637341e1b.png

解决方法:添加 \centering

% Please add the following required packages to your document preamble:
% \usepackage{booktabs}
\begin{table}[]
\centering %使表格居中显示
\begin{tabular}{@{}cccc@{}}
\toprule
class & math & chinese & english \\ \midrule
1     & 77   & 90      & 89      \\
2     & 82   & 87      & 91      \\
3     & 87   & 88      & 84      \\ \bottomrule
\end{tabular}
\caption{\centering{Table test}}
\label{tab:my-table}
\end{table}

效果:
在这里插入图片描述

5.2 希望表格跨两栏显示

解决方法:将

\begin{table}[]
……
\end{table}

改成:

\begin{table*}[]
……
\end{table*}

效果:
在这里插入图片描述

5.3 缩放表格尺寸

使用 \scalebox{缩放倍数} 将表格内容包起来
完整代码:

\begin{table*}[]
\centering %使表格居中显示
\scalebox{3}{ %控制表格缩放
	\begin{tabular}{@{}cccc@{}}
	\toprule
	  & content1 & content2 & content3 \\ \midrule
	a & 11       & 12       & 13       \\
	b & 21       & 22       & 23       \\
	c & 31       & 32       & 33       \\ \bottomrule
	\end{tabular}
}
\caption{\centering{Table test}}  %\centering 使得表格标题居中显示
\label{tab:my-table}
\end{table*}

效果:
在这里插入图片描述

5.4 添加竖线

解决方法:修改

 \begin{tabular}{@{}cccc@{}} 

为:

  \begin{tabular}{@{}|c|ccc|@{}}  %要在哪里分割就在哪里画竖线。

完整代码:

% Please add the following required packages to your document preamble:
% \usepackage{booktabs}
\begin{table*}[]
\centering %使表格居中显示
\scalebox{3}{ %控制表格缩放
   \begin{tabular}{@{}|c|ccc|@{}} %要在哪里分割就在哪里画竖线
   \toprule
   class & math & chinese & english \\ \midrule
   1     & 77   & 90      & 89      \\
   2     & 82   & 87      & 91      \\
   3     & 87   & 88      & 84      \\ \bottomrule
   \end{tabular}
}
\caption{\centering{Table test}}
\label{tab:my-table}
\end{table*}

效果:
在这里插入图片描述

5.5 表格交叉线有空隙

解决方法:将所有的 \toprule \midrule \bottomrule 都改成 \hline
完整代码:

% Please add the following required packages to your document preamble:
% \usepackage{booktabs}
\begin{table*}[]
\centering %使表格居中显示
\scalebox{3}{ %控制表格缩放
	\begin{tabular}{@{}|c|ccc|@{}} %要在哪里分割就在哪里画竖线
	\hline %去除交叉线空隙
	class & math & chinese & english \\ \hline %去除交叉线空隙
	1     & 77   & 90      & 89      \\
	2     & 82   & 87      & 91      \\
	3     & 87   & 88      & 84      \\ \hline %去除交叉线空隙
	\end{tabular}
}
\caption{\centering{Table test}}
\label{tab:my-table}
\end{table*}

效果:
在这里插入图片描述
\hline 所带来的问题:替换成\hline 之后,行高变小,表格内容紧贴着框线,不顾美观,如下:
在这里插入图片描述
解决方法:手动设置行高
关键代码:

\renewcommand\arraystretch{行高} %设置表格行高

完整代码:

% Please add the following required packages to your document preamble:
% \usepackage{booktabs}
\begin{table*}[]
\renewcommand\arraystretch{2} %设置表格行高
\centering %使表格居中显示
	\begin{tabular}{@{}|c|ccc|@{}} %要在哪里分割就在哪里画竖线
	\hline %去除交叉线空隙
	class & math & chinese & english \\ \hline %去除交叉线空隙
	1     & 77   & 90      & 89      \\
	2     & 82   & 87      & 91      \\
	3     & 87   & 88      & 84      \\ \hline %去除交叉线空隙
	\end{tabular}
\caption{\centering{Table test}}
\label{tab:my-table}
\end{table*}

效果:
在这里插入图片描述

  • 10
    点赞
  • 84
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值