Graphics, Figures & TablesFigures in multicols Enviroment

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
s.david
Posts: 43
Joined: Thu Sep 10, 2009 5:22 pm

Figures in multicols Enviroment

Post by s.david »

Hello,

I am using the multicols enviroment, specifically two columns. But I am facing a problem with the figures, where I can not put them in one of the two columns, so I used figure* enviroment, to spread them over the two columns, but this solution consumes so much space. I have noticed some authors place their figures perfectly in one of the two columns, how did they do that?

Thanks in advance

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Figures in multicols Enviroment

Post by localghost »

You can't use a figure environment. Load the caption package and use its \captionof command. You may put a minipage environment around figure and caption to keep them together. This will result in a non-floating figure with the well known caption format.


Best regards
Thorsten
s.david
Posts: 43
Joined: Thu Sep 10, 2009 5:22 pm

Figures in multicols Enviroment

Post by s.david »

localghost wrote:You can't use a figure environment. Load the caption package and use its \captionof command. You may put a minipage environment around figure and caption to keep them together. This will result in a non-floating figure with the well known caption format.


Best regards
Thorsten
I have this piece of code, for example:

Code: Select all

\documentclass[a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{through}
\usepackage{multicol}

\begin{document}
\begin{multicols}{2}
\begin{figure*}
\begin{center}
\begin{tikzpicture}[>=latex']

    \node (source) at (0,0) [circle,draw] {};
    \node (relay) at (3,2) [circle,draw] {};
    \node (destination) at (6,0) [circle,draw] {};

    \draw [->] (source.60) to node [auto] {} (relay.west);
    \draw [->] (relay.east) to node [auto] {} (destination.120);
    \draw [->] (source.east) to node [auto,swap] {} (destination.west);
\end{tikzpicture}
\end{center}
\end{figure*}

\end{multicols}
\end{document}
how to apply what you did say on this?

Thanks in advance
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Figures in multicols Enviroment

Post by localghost »

Omit the figure* environment and place a \captionof command from the caption package inside the center environment. For more information refer to the manual.
Post Reply