Typst for Beginners

Aus Wiki
Zur Navigation springen Zur Suche springen

Typst Introduction

[Bearbeiten | Quelltext bearbeiten]

See Open Source Downloads

  • Linux: use the package manager (normally typst package). Otherwise install Rust and cargo (Arch Linux Wiki, Ubuntu Users (Deutsch)), then install the typst-cli package: cargo install --locked typst-cli
  • macOS: same as Linux, or just use the Homebrew Formula
  • Windows: see Open Source, add the exe to %PATH%

Online - Open AND Sign Up, or just play here

See the official tutorial

For LaTeX People

[Bearbeiten | Quelltext bearbeiten]

Math becomes much simpler :) Symbol Reference helps a ton here.

And read the Guide for LaTeX Users.

For math conversion, see tex2typst Web App.

Instant Preview

[Bearbeiten | Quelltext bearbeiten]

Compared to LaTeX, one can instantly preview the output PDF file edits (even on older hardware!):

typst watch document.typ

Then use your favorite PDF viewer (zathura, MuPDF, etc.).

Hello World Template

[Bearbeiten | Quelltext bearbeiten]
#let project(
  author: "",
  title: "",
  font-size: 12pt,
  body,
) = {
  // set generic document metadata
  set document(author: author, title: title)
  // Margin of 20mm on all 4 sides, A4 format (width * height -> 210 mm * 297 mm)
  set page(margin: 20mm, paper: "a4")
  // Set de-AT (German, Austria) language hint
  set text(font: "Noto Sans", size: font-size, lang: "de", region: "at")

  // special argument name - everything else is inserted here (in our case, hello world)
  body
}

#show: project.with(
  author: "Ottakringer Drinker",
  title: "My first document",
)

= Die Überschrift, Niveau 1

Hallo Welt! Ich spreche österreichisch.

Of course, one can create a project.typ file with the project definition, and then import it like this (if same directory):

#import "./project.typ": project

#show: project.with(
 /* multi
    line
 */
 // same arguments follow...
)
  • Sign in or Sign up here!
  • Collaborative editing like Overleaf does in fact exist; create a Team, invite Members, work together on a Project.