feat(latex): 新增 LaTeX 排版系统,从 Markdown 生成 ctexbook

- 新增 officefile/latex/ 目录,包含 main.tex、preamble.tex 及 14 个章节 + 10 个附录 tex 文件
- md→tex 转换流程:pandoc 转换 + _postprocess.py 后处理(去编号、修破折号、清标签)
- 修复 5 个 md 源文件的标题层级(H1→H2 降级,统一层级结构)
- 配置 VS Code LaTeX Workshop(xelatex + ctexbook 编译链)
- 新增 VS Code workspace 和 .gitignore(排除 LaTeX 编译产物)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-29 12:21:15 +08:00
parent 72a9484188
commit c81cf83c13
38 changed files with 12245 additions and 23 deletions
+92
View File
@@ -0,0 +1,92 @@
% ========== 页面布局 ==========
\usepackage[top=2.54cm, bottom=2.54cm, left=3.17cm, right=3.17cm]{geometry}
% ========== 行距 ==========
\usepackage{setspace}
\onehalfspacing
% ========== 修复页眉高度警告 ==========
\setlength{\headheight}{14.49998pt}
% ========== 页眉页脚 ==========
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE]{\thepage}
\fancyhead[RE]{\leftmark}
\fancyhead[LO]{\rightmark}
\fancyhead[RO]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
% ========== 数学 ==========
\usepackage{amsmath,amssymb,mathtools}
% ========== 表格 ==========
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{longtable}
% ========== 图形 ==========
\usepackage{graphicx}
\usepackage{subfig}
\graphicspath{{figures/}{figures/ch01/}{figures/ch02/}{figures/ch03/}{figures/ch04/}{figures/ch05/}{figures/ch06/}{figures/ch07/}{figures/ch08/}{figures/ch09/}{figures/ch10/}{figures/ch11/}{figures/ch12/}{figures/ch13/}}
% ========== 代码 ==========
\usepackage{listings}
\lstset{
basicstyle=\ttfamily\small,
breaklines=true,
frame=single,
backgroundcolor=\color{gray!10},
keywordstyle=\color{blue},
commentstyle=\color{green!60!black},
stringstyle=\color{red},
numbers=left,
numberstyle=\tiny\color{gray},
xleftmargin=2em,
}
% ========== 颜色 ==========
\usepackage{xcolor}
% ========== 超链接 ==========
\usepackage{hyperref}
\usepackage{bookmark}
\hypersetup{
colorlinks=true,
linkcolor=blue!70!black,
citecolor=green!50!black,
urlcolor=blue!80!black,
bookmarksopen=true,
}
% ========== 其他 ==========
\usepackage{enumitem}
\usepackage{tcolorbox}
% ========== 修复 pandoc longtable 无标题表格 ==========
\newcounter{none}
% ========== 修复 pandoc tightlist ==========
\providecommand{\tightlist}{}
% ========== 修复 pandoc passthrough ==========
\providecommand{\passthrough}[1]{#1}
% ========== 章节格式 ==========
\ctexset{
chapter = {
format = \huge\bfseries\centering,
nameformat = {},
titleformat = {},
beforeskip = 1ex,
afterskip = 2ex,
},
section = {
format = \Large\bfseries,
},
subsection = {
format = \large\bfseries,
},
}