Typst Syntax
This is not a reference to Typst syntax, see Typst Reference for that. This is a demonstration of what you can do with Typst syntax in Tybios.
Basic Text
This is a normal text. You can make it italic or bold. You can also make it both. And underlined, strikethrough, overlined are also supported. Why not make it highlighted?
Left a blank line to start a new paragraph.
Insert \ to break a line without starting a new paragraph.
Some characters need to be escaped, such as #, *, _, `, \, as they are markup characters.
Unfortunately, you canβt change the font family, size and color inside Typst, they are determined by CSS in Tybios.
Links
Links can be created using the #link(target, content)11 Or #link(target)[content], this is a syntactic sugar for the special case of first form: #link(target, [content]). function. The first argument is the URL, and the second argument is the text to display.
Target can be a URL, like source of Tybios or home page. Typst label an be also a target, like the sine diagram figure or this section.
See more imformation about links in Typst Reference: link.
Blockquotes
Use #quote(block: true, attribution: "Author Name")[Content] to create a blockquote with attribution.
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyse a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
Robert A. Heinlein
Raw Blocks
This is an inline raw block println!("Hello, world!");.
This is an inline syntax-highlighted raw block println!("Hello, world!");.
This is a long inline raw block @media(prefers-color-scheme:dark){:root{background-color:var(--color-neutral-900);color:var(--color-neutral-300)}}.
Js syntax highlight are handled by syntect:
class T { constructor() { console.log("Hello, world!"); }}Typst syntax hightlight are specially handled internally:
#let fn(x) = xEquations
This is an inline equation .
This is a display equation:
Tables
Create a table using the #table() function. See more information about tables in Typst Reference: Table Function.
| Framework | Language | License | Description |
|---|---|---|---|
| Astro | TypeScript | MIT | The web framework for content-driven websites. |
| Eleventy | JavaScript | MIT | A simpler site generator. |
| Hugo | Go | Apache-2.0 | The worldβs fastest framework for building websites. |
| Zola | Rust | MIT / EUPL-1.2 | A static site generator in a single binary with everything built-in. |
Prefer to Markdown tables? A Typst package tablem can help you with that.
| Name | Location | Height | Score |
|---|---|---|---|
| John | Second St. | 180 cm | 5 |
| Wally | Third Av. | 160 cm | 10 |
Figures
Use #tybios.frame() to wrap any content that canβt automatically convert to HTML, convert them to SVGs. 22 Converted SVGs will adapt to dark theme by color invert and hue rotation, but the result may not be perfect.
Lists
- An unordered list here
- You can use
-to start a unordered list item.
- An ordered list here
- You can use
+to start a ordered list item, and the number will be automatically generated. - You can also use numbers to specify the order.
- After a specified order item, the next item will continue the order you specified.
- Term
- A word or expression that has a precise meaning in some uses or is peculiar to a science, art, profession, or subject. Here is a list of terms.
- SVG
- Scalable Vector Graphics, an XML-based markup language for describing two-dimensional based vector graphics.
- XML
- EXtensible Markup Language, a strict serialization of the DOM.
- DOM
- Document Object Model, connects web pages to scripts or programming languages by representing the structure of a document.
- HTML
- HyperText Markup Language, a standard for structuring web content.
- URL
- Uniform Resource Locator, a text string that specifies where a resource can be found on the Internet.