Graphics, Figures & Tables ⇒ Put figures and tables in columns
Put figures and tables in columns
I'm looking for a solution to following problem:
I'm working in a multicols environment(2 columns) and I want to keep some figures and tables absolutely in this environment! So in other words: let's say I'm in the second column and I want to add a figure there, how can I do this without having to put my figure over the whole width of the page, but only in the specified column?
Cheers
Hans
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Put figures and tables in columns
So, you have (at least) the following options:package description wrote: ...furthermore, there is no provision for single column floats inside a multicolumn environment, so figures and tables must be coded in-line (using, for example, the H modifier of the float package).
a) Use the H placement specifier provided by the float package (as suggested in the quoted text):
Code: Select all
\documentclass{article}
\usepackage{multicol}
\usepackage{float}
\usepackage{lipsum}% just to generate filler text for the example
\begin{document}
\lipsum[1]
\begin{multicols}{2}
\lipsum[1]
\begin{table}[H]
\centering
\begin{tabular}{cc}
column1a & column2a\\
column1b & column2b
\end{tabular}
\caption{test table.}
\label{tab:test}
\end{table}
text text text
\end{multicols}
\end{document}
Code: Select all
\documentclass{article}
\usepackage{multicol}
\usepackage{caption}
\usepackage{lipsum}% just to generate filler text for the example
\begin{document}
\lipsum[1]
\begin{multicols}{2}
\lipsum[1]
{\centering
\begin{tabular}{cc}
column1a & column2a\\
column1b & column2b
\end{tabular}
\captionof{table}{test table.}
\label{tab:test}
}
text text text
\end{multicols}
\end{document}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Put figures and tables in columns
Code: Select all
\documentclass[11pt,a4paper,twocolumn,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\usepackage{blindtext}
\begin{document}
\blindtext
\begin{center}
\rule{0.75\linewidth}{0.5\linewidth}
\captionof{figure}{Dummy figure}\label{fig:dummy}
\end{center}
\blindtext[2]
\begin{center}
\captionof{table}{Dummy table}\label{tab:dummy}
\rule{0.75\linewidth}{0.5\linewidth}
\end{center}
\blindtext
\end{document}
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Put figures and tables in columns
Greets,
Hans