Graphics, Figures & TablesColumns and figures

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
pmrdias
Posts: 1
Joined: Wed Mar 10, 2021 11:50 am

Columns and figures

Post by pmrdias »

Hello

I am writing an article with the format of two columns, but I cannot place the figure.
They can help.
Thanks

% If activated, the figure will evaporate. Why???
% FOTO E CAPTION CENTER

%\begin{figure}
% \centering
\includegraphics[width=8cm]{Subsist_front.jpg}
\caption{Subsystem and its borders}
\label{fig:SubsFont}
%\end{figure}

Code: Select all

\documentclass[a4paper, 11pt] {article}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{authblk}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{geometry}
 \geometry{
 a4paper,
 %total={210mm,297mm},
 left=15mm,
 right=15mm,
 top=10mm,
 bottom=15mm,
 }
\setlength\parindent{0pt}
\title{Teste}
\author[1]{Pedro M. R. Dias}
\affil[1]{FCT}
\affil[1]{Tel: (+351) 211 00; e-mail: xxx@xx.pt}
\date{}
\begin{document}
\maketitle
\begin{abstract}
The article contains .....
\end{abstract}
\begin{multicols}{2}
\section{Introduction}
The maintenance ...:

\begin{itemize}[noitemsep]
\item 
Equipment ...,
\item 
Initial formation,
\item
Selection ...
\end{itemize}
\section{IMPLEMENTATION ...}
The improvement ...\\
\subsection{Equipment Division into subsystems}
In the figure \ref{fig:SubsFont} ...\\


% If activated, the figure will evaporate. Why???

% FOTO E CAPTION CENTER

%\begin{figure} 
%    \centering
    \includegraphics[width=8cm]{Subsist_front.jpg}
    \caption{Subsystem and its borders}
    \label{fig:SubsFont}
%\end{figure}
We ...:
\section{DISCUSSION OF RESULTS}
Initiate .... 
\end{multicols}
ZZZZ...
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Stefan Kottwitz
Site Admin
Posts: 10310
Joined: Mon Mar 10, 2008 9:44 pm

Columns and figures

Post by Stefan Kottwitz »

The multicol package does not support floating figures, it doesn't work good with column balancing. You can include it directly, as here:

Code: Select all

\documentclass[a4paper, 11pt] {article}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{caption}
\usepackage{authblk}
\usepackage{enumitem}
\usepackage[demo]{graphicx}
\usepackage{geometry}
 \geometry{
 a4paper,
 %total={210mm,297mm},
 left=15mm,
 right=15mm,
 top=10mm,
 bottom=15mm,
 }
\setlength\parindent{0pt}
\title{Teste}
\author[1]{Pedro M. R. Dias}
\affil[1]{FCT}
\affil[1]{Tel: (+351) 211 00; e-mail: xxx@xx.pt}
\date{}
\begin{document}
\maketitle
\begin{abstract}
The article contains .....
\end{abstract}
\begin{multicols}{2}
\section{Introduction}
The maintenance ...:

\begin{itemize}[noitemsep]
\item 
Equipment ...,
\item 
Initial formation,
\item
Selection ...
\end{itemize}
\section{IMPLEMENTATION ...}
The improvement ...\\
\subsection{Equipment Division into subsystems}
In the figure \ref{fig:SubsFont} ...\\


% If activated, the figure will evaporate. Why???

% FOTO E CAPTION CENTER

\begin{center} 
    \includegraphics[width=8cm]{Subsist_front.jpg}
    \captionof{figure}{Subsystem and its borders}
    \label{fig:SubsFont}
\end{center}
We ...:
\section{DISCUSSION OF RESULTS}
Initiate .... 
\end{multicols}
ZZZZ...
\end{document}
I loaded the caption package to get the \captionof command (it can do much more) and used a center environment.

Stefan
LaTeX.org admin
Post Reply