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

What are the differences between \newdimen, \newskip, and\newlength?

When should I use each of them? Please give me a non-trivial example for each case.

share|improve this question
up vote 27 down vote accepted

\newlength is the LaTeX2e version of \newskip. It has extra check to avoid redefinition or illegal name. In LaTeX2e, it is defined


For example,

\newlength\foo % OK
\newlength\foo % redefinition ERROR!

\newlength\endbar % ERROR: \endbar is illegal command name in LaTeX2e.
% It is reserved by LaTeX kernel to define bar environment together with \bar

\newskip only allocates a new skip (glue, or rubber space) register. If you use low-level TeX command \newskip instead, no error message will be shown.

You should always use \newlength rather than \newskip in LaTeX.

\newdimen is another low-level TeX macro that allocates a new dimension register, it is different with \newskip. They have different meaning. For example,

\rigidlength=2pt % or \setlength{\rigidlength}{2pt}

\newlength\rubberlength % you cannot use \newdimen here
\setlength{\rubberlength}{2pt plus 2pt minus 1pt}
share|improve this answer

\newlength is LaTeX syntax and always a skip register:

\foo=1cm plus 1mm minus 3mm
\bar=1cm %plus 1mm minus 3mm % not possible
\setlength\baz{1cm plus 1mm minus 3mm} 
\the\foo \par
\the\bar \par
share|improve this answer
When should I use \newdimen, \newlength and \newskip? – xport Jul 12 '11 at 12:41
@xport: For LaTeX high-level code use \newlength. Use \newdimen for lower-level code if you are sure that you only need a rigid dimension. \newskip also allows you to add stretch-amounts so the value can be a little higher or lower if required, which is useful for inter-word and inter-paragraph skips to fill the given size better. – Martin Scharrer Jul 12 '11 at 12:54
\newlength tests if the command (length) already exists, \newdimen and newskip overwrite an already existing definition – Herbert Jul 12 '11 at 12:59

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.