I would like to know how to add an image in a two-columns template in LateX. I have tried to use \begin{figure}, \includegraphics{figure}, and \begin{wrapfigure}, but unfortunately no image was included in the document (image's format: jpg). Could you please tell me how add an image (center between the two columns, or on the right/left columns) in this template? Many thanks.
% test.tex
\title{Article Title\cite{LinkReference1}}
\author{Some Author\cite{Author1}}
\newcommand{\abstractText}{\noindent
Abstract goes here.
}
%%%%%%%%%%%%%%%%%
% Configuration %
%%%%%%%%%%%%%%%%%
\documentclass[12pt, a4paper, twocolumn]{article}
\usepackage{xurl}
\usepackage[super,comma,sort&compress]{natbib}
\usepackage{abstract}
\renewcommand{\abstractnamefont}{\normalfont\bfseries}
\renewcommand{\abstracttextfont}{\normalfont\small\itshape}
\usepackage{lipsum}
%%%%%%%%%%%%%%
% References %
%%%%%%%%%%%%%%
% If changing the name of the bib file, change \bibliography{test} at the bottom
\begin{filecontents}{test.bib}
@misc{LinkReference1,
title = "Link Title",
author = "Link Creator(s)",
howpublished = "\url{https://example.com/}",
}
@misc{Author1,
author = "LastName, FirstName",
howpublished = "\url{mailto:[email protected]}",
}
@article{ArticleReference1,
author = "Lastname1, Firstname1 and Lastname2, Firstname2",
title = "Article title",
year = "Year",
journal = "Journal name",
note = "\url{https://dx.doi.org/...}",
}
\end{filecontents}
% Any configuration that should be done before the end of the preamble:
\usepackage{hyperref}
\hypersetup{colorlinks=true, urlcolor=blue, linkcolor=blue, citecolor=blue}
\begin{document}
%%%%%%%%%%%%
% Abstract %
%%%%%%%%%%%%
\twocolumn[
\begin{@twocolumnfalse}
\maketitle
\begin{abstract}
\abstractText
\newline
\newline
\end{abstract}
\end{@twocolumnfalse}
]
%%%%%%%%%%%
% Article %
%%%%%%%%%%%
\section{Section1Title}
This is the first sentence\cite{ArticleReference1}.
\section{Section2Title}
\lipsum[1]
%%%%%%%%%%%%%%
% References %
%%%%%%%%%%%%%%
\nocite{*}
\bibliographystyle{plain}
\bibliography{test}
\end{document}
This is what I have tried to include this figure (link: https://ibb.co/tZftSFf):
\begin{wrapfigure}{l}{0.7\linewidth}
\includegraphics[width=\linewidth]{figure.jpg}
\end{wrapfigure}
wrapfig
you should be able to create a figure with text wrapping around it inside one of the two columns. Can you please show us what you've tried to include a figure? You can use the dummy imageexample-image-duck
which should be contained in most LaTeX installations.wrapfig
, that's its only purpose. Withexample-image-duck
I meant that you should use that instead offigure.jpg
, because we don't have that file on our pc.