To include images in LaTeX you need to include a new package in the preamble of your document: \usepackage{graphicx}
. You will also need to add the path to your figures folder with \graphicspath{ {figures/} }
.
figure
environment\includegraphics{}
argument.It is useful, though, to include the image in a figure frame by creating a figure environment. In Overleaf, if you create a figure environment, Overleaf automatically creates the following code that centers your image with default caption and label as shown below:
The size of the figure can be modified by specifying the width or height of the figure.
\includegraphics[width=150pt]{figures/figure1.jpg}
You can also use \textwidth
and \paperwidth
to specify relative sizes. Below, I show the screenshot where we can change the width of the image:
\includegraphics[width=0.5\paperwidth]{figures/figure1.jpg}
Creating tables in LaTeX is straightforward and offers plenty of customization options.
table
environment.\begin{tabular}
function.&
) in between each column content\\
to indicate at the end of the row\hline
adds a vertical line.To create a simple table, we use the table
environment. Below, I present a screenshot of how a table environment is utilized: