Universe
Create project in app

Scripst is a template package based on Typst, offering a set of simple and efficient document templates suitable for everyday documents, assignments, notes, papers, and other scenarios.

Current Version License Docs Online Latest Release

็ฎ€ไฝ“ไธญๆ–‡ | English

๐Ÿ“‘ Contents


๐Ÿš€ Features

  • Added the countblock module: A customizable-named and colored block with a built-in counter that can be referenced anywhere in the document. It supports theorem/problem/remark typesetting. For details, see ๐Ÿ†• countblock module.
  • Quick settings via labels: Font color customization, disabling math environments, and removing title numbering.
  • Enhanced counter hierarchy: Global counters now support multi-level numbering formats (1, 1.1, 1.1.1). Equations, figures, and countblock can adopt hierarchical numbering as needed.
  • New modules: blankblock, proof, solution, and other environments.
  • Universal function #newpara(): Instantly switch to a new paragraph without layout issues.
  • Personalization options: Easily adjust document indentation, line spacing, and paragraph spacing.
  • Multilingual design: Localized default layouts for different languages.
  • Simple and lightweight: Minimalist templates for effortless use and clean aesthetics.
  • High Extensibility: Modular design, easy to extend the templates.

Demo0 Demo1 Demo2

๐Ÿ“Œ Fonts

This project uses the following fonts by default:

If using these default fonts, please make sure they are correctly installed. Otherwise, replace them according to the instructions in Offline Usage.

๐Ÿ“ฆ Installation

Install Typst

Make sure Typst is installed. You can install it using the following commands:

sudo apt install typst # Debian/Ubuntu
sudo pacman -S typst # Arch Linux
winget install --id Typst.Typst # Windows
brew install typst # macOS

Or refer to the Typst official documentation for more information.

Using Scripst

๐Ÿ“„ Using Scripst

Import Scripst Template

Import the template at the beginning of your Typst file:

#import "@preview/scripst:1.1.1": *

Use typst init to quickly create a project:

typst init @preview/scripst:1.1.0 project_name

Create article Document

#show: scripst.with(
  template: "article",
  title: [How to Use Scripst],
  info: [This is an article template],
  author: ("Author1", "Author2", "Author3"),
  time: datetime.today().display(),
  abstract: [Abstract content],
  keywords: ("Keyword1", "Keyword2", "Keyword3"),
  font-size: 11pt,
  contents: true,
  content-depth: 2,
  matheq-depth: 2,
  counter-depth: 2,
  cb-counter-depth: 2,
  header: true,
  lang: "en",
)

๐Ÿ”ง Template Parameters

Parameter Type Default Value Description
template str "article" Choose template ("article", "book", "report")
title content, str, none "" Document title
info content, str, none "" Document subtitle or supplementary information
author content, str, array () List of authors
time content, str, none "" Document date
abstract content, str, none none Document abstract
keywords array () Keywords
preface content, str, none none Preface
font-size length 11pt Font size
contents bool false Whether to generate a table of contents
content-depth int 2 Table of contents depth
matheq-depth int 2 Math equation numbering depth
counter-depth int 2 Overall counter numbering depth
cb-counter-depth int 2 countblock module counter numbering depth
header bool true Enable header
lang str "zh" Language ("zh", "en", "fr", etc.)

๐Ÿ†• Feature Demonstration

The specific use of this section is described in [Scripst Documentation](. /docs/builds/article.pdf).

countblock Module

The countblock module is a customizable module where you can set the name and color, and it comes with a built-in counter that can be referenced anywhere in the document. It can be used to create blocks for theorems, definitions, problems, notes, and more.

Below is an example of a countblock module:

countblock example

#theorem("thm", subname: [_Fermat's Last Theorem_], lab: "fermat", cb)[

  No three $a, b, c in NN^+$ can satisfy the equation
  $
    a^n + b^n = c^n
  $
  for any integer value of $n$ greater than 2.
]
#proof[Cuius rei demonstrationem mirabilem sane detexi. Hanc marginis exiguitas non caperet.]
Fermat did not provide a public proof for @fermat.

