forked from Xueheng-Li/quarto-book-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path_quarto-pdf.yml
More file actions
110 lines (98 loc) · 4.38 KB
/
_quarto-pdf.yml
File metadata and controls
110 lines (98 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# pdf profile: 渲染全书为 LaTeX/PDF
# 使用方式:quarto render --profile pdf
#
# project.output-dir 继承自 _quarto.yml(默认值:_book)
#
# =============================================================================
# TODO (template users): 用户通常需要修改的字段
# -----------------------------------------------------------------------------
# - format.pdf.mainfont 英文/拉丁正文字体(如 "Latin Modern Roman")
# - format.pdf.CJKmainfont 中文正文字体(如 "Noto Serif CJK SC" / "PingFang SC"
# / "Songti SC"),系统中必须实际安装该字体
# - format.pdf.documentclass 中文书使用 ctexbook;纯英文/拉丁书可换成 scrreport
# - format.pdf.papersize a4 / letter ……
# - project.render 章节列表(与 _quarto-full.yml 保持一致)
# - website.sidebar.contents PDF 不使用侧边栏,但 Quarto 仍要求 website 块存在
# 以便共用基础配置;保持与 full profile 一致即可
#
# 前置依赖:
# - 一个 TeX 发行版(推荐 quarto install tinytex)
# - LuaLaTeX 引擎(TinyTeX 与 TeX Live 默认提供)
# - 中文字体(macOS 自带 PingFang/Songti;Linux 推荐 Noto Serif/Sans CJK SC)
#
# 注意:opencode-prompt.lua 滤镜目前只会输出 RawBlock html,
# 这些块在 PDF 输出中不会被特殊渲染,会退化为普通代码块。
# 若需要在 PDF 中得到对应样式,需要为该滤镜增加 PDF/LaTeX 代码路径
# (例如使用 \begin{tcolorbox} … \end{tcolorbox} 之类的 RawBlock latex)。
# =============================================================================
project:
render:
- index.md
# 示例:渲染章节模板下的所有 md 文件
- chapters/chapter-template/index.md
- chapters/chapter-template/section-*.md
- chapters/chapter-template/summary.md
# TODO: 在此处追加更多章节,例如:
# - chapters/chapter-1/index.md
# - chapters/chapter-1/section-*.md
# - chapters/chapter-1/summary.md
website:
sidebar:
contents:
- index.md
# 示例:用 section 把章节组织成"部分"
- section: "第一部分:示例部分"
contents:
- section: chapters/chapter-template/index.md
contents:
- chapters/chapter-template/section-1.md
- chapters/chapter-template/section-2.md
- chapters/chapter-template/summary.md
# TODO: 按需添加更多部分与章节
format:
pdf:
# ----- 引擎 -----
pdf-engine: lualatex
# ----- 文档类 -----
# 默认使用 ctexbook(与 _quarto.yml 中 lang: zh 默认中文环境匹配)
# ctexbook 自动加载 xeCJK/luatexja-fontspec 等 CJK 支持
documentclass: ctexbook
classoption:
- UTF8
- oneside
# TODO: 如果你的书是纯英文/拉丁文,可改用 scrreport(KOMA-Script),
# 同时去掉 CJKmainfont、ctex 相关 classoption,并删掉/替换 \usepackage{xeCJK}
# 示例(取消下面三行的注释,并注释掉上面的 documentclass/classoption):
# documentclass: scrreport
# classoption:
# - paper=a4
# - 11pt
# ----- 纸张 / 字号 -----
papersize: a4
fontsize: 11pt
linestretch: 1.5
geometry:
- margin=2.5cm
# ----- 字体 -----
# TODO: 替换为系统中实际可用的字体名(fc-list :lang=zh 可以列出中文字体)
mainfont: "Latin Modern Roman" # 英文/拉丁正文
# sansfont: "Latin Modern Sans"
# monofont: "Latin Modern Mono"
CJKmainfont: "PingFang SC" # 中文正文(macOS 自带)
# 若使用 Linux/CI,可改成:CJKmainfont: "Noto Serif CJK SC"
# CJKsansfont: "PingFang SC"
# CJKmonofont: "STFangsong"
# ----- 目录与编号 -----
toc: true
toc-depth: 3
number-sections: false
# ----- 调试 -----
# Set to true while debugging LaTeX errors
keep-tex: false # 保留中间生成的 .tex,便于调试 LaTeX 报错
# ----- 备选:非中文环境的最小可用配置(参考用,已注释) -----
# 若切换为 scrreport / 纯拉丁文,可参考下面这段:
# include-in-header:
# text: |
# % 仅在不使用 ctex 系列时启用 xeCJK:
# % \usepackage{xeCJK}
# % \setCJKmainfont{Noto Serif CJK SC}