Formatting

Customize the appearance of your documents with NovaType style rules.

Page Configuration

#set page(
  paper: "a4",                  // Format: a4, letter, a5...
  margin: (
    top: 2.5cm,
    bottom: 2cm,
    left: 2.5cm,
    right: 2cm
  ),
  header: [
    #align(right)[My Document]
    #line(length: 100%)
  ],
  footer: [
    #align(center)[
      Page #counter(page).display()
    ]
  ],
  numbering: "1"               // Page numbering
)

Available Page Formats

Format Dimensions Usage
"a4"210 x 297 mmEuropean standard
"letter"8.5 x 11 inAmerican standard
"a5"148 x 210 mmSmall format
"presentation-16-9"16:9Slides

Text Configuration

#set text(
  font: "Arial",           // Main font
  size: 11pt,              // Base size
  fill: rgb("#333333"),   // Text color
  lang: "en",              // Language (hyphenation, quotes)
  weight: "regular",       // Weight: thin, regular, bold
  style: "normal"          // Style: normal, italic, oblique
)

Popular Fonts

// Serif (formal documents)
#set text(font: "Times New Roman")
#set text(font: "Georgia")
#set text(font: "Garamond")

// Sans-serif (modern documents)
#set text(font: "Arial")
#set text(font: "Helvetica")
#set text(font: "Calibri")

// Monospace (code)
#set raw(font: "JetBrains Mono")

Paragraph Configuration

#set par(
  justify: true,           // Justification
  leading: 0.65em,         // Line spacing
  first-line-indent: 1em,  // First line indent
  spacing: 1.2em           // Space between paragraphs
)

Heading Styles

// Numbering
#set heading(numbering: "1.1")

// Custom style
#show heading.where(level: 1): it => {
  set text(size: 18pt, weight: "bold", fill: rgb("#2563eb"))
  v(1em)
  block(it)
  v(0.3em)
  line(length: 100%, stroke: 2pt + rgb("#2563eb"))
  v(0.8em)
}

#show heading.where(level: 2): it => {
  set text(size: 14pt, weight: "bold")
  v(0.8em)
  block(it)
  v(0.4em)
}

Colors

// Color definition
#let primary = rgb("#2563eb")
#let secondary = rgb("#64748b")
#let accent = rgb("#059669")

// Usage
#text(fill: primary)[Blue text]

// Other formats
rgb(255, 0, 0)          // RGB
rgb("#ff0000")          // Hex
cmyk(0%, 100%, 100%, 0%) // CMYK
luma(50%)               // Grayscale

Blocks and Boxes

// Simple block
#block(
  fill: rgb("#f1f5f9"),
  inset: 1em,
  radius: 4pt,
  width: 100%
)[
  Block content with colored background and rounded corners.
]

// Box with border
#block(
  stroke: 1pt + rgb("#2563eb"),
  inset: 1em,
  radius: 4pt
)[
  Boxed content with blue border.
]

// Note or warning
#block(
  fill: rgb("#fef3c7"),
  stroke: (left: 4pt + rgb("#f59e0b")),
  inset: 1em
)[
  *Warning:* This is an important warning.
]

Lines and Separators

// Horizontal line
#line(length: 100%)

// Styled line
#line(
  length: 100%,
  stroke: 2pt + rgb("#2563eb")
)

// Dashed line
#line(
  length: 100%,
  stroke: (dash: "dashed")
)

Columns

// Two-column document
#set page(columns: 2)

// Section with columns
#columns(2, gutter: 1cm)[
  First column content...

  #colbreak()

  Second column content...
]

Variables and Custom Functions

// Variables
#let title = "My Document"
#let author = "John Doe"

// Custom function
#let note(body) = block(
  fill: rgb("#e0f2fe"),
  inset: 1em,
  radius: 4pt,
  width: 100%
)[
  #text(weight: "bold")[Note:] #body
]

// Usage
#note[This is an important note.]
set vs show

#set defines default values. #show transforms the appearance of existing elements.