This will create a theorem block and allow it to be referenced in the document.

Quick setting by using lable

== Schrรถdinger equation <hd.x>

Below is Schrรถdinger equation๏ผš
$
  i hbar dv(,t) ket(Psi(t)) = hat(H) ket(Psi(t))
$ <text.blue>
where
$
  ket(Psi(t)) = sum_n c_n ket(phi_n)
$ <eq.c>
is the wave function. From this, the time-independent Schrรถdinger equation can be derived:
$
  hat(H) ket(Psi(t)) = E ket(Psi(t))
$
<text.teal>
where $E$<text.red> is #[energy]<text.lime>ใ€‚

labelset example

newpara function

#newpara()

Some of the text after the environment will not be automatically line-breaked, such as math equations, code blocks, countblock, etc., because some explanation of the above may be needed.

But if you need line breaks, you can use the #newpara() function. The newly opened natural paragraph will be indented automatically and the line spacing will be adjusted automatically.

This function allows you to create new natural paragraphs in all scenarios without worrying about layout!

So when you think the layout between paragraphs is not pretty enough, try using the #newpara() function.


โœจ Template Examples and Explanations

Article

Article Page 1 Article Page 2

Aritcle Demo

Book

Book Page 1 Book Page 2

Book Demo (Only in Simplified Chinese)

Report

Report Page 1 Report Page 2

Report Demo (Only in Simplified Chinese)

๐Ÿ“œ Contributing

Feel free to submit issues or pull requests! If you have any improvement suggestions, join the discussion.

  • GitHub Repository: Scripst
  • Issue Feedback: Submit an issue to discuss

๐Ÿ”— Dependencies

For certain content, Scripst uses the following Typst packages:

๐Ÿ“ License

This project is licensed under the MIT License.

๐Ÿ“ฅ Offline Usage

To use the template locally or make adjustments, you can manually download the Scripst template.

Method 1: Manual Download

  1. Visit the Scripst GitHub repository.
  2. Click the <> Code button.
  3. Select Download ZIP.
  4. After extraction, place the template files in your project directory.

Recommended Directory Structure

project/  
โ”œโ”€โ”€ src/  
โ”‚   โ”œโ”€โ”€ main.typ  
โ”‚   โ”œโ”€โ”€ components.typ  
โ”œโ”€โ”€ pic/  
โ”‚   โ”œโ”€โ”€ image.jpg  
โ”œโ”€โ”€ main.typ  
โ”œโ”€โ”€ chap1.typ  
โ”œโ”€โ”€ chap2.typ  

If the template is stored in the src/ directory, import it as:

#import "src/main.typ": *  

Method 2: Using Typst Local Package Management

Manually download Scripst and store it in:

~/.local/share/typst/packages/preview/scripst/1.1.1                 # Linux  
%APPDATA%\typst\packages\preview\scripst\1.1.1                      # Windows  
~/Library/Application Support/typst/packages/preview/scripst/1.1.1  # macOS  

Alternatively, run the following command:

cd {data-dir}/typst/packages/preview/scripst  
git clone https://github.com/An-314/scripst.git 1.1.1  

Here, data-dir refers to Typstโ€™s data directory (e.g., ~/.local/share/ on Linux, %APPDATA%\ on Windows, or ~/Library/Application Support/ on macOS).

Then import the template directly in your Typst file:

#import "@local/scripst:1.1.1": *  

Use typst init to create a project quickly:

typst init @local/scripst:1.1.1 project_name  

Scripst offers several adjustable settings, i.e. font, colour palette, default countblock name in ./src/configs.typ. You can adjust them per your need.

๐ŸŽฏ TODO

  • [ ] Add beamer template
  • [ ] Add more configuration options