Ragged Blocks: Rendering Structured Text with Style
Sam Cohen, Ravi Chugh
Abstract
Whether it be source code in a programming language, prose in natural language, or otherwise, text is highly structured. Currently, text visualizations are confined either to flat, line-based decorations, which can convey only limited information about textual structure, or nested boxes, which convey structure but often destroy the typographic layout of the underlying text. We hypothesize that the lack of rich styling options limits the kinds of information that are displayed alongside text, wherever it may be displayed.
In this paper, we show that it is possible to achieve arbitrarily nested decorations while minimally disturbing the underlying typographic layout. Specifically, we present a layout algorithm that generates ragged blocks, or rocks, which are rectilinear polygons that allow nested text to be compactly rendered even when styled with borders and padding. Our layout algorithm is evaluated on a benchmark suite comprising representative source code files in multiple programming languages. The (ragged block) layouts produced by our algorithm are substantially more compact than the (rectangular block) layouts produced by conventional techniques, when uniformly styling every element in the syntax tree with borders and padding.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext ee801b44-3576-498c-a0cd-b7d3291ee3fdBuilds on11
- Penrose: from mathematical notation to beautiful diagramsKatherine Ye, Wode Ni, Max Krieger, Dor Ma'ayan et al.SIGGRAPH 2020 · 53 citations
- Ivie: Lightweight Anchored Explanations of Just-Generated CodeLitao Yan, Alyssa Hwang, Zhiyuan Wu, Andrew HeadCHI 2024 · 40 citations
- Filling typed holes with live GUIsCyrus Omar, David Moon, Andrew Blinn, Ian Voysey et al.PLDI 2021 · 35 citations
- Textlets: Supporting Constraints and Consistency in Text DocumentsHan L. Han, Miguel A. Renom, Wendy E. Mackay, Michel Beaudouin-LafonCHI 2020 · 35 citations
- Adding interactive visual syntax to textual codeLeif Andersen, Michael Ballantyne, Matthias FelleisenOOPSLA 2020 · 28 citations
Related papers
- Code Style Sheets: CSS for CodeSam Cohen, Ravi ChughOOPSLA 2025 · 5 citations
- RidgeBuilder: Interactive Authoring of Expressive Ridgeline PlotsShuhan Liu, Yangtian Liu, Junxin Li, Yanwei Huang et al.CHI 2025 · 3 citations
- HDLayout: Hierarchical and Directional Layout Planning for Arbitrary Shaped Visual Text GenerationTonghui Feng, Chunsheng Yan, Qianru Wang, Jiangtao Cui et al.AAAI 2025
- Information Extraction from Visually Rich Documents using LLM-based Organization of Documents into Independent Textual SegmentsAniket Bhattacharyya, Anurag Tripathi, Ujjal Das, Archan Karmakar et al.ACL 2025
- A Pretty Expressive PrinterSorawee Porncharoenwase, Justin Pombrio, Emina TorlakOOPSLA 2023
