1

I am tinkering with my somewhat unusual math definitions for my finance textbook (which sadly has to use the outdated eqnarray instead of align for many reasons).

I am fighting against the various vertical (partly stretchable?) spacing introduced by many nested environments. By the time I am done, I think a number of them have all "competed" to add vspace how they like it, presumably often in the assumption that they are all alone when I need them in a Franken-sense way.

Now, to figure out how to coax them into what I want, I would ideally get the equivalent of a CSS inspector in a web browser --- which can tell me that environment A added this much, B added that much, C removed this, etc. Yes, it would be lovely if a diagnostic package could tell me in the marginpar what environment added what space. Alas, this is unreasonable to ask for. Instead, I wonder whether lualatex could tell me how much net total fixed and rubber space it has been working with to determine the actual vertical space at each space insertion (other than ordinary lines within paragraphs). This would allow me to hand-add and subtract (i.e., further mess with) the fixed and stretchable components. or at least allow me to query it specifically at some spots. is this possible?

PS: my knowledge of rubber spacing comes from What is glue stretching?

3
  • it is hard to imagine any reason to use eqnarray over align, but \showoutput in your preamble will show you every box and every space added to every page Commented Jun 14, 2022 at 7:50
  • thx, D. the output is impressive. it makes it more obvious what is going on under the hood. could you please post as full answer to accept? perhaps add what a few of the more prominent items mean? Much is self-explanatory. Is \glue in this output always vspace? Presumably same for \penalty. I see \localpar--- are there paragraphs that are not localpar?
    – ivo Welch
    Commented Jun 14, 2022 at 17:49
  • you are using luatex then as localpar isn't standard tex. every possible node type can be logged so a full description is a full decripion of tex, so not really an answer here... Commented Jun 14, 2022 at 18:09

1 Answer 1

2

\showoutput logs the internal box structure, you can use \showboxdepth to limit the log to the main vertical list, eg

\documentclass{article}

\usepackage{amsmath}

\showoutput
\showboxdepth=3

\begin{document}

aaaa
\[x=y\]
bbb
\begin{align}
  x&=1\\
  y&=2
\end{align}
ccc

\end{document}

produces

Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
.\glue 16.0
.\vbox(617.0+0.0)x345.0, shifted 62.0
..\vbox(12.0+0.0)x345.0, glue set 12.0fil
...\glue 0.0 plus 1.0fil
...\hbox(0.0+0.0)x345.0 []
..\glue 25.0
..\glue(\lineskip) 0.0
..\vbox(550.0+0.0)x345.0, glue set 450.95183fil
...\write-{}
...\glue(\topskip) 5.69446
...\hbox(4.30554+0.0)x345.0, glue set 309.99994fil []
...\penalty 10000
...\glue(\abovedisplayshortskip) 0.0 plus 3.0
...\glue(\baselineskip) 7.69446
...\hbox(4.30554+1.94444)x24.31009, shifted 160.34496, display []
...\penalty 0
...\glue(\belowdisplayshortskip) 6.0 plus 3.0 minus 3.0
...\glue(\baselineskip) 3.11111
...\hbox(6.94444+0.0)x345.0, glue set 328.33328fil []
...\penalty 10000
...\glue(\abovedisplayskip) 10.0 plus 2.0 minus 5.0
...\glue -3.0
...\glue 0.0
...\glue(\baselineskip) 6.60004
...\hbox(8.39996+3.60004)x345.0, display []
...\penalty 10000
...\glue 0.0
...\glue(\baselineskip) 3.0
...\hbox(8.39996+3.60004)x345.0, display []
...\penalty 10000
...\glue 0.0
...\penalty 0
...\glue(\belowdisplayskip) 10.0 plus 2.0 minus 5.0
...\glue(\baselineskip) 4.09442
...\hbox(4.30554+0.0)x345.0, glue set 331.66667fil []
...\glue 0.0 plus 1.0fil
...\glue 0.0
...\glue 0.0 plus 0.0001fil
..\glue(\baselineskip) 23.55556
..\hbox(6.44444+0.0)x345.0
...\hbox(6.44444+0.0)x345.0, glue set 170.0fil []

which are all the vertical items as the horizontal display corresponding to lines such as aaaa is compressed to

\hbox(4.30554+0.0)x345.0, glue set 309.99994fil []

You must log in to answer this question.

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