mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-12-23 08:47:50 +00:00
| .. | ||
| icons | ||
| scripts | ||
| src | ||
| .eslintignore | ||
| .eslintrc.js | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc.js | ||
| .vscodeignore | ||
| CHANGELOG.md | ||
| language-configuration.json | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| typst.tmLanguage.json | ||
Tinymist Typst VS Code Extension
A VS Code or VS Codium extension for Typst. You can find the extension on:
- Night versions available at GitHub Actions.
- Stable versions available at Visual Studio Marketplace.
- Stable versions available at Open VSX.
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.
- Use command
- There is a global configuration
tinymist.typstExtraArgsto pass extra arguments to tinymist LSP, like what you usually do withtypst-cliCLI.- For example, you can set it to
["--input=awa=1", "--input=abaaba=2"]to configuresys.inputs. - Note: the arguments has quite low priority, and that may be overridden by other settings.
- For example, you can set it to
- To find a way to compile PDF:
- Click the code len
Export PDFat the top of document, or use commandTypst Show PDF ..., to show the current document to PDF. - Use command
Typst Export PDFto 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.
- Click the code len
- To configure path to search fonts:
- Open settings.
- File -> Preferences -> Settings (Linux, Windows).
- Code -> Preferences -> Settings (Mac).
- Search for "Tinymist Font Paths" for providing paths to search fonts order-by-order.
- Search for "Tinymist No System Fonts" for disabling system fonts to be searched, which is useful for reproducible rendering your PDF documents.
- 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:
- Open settings.
- Search for "Tinymist Root Path" and modify the value.
- 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:
- Open settings.
- Search for "Tinymist Export PDF".
- Change the "Export PDF" setting.
onSavemakes a PDF after saving the Typst file.onTypemakes PDF files live, as you type.neverdisables PDF compilation.- "onDocumentHasTitle" makes a PDF when the document has a title and, as you save.
- To configure where PDFs are saved:
- Open settings.
- Search for "Tinymist Output Path".
- Change the "Output Path" setting. This is the path pattern to store artifacts, you can use
$rootor$diror$nameto do magic configuration
- e.g.
$root/$dir/$name(default) for$root/path/to/main.pdf. - e.g.
$root/target/$dir/$namefor$root/target/path/to/main.pdf. - e.g.
$root/target/foofor$root/target/foo.pdf. This will ensure that the output is always output totarget/foo.pdf.
- Note: the output path should be substituted as an absolute path.
Technical
The extension uses Tinymist on the backend.