Skip to main content
Every Autype document has a defaults configuration that controls the visual appearance of all elements. Styles are applied automatically during rendering — you don’t need to add inline styling to every element.

How styles work

Styles are defined in the document’s defaults.styles object. Each element type has its own style configuration. When you render a document, the renderer applies these styles to all matching elements. Inline style overrides (e.g., <h1 align="center">) take precedence over defaults.

Style categories

Text styles

Style keyApplies toKey properties
heading1heading6Headings h1–h6fontFamily, fontSize, fontWeight, color, align, spacing
textStandard paragraphsfontFamily, fontSize, fontWeight, fontStyle, color, align, spacing, lineSpacing
text2Secondary paragraphs (| text)Same as text

Caption styles

Captions are automatically generated for images, charts, and tables that have a caption or alt text.

Figure captions

Applies to images and charts with captions. Configured under defaults.styles.figureCaption:
PropertyValuesDefaultDescription
disabletrue, falsefalseDisable figure captions globally
prefixString"Figure"Prefix for auto-numbering (e.g., "Figure", "Abb.", "Fig.")
fontFamilyFont name(inherits)Caption font family
fontSizeNumber (pt)(smaller than body)Caption font size
fontWeightnormal, boldnormalCaption font weight
fontStylenormal, italicitalicCaption font style
colorHex color(inherits)Caption text color
alignleft, center, rightcenterCaption alignment
spacingBeforeNumber (pt)4Space between image/chart and caption
A figure caption renders as: Figure 1: Your caption text The number is auto-incremented across the document. The prefix ("Figure") is configurable — set it to "Abb." for German documents or "Fig." for abbreviated English.

Table captions

Applies to tables with the caption attribute. Configured under defaults.styles.tableCaption:
PropertyValuesDefaultDescription
disabletrue, falsefalseDisable table captions globally
prefixString"Table"Prefix for auto-numbering (e.g., "Table", "Tabelle", "Tab.")
fontFamilyFont name(inherits)Caption font family
fontSizeNumber (pt)(smaller than body)Caption font size
fontWeightnormal, boldnormalCaption font weight
fontStylenormal, italicitalicCaption font style
colorHex color(inherits)Caption text color
alignleft, center, rightcenterCaption alignment
spacingAfterNumber (pt)4Space between caption and table
A table caption renders as: Table 1: Your caption text Controls the appearance of internal cross-references. Configured under defaults.styles.refLink:
PropertyValuesDefaultDescription
boldtrue, falsefalseBold reference links
italictrue, falsefalseItalic reference links
underlinetrue, falsetrueUnderline reference links
colorHex color#0000FFReference link color

List of Abbreviations style

Controls how the abbreviation list is rendered. Configured under defaults.styles.listOfAbbreviations:
PropertyValuesDefaultDescription
fontFamilyFont name(inherits)Font family
fontSizeNumber (pt)(inherits)Font size
fontWeightnormal, boldnormalFont weight

Example configuration

{
  "defaults": {
    "styles": {
      "heading1": {
        "fontFamily": "Georgia",
        "fontSize": 24,
        "fontWeight": "bold",
        "color": "#1a1a1a",
        "spacing": { "before": 24, "after": 12 }
      },
      "text": {
        "fontFamily": "Arial",
        "fontSize": 11,
        "lineSpacing": 1.5
      },
      "figureCaption": {
        "prefix": "Abb.",
        "fontStyle": "italic",
        "align": "center",
        "fontSize": 9
      },
      "tableCaption": {
        "prefix": "Tabelle",
        "fontStyle": "italic",
        "align": "center",
        "fontSize": 9
      },
      "refLink": {
        "color": "#0066cc",
        "underline": true
      }
    }
  }
}