Changing image size and rotating the picture

If we want to further specify how LaTeX should include our image in the document (length, height, etc), we can pass those settings in the following format:

\begin{document}

Overleaf is a great professional tool to edit online documents, 
share and backup your \LaTeX{} projects. Also offers a 
rather large help documentation.

\includegraphics[scale=1.5]{overleaf-logo}
Example of changing image size

The command \includegraphics[scale=1.5]{overleaf-logo} will include the image overleaf-logo in the document while the extra parameter scale=1.5 will do exactly that, scale the image 1.5 times its real size.

You can also scale the image to a specific width and height.

\begin{document}

Overleaf is a great professional tool to edit online documents, 
share and backup your \LaTeX{} projects. Also offers a 
rather large help documentation.

\includegraphics[width=5cm, height=4cm]{overleaf-logo}
Example of setting image height and width

As you probably have guessed, the parameters inside the brackets [width=5cm, height=4cm] define the width and the height of the picture. You can use different units for these parameters. If only the width parameter is passed, the height will be scaled to keep the aspect ratio.

The length units can also be relative to some elements in the document. If you want, for instance, to make a picture the same width as the text:

\begin{document}

The universe is immense and it seems to be homogeneous, 
in a large scale, everywhere we look at.

\includegraphics[width=\textwidth]{universe}
Example of image set to text width

Instead of \textwidth you can use any other default LaTeX length: \columnsep, \linewidth, \textheight, \paperheight, etc. See the reference guide for a further description of these units.

There is another common option when including a picture within your document, which is to rotate it. This can easily accomplished in LaTeX:

\begin{document}

Overleaf is a great professional tool to edit online, 
share and backup your \LaTeX{} projects. Also offers a 
rather large base of help documentation.

\includegraphics[scale=1.2, angle=45]{overleaf-logo}
Example of rotating an image

The parameter angle=45 rotates the picture 45 degrees counter-clockwise. To rotate the picture clockwise, use a negative number.

Last updated

Was this helpful?