[Tex/LaTex] Define the size of an imported picture

graphicsscaling

Is it possible to use the width of the paper as a variable in order to set the width of an imported graphics? For instance when I want the picture size to be the width of the paper, minus 3 centimeters, or half of the paper's width etc.

Best Answer

The answer is simply to use \textwidth and do whatever you want with it. Of course by width of paper you mean the text block width, not the paper itself, in that case you use \paperwidth.

\includegraphics[width=\textwidth-5cm]{./Images/MyImage}
\includegraphics[width=\paperwidth]{./Images/MyImage}
\includegraphics[width=2\textheight]{./Images/MyImage}
\includegraphics[height=\marginparwidth]{./Images/MyImage}

you could use pt or inch or em ...etc, instead of cm.

Refer to http://en.wikibooks.org/wiki/LaTeX/Page_Layout#Page_dimensions for useful page dimensions commands.

Related Question