[Tex/LaTex] Figure length and width


I would like to add a figure, but I would like to control both width and length of figure. I know to control length and width separately but not together. Could anyone let me know the command to do that.

I am using the following commands:


Best Answer

Here you are:



\includegraphics[height=3cm, width=3cm]{example-image-b}
\includegraphics[height=3cm, width=6cm]{example-image-b}
\includegraphics[keepaspectratio,height=3cm, width=6cm]{example-image-b}

And the result:

enter image description here

Be very careful! By defining both height and width, you will distort the aspect ratio of the images. See the manual of the graphics bundle for more details and how to avoid distortions. To avoid the distortion, you can use the keepaspectratio-option, as presented in the last command.