In the IEEE Transactions template, there is a conflict between the subfig package and the fontenc package, how to solve it?

In the IEEE Transactions template, there is a conflict between the subfig package and the fontenc package, how to solve it?

    This article records how to solve the conflict between the subfig package and the fontenc package in the IEEE Transactions template.

1. Font display problem

    In the template of IEEE Transactions, in the template downloaded from the official website, the font display is as follows, which is different from the font in the actual paper published by IEEE.
insert image description here
    In order to make the display of the font consistent with the published paper, the following line needs to be added to the latex file:

    \usepackage[T1]{fontenc}

    After adding the above line, the font of the text is displayed as follows:
insert image description here

2. Package conflict problem description

     In the latex file, if you want to use subfigthe package to display the subgraph, you need to use the following package in the latex file:
     \usepackage{subfig}
    But the problem is, if you use both \usepackage{subfig}and \usepackage[T1]{fontenc}later, you will find that the title of the table in the IEEE transaction template And the title of the picture, the fonts of these two parts have changed, that is, \usepackage[T1]{fontenc}the effect of the modified fonts is invalid. At this time, in order to solve this problem, you need to delete \usepackage{subfig}this line and add the following two lines of code:

     \usepackage[caption=false,farskip=0pt,labelfont={bf}]{subfig}

     \usepackage[T1]{fontenc}

     When displayed correctly, table titles and figure titles look like this:
insert image description here

\usepackage{subfig}When a conflict with the package      occurs \usepackage[T1]{fontenc}, the font falls back to Times New Roman, and the titles of figures and tables are displayed as follows:
insert image description here

     At this time, the code to realize the submap display is as follows:

\begin{
    
    figure}[!t]
	\centering
	\subfloat[]{
    
    \includegraphics[width=1.1in]{
    
    1.png}
	\label{
    
    1}}
	% \hfil
	\subfloat[]{
    
    \includegraphics[width=1.1in]{
    
    2.png}%
    \label{
    
    2}}
    % \hfil
    \subfloat[]{
    
    \includegraphics[width=1.1in]{
    
    3.png}%
	\label{
    
    3}}
    \caption{
    
    An example of image .}
	\label{
    
    image1}
\end{
    
    figure}

Online references:

Guess you like

Origin blog.csdn.net/weixin_43981621/article/details/131405551