2

Please excuse me if this is silly question...

Can any one explain the function of \offinterlineskip? And where should be applicable?

4
  • See tex.stackexchange.com/questions/374316/… Commented Feb 4, 2020 at 15:41
  • 1
    @CampanIgnis no, I don't think it does. Commented Feb 4, 2020 at 18:17
  • 1
    @CampanIgnis yes I know, but it's my answer that you are referring to, and it doesn't explain what offinterlineskip is for, just that it was not doing what the questioner expected in the case of longtable. Commented Feb 4, 2020 at 23:03
  • @DavidCarlisle I did not noticed that the other answer was yours, too. I guess you are right after all. Thank you for your work. Commented Feb 4, 2020 at 23:14

1 Answer 1

6

\offinterlineskip is a macro defined as

\def\offinterlineskip{%
  \baselineskip=-1000pt
  \lineskip=0pt
  \lineskiplimit=\maxdimen
}

so within its scope TeX makes no attempt to make even line spacing and just stacks things vertically.

Compare the normal setting on the right where a line of . gets the same space as a line of A, with the setting with \offinterlineskip

enter image description here

\documentclass{article}

\begin{document}

\parbox[t]{3cm}{\offinterlineskip
A A A A A A A A A A A A 
A A A A A A A A A A A A 
A A A A A A A A A A A A 
x x x x x x x x x x x x 
x x x x x x x x x x x x 
x x x x x x x x x x x x 
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
}
\parbox[t]{3cm}{
A A A A A A A A A A A A 
A A A A A A A A A A A A 
A A A A A A A A A A A A 
x x x x x x x x x x x x 
x x x x x x x x x x x x 
x x x x x x x x x x x x 
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
}

\end{document}

Obviously this looks fairly horrible if used for paragraphs of text as here but it can be useful in special situations where you have constructed boxes with specific contents that want to be stacked exactly without TeX inserting any additional inter-line space.

3
  • Thanks for your detailed explanation....
    – MadyYuvi
    Commented Feb 6, 2020 at 10:33
  • After use of \offinterlineskip, how to restore the original vertical confugeration? It seems there is not a macro named oninterlineskip.
    – lyl
    Commented Mar 21, 2022 at 2:13
  • @lyl it's just three \setlength commands. Like any other settings, normally you do them in a group so they revert at the end. Commented Mar 21, 2022 at 7:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .