A simple report for Typst with LaTeX style, fully customizable.
Usage
You can use this template in the Typst web app by clicking “Start from template” on the dashboard and searching for latexlike-report
.
Alternatively, you can use the CLI to kick this project off using the command
typst init @preview/latexlike-report
Typst will create a new directory with all the files needed to get you started.
Configuration
The template exports one function latexlike-report
with the following named parameters:
Cover Parameters
author (str)
: The main author of the document (must be a string)title (content)
: The main title of the reportsubtitle (content)
: The document’s subtitleparticipants (content)
: List of additional authors (the main author appears first)affiliation (content)
: Institution or academic affiliationyear (content)
: Publication year of the documentclass (content)
: Academic class or subjectother (content)
: Additional optional informationdate (content)
: Document date (can use #datetime.today().display() for current date)logo (image)
: Institutional logo image (usage: image(“path/to/image.svg”))
Theme and Language Configuration
theme-color (color)
: Main theme color (see color for more information)lang (str)
: Document language (“es” for Spanish, “en” for English, etc)participants-supplement (str)
: Text preceding the authors list (adjusts based on language)
Font Configuration
title-font (str)
: Font used for titlesfont (str)
: Main document text fontfont-size (length)
: Main font size (default: 13pt)font-weight (number)
: Font weight (default: 400)
Mathematics Configuration
math-font (str)
: Font for mathematical equationsmath-weight (number)
: Mathematical font weightmath-ref-supplement (str/function)
: Supplement for mathematical references (none, auto, or custom)math-numbering
(see numbering): Equation numbering style (default: “(1.1)”) From equate packagemath-number-mode (str)
: Numbering mode (“label” or “line”)math-sub-numbering (boolean)
: Enables sub-equation numbering (true or false)
Page Style
pagebreak-section (boolean)
: Inserts page break after level 1 headings (true or false)show-outline (boolean)
: Shows or hides table of contents (true or false)page-paper (str)
: Defines the type of paper (default: “a4”)
Headers and Footers (from chic header package)
You can add images, text, the number of the current page, etc, or put none if you don’t want some part of the header or footer.
Some useful function: chic-page-number()
, chic-heading-name()
h-l (content)
: Left header contenth-r (content)
: Right header contenth-c (content)
: Center header contentf-l (content)
: Left footer contentf-r (content)
: Right footer contentf-c (content)
: Center footer content
Special Features
Unnumbered headings
You can use <nonumber>
at the end of the same line of your heading to toggle to unnumbered headings, similar to \section*
in LaTeX
= Unnumbered heading <nonumber>
= <nonumber> Not an unnumbered heading
Unnumbered headings won’t appear in the outline.
Customize outline
You can customize the outline by disabling the default and then using a show rule and calling the function like here.
#show: latexlike-report.with(
.....
show-outline:false,
..... )
#show outline.entry: it => link(
it.element.location(),
it.indented(it.prefix(), it.body()),
) //this is just an example, it can be customized to your preference
#outline()
Fixed Features and Overriding
This template has some fixed features that you can keep or replace if you don’t like making it fully customizable. To replace it you just need to add a show rule below the main function call, for example:
#show: latexlike-report.with(
..... )
#show smallcaps: set text(font: "Latin Modern Roman Caps")
The fixed features are listed below:
Headings style and color
: see heading to learn how to customize it.Tables and figures caption
: using#show figure.caption()
you can change itParagraph style
: see par, default with justify and first line indentation.Paragraph justify off in tables
: I don’t recommend changing this, but you can do it adding#show table.cell: set par(justify: true)
chic-hdr package
: Learn how to use it here, you don’t need to import it, just add the show rule below the main functionequate package
: Learn how to use it here, you don’t need to import it, just add the show rule below the main function