tinymist/editors/vscode
2024-03-17 19:52:01 +08:00
..
icons dev: init 2024-03-07 05:29:31 +08:00
scripts feat: add template gallery as template picker (#52) 2024-03-16 22:23:09 +08:00
src feat: init template in place (#62) 2024-03-17 16:59:21 +08:00
.eslintignore dev: init 2024-03-07 05:29:31 +08:00
.eslintrc.js feat: add template gallery as template picker (#52) 2024-03-16 22:23:09 +08:00
.gitignore feat: support font arguments 2024-03-11 02:24:27 +08:00
.prettierignore dev: init 2024-03-07 05:29:31 +08:00
.prettierrc.js dev: init 2024-03-07 05:29:31 +08:00
.vscodeignore fix: editor-tools files are not bundled (#60) 2024-03-17 15:38:27 +08:00
CHANGELOG.md build: bump version to 0.11.0 (#63) 2024-03-17 19:52:01 +08:00
language-configuration.json dev: init 2024-03-07 05:29:31 +08:00
LICENSE dev: init 2024-03-07 05:29:31 +08:00
package.json build: bump version to 0.11.0 (#63) 2024-03-17 19:52:01 +08:00
README.md build: bump version to 0.10.3 (#54) 2024-03-17 00:57:36 +08:00
tsconfig.json feat: add template gallery as template picker (#52) 2024-03-16 22:23:09 +08:00
typst.tmLanguage.json dev: init 2024-03-07 05:29:31 +08:00

Tinymist Typst VS Code Extension

A VS Code or VS Codium extension for Typst. You can find the extension on:

Features

See Tinymist features for a list of features.

Usage Tips

  • This extension compiles to PDF, but it doesn't have a PDF viewer yet. To view the output as you work, install a PDF viewer extension, such as vscode-pdf.
  • To initialize a Typst project:
    • Use command Typst Init Template (tinymist.initTemplate) to initialize a new Typst project based on a template.
    • Use command Typst Show Template (tinymist.showTemplateGallery) to show available Typst templates for picking up a template to initialize.
  • There is a global configuration tinymist.typstExtraArgs to pass extra arguments to tinymist LSP, like what you usually do with typst-cli CLI.
    • For example, you can set it to ["--input=awa=1", "--input=abaaba=2"] to configure sys.inputs.
    • Note: the arguments has quite low priority, and that may be overridden by other settings.
  • To find a way to compile PDF:
    • Click the code len Export PDF at the top of document, or use command Typst Show PDF ..., to show the current document to PDF.
    • Use command Typst Export PDF to export the current document to PDF.
    • There are code lens buttons at the start of the document to export your document to PDF or other formats.
  • To configure path to search fonts:
    1. Open settings.
    • File -> Preferences -> Settings (Linux, Windows).
    • Code -> Preferences -> Settings (Mac).
    1. Search for "Tinymist Font Paths" for providing paths to search fonts order-by-order.
    2. Search for "Tinymist No System Fonts" for disabling system fonts to be searched, which is useful for reproducible rendering your PDF documents.
    3. Reload the window or restart the vscode editor to make the settings take effect. Note: you must provide absolute paths. Note': you can use vscode variables in the settings, see vscode-variables for more information.
  • To configure the root path resolved for Typst compiler:
    1. Open settings.
    2. Search for "Tinymist Root Path" and modify the value.
    3. Reload the window or restart the vscode editor to make the settings take effect. Note: you must provide absolute paths.
  • To configure when PDFs are compiled:
    1. Open settings.
    2. Search for "Tinymist Export PDF".
    3. Change the "Export PDF" setting.
    • onSave makes a PDF after saving the Typst file.
    • onType makes PDF files live, as you type.
    • never disables PDF compilation.
    • "onDocumentHasTitle" makes a PDF when the document has a title and, as you save.
  • To configure where PDFs are saved:
    1. Open settings.
    2. Search for "Tinymist Output Path".
    3. Change the "Output Path" setting. This is the path pattern to store artifacts, you can use $root or $dir or $name to do magic configuration
    • e.g. $root/$dir/$name (default) for $root/path/to/main.pdf.
    • e.g. $root/target/$dir/$name for $root/target/path/to/main.pdf.
    • e.g. $root/target/foo for $root/target/foo.pdf. This will ensure that the output is always output to target/foo.pdf.
    1. Note: the output path should be substituted as an absolute path.

Technical

The extension uses Tinymist on the backend.