TransWikia.com

How can I fit a picture in LaTeX (regarding to being center and also fit height and its width)?

TeX - LaTeX Asked by Azam Ghamari on April 17, 2021

I try to put my picture in a page, my picture is a little bit large.
I try this way, it does not give me the best answer, some part of the image is cut. I also try [width=.5] or [scale=.6] or many other numbers instead of them, but no good answer. Does anyone know what do exactly width=linewidth and columnwidth and height-0.35textheight do?

begin{figure}[H]
    begin{center}
        hfillincludegraphics[width=linewidth,height=0.35textheight]{axe/11}hspace*{fill}  %it is suggested to using scale to zoom figures without distortion
    end{center}
    caption{The overview of three tanks connect to each other cite{xie1999strong}.}
    label{fig:tank}
end{figure} 

screenshot

One Answer

First, as advised by @Werner, make sure your picture has minimal white (useless) space around it.

Then a standard

begin{figure}[h]
centering
includegraphics[width=textwidth]{img/myfigure.jpg}
caption{blablabla}
end{figure}

should do the trick.

If you want more tuning, you can check resizebox{}{}{}. For instance:

resizebox{textwidth}{!}{
includegraphics[scale=1]{img/myfigure.jpg}
}

Answered by jchd on April 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP