Basic Syntax

NovaType uses Typst syntax, a modern and expressive markup language. Here are the fundamental elements.

Writing Modes

NovaType has three main modes:

Mode Description Example
Markup Text with formatting Text *bold* and _italic_
Code Functions and logic #set text(size: 12pt)
Math Mathematical equations $ x^2 + y^2 = z^2 $

Text and Paragraphs

Plain text is written directly. Paragraphs are separated by a blank line.

This is a first paragraph. It can extend
across multiple lines in the source code.

This is a second paragraph, separated from the first
by a blank line.

Text Formatting

Syntax Result Description
*bold* bold Bold text
_italic_ italic Italic text
`code` code Inline code
*_bold italic_* bold italic Combination
~subscript~ H2O Subscript
^superscript^ x2 Superscript

Headings and Sections

Headings use the = sign. The number of = determines the level:

= Level 1 Heading

== Level 2 Heading

=== Level 3 Heading

==== Level 4 Heading

To enable automatic numbering:

#set heading(numbering: "1.1")   // 1, 1.1, 1.1.1
#set heading(numbering: "I.A.1") // I, I.A, I.A.1
#set heading(numbering: "1.")   // 1., 1.1., 1.1.1.

Lists

Bullet Lists

- First item
- Second item
  - Sub-item
  - Another sub-item
- Third item

Numbered Lists

+ First step
+ Second step
  + Sub-step A
  + Sub-step B
+ Third step

Term Lists

/ NovaType: Modern document composition system
/ Typst: Underlying rendering engine
/ LaTeX: Traditional typesetting system

Links and References

External Links

// Simple link
https://novatype.dev

// Link with text
#link("https://novatype.dev")[Official website]

Labels and Internal References

// Create a label
= Introduction <intro>

// Reference the label
See section @intro for more details.

Comments

// Single line comment

/* Multi-line
   comment */

Code Blocks

// Inline code
The `print()` function displays text.

// Code block
```python
def hello():
    print("Hello, World!")
```

// Code block with typst
#raw(lang: "python", block: true, `
def hello():
    print("Hello!")
`)

Special Characters

Syntax Result Description
\* * Literal asterisk
\_ _ Literal underscore
\# # Literal hash
--- Em dash
-- En dash
... Ellipsis

Basic Functions

Functions start with #:

// Vertical spacing
#v(1cm)        // 1 centimeter
#v(1em)        // 1 font size

// Horizontal spacing
#h(1cm)

// Page break
#pagebreak()

// Alignment
#align(center)[Centered text]
#align(right)[Right-aligned text]

// Block with style
#block(fill: rgb("#f0f0f0"), inset: 1em)[
  Block content
]
Tip

Square brackets [] contain markup content, while parentheses () contain function arguments.

Next Steps