fix(pdf): center cover pages and prefer TeX Gyre Termes

This commit is contained in:
Zhengshou Lai
2026-07-29 15:58:04 +08:00
parent 8f60860419
commit 01165b5a69
4 changed files with 15 additions and 12 deletions
+6 -6
View File
@@ -18,13 +18,13 @@
\usepackage{caption}
\usepackage{hyperref}
% ---- fonts (Times New Roman + SimSun/SimHei/KaiTi; ctex default set as fallback) ----
\IfFontExistsTF{Times New Roman}{\setmainfont{Times New Roman}}{}
% ---- fonts: TeX Gyre Termes + SimSun/SimHei (fallback ctex auto) ----
\xeCJKsetup{CJKecglue = \hspace{0.3em}}
\usepackage{tgtermes}
\IfFontExistsTF{SimSun}{%
\setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun}%
\setCJKsansfont[BoldFont={SimHei}]{SimHei}%
}{}
\IfFontExistsTF{Courier New}{\setmonofont{Courier New}}{\setmonofont{Menlo}}
% ---- vertical rhythm (keep in sync with Typst md-to-pdf/manual template) ----
% Typst: leading 0.76em, paragraph spacing 1.08em
@@ -117,16 +117,16 @@
\begin{document}
% ---- cover page ----
% ---- cover page (vertically centered) ----
\begin{titlepage}
\vspace*{\fill}
\centering
\vspace*{2cm}
{\fontsize{28}{34}\selectfont\bfseries\color{primary} Phynexis Python API 参考手册\par}
\vspace{0.8cm}
{\fontsize{16}{20}\selectfont\color{accent} 技术与使用文档\par}
\vspace{2cm}
{\fontsize{12}{16}\selectfont\color{light} 2026 年 7 月\par}
\vfill
\vspace*{\fill}
\end{titlepage}
\tableofcontents
@@ -7,8 +7,8 @@
#let cover-page(title, subtitle, date) = {
page(margin: (top: 3cm, bottom: 3cm, left: 3cm, right: 3cm))[
#align(center + horizon)[
#v(2cm)
#v(1fr)
#align(center)[
#text(size: 28pt, weight: "bold", fill: primary, title)
#if subtitle != none {
v(0.8cm)
@@ -19,6 +19,7 @@
text(size: 12pt, fill: light, date)
}
]
#v(1fr)
]
}
@@ -16,8 +16,8 @@
#let cover-page(title, subtitle, date) = {
page(margin: (top: 3cm, bottom: 3cm, left: 3cm, right: 3cm))[
#align(center + horizon)[
#v(2cm)
#v(1fr)
#align(center)[
#text(size: 28pt, weight: "bold", fill: primary, title)
#if subtitle != none {
v(0.8cm)
@@ -28,6 +28,7 @@
text(size: 12pt, fill: light, date)
}
]
#v(1fr)
]
}
@@ -95,8 +95,8 @@
#let cover-page(title, subtitle, date) = {
page(margin: (top: 3cm, bottom: 3cm, left: 3cm, right: 3cm))[
#align(center + horizon)[
#v(2cm)
#v(1fr)
#align(center)[
#text(size: 28pt, weight: "bold", fill: primary, title)
#if subtitle != none {
v(0.8cm)
@@ -107,6 +107,7 @@
text(size: 12pt, fill: light, date)
}
]
#v(1fr)
]
}