This repository provides a powerful authoring environment for the Typst typesetting system, enhanced with integrated AI assistance.
A key feature of this template is its deep integration with large language models (LLMs) to provide expert-level assistance for writing formal academic articles. The AI's knowledge base is built directly from the official Typst documentation, which is included as a submodule.
By referencing the complete and up-to-date documentation, the AI can:
- Provide Accurate Guidance: Offer precise and reliable answers based on the official Typst tutorials, guides, and reference materials.
- Avoid Hallucinations: Significantly reduce the risk of generating incorrect or outdated code (e.g., LaTeX syntax) by grounding its responses in the official documentation. This is particularly helpful given the relative scarcity of Typst examples in public training data.
- Accelerate Your Workflow: Help you quickly find the right functions, understand complex syntax, and apply best practices for academic writing in Typst.
This approach ensures that you receive high-quality, context-aware support, making your writing process faster and more efficient.
This repository includes the following templates:
- Article: A standard template for academic papers.
- Sample:
article_sample.typ
- Sample:
- Poster: A template for creating conference posters.
- Template:
templates/poster.typ
- Sample:
poster_sample.typ
- Template:
- Slide: A template for presentation slides.
- Template:
templates/slide.typ
- Sample:
slide_sample.typ
- Template:
To use this template, simply clone the repository and initialize the submodule to ensure the AI has access to the full documentation:
git clone <repository-url>
cd Typst_template
git submodule update --init --recursive
You can then begin writing your document by editing one of the sample files (article_sample.typ
, poster_sample.typ
, or slide_sample.typ
) and interact with the integrated AI to assist you.
To compile .typ
files, you need to install the Typst command-line interface (CLI). You have two main options:
-
Using Cargo: If you have Rust and Cargo installed, you can install the CLI from source:
cargo install --git https://github.com/typst/typst typst-cli
-
Pre-compiled Binaries: You can download pre-compiled binaries for your operating system from the official Typst releases page.
After installation, ensure that the typst
executable is in your system's PATH.
This repository is configured with a pre-commit hook that automatically compiles your .typ
files into PDFs before each commit. To enable this feature, follow these steps:
-
Install Python: Make sure you have Python installed on your system.
-
Install pre-commit: Use pip, the Python package installer, to install the
pre-commit
framework:pip install pre-commit
-
Install the Git hooks: In your repository, run the following command to set up the pre-commit hooks:
pre-commit install
Now, whenever you commit changes to a .typ
file, a corresponding PDF will be generated in the same directory.