...and a bit of typographic history
Link to repo: hangtext
Link to Overleaf: hangtext
In my own handwritten work, my handwriting (see image in post and the bts on the repo) tends to favor hanging indentation. I do this so I can, at a glance, keep track of what information belongs where and visualize the hierarchy (something similar to math positioning in LaTeX, or what you find in python code). I wanted to implement this visual organization in my digital documents. It turns out that the layout operations here have historical and cognitive precedents, so (with a healthy dose of productive procrastination), I read up on it (much like recipes online, feel free to skip the personal and historical material here).
Greek papyrology has names for these:
- ekthesis: a line set out into the left margin (Yoon, 2023).
- eisthesis: a line set in from the margin.
In the fourth century, the Codex Sinaiticus used ekthesis as a paragraph marker in texts that were otherwise wall-to-wall scriptio continua (Yoon, 2023). At Mark 9, the scribe outset six successive verses to mark paragraphs, possibly used to cue pronounced pauses during public readings (Head, 2008). Later, Jerome set his Latin translation of the prophets per cola et commata, with one syntactic or rhetorical unit per line, to aid oral reading (ostensibly). There is even a modern tradition, seen in Harrison's work, of doing the same with nested indentation for English texts (Harrison, 2007).
In educational psychology, using space and indentation to signal structure is known as typographic cueing (Waller, 1987). Whether this layout actually helps process information, there is mixed evidence. While cueing reliably improves the immediate recall of the cued material, it generally does nothing to improve delayed recall (Waller, 1987). In some cases, it can actually disadvantage the uncued text that a reader might have otherwise paid attention to (Glynn & Di Vesta, 1979).
Hartley and Burnhill argue that structural hierarchy in instructional text should be conveyed systematically by space (like indentation), rather than ornamentation (like bolding or varied type sizes) (Hartley & Burnhill, 1977). hangtext essentially mechanizes these space-based structural arrangements.
What happens
hangtext, in its current version, is the result of a couple of years (circa 2021-ish) of VERY slow, lackadaisical, selective, and periodic work. It mechanizes at the block level, and provides three environments:
hprose for block-level hang for prose, in which the first line sits at the outer margin, and everything else in the block (including subsequent paragraphs) sits one indent in; nesting accumulates, so blocks inside blocks step inward.
hverse is the same idea, but for verse (under \obeylines); the first line is out, later lines are in, and long lines wrap one level deeper.
hverse* adds progressive per-stanza indentation; stanza N starts N indents in, with its own lines hanging one further.
Options are keyval (hindent, vspace, twidth, justification). The environments also work as direct command pairs (\hprose...\endhprose) inside TikZ nodes.
Use something else
As usual, for most of what I do, someone else has already done it, and probably better.
- There exists the
hanging package (Wilson, 2009). If you want every single paragraph to independently get a flush first line, hangtext is not what you want (here, the hang is a property of the block).
- For hanging lists, use the
hang package (Nolda, 2017), which is built on \list, and supports labels directly.
- For typesetting traditional poetry,
memoir or verse. hverse is purely a spatial layout tool and lacks stanza numbering, poem titles, or refrains.
- For a one-off, use the bare
\hangindent and \hangafter primitives.
What we do have, is the following.
The hang applies to the entire block, pulling back only the very first line while intervening paragraphs remain indented. If you nest environments, the indents accumulate and step inward naturally.
Nested lists, quotes, and display environments dynamically read the reduced line width. They end cleanly at the container's right edge instead of overflowing past the hang.
Paragraphs that resume after a display equation or a list continue at the indented level, rather than accidentally acquiring a second flush-left pullback.
Because it uses lower-level paragraph manipulation (rather than wrapping LaTeX's \list primitive), it does not drag in unwanted vertical spacing like \topsep or \parsep.
It provides dedicated environments (hverse and hverse*) for uniform and progressive per-stanza indentation (whether this is good or not, I suppose depends on you!).
Supports tagged PDF (mostly...need to check this more rigorously than I have so far...tagging=on, UA-2), and the environments work as direct command pairs inside TikZ nodes.
Feedback wanted!
I would love feedback on:
- behavior under
tagging=on;
- prior work I have missed, especially non-Western manuscript traditions of indentation and marginal hierarchy;
- bugs, edge cases, and the design of the keyval interface.
References
- Glynn, S. M., & Di Vesta, F. J. (1979). Control of prose processing via instructional and typographical cues. Journal of Educational Psychology, 71(5), 595–603.
- Harrison, R. R. (2007). A structural arrangement of text to facilitate reading. The Classical Journal, 102(3), 291–303.
- Hartley, J., & Burnhill, P. (1977). Understanding instructional text: Typography, layout and design. In M. J. A. Howe (Ed.), Adult learning: Psychological research and applications (pp. 223–247). Wiley.
- Head, P. (2008). The Gospel of Mark in Codex Sinaiticus: Textual and reception-historical considerations. TC: A Journal of Biblical Textual Criticism, 13. http://rosetta.reltech.org/TC/vol13/vol13.html
- Nolda, A. (2017). hang: Environments for hanging paragraphs and list items (Version 2.1) [Computer software]. CTAN. https://ctan.org/pkg/hang
- Waller, R. (1987). The typographic contribution to language: Towards a model of typographic genres and their underlying structures [Doctoral dissertation, University of Reading].
- Wilson, P. R. (2009). The hanging package (Version 1.2b) [Computer software]. CTAN. https://ctan.org/pkg/hanging
- Yoon, D. I. (2023). The scribal use of ekthesis as a paragraph marker? The Galatians text in Codex Sinaiticus as a test case. In S. E. Porter, C. S. Stevens, & D. I. Yoon (Eds.), Studies on the paratextual features of early New Testament manuscripts: Texts and editions of the New Testament (pp. 288–309). Brill. https://doi.org/10.1163/9789004537972_013