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 need to draw lines at specific distances (in mm). For example:

---- line 0
---- line 1 at 35.64 mm below line 0
---- line 2 at 33.64 mm below line 1

The macro I'm using is as follows (I don't remember from where I copied it):

    %\advance \dimen0 by -2.41pt
    \advance \dimen0 by -1pt
    \vskip \dimen0
    \vrule height 0.5pt depth 0.5pt width 2in

And I use it as follows:


\#0 \fr{1mm}
\#1 \fr{35.64}
\#2 \fr{33.64}

However I cannot get the lines to appear at the desired positions.

share|improve this question

This should be a matter of \vrule and \vskip only. The following should work:

\def\fr#1#2{\vskip #2\noindent\smash{#1}%
  \vrule height 0.4pt depth 0pt width 2in\relax}



Note how the \smash macro is used to prevent the numbers from adding any height or depth.

share|improve this answer
Is the AMS \smash very different in use/behaviour from plain \smash? – morbusg Feb 22 '12 at 6:52
@morbusg: No, it's just that I didn't know Plain TeX also has it. – Andrey Vihrov Feb 22 '12 at 7:25
i may be missing something, but doesn't the rule height accumulate? it's not smashed ... – barbara beeton Feb 22 '12 at 15:17
@barbarabeeton: It does, and it's what I intended. The question asks for relative line position, not absolute. egreg has the other alternative, so let the op choose the correct one. – Andrey Vihrov Feb 22 '12 at 16:30

A Plain solution (inspired by Andrey's one):

\def\fr#1#2{\vskip #2\smash{#1 \vrule height 0.4pt depth 0pt width 2in}}


% A ruler in the margin to show alignment
\llap{\smash{\vtop to 100pt{
  \leaders\vbox to 20pt{\leaders\vrule\vfill\hrule width 2mm}\vfill}}}



enter image description here

share|improve this answer

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.