[Tex/LaTex] How to add subfigures in a poster

a0postersubfloats

I am making a scientific poster in Latex. The code is working fine if I am working with single figures but as soon as I am adding subfigures (figures side by side), I am getting several errors at once. The code to include subfigures is correct since I verified it by taking it in an a4 sheet only. The Latex code I am using is as follows

\documentclass[portrait,a0]{sciposter}
    \usepackage{amsmath}
    %\usepackage{subfig}
   \usepackage{array}
   \usepackage{braket}
   \usepackage[pdftex]{graphicx}
   \usepackage{epstopdf}
\usepackage{caption}
\usepackage{subcaption}
\captionsetup{compatibility=false}
%\usepackage{subfloat}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{sectionbox}


\renewcommand{\titlesize}{\Huge}
\renewcommand{\authorsize}{\Large}
\renewcommand{\instsize}{\large}

\title{title}
\author{name}
\institute{nameinst}
\email{jvlfvj} 

\leftlogo[1]{logo.jpg}
\conference{Open Poster Presentation}

\begin{document}

\maketitle

\renewcommand{\fontpointsize}{15pt}

\begin{multicols}{3}

\begin{figure}
\centering
\includegraphics[width=\textwidth]{ers.png}
 \caption{diagram}
  \end{figure}

  \begin{figure}
  \centering
  \begin{subfigure}{0.3\textwidth}
  \centering
  \includegraphics[width=0.9\textwidth]{uvw.eps}
   \caption{a}
   \end{subfigure}%
   \begin{subfigure}{0.3\textwidth}
   \centering
  \includegraphics[width=0.9\textwidth]{xyz.eps}
  \caption{b}
  \end{subfigure}%
  \begin{subfigure}{0.3\textwidth}
  \centering
  \includegraphics[width=0.9\textwidth]{abc.eps}
  \caption{c}
  \end{subfigure}
  \caption{fig}
  \end{figure}

  \end{multicols}

  \end{document}

I have tried various combinations of the packages given in preamble. I don't know where I am going wrong. Please help.

Best Answer

"When all else fails, read the manual." Sciposter redefines the figure environment, \caption and \subfigure. However, \subfigure is implemented as a tabular, not a minipage. Also, it uses subfig instead of subfigure as a counter, but \captionof doesn't know what to do with subfig.

So to get the captions to work right, I went back to figure and caption, but used minipage and created \subcaption for subfigures.

Just for fun, I also created a subfigure environment. When not creating a list of figures, it's probably the most trivial environment in existence.

cropped poster

\documentclass[portrait,a0]{sciposter}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\usepackage{multicol}
\usepackage{mwe}% for example images

\newcommand{\subcaption}[1]% %1 = text
{\refstepcounter{subfig}%
\par\vskip\abovecaptionskip
\centerline{\textbf{(\alph{subfig})} #1}%
\vskip\belowcaptionskip\par}

% create subfigure environment
\def\subfigure{\let\oldcaption=\caption
\let\caption=\subcaption
\minipage}
\def\endsubfigure{\endminipage
\let\caption=\oldcaption}

\renewcommand{\titlesize}{\Huge}
\renewcommand{\authorsize}{\Large}
\renewcommand{\instsize}{\large}

\leftlogo[1]{example-image}
\conference{Open Poster Presentation}

\title{title}
\author{name}
\institute{nameinst}
\email{jvlfvj} 

\begin{document}

\maketitle

\renewcommand{\fontpointsize}{15pt}
\begin{multicols}{3}
\begin{figure}
 \includegraphics[width=\textwidth]{example-image}
 \caption{diagram}
\end{figure}

\begin{figure}
 \centering
 \begin{subfigure}{0.3\textwidth}
  \centering
  \includegraphics[width=0.9\textwidth]{example-image-a}
  \caption{a}
 \end{subfigure}\hfil
 \begin{subfigure}{0.3\textwidth}
  \centering
  \includegraphics[width=0.9\textwidth]{example-image-b}
  \caption{b}
 \end{subfigure}\hfil
 \begin{subfigure}{0.3\textwidth}
  \centering
  \includegraphics[width=0.9\textwidth]{example-image-c}
  \caption{c}
 \end{subfigure}%
  \caption{fig}
\end{figure}

\lipsum[1-6]
\end{multicols}
\end{document}