typst(9)
[Home]
[Commands]
[Variables]
[Macro-Dev]
[Glossary]
SYNOPSIS
typ, typst - Typst Markup File.
FILES
hktypst.emf - Typst file hook definition
typst.eaf - Typst abbreviation file
typst.etf - Typst template file
EXTENSIONS
.typ, .typst - Typst files
DESCRIPTION
The Typst file hook provides a editing environment for Typst files. The file hook provides highlighting, folding of section, document outline using item-list and abbreviations. Fenced code blocks within triple backticks can be highlighted using the declared code block language.
File recognition is performed using the standard file extension .typ, .typst.
Abbreviations
The installation comes with a default abbreviation file for Typst code editing which can be used by writing short abbreviations like "fig" for a figure environment, "bib" for a bibliography file, "img" for an image file, or "co" for a code chunk - and then pressing the key-binding for the
expand-abbrev-handle(3) command. The list of abbreviations can be used interactively in the GUI version of MicroEmacs using the
abbrev-list(3) command.
Folding and Information Hiding
Generic folding is enabled within the Typst files. The folds occur about the level 1 and 2 headers, so headers with one or two equal symbols at the beginning of a line. The following commands are supported to show and hide the function bodies.
collapse-all(3) (un)folds all regions in the file,
collapse-current(3) (un)folds the current region.
List Items
Item listing is available and the level 1 and 2 headers of the file are displayed in the item-list.
Short Cuts
The short cut keys used within the buffer are:-
C-c C-c - Comment out the current line.
C-c C-d - Uncomment the current line.
f2 - (un)fold the current region
f3 - (un)fold all regions
f6 - list items
esc f6 - close list items
Code Chunk Highlighting
Inside code chunks as well syntax hilghlighting for a few programming languages like Tcl (tcl), R (r), GraphViz Dot (dot), Python (py), SQL (sql), MicroEmacs macro code (emf)or Javascript (js) is available. Here an example which should be highlighted within a Typst file using the R file hook:
```r
x = 1
test = function () {
print("Test")
}
```
SEE ALSO
(c) Copyright JASSPA 2025
Last Modified: 2025/09/25
Generated On: 2025/09/29