Skip to content

Conversation

@jjallaire
Copy link
Collaborator

@jjallaire jjallaire commented Mar 30, 2023

This PR implements support for the typst output format added in Pandoc v3.1.2.

Getting Started

To try out the typst format, do the following:

  1. Install the typist CLI tool: https://github.com/typst/typst#installing

  2. Install and configure the development version of Quarto: https://github.com/quarto-dev/quarto-cli#development-version

  3. Within the quarto-cli development directory, switch to the feature/typst branch then type quarto check to make sure the branch is correctly configured:

    $ git checkout feature/typst 
    $ quarto check
  4. Create a document that uses format: typst. For example:

    ---
    title: "My document"
    format: typst
    ---
    
    Hello, typst!

Typst Options

The following options are available for typst documents:

Option Description
toc Include a table of contents.
title Main document title
author. One or more document authors.
date Date of publication
abstract Article abstract
number-sections Apply numbering to sections and sub-sections
section-numbering Schema to use for numbering sections, e.g. 1.1.a.
margin Margins: xytopbottomleftright.
papersize Paper size: a4us-letter, etc.
fontsize Font size (e.g., 12pt)
section-numbering Schema to use for numbering sections, e.g. 1.1.a.
columns Number of columns for body text.
template File containing custom typst template
include-in-header .typ file to include in header
include-before-body .typ file to include before body
include-after-body .typ file to include after the body
keep-typ Keep the intermediate .typ file after render.

Raw Blocks

If you want to use raw typst markup, use a raw typst block. For example:

```{=typst}
#set par(justify: true)

== Background
In the case of glaciers, fluid
dynamics principles can be used
to understand how the movement
and behavior of the ice is
influenced by factors such as
temperature, pressure, and the
presence of other fluids (such as
water).
```

To learn more about typst markup, see the tutorial here: https://typst.app/docs/tutorial/

Known Limitations

  • Cross references are supported for figures, sections, and equations (but not subfigures, tables ,or theorems as these aren't yet supported in typst)
  • Callouts are not yet supported (they become block quotes with a bold heading)
  • Advanced page layout (panel layout, margin layout, etc.) does not work
  • There is not yet a system for titles blocks and template partials (as we have for PDF and HTML output)
  • Various other small things might not yet be implemented, please let us know if you see things that could use improvement!

@jjallaire jjallaire added this to the v1.4 milestone Mar 30, 2023
@jjallaire jjallaire marked this pull request as draft March 30, 2023 14:25
@ghost ghost assigned jjallaire Apr 20, 2023
@dragonstyle dragonstyle marked this pull request as ready for review April 25, 2023 18:36
@dragonstyle dragonstyle merged commit 27cec8b into main Apr 25, 2023
@cscheid cscheid deleted the feature/typst branch April 25, 2023 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants