latex variable image size based on text width

The best way to have an image in latex with width depending on text width in my opinion is:

\begin{figure}[H]
    \begin{center}
        \includegraphics[width=0.4 \textwidth]{path/to/image.eps}
    \end{center}
    \caption{Sample image description}
    \label{fig:image_sample}
\end{figure}
  1. Use of the [H] makes the image not float around. To use it you have to download and include the library: http://www.ctan.org/tex-archive/help/Catalogue/entries/float.html

  2. Notice the “width=0.4 \textwidth”, which makes the images width 40% times the text width.

Posted by wojtek Sun, 14 Dec 2008 14:10:00 GMT




Comments

Leave a response

Leave a comment