Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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[caption]{picture}
\label{}
\end{figure}
\end{document}
share|improve this question
    
LaTeX tells you not to use \caption? You can, even in ieeetran. When I add \caption{A caption} to your MWE, I obtain Fig 1. A caption. Or is it that you don't want to use \caption but \subfloat instead? –  Werner May 9 '13 at 16:08
    
It seems to me you are mixing the caption package and the \caption command. Of course you can use \caption but should not use the caption package since it is incompatible to the IEEEtran document class. So better replace \usepackage{subfig} with \usepackage[caption=false]{subfig} to prevent loading the caption package. –  Axel Sommerfeldt May 9 '13 at 16:09
    
@AxelSommerfeldt I am not using the caption package and I get the latex warning with \caption –  dustin May 9 '13 at 16:13
1  
@dustin You are using the caption package since \usepackage{subfig} does load it unless you say \usepackage[caption=false]{subfig}. The warning you get does not come from LaTeX itself but from the caption package. –  Axel Sommerfeldt May 9 '13 at 17:34
    
@AxelSommerfeldt post your comment as a solution. You fixed the problem. –  dustin May 10 '13 at 18:03

2 Answers 2

up vote 6 down vote accepted

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.

share|improve this answer
    
I have used your above code to redefine the captions for figures. The captions for tables –  J Spen Oct 25 '13 at 7:02
    
I have used your above code to be able to use the subcation class with IEEEtran and get the same figure captions. The subcaption class also redefines the table caption so can you provide the code for the correct table caption or inform me how I can find it? I have all my other documents using subcaption package so much easier than changing everything over to use the subfig package. –  J Spen Oct 25 '13 at 7:05
    
if you need an example let me know but can just look at any IEEE journal with a table caption and what you get is a table caption that is the same type as the figure caption. –  J Spen Oct 25 '13 at 7:06
    
This seems to be the right settings for the table caption: \captionsetup[table]{format=plain,labelformat=simple,justification=centering, labelsep=newline, singlelinecheck=false, textfont={sc}}. Do you have something similar?? Also I noticed another issue of the table and figures not lining up to text at the top of the pages. They align maybe 0.2 or 0.3 cms above the text. This is not supposed to be the case as it should line up evenly with the text. Do you know how to set the margins so the figures line up correctly? –  J Spen Oct 25 '13 at 7:41
    
@JSpen That's a known issue. you don't need to worry about it because IEEE will fix stuff by themselves. I'll check the table settings when I have the chance in the meantime I have this answer for a reasoning about why you don't need to make it perfect tex.stackexchange.com/a/89790/3235 –  percusse Oct 25 '13 at 9:10

According to http://www.michaelshell.org/tex/ieeetran/ the following code may be used in the preamble.

\makeatletter
\let\MYcaption\@makecaption
\makeatother

\usepackage[font=footnotesize]{subcaption}

\makeatletter
\let\@makecaption\MYcaption
\makeatother
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.