# Problem compiler error about figure/subfigure ' caption using latex IEEE ACCESS template

In IEEE ACCESS template latex file, there is a example code of "\Figure", when inserting pictures into paper.

But I want to use figure and subfigure environment to fit my requirement. So I add usepackage of "subfigure" and "caption", except for losing figure's caption color it works well. If I cancel the usagepackage of "caption", compiler error occurs: "Undefined control sequence. \caption{Universe}"

How I can use figure and subfigure which shows correctly and normally(with color caption) in my paper? (I am using MikTex and Texstudio in Windows10)

Following is the source code of latex file and error picture.

IEEE ACCESS template is here.

latex source code:

% !TeX spellcheck = en_US
\documentclass{ieeeaccess}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithm}
\usepackage{algorithmic}

\usepackage{graphicx}
\usepackage{subfigure}  % support sub-figure

% compiler error without following two lines
%\usepackage{caption,setspace}
%\captionsetup{font={small,stretch=0.80}}

\usepackage{textcomp}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}

\begin{document}

\begin{abstract}

hese instructions give you guidelines for preparing papers for
IEEE Access. Use this document as a template if you are
using \LaTeX. Otherwise, use this document as an
instruction set.
\end{abstract}

\begin{keywords}
Figure, Float, SubFigure

\end{keywords}

\titlepgskip=-15pt

\section{Introduction}
\label{sec:introduction}

\PARstart{T}{his} document is a template for \LaTeX. If you are
electronic file \ref{fig:universe}.

\begin{figure}[h!]
\centering
\includegraphics[scale=1.0]{universe.jpg}
\caption{Universe}
\label{fig:universe}
\end{figure}

\EOD

\end{document}

• Welcome to TeX.SE! – Cragfelt Dec 16 '17 at 1:28
• Are you forced by a journal using that class? If yes, I think they will not accept papers not using there template, so do not change it ... Ask if you are allowed to change the template ... – Mensch Dec 17 '17 at 1:58
• subfigure is obsolete for over ten years. – Johannes_B Dec 24 '17 at 7:54

If you are allowed to change the template, you can use the labelfont key in \captionsetup to set the color. Finding the latter took some digging in the code of the class. I also took the freedom to set the fonts according to the template (sf and bf).

The code:

% !TeX spellcheck = en_US
\documentclass{ieeeaccess}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
%\usepackage{algorithm}
%\usepackage{algorithmic}

\usepackage{graphicx}
\usepackage{subfigure}  % support sub-figure

% compiler error without following two lines
\usepackage{caption,setspace}
\captionsetup{font={sf,small,stretch=0.80},labelfont={bf,color=accessblue}}

\usepackage{textcomp}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}

\begin{document}

\begin{abstract}

hese instructions give you guidelines for preparing papers for
IEEE Access. Use this document as a template if you are
using \LaTeX. Otherwise, use this document as an
instruction set.
\end{abstract}

\begin{keywords}
Figure, Float, SubFigure

\end{keywords}

\titlepgskip=-15pt

\section{Introduction}
\label{sec:introduction}

\PARstart{T}{his} document is a template for \LaTeX. If you are
electronic file \ref{fig:universe}.

\begin{figure}[h!]
\centering
\includegraphics[scale=0.2]{example-image.png}
\caption{Universe}
\label{fig:universe}
\end{figure}

\Figure[h]()[scale=0.2]{example-image.png}{Universe}

\EOD

\end{document}

• subfigure is obsolete package.its supersede is subfig. or use subcaption. – Zarko Dec 17 '17 at 18:13

They provide a new command to handle the images in IEEE Access. I show you an example.

\Figure[!t]()[width=0.95\textwidth]{imageName}
{Caption.\label{fig:label}}


This command puts the image using two columns or one column automatically. It depends on the figure's dimension. If it is lower than 50%, the figure is put in one column, else in two columns.

• How can I centre the figure? – Mohamed Dec 6 '18 at 4:54
• it is not need to centre the figure, in the ieee access style file is pre-defined to be centered. For instance, all my images are centered in my document using the \Figure command without using \centering command – Pedro A. Marin-Reyes Dec 20 '18 at 9:58
• This is good for single images, but I don't there exist a preset thing for subfigures yet. – Laurens Meeus Feb 25 '19 at 16:50

for plotting subfigures i used the code in the IEEE access template and it works. I included the following packages

\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage[caption=false]{subfig}
\usepackage{caption,setspace}
\captionsetup{font={sf,small,stretch=0.80},labelfont={bf,color=accessblue}}
\usepackage{textcomp}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}

\begin{figure*}[!t]
\centering
%\vspace*{-.02in}
\subfloat[Performance comparison when x=t]{
\hspace*{-.1in}
\includegraphics[scale=0.33]{fig1.pdf}
\hspace*{-.1in}
\includegraphics[scale=0.33]{fig2.pdf}
\label{p_D_req_100}
}
%   \vspace*{-.14in}
\hfill
\subfloat[Performance comparison when x=u]{
\hspace*{-.1in}
\includegraphics[scale=0.33]{fig3.pdf}
\hspace*{-.1in}
\includegraphics[scale=0.33]{fig4.pdf}
\label{p_D_req_400}
}
%   \vspace*{-.14in}
\hfill
\subfloat[Performance comparison when x=z]{
\hspace*{-.1in}
\includegraphics[scale=0.33]{fig5.pdf}
\hspace*{-.1in}
\includegraphics[scale=0.33]{fig6.pdf}
\label{p_D_req_1000}
}
\caption{the EE (left) and  xxxx  (right) of cat cat cat load.}
\label{fig:p_graph}
\end{figure*}


According to Section IV.I.2 of the IEEE Access template,

Multipart figures should be combined and labeled before final submission. Labels should appear centered below each subfigure in 8 point Times New Roman font in the format of (a) (b) (c).

Such a subfigure feature is not supported by IEEE Access template.