Skip to content

Inline Attributes ​

All attributes available on inline and text elements (span, b, i, p, h1-h6, etc.). These attributes are inherited by child elements unless overridden.

Font ​

AttributeTypeDefaultDescription
fontfont nameInterFont family (Google Font name or registered asset font)
font-familyfont name--Alias for font
font-sizept, fit12ptFont size, or fit to auto-scale to fill container
font-size-minpt--Minimum font size when using font-size="fit"
font-size-maxpt--Maximum font size when using font-size="fit"
font-stylenormal, bold, italicnormalFont style
font-weight100-900, named weight--Font weight (overrides font-style for variant selection)
font-colorcolourblackText colour

Text Layout ​

AttributeTypeDefaultDescription
text-alignleft, right, center, justifyreading directionHorizontal text alignment; unset follows the text's own direction
line-heightnumber or pt1.2Line height (number = multiplier, pt = absolute)

Text Effects ​

AttributeTypeDefaultDescription
underlinetrue, falsefalseUnderlines text (inherited by child elements)
strike-throughtrue, falsefalseStrikes through text (inherited by child elements)
text-decorationnone, or underline and/or strike-through--Sets underline and strike-through together. none sets both to false; a named value sets its own to true and leaves the other inherited
text-shadowpt--Shadow offset distance
text-shadow-colorcolour--Shadow colour
text-transformuppercase, lowercase, capitalize, upper, lower, title--Text case transformation (inherited by child elements)
caseAlias for text-transform--Text case transformation (inherited by child elements)

Text Behaviour ​

AttributeTypeDefaultDescription
preserve-whitespacetrue, falsefalsePreserve whitespace and line breaks
wrapnormal, nonenormalText wrapping behaviour
overflowellipsis--Overflow handling (ellipsis truncates with ...)

Conditional and Style ​

AttributeTypeDefaultDescription
show-ifdata path--Render only when condition is truthy
targetstring--Link to element with matching id (internal link)
style@alias-name--Apply a style alias

Leader ​

<leader/> repeats a glyph across the free width of its line, such as the dots between a contents entry and its page number. It takes the font, colour, text-effect and link attributes above, plus:

AttributeTypeDefaultDescription
charvisible text.The glyph to repeat
spacingptone space widthGap between repeats; 0pt with char="_" draws a solid rule
min-widthpttwo repeatsThe shortest the run of dots may be
xml
<p>Introduction <leader /> 12</p>
<p>Method <leader char="·" spacing="4pt" font-color="#9ca3af" /> 128</p>
  • Put the leader directly in the text of a block such as <p>, <h2> or a <frame>. That block fills its column unless you set a width, so the text after the leader sits at the end of the line.
  • Whitespace around <leader /> makes no difference to the output.
  • One space width stays clear at each end of the dots.
  • The dots of rows set in the same style line up on shared columns.
  • When a title wraps, the dots and the number follow its last line. When the leader's minimum does not fit on that line, the leader and the number move to the next line together when they fit there. A number never splits across lines unless it alone is wider than the column.
  • target on the leader links the dotted space, as it does on a <span>.
  • Repeats are never set closer than 0.5pt apart.

Style every leader in the document with a rule in <styles>:

xml
<styles>
  <leader>
    <char>-</char>
    <spacing>2pt</spacing>
    <font-color>#999999</font-color>
  </leader>
</styles>

Papermill rejects the document with message:

  • <leader> must be placed directly in the text of an element such as <p>, not inside <span> when a leader sits inside an inline element. The message names that element.
  • <leader> cannot sit directly in a row; put the entry in a <p> or a child frame when a leader sits directly in a direction="row" frame or cell.
  • <leader> char '…' with spacing '…' must be one run of visible characters when char is empty or holds a space.
  • <leader> char '…' with spacing '…' repeats at no width. Use a visible char or a positive spacing when neither the glyph nor the spacing has any width.

To build a contents page with leaders, see Table of Contents.