[Tex/LaTex] ieeetran caption question

captionsfloatsieeetran

In the ieeetran how to, they are using caption with their examples; however, latex tells me not to use caption.

So if I use subfloat, all my figures are labeled as such (a), (b) and don't have a main label Figure:1. In order to get the main label, I would need to use caption.

How can I change the label from (a) to figure 1 without using caption?

\documentclass[journal]{IEEEtran}
\uspackage{subfig, float, wrapfig}
\begin{document}
\begin{figure}
\centering
\subfloat{picture}
\label{}
\end{figure}
\end{document}

Best Answer

I have mentioned it a few times before but IEEE does not directly use your .tex file. It's there to supply the bare minimal so if it looks like an article it's enough. It doesn't have to be following the standards internally.

They will recode your article with their own terrible terrible workflow, rasterize your images and ruin your math after acceptance. I've been using the following for a couple of years without any issues. It uses subcaption and does a superb job even though it has a command clash due to the redefinitions.

\documentclass[final]{ieeetran}
\usepackage{tikz,lipsum}
\usepackage[labelformat=simple]{subcaption}

% Training subcaption package to comply with
% IEEE standards. We can ignore the warning
% generated by caption.sty which is due to 
% the redefinition of \@makecaption
\DeclareCaptionLabelSeparator{periodspace}{.\quad}
\captionsetup{font=footnotesize,labelsep=periodspace,singlelinecheck=false}
\captionsetup[sub]{font=footnotesize,singlelinecheck=true}
\renewcommand\thesubfigure{(\alph{subfigure})}

\title{My title}
\author{my author}

\begin{document}
\maketitle
\begin{abstract}
\lipsum*[1]
\end{abstract}

\lipsum[2-5]
\begin{figure}
\begin{subfigure}[b]{.6\linewidth}
\centering%
\begin{tikzpicture}
\draw[help lines] (-1,-1) grid (1,2);
\end{tikzpicture}
\caption{A caption}
\label{fig:a}
\end{subfigure}%
\begin{subfigure}[b]{.4\linewidth}
\centering%
\begin{tikzpicture}
\draw[help lines] (-1,-1) grid (1,2);
\end{tikzpicture}
\caption{B cap}
\label{fig:b}
\end{subfigure}
\caption{Two figures.}\label{fig:1}
\end{figure}
\end{document}

enter image description here

If you only want the caption labels leave the sub \caption{} definitions empty and describe the subfigures in the main caption. If you want to remove also the (a),(b) use \phantomcaption commands as described in the manual.

Related Question