Notes on writing IEEE LaTeX paper templates (1) Pictures and tables

This article is a record of some problems I encountered while writing and their solutions, for your reference only~

Different IEEE journals have different templates, which can be found at https://template-selector.ieee.org/secure/templateSelector/publicationType .

IEEE templates generally reference the following libraries at the beginning:

\documentclass[lettersize,journal]{IEEEtran}
\usepackage{amsmath,amsfonts}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{array}
\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
\usepackage{textcomp}
\usepackage{stfloats}
\usepackage{url}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage{cite}
\hyphenation{op-tical net-works semi-conduc-tor IEEE-Xplore}

But in actual use, these are not enough, and some of them need to be modified. Let’s look at them one by one.

1. Pictures

When I first started using the IEEE template, the layout of pictures was quite a headache, because the template only had instructions for layout of multiple pictures across columns. The code and pictures are as follows:

\begin{figure*}[!t]
\centering
\subfloat[]{\includegraphics[width=2.5in]{fig1}%
\label{fig_first_case}}
\hfil
\subfloat[]{\includegraphics[width=2.5in]{fig1}%
\label{fig_second_case}}
\caption{Dae. Ad quatur autat ut porepel itemoles dolor autem fuga. Bus quia con nessunti as remo di quatus non perum que nimus. (a) Case I. (b) Case II.}
\label{fig_sim}
\end{figure*}

There are some usages in this picture that I am not used to. Here are some suggestions for you:

1. How to realize the layout of multiple pictures in a single column?

Just remove the * in begin{}. The function of * is to cross the hurdles . At the same time, you need to adjust the size of the picture. The IEEE example gives a width of 2.5 inches. If you want to arrange two pictures side by side in a single column, the width is 1.25 inches, or you can use the command [width=0.5\linewidth], which means 0.5 times the column width. (The coefficient 0.5 here sometimes needs to be adjusted). The effect is as follows:

2. How to adjust the sub-picture label font?

You can see that the small icon font in the IEEE example is strange and not what the blogger wants. You can modify the referenced library and change

\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}

change into:

\usepackage[caption=false,font=footnotesize,labelfont=rm,textfont=rm]{subfig}

Then you can get the following effect:

You can see that the font has been changed to times roman, and it has also become smaller, which is more in line with the blogger's aesthetic.

3. What if there are four pictures?

If you want four pictures to be arranged in a rectangular shape, just add \\ after the first row of pictures to indicate a line break.

\begin{figure}[!t]
\centering
\subfloat[]{\includegraphics[width=0.5\linewidth]{fig1}%
\label{fig_first_case}}
\hfil
\subfloat[]{\includegraphics[width=0.5\linewidth]{fig1}%
\label{fig_second_case}}\\
\subfloat[]{\includegraphics[width=0.5\linewidth]{fig1}%
	\label{fig_first_case1}}
\hfil
\subfloat[]{\includegraphics[width=0.5\linewidth]{fig1}%
	\label{fig_second_case1}}
\caption{Dae. Ad quatur autat ut porepel itemoles dolor autem fuga. Bus quia con nessunti as remo di quatus non perum que nimus. (a) Case I. (b) Case II.}
\label{fig_sim}
\end{figure}

The effect is as shown in the figure:

If you feel that the line spacing between the upper and lower lines of the image is too long, you can also use vspace{} in the code to shorten the distance.

4. What should I do if I want to change the order of subtitles abcd?

As far as the blogger's knowledge is concerned, there seems to be no way to adjust it, except for the order ab\\cd.

5. How to quote pictures and sub-pictures?

In the code, \label{} in the figure environment is the reference label of the picture, such as \label{fig_sim} in the above code; label in the subfloat environment is the label of the subfigure, such as \label{fig_first_case} in the above code. If you want to reference a sub-image, you cannot directly reference the tag of the sub-image. Instead, you need to \ref the image first, and then \subref the sub-image, as shown below:

Fig. \ref{fig_sim}\subref{fig_first_case}

The effect is as follows

2. Form

The table given in the IEEE2023 template is quite strange, as shown in the figure below. Bloggers don't see it in many papers. From a personal point of view, they are not used to it and prefer to use three-line tables.

1. How to make a three-wire meter?

To use a three-line table, you first need to reference the library \usepackage{booktabs}, and then the basic code is as follows

\begin{table} %开始表格环境
	\caption{Table Example}        %表格的标题
	\label{tableexample}           %表格标签
	\begin{center}                 %center表示表格位置居中
		\begin{tabular}{c c c c c} %开始表格,c的数量表示列的数量,c表示居中
			\toprule               %三线表的第一条线
			Title &1&2&2&2\\       %表格第一行,&的位置对齐
			\hline                 %三线表的第二条线,也可以使用\midrule
			lineA &3&4&2&2 \\
			lineB &5&6&2&2\\
			\bottomrule            %三线表的第三条线
		\end{tabular}
	\end{center}
\end{table}

The effect is as shown in the figure

2. How to adjust column width?

The table in the paper should try to fill a full column, and the blogger thinks it is more beautiful. However, the above code does not meet this requirement and is modified as follows:

\begin{table}
	\caption{Table Example}
	\label{tableexample}
	\begin{center}
		\begin{tabular}{p{2cm} p{1cm}<{\centering} p{1cm}<{\centering} p{1cm}<{\centering} p{1cm}<{\centering}}
			\toprule  
			Title &1&2&2&2\\
			\hline
			lineA &3&4&2&2 \\
			lineB &5&6&2&2\\
			\bottomrule
		\end{tabular}
	\end{center}
\end{table}

 p{2cm} means that this column is 2cm wide. The default is left. Adding <{\centering} means centering. The effect is as follows. There is less content in the table, so the look and feel is average. However, in fact, if the table content in the paper is generally more, the look and feel will be better. All tables in this article should be as consistent in width as possible, but this is not a requirement.

 2. How to adjust table row height?

If the row height of the table is slightly small, you can add the following code below \begin{table} to increase the row height. 1.3 represents a multiple of the row height.

\renewcommand\arraystretch{1.3}

The effect is as follows:

If you encounter multiple tables with the same form during the writing process and want to save space, you can merge multiple tables. You only need to add a column in front of the table and mark it with a number.

3. How to reference tables?

Table \ref{tableexample}

Note that Table is spelled out in full, the first letter is capitalized, and there are no small dots after it.

Guess you like

Origin blog.csdn.net/dasnbeast/article/details/131063979