1- # 第二章 进阶用法 / Chapter 2: Advanced Usage
1+ # Chapter 2: Advanced Usage
22
3- 本章介绍 mdpress 的高级功能,帮助你打造专业级的 PDF 图书。
3+ This chapter covers advanced mdpress features for creating professional-grade PDF books.
44
5- * This chapter covers advanced mdpress features for creating professional-grade PDF books. *
5+ ## 2.1 Custom Themes
66
7- ## 2.1 自定义主题 / Custom Themes
7+ mdpress comes with three built-in themes:
88
9- mdpress 内置三套主题 / mdpress comes with three built-in themes:
9+ - ** technical** : Technical docs style, ideal for programming books
10+ - ** elegant** : Elegant literary style, ideal for literary works
11+ - ** minimal** : Minimalist style, ideal for notes and memos
1012
11- - ** technical** :技术文档风格,适合编程书籍 / Technical docs style, ideal for programming books
12- - ** elegant** :优雅文学风格,适合文学作品 / Elegant literary style, ideal for literary works
13- - ** minimal** :极简风格,适合笔记和备忘录 / Minimalist style, ideal for notes and memos
14-
15- 在 ` book.yaml ` 中切换主题 / Switch themes in ` book.yaml ` :
13+ Switch themes in ` book.yaml ` :
1614
1715``` yaml
1816style :
1917 theme : " elegant"
2018` ` `
2119
22- ### 创建自定义主题 / Creating Custom Themes
20+ ### Creating Custom Themes
2321
24- 你也可以创建自己的主题文件(YAML 格式)/ You can create your own theme file (YAML format):
22+ You can create your own theme file (YAML format):
2523
2624` ` ` yaml
2725name : my-theme
@@ -34,32 +32,32 @@ colors:
3432 link : " #2980b9"
3533` ` `
3634
37- ## 2.2 交叉引用 / Cross References
35+ ## 2.2 Cross References
3836
39- mdpress 支持图表和章节的交叉引用。/ mdpress supports cross-referencing of figures, tables, and sections.
37+ mdpress supports cross-referencing of figures, tables, and sections.
4038
41- ### 图片引用 / Figure References
39+ ### Figure References
4240
4341` ` ` markdown
44- {#fig: architecture}
42+ {#fig- architecture}
4543
46- 如 {{ref:fig:architecture}} 所示... / As shown in {{ref:fig: architecture}}...
44+ As shown in {{ref:fig- architecture}}...
4745```
4846
49- ### 表格引用 / Table References
47+ ### Table References
5048
5149``` markdown
52- | 列1 / Col1 | 列2 / Col2 |
53- | -----| -----|
54- | a | b |
55- {#tab: comparison }
50+ | Col1 | Col2 |
51+ | ------ | - -----|
52+ | a | b |
53+ {#tab- comparison}
5654
57- 详见 {{ref:tab : comparison }}。/ See {{ref:tab: comparison }}.
55+ See {{ref: tab- comparison }}.
5856```
5957
60- ## 2.3 多文件组织 / Multi-file Organization
58+ ## 2.3 Multi-file Organization
6159
62- 对于大型图书项目,建议按章节组织文件 / For large book projects, organize files by chapter:
60+ For large book projects, organize files by chapter:
6361
6462```
6563my-book/
@@ -79,38 +77,34 @@ my-book/
7977 └── references.md
8078```
8179
82- ## 2.4 页眉页脚 / Headers & Footers
80+ ## 2.4 Headers & Footers
8381
84- 自定义页眉页脚支持模板变量 / Custom headers and footers support template variables:
82+ Custom headers and footers support template variables:
8583
86- | 变量 / Variable | 说明 / Description |
87- | ------| ------|
88- | ` {{.Book.Title}} ` | 书名 / Book title |
89- | ` {{.Book.Author}} ` | 作者 / Author |
90- | ` {{.Chapter.Title}} ` | 当前章节标题 / Current chapter title |
91- | ` {{.PageNum}} ` | 当前页码 / Current page number |
84+ | Variable | Description |
85+ | ---------- | ------- ------|
86+ | ` {{.Book.Title}} ` | Book title |
87+ | ` {{.Book.Author}} ` | Author |
88+ | ` {{.Chapter.Title}} ` | Current chapter title |
89+ | ` {{.PageNum}} ` | Current page number |
9290
93- 配置示例 / Configuration example:
91+ Configuration example:
9492
9593``` yaml
9694style :
9795 header :
9896 left : " {{.Book.Title}}"
9997 right : " {{.Chapter.Title}}"
10098 footer :
101- center : " 第 {{.PageNum}} 页 / Page {{.PageNum}}"
99+ center : " Page {{.PageNum}}"
102100` ` `
103101
104- ## 2.5 脚注 / Footnotes[^1]
105-
106- mdpress 完整支持 Markdown 脚注语法,脚注会自动编号并在页面底部或章节末尾显示。
107-
108- *mdpress fully supports Markdown footnote syntax. Footnotes are automatically numbered and displayed at the bottom of the page or end of the chapter.*
102+ ## 2.5 Footnotes[^1]
109103
110- [^1]: 这是一个脚注示例。/ This is a footnote example .
104+ mdpress fully supports Markdown footnote syntax. Footnotes are automatically numbered and displayed at the bottom of the page or end of the chapter .
111105
112- ## 2.6 小结 / Summary
106+ [^1]: This is a footnote example.
113107
114- 通过本章的学习,你已经掌握了 mdpress 的大部分高级功能。更多详细信息请参阅项目文档。
108+ ## 2.6 Summary
115109
116- * After this chapter, you have mastered most of the advanced features of mdpress. For more details, refer to the project documentation.*
110+ After this chapter, you have mastered most of the advanced features of mdpress. For more details, refer to the project documentation.
0 commit comments