1

I am transforming a paper from \documentclass[Journal]{IEEEtran} to \documentclass{ifacconf}. There is no problem with IEEE version although in this new version if I use \usepackage{subfig} the caption becomes vertical and appears one-word-in-a-line. When I use \usepackage{subfig} the result is: enter image description here

and when I don't, the result is: enter image description here

I have to use subfig because I have subfloat in my writing which cannot compile without it. I have tried \usepackage[caption=false]{subfig}.

ADDED! Here is a sample of what I am trying to do:

\documentclass{ifacconf}
\usepackage{subfig}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{amsmath}
\usepackage[table]{xcolor}
\usepackage{graphicx}      % include this line if your document contains figures
\usepackage{graphics}
\usepackage{natbib}        % required for bibliography
%=============table
\usepackage{tikz}
\usepackage{pgf}
\usepackage{tikz}
\usepackage{graphicx}
\usetikzlibrary{arrows,automata}
\usepackage{booktabs}
\usepackage{float}
\usepackage[utf8]{inputenc}

\definecolor{mycolor}{RGB}{0, 85, 128}    % maybe too dark?
\definecolor{mycolor1}{RGB}{4, 5, 31}
\definecolor{line1}{RGB}{224, 224, 209}
\definecolor{line2}{RGB}{253, 198, 199}
\definecolor{grayover}{RGB}{163, 163, 194}
\definecolor{line3}{RGB}{117, 117, 163}
\definecolor{line4}{RGB}{224, 224, 209}
\definecolor{line5}{RGB}{140, 179, 217}
\definecolor{ruler}{RGB}{182, 177, 175}

%\arrayrulecolor{mycolor}
\setlength{\arrayrulewidth}{0.5mm}
\setlength{\tabcolsep}{4pt}     % 18pt seems extravagant
\renewcommand{\arraystretch}{2.5} % 2.5 seems excessive
\usepackage{tikz}
\def\checkmark{\tikz\fill[scale=0.4](0,.35) -- (.25,0) -- (1,.7) -- (.25,.15) -- cycle;}
\usepackage{tabularx,ragged2e}
\newcolumntype{C}{>{\Centering\arraybackslash\hspace{0pt}}X}
\newcolumntype{s}{>{\raggedright}p{5cm}}

%=============table
%===============================================================================
\begin{document}
    \section{Sec 1}
    \clearpage
    \begin{table*}[]
        \centering
        \caption{Recent Research Contributions in Parallel and Distributed Simulation - Summary}
        \label{table:tab1}
        \resizebox{\linewidth}{!}{%
            \begin{tabular}{rcccccl}

            \end{tabular}}%
        \end{table*}%
    \clearpage

\section{Figures }
    \begin{figure*}[!htbp]
        \centering
        \subfloat[caption for this]{\label{fig:A}
            \resizebox{6.5cm}{!}{
                \begin{tikzpicture}[auto,node distance=2.8cm,thick]
                %A tik picture that works fine goes here
                \end{tikzpicture}
            }
        }%
        %\hfill 
        \subfloat[caption for this]{\label{fig:B}
            \resizebox{5cm}{!}{
                \begin{tikzpicture}[auto,node distance=2.8cm,thick]
                %another tikz picture here
                \end{tikzpicture}
            }
        }%
        \hfill 

        \subfloat[Select the pair of processes with maximum edge cost, insert in queue (B,C)]{\label{fig:C}
            \resizebox{6.5cm}{!}{
                \begin{tikzpicture}[auto,node distance=2.8cm,thick]
                %and another here
                \end{tikzpicture}
            }
        }%
        \hfill
        \newline
        \hfill
        \caption{Execution Model}\label{fig:G}
        \end{figure*}
    \end{document}

The document template can be downloaded from this link

  • @TorbjørnT. the work is related to my thesis so I refrain from posting it. But \subfloat is working fine in the first paper – Saad May 14 '18 at 11:18
  • I deleted my comment because I realized this wasn't about a \subfloat. a) You shouldn't post the whole thing in the first place, only the what is needed to reproduce the problem. For example \documentclass{ifacconf} \usepackage[caption=false]{subfig} \usepackage{natbib} \begin{document} \begin{table} \caption{foo bar baz} \begin{tabular}{c} a \end{tabular} \end{table} \end{document} b) Replace the content with dummy text if you don't want to show the content. c) A link to where ifacconf.cls can be downloaded should be included in the question. – Torbjørn T. May 14 '18 at 11:23
  • ok let me edit it with complete details – Saad May 14 '18 at 11:24
  • @TorbjørnT. please take a look at the updates – Saad May 14 '18 at 11:41
  • 1
    You should test your example before posting, that one gives a Package graphics Error: Division by 0. because the tabular in your \resizebox is empty. But the \resizebox and tabular isn't really needed in the first place, you can just remove it. – Torbjørn T. May 14 '18 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.