TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't know if I am right. Let's read the codes :)


the snippet of the log file:

.\glue 2.0
.\kern 2.0
.\glue(\parskip) 0.0 plus 1.0
.\glue(\baselineskip) 5.05556

When we


Sometimes, we have no chance of examining the log file, so, how can we decide the glue or the kern in some \skip<number> is glue or kern?

share|improve this question
You can use e-TeX's \lastnodetype (texdoc etex is your friend). – egreg Mar 31 '13 at 13:41
@egreg thank you, egreg, I will visit my friend :) – Timothy Li Mar 31 '13 at 13:44
@egreg: I notice that when I input etex in the shell, it refers to pdfTeX. – Timothy Li Mar 31 '13 at 13:49
Yes: the modern TeX distributions always use pdftex for etex, pdftex, latex and pdflatex. – egreg Mar 31 '13 at 13:50
BTW, use odd numbers for local assignments and even numbers for global assignments of the first ten scratch registers (\global\skip1=\lastkern and \global\skip3=\lastskip). This is the convention in plain TeX and LaTeX to prevent problems with "save stack buildup". – Heiko Oberdiek Mar 31 '13 at 15:00
up vote 7 down vote accepted

This can be done with e-TeX (which is incorporated in pdftex):

  \ifnum\lastnodetype=12 % kern
    \ifnum\lastnodetype=11 % skip




The output is

> 2.0pt.
l.24 \showthe\skip1

> 4.0pt.
l.25 \showthe\skip3

share|improve this answer
Yeah, I think I can always ask a teacher like you when in troube. – Timothy Li Mar 31 '13 at 13:54
@TimLi You have asked eight questions, of which six received at least an answer. Please review them and, if one of the answers has helped you, mark it as accepted by clicking the tick mark next to the vote marks. This is useful for future readers, who can thus know what answer helped you most. – egreg Mar 31 '13 at 15:08
Yeah, I have done that :) – Timothy Li Mar 31 '13 at 15:24
@TimLi Upvoting is not the same as accepting. – egreg Mar 31 '13 at 15:27
This time, I really have marked all :) – Timothy Li Mar 31 '13 at 15:36

In classic TeX you can not tell. You can examine \lastskip or \lastkern but these will be 0pt whether the last item on the list is not a skip or if it is a skip of size 0pt, you can not distinguish those cases.

Using e-tex however you can examine the value of the integer \lastnodetype which will be 11 for a glue (skip) node and 12 for a kern node.

share|improve this answer
Thanks, the information is very important for me. – Timothy Li Mar 31 '13 at 13:51

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.