overleaf 5

 \documentclass{article}

\usepackage{graphicx}

\title{Image}

\author{Student}

\date{July 2025}

\begin{document}

\maketitle

\section{Introduction}

In this section we are discussing about how to insert an image in LaTeX document.

\subsection{Packages}

LaTeX cannot manage images by itself. So we need to use the graphicx package. To use it, we include the following line in the preamble:

\begin{verbatim}

\usepackage{graphicx}

\end{verbatim}

The command `\graphicspath{{image/}}` tells LaTeX that the images are kept in a folder named `image` under the directory of the main document.

The include graphics {universe} command is the one that actually includes the image in the document. Here `universe` is the name of the file containing the image without the extension. Then `universe.PNG` becomes `universe`. The file name of the image should not contain white spaces or multiple dots.

It also provides a way to change the width, height, and position of the image.

\begin{figure}

    \centering

    \includegraphics[width=5cm]{image.png}

    \caption{TexStudio}

\end{figure}

\end{document}

Comments

Popular posts from this blog

overleaf 1

overleaf 6

overleaf 2