[Tex/LaTex] Scalebox – knowing how much it scales

graphicsscaling

I am relatively new to LaTeX and I was playing around with figures and came across the scalebox command. This apparently lets you scale a graph that you create or import into your LaTeX document by a certain amount. How do you know how much scalebox will scale your figure by? I read somewhere that typing \scalebox{0.5} scales a graph to 0.8 times the original size. Is there any way to figure out what fraction of the original size your graph will become?

Best Answer

It is not true that \scalebox{0.5} of the graphics package scales a graph to 0.8 times of the original size. It scales it simply by this factor, as Ian Thompson already said in his answer.

Note that their is also \resizebox{<width>}{<height>}{<content>} which allows you to scale the image to a given size. This can be more useful for adjusting bigger graphics or pictures: \resizebox{\textwidth}{!}{<content>} scales the content directly to the size of the main text. The ! for the height states that it should scale with the width. See my answer to Quickest way to include graphics for more explanation about scale vs. direct width/height.

See the graphics/x manual for the other commands like \rotatebox. Note that if you want to resize images you can use the optional arguments of \includegraphics[height=<height>,width=<width>,angle=<angle>,keepaspectratio]{<filename>}.

For other things like diagrams drawn using TeX commands (pgf/tikz, pstricks, etc.) there is the adjustbox package which gives you \adjustbox{height=<height>,width=<width>,angle=<angle>,keepaspectratio}{<TeX content>} or the similar and very new gincltex which allows you to include .tex files like images using \includegraphics.