Skip to main content

Module helpers

Module helpers 

Source

Functions§

is_para
Is node an ltx:para, or the streaming placeholder of a run that ends with one?
list_or_block_open_inside_para
Whether a list (ltx:itemize, ltx:enumerate, ltx:description) or an inline sectional block (ltx:inline-sectional-block) is open between the insertion point and the paragraph (ltx:para) that holds it: a \par or a skip there ends no paragraph (\lx@normal@par, \vskip), since closing that paragraph would end the list or the block too. Only a list that can auto-close is affected — a \trivlist’s (_autoclose, latex_constructs sect06.rs); the others never closed this way. The block is the paragraph-bridged one a sectioning unit opens in a list item (document.rs AUTO_OPEN_BRIDGES, OXIDIZED_DESIGN #189), whose end is the item’s or the list’s: a blank line between the \bibitems of a bibliography in it closed the bridge paragraph, the block, its section and the bibliography, and every later entry was misplaced (1805.06896, 2304.12197, 2307.13461, hep-ex0406049, 0705.0894, 2511.04367). Perl opens no paragraph above a section, so its \par finds none there.
preceding_para_sibling
Does an ltx:para element immediately precede node? Both prune_empty_para (to decide ltx_pruned_first) and the first-paragraph ltx_noindent stamp (tex_paragraph.rs, OXIDIZED_DESIGN #143) ask this: a paragraph with no preceding ltx:para sibling is the first paragraph of its parent, structurally — a signal robust to how many stray \pars fired before it (which varies by TeX Live year / dump vs no-dump).
prune_empty_para
In some cases we could have e.g. a \noindent followed by a {table}, in which case we end up with an empty ltx:para which we can prune.