Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing out LaTeX Variables

I am using a LaTeX class file which sets various parameters such as margins, line spacing, ... according to the parameters passed to it. For some reason, the end result does not look right. Some margins are not properly set. I'd like to print out the values of various variables that LaTeX have computed along the way to see where the problem is. For instance, I'd like to know what the value of \oddsidemargin is in a certain line of code. Is there a way to ask LaTeX to print out such information?

like image 289
reprogrammer Avatar asked Jul 22 '09 22:07

reprogrammer


4 Answers

You can insert the value of a variable with \the:

\the\oddsidemargin
like image 74
Svante Avatar answered Nov 13 '22 10:11

Svante


For debugging page layout, Peter Wilson's layouts package is the way to go. Here's an example for visualising the page design and seeing the dimensions used for it:

\documentclass{article}
\usepackage{layouts}
\begin{document}
\drawmarginparstrue
\currentpage
\pagedesign
\end{document} 

There are many features to fine-tune the information returned by the package. It also provides the \prntlen command to print the size of a length in case you don't need so much information.

like image 13
Will Robertson Avatar answered Nov 13 '22 09:11

Will Robertson


CTAN says: printlen which allows you to specify the output units.

like image 5
dmckee --- ex-moderator kitten Avatar answered Nov 13 '22 11:11

dmckee --- ex-moderator kitten


Try also this:

\usepackage[verbose]{geometry}
like image 4
lhf Avatar answered Nov 13 '22 10:11

lhf