What is the purpose of restoring the initial value of \prevdepth at the end of a horizontal alignment:

\everycr{\noalign{\dimen0=\prevdepth prevdepth in noalign: \the\dimen0}}
\strut #\strut%
Text in a horizontal alignment%
\dimen0=\prevdepth prevdepth after horizonal alignment: \the\dimen0

enter image description here


Above output was produced by LuaTeX version beta-0.79.1.

  • think of this more generally -- the argument of \halign is a local group. all temporary settings are abandoned when a group is closed. if a setting needs to be preserved after the group is closed, it must intentionally be set globally. Commented Oct 22, 2014 at 12:40
  • 1
    @barbarabeeton The TeXbook, p. 282: “The value of \prevdepth at the time of the \halign is used at the beginning of the internal vertical list, and the final value of \prevdepth is carried to the enclosing vertical list when the alignment is completed, so that the interline glue is calculated properly at the beginning and end of the alignment.” Indeed, the value shown when TeX is used (as opposed to LuaTeX) is 1.9444pt (the same with XeTeX).
    – egreg
    Commented Oct 22, 2014 at 15:04
  • @egreg -- okay. so this is a bug only in luatex. thanks. (guess i have to go back to reading the basics ... in my voluminous free time.) Commented Oct 22, 2014 at 16:16

1 Answer 1


This looks like an issue with the engine that has been reported here and will be fixed in the next release.

You must log in to answer this question.

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