Bar Models¶
The barmodel{} keyword draws a single horizontal bar (Singapore-style
"schéma en barre") split into one or more cells. As for the other keywords,
cell values are separated by ;, and options follow a | separator;
multiple options are separated by ;. An empty value (or _) leaves the
corresponding cell empty.
The barmodel{} keyword has several options:
widths— comma-separated list of percentages (one per cell), which must sum to 100. Default: equal widths.fill— background colour of the cells. A single value applies to every cell; a comma-separated list assigns a per-cell colour. Use_(ornone) for a transparent cell.border_color— colour of the bar borders. A single value colours every cell border and the brace strokes; a comma-separated list assigns a per-cell border colour to the bar only (braces fall back to the default colour). Use_to keep the default colour for a given cell.color— default colour applied to string-derived cell contents.split— per-cell sub-grid. Each entry has the formR×C(orR*C) and subdivides the cell into R rows and C columns; use_for no split. The bar grows in height to keep every sub-row at full size (max(R)); sub-column widths follow from the cell's overallwidthsvalue.brace_top— brackets drawn above the bar. Each entry has the formi-j:label(ori:labelfor a single column) and spans columns i to j (1-indexed, inclusive). Two optional trailing fields override colours for that entry:i-j:label:strokesets the bracket / outline colour, andi-j:label:stroke:filladditionally sets a background colour (only meaningful in tape style — see below). Use_in either field to keep the default. Wrap a label or colour containing,,;or:in{...}to protect it from being split.brace_bot— same syntax asbrace_top, drawn below the bar.brace_top_style— rendering style for the top entries:brace(default) draws curly brackets ;tapedraws filled / stroked rectangles sitting flush above the main bar. In tape mode multiple entries are allowed but their ranges must not overlap.brace_bot_style— same, for entries below the bar.baseline— vertical alignment of the bar with the surrounding text:middle(default),top, orbottom. Braces above/below don't shift this alignment.
Examples :
| Expression | Renders as |
|---|---|
barmodel{12 ; 8 ; 20 ; 5} |
|
barmodel{text{N | color=#36add4} ; text{35 | color=#eba215} | |
|
barmodel{math{x} ; text{$2.80 | color=#eba215} | |