[Tex/LaTex] Determine text width

lengthsmargins

For sizing figures in LaTeX it's helpful to know how wide the text is so that figures can be sized to match without rescaling. LaTeX provides \textwidth for reference by other commands, e.g.
\includegraphics[width=\textwidth]{figure}
but including \textwidth "raw" in the document produces errors.

Is there a way to determine what this value is?

Best Answer

From http://www.latex-community.org/forum/viewtopic.php?f=5&t=2712

Using \the\textwidth will allow you to see the value LaTeX is using. However, the default unit of measurement is probably points, not a likely option for your graphics software.

Fortunately, the conversion function is available in the standard layouts package: \usepackage{layouts}
...
textwidth in cm: \printinunitsof{cm}\prntlen{\textwidth}
will print the value in cm. All the usual LaTeX units of measurement are also available if cm aren't what you want.