Universe

Create project in app

An arXiv-style paper template for Typst. Compile to HTML and PDF from the same source!

diprint template preview

Quick start

#import "@preview/diprint:0.1.1": diprint, diprint-appendices

#show: diprint.with(
  title: "The Paper Of All Time",
  authors: (
    (name: "Jane Doe", email: "jane@uni.edu",
     affiliation: "University", orcid: "0000-0000-0000-0000"),
    (name: "wylited", email: "john@uni.org",
     affiliation: "God"),
  ),
  abstract: [A short abstract.],
  keywords: ("internet", "typesetting"),
  date: "January 2025",
)

= Introduction
...

#show: diprint-appendices
= Supplementary Material
...

Compiling

# PDF
typst compile paper.typ

# Standalone HTML (CSS inlined)
typst compile --features html paper.typ paper.html

For multi-file HTML output with an external stylesheet you can try:

// bundle.typ
#import "@preview/diprint:0.1.1": diprint, diprint-css, diprint-appendices

#asset("diprint.css", diprint-css())

#document("paper.html", title: [My Paper], [
  #show: diprint.with(use-bundle-css: true, ...)
  ...
])
typst compile --features html,bundle --format bundle bundle.typ out/
# out/paper.html + out/diprint.css

This may be updated in the future.

Options

diprint

Parameter Type Default
title str | content ""
authors array of dict ()
abstract content | none none
keywords array of str ()
date str | none none
header-text str "A Preprint"
short-title str | none none
use-bundle-css bool false
font str "serif"

Author dicts accept name, email, affiliation, and orcid.

For HTML output, set font: "sans" to use a sans-serif body font instead of the default serif.

diprint-appendices

A show rule that switches heading numbering to appendix style. Call it after the main body:

#show: diprint-appendices
= My Appendix
== Subsection

diprint-css

Returns the CSS as a string for use with asset() in bundle mode.

HTML output

HTML output is responsive, adapts to light and dark themes via prefers-color-scheme, and uses semantic <article> and <figure> elements with MathML for equations.

License

MIT — see LICENSE.

This template draws from a few external projects: