2

I'm writing a paper using the article class, and using 2 figures side-by-side to condense material. I'm using the float package to make distinct figure labels for the appendix, that way appendix figure captions won't show up in the main list of figures. For some reason the first caption doesn't show up in the appendix figures, and the second caption is in the place of the first caption. Any ideas?

\documentclass[letterpaper,11pt]{article}
\usepackage{float}
\newfloat{figurea}{htbp}{lofa}[section]
\floatname{figurea}{Figure}
\usepackage{caption}
\captionsetup{labelsep=period,font=small,labelfont=bf,aboveskip=2ex,belowskip=0ex}
\usepackage[title]{appendix}

\begin{document}

\listoffigures
\section{Figures in main body}
\begin{figure}[htb]
  \begin{minipage}[b]{0.48\textwidth}
    \centering
    \framebox[\textwidth]{First fig}
    \caption{First fig.}
    \label{fig1}
  \end{minipage}
  \hfill
  \begin{minipage}[b]{0.48\textwidth}
    \centering
    \framebox[\textwidth]{Second fig}
    \caption{Second fig.}
    \label{fig2}
  \end{minipage}
\end{figure}

\begin{appendices}
\section{Figures in appendix}
\begin{figurea}[htb]
  \begin{minipage}[b]{0.48\textwidth}
    \centering
    \framebox[\textwidth]{First figa}
    \caption{First figa.}
    \label{figa1}
  \end{minipage}
  \hfill
  \begin{minipage}[b]{0.49\textwidth}
    \centering
    \framebox[\textwidth]{Second figa}
    \caption{Second figa.}
    \label{figa2}
  \end{minipage}
\end{figurea}
\end{appendices}

\end{document}
1

Use a float package that is fully supported by caption - newfloat:

enter image description here

\documentclass{article}

\usepackage{newfloat}
\DeclareFloatingEnvironment[
  fileext = lofa,
  placement = htbp,
  name = Figure,
  within = section
  ]{figurea}
\usepackage{caption}
\captionsetup{labelsep=period,font=small,labelfont=bf,aboveskip=2ex,belowskip=0ex}
\usepackage[title]{appendix}

\begin{document}

\listoffigures
\section{Figures in main body}
\begin{figure}[htb]
  \begin{minipage}[b]{0.48\textwidth}
    \centering
    \framebox[\textwidth]{First fig}
    \caption{First fig.}
  \end{minipage}
  \hfill
  \begin{minipage}[b]{0.48\textwidth}
    \centering
    \framebox[\textwidth]{Second fig}
    \caption{Second fig.}
  \end{minipage}
\end{figure}

\begin{appendices}
\section{Figures in appendix}
\begin{figurea}[htb]
  \begin{minipage}[b]{0.48\textwidth}
    \centering
    \framebox[\textwidth]{First figa}
    \caption{First figa.}
  \end{minipage}
  \hfill
  \begin{minipage}[b]{0.49\textwidth}
    \centering
    \framebox[\textwidth]{Second figa}
    \caption{Second figa.}
  \end{minipage}
\end{figurea}
\end{appendices}

\end{document}
0

A solution with floatrow. Note float has to be loaded after floatrow (or replaced with it):

\documentclass[letterpaper,11pt]{article}
\usepackage{floatrow}%
\DeclareNewFloatType{figurea}
{placement=htbp, name=Figure, within=section, fileext=lofa}
\renewcommand\thefigurea{\arabic{figurea}}
\newfloatcommand{ffigabox}{figurea}[\nocapbeside][]
\usepackage{caption}
\captionsetup{labelsep=period,font=small,labelfont=bf,aboveskip=2ex,belowskip=0ex}
\usepackage[title]{appendix}

\usepackage{float}
 \begin{document}

\listoffigures

\section{Figures in main body}

\begin{figure}[!ht]
 \begin{floatrow}
\ffigbox{\caption{First fig.} \label{fig1}}{\framebox[0.48\textwidth]{First fig}}
 \ffigbox{\caption{Second fig.} \label{fig2}}{\framebox[0.48\textwidth]{Second fig}}
 \end{floatrow}
\end{figure}

\begin{appendices}

\section{Figures in appendix}

\begin{figurea}[htb]
  \begin{floatrow}%
    \ffigabox{\caption{First figa.} \label{figa1}}{\framebox[0.48\textwidth]{First figa}}
    \ffigabox{ \caption{Second figa.} \label{figa2}}{\framebox[0.48\textwidth]{Second figa}}
  \end{floatrow}
\end{figurea}
\end{appendices}

\end{document} 

enter image description here

Your Answer

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

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