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.
็ฎไฝไธญๆ | English
๐ Contents
- ๐ Contents
- ๐ Features
- ๐ Fonts
- ๐ฆ Installation
- ๐ Using Scripst
- ๐ง Template Parameters
- ๐ Feature Demonstration
- โจ Template Examples and Explanations
- ๐ Contributing
- ๐ Dependencies
- ๐ License
- ๐ฅ Offline Usage
- ๐ฏ TODO
๐ 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, andcountblock
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.
๐ Fonts
This project uses the following fonts by default:
- Primary fonts: CMU Serif, Consolas
- Alternative fonts: Linux Libertine
- Chinese fonts such as SimSun, SimHei, KaiTi, etc.
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:
#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>ใ
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
Book
Book Demo (Only in Simplified Chinese)
Report
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
- Visit the Scripst GitHub repository.
- Click the
<> Code
button. - Select
Download ZIP
. - 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