4

I need to add a picture to to a latex document and apply multicol environments to it so it may not float. If I just use \includegraphics it can be used with multicol but I cannot use a caption for it. If I put \begin{figure} and \end{fingure} around \includegraphics it cannot be used in minipage and multicol space.

How can I add a not floating figure with a caption?

3
  • \captionof{figure}{Your caption} works even without floating/figure environment You need the caption package
    – user31729
    Oct 27, 2015 at 15:24
  • What's your question? This answer might help if it's to do with putting a float where you want it: tex.stackexchange.com/a/8633/28808
    – Chris H
    Oct 27, 2015 at 15:25
  • @ChristianHupfer where should I add it. How I connect it to a figure? Oct 27, 2015 at 15:29

1 Answer 1

6

Use\captionof{figure}{your normal caption} text for a non-floating graphics (or for a table: \captionof{table}{caption text})

\documentclass{article}

\usepackage{caption}
\usepackage[demo]{graphicx}
\usepackage{multicol}
\usepackage{blindtext}
\begin{document}

\begin{multicols}{2}
  \blindtext
  \begin{center}
  \includegraphics[scale=0.1]{bild_erwin_schroedinger}
  \captionof{figure}{Erwin}
  \end{center}
\blindtext
  \begin{center}
  \includegraphics[scale=0.4]{a_1.jpg}
  \captionof{figure}{A famous duck}
  \end{center}
  \blindtext
\end{multicols}

\end{document}

enter image description here

2
  • Is there anywhere to add a label to the picture? Oct 27, 2015 at 15:47
  • @user62181: Of course, just say \label{foo} after \captionof{...}{...} -- it works the usual way!
    – user31729
    Oct 27, 2015 at 15:48

You must log in to answer this question.

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