Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The \show command is extremely useful for figuring out what's going on with a particular macro. Similarly, using \the can tell me the value of a counter. I'd like to know if there's something similar for lengths and skips. At the moment, I end up doing something like \rule{1pt}{\unknownlength} but that's a fairly crude method.

share|improve this question
add comment

2 Answers

up vote 35 down vote accepted

To show registers (which include dimensions, skips and counts) you want \showthe.

share|improve this answer
Given that there's \show, \the, and \showthe; I'm left wondering what \theshow does. Frivolity aside, thanks! –  Loop Space Jul 29 '10 at 10:50
'Undefined control sequence!' :-) –  Joseph Wright Jul 29 '10 at 11:14
add comment

Somewhat more friendly than \showthe, which returns lengths in pt, is the printlen package. It gives \printlength{...}, which will typeset (so it's actually more like \the I guess) the length in the units specified by \uselengthunit. E.g., from the documentation:

The \verb|\textwidth| is \printlength{\textwidth} which is also
\uselengthunit{in}\printlength{\textwidth} and
share|improve this answer
This is one of those cases where it'd be nice to be able to accept both answers. Thanks for taking the time to add the extra information. –  Loop Space Jul 29 '10 at 11:05
@Andrew: Interesting feature request: allow accepting both answers, splitting the 15 points of acceptance between the accepted answers....Meta? –  Yossi Farjoun Jul 29 '10 at 11:41
@Yossi Farjoun: We debated this on MO a bit and decided that it wasn't worth the hassle. In this case, Joseph was first and in practice his is the answer I am most likely to use so the acceptance is defendable. Given that rep isn't quite everything, I hope that my first comment (and vote) is sufficient thanks from me to Will. It only takes two votes from other people to give him more rep than the accepted answer tag would have done so I hope that enough will vote here that he won't feel hard done by. –  Loop Space Jul 29 '10 at 11:52
@Andrew: I looked this up on meta.SO where they had a discussion of this before. Basically, the idea is that one question has either one correct answer or none....I guess, an good answer will be voted up regardless if it accepted or not. –  Yossi Farjoun Jul 29 '10 at 12:53
@Yossi Farjoun: Hmm, the mathematician in me wants to say that a question can have several right answers, but that one will be more right than others in a specific situation. I think that your last remark is spot on. (And I think that we should get out of Will's "comment list"! If there is anything further to say on this - which I don't think there is - it should be shifted to meta.) –  Loop Space Jul 29 '10 at 13:02
show 2 more comments

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.