2

I would like to show a caption above a figure. I looked around for some solutions, but I still can not achieve my goal.

This is my code:

   \documentclass[12]{article}

\usepackage{fullpage}
\usepackage[nottoc]{tocbibind}
\usepackage{url}
\usepackage{xpatch} 
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{enumerate}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{gensymb}
\usepackage{caption}
\usepackage[round]{natbib}
\usepackage{pdfpages}
\usepackage{geometry}
\usepackage{wrapfig}
\usepackage{floatrow}
\usepackage{float}
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}

\begin{document}

\begin{titlepage}
.
.
.
\end{titlepage}
.
.
.
 \begin{table} [H]
                \caption{Summary of the Proctor compaction test results.}
                 \includegraphics[scale=0.80]{Excel_table.png}
    \end{table}

\end {document}

However, the caption still displays below the graphics. Can someone please help me?

Thank you!

2
  • 2
    the default is for the caption to appear exactly where you place \caption so if it is appearing below the figure you (or your class file) must have specified that but you have shown no relevant code so it is hard to help Commented Sep 17, 2016 at 21:30
  • Hi David, I have included the packages I am using.
    – CivilSigma
    Commented Sep 17, 2016 at 21:33

1 Answer 1

7

binary chop on your package list soon shows that this is a feature of floatrow if you do not include that package, the caption is above the image.

\documentclass[12]{article}


\usepackage{graphicx}




%\usepackage{floatrow}
\usepackage{float}


\begin{document}


 \begin{table} [H]
                \caption{Summary of the Proctor compaction test results.}
                 \includegraphics[scale=0.80]{example-image}
    \end{table}

\end {document}
6
  • Wow thank you that fixed it. What would the package floatrow be used for?
    – CivilSigma
    Commented Sep 17, 2016 at 21:40
  • you might want to look at texdoc floatrow and the rawcaption command which looks like a way to escape the packages caption logic Commented Sep 17, 2016 at 21:41
  • @CivilSigma er if you don't know why have you loaded it??? It's a really bad idea to load lots of packages you don't use them: it slows things down and leads to unnecessary conflicts (floatrow is for controlling float and caption positioning.....) Commented Sep 17, 2016 at 21:42
  • Yea it is a bad practice, but I find it hard to memorize all the different packages and their uses - so I always compile the same list of packages I use to compose my documents.
    – CivilSigma
    Commented Sep 17, 2016 at 21:43
  • 1
    @CivilSigma I often add a comment line behind a package to remind myself why I included the package. Especially in my early LaTeX days.
    – Roald
    Commented Sep 18, 2016 at 8:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .