Skip to content

基于 rewind-note 魔改的自用 Typst 小红书模板。

License

Notifications You must be signed in to change notification settings

Candlest/typst-rednote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typst 小红书模板

基于 rewind-note 魔改的自用 Typst 小红书模板。

本地复用方法

方式1:软链接(推荐)

在你的项目目录中创建软链接,比如

ln -s <path/to/typst-rednote> ./typst-rednote

方式2:Git Submodule

git submodule add <repository-url> ./typst-rednote

在项目中使用

方式1:软链接项目

#import "typst-rednote/lib.typ": *

// 使用主题
#show: theme.with(
  font-family: serif-fonts,
  bg-color: rgb("#fff0f0"),
  accent-color: rgb("#ff6b6b"),
)

// 添加封面
#cover(
  title: "你的标题",
  subtitle: "副标题",
  author: "@你的ID",
)

// 开始写作
= 标题
正文内容...

方式2:直接在模板目录内

#import "lib.typ": *

可配置参数

  • font-family: 字体族(serif-fonts / sans-fonts / code-fonts)
  • bg-color: 背景色
  • text-color: 文字颜色
  • highlight-color: 高亮颜色
  • accent-color: 强调色
  • page-width: 页面宽度(默认 1080pt)
  • page-height: 页面高度(默认 1800pt)
  • body-size: 正文字号(默认 42pt)

所需字体

无衬线字体(Sans)

  • Source Han Sans SC - 思源黑体(主要字体)
  • Source Han Sans HW SC - 思源黑体等宽版(可选)
  • PingFang SC - macOS 原生黑体(macOS 自带)
  • Heiti SC - 基础黑体(macOS 自带)

衬线字体(Serif)

  • LXGW WenKai - 霞鹜文楷(推荐,下载地址:GitHub
  • Source Han Serif SC - 思源宋体(下载地址:GitHub
  • Songti SC
  • STSong

代码字体(Code/Mono)

  • JetBrains Mono - 主要代码字体(下载地址:官网
  • Menlo

请从各自官网下载并安装字体,或使用系统包管理器安装。

注意:模板使用了字体回退机制,如果没有全部字体,会自动使用系统可用字体。

文件结构

typst-rednote/
├── lib.typ           # 统一导出入口
├── main.typ          # 模板示例
├── core/
│   └── constants.typ # 字体、颜色等常量
└── themes/
    ├── theme.typ     # 主题函数
    └── cover.typ     # 封面组件

About

基于 rewind-note 魔改的自用 Typst 小红书模板。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages