# Discouraging line break in an alignment

In the question Generate table with dynamic number of columns the OP posed a question to which my initial reaction was "No".

However, now I've run into something interesting which, if I'm reading it right, would fit the bill. From the TeX by topic by Victor Eijkhout (25.2.3):

\noalign{\penalty100} for discouraging a page break (or line break) in between two rows (columns) of an \halign (\valign).

So if I understood the above correctly, for \valign that would read:

\noalign{\penalty100} for discouraging a line break in between two columns of an \valign.

I thought: "That's exactly what was asked for", but couldn't figure out how.

-
\penalty1000 only discourages a line break; to inhibit it you have to say \penalty10000 –  egreg May 14 '11 at 10:10
@egreg: typo. Fixed to the question. Doesn't change the outcome. –  morbusg May 14 '11 at 10:19
If I add some columns to that alignment, I don't get any line break. Please, provide a minimal example. –  egreg May 14 '11 at 10:25
@egreg: uh, what do you mean "minimal example"? It is a minimal example! If you got it to work, could you add that as an answer? Thanks! –  morbusg May 14 '11 at 10:35
@morbusg: I don't follow you. It' obvious that the alignment you show will not have any line break when the \hsize is reasonable. But if I typeset your alignment after \hsize=1pt I don't get any line break, that would instead be present if the inserted penalties were less than 10000. –  egreg May 14 '11 at 10:40

I know. Trying to recreate \halign mostly by hand, I got stuck on \halign to <dimen> and \halign spread <dimen>. The rest (\noalign, \span) was mostly ok. One case in which I couldn't manage to unbox properly is alignment displays, such as \halign{...}. –  Bruno Le Floch May 16 '11 at 7:32