1
0

feat: change note for filter update

This commit is contained in:
2026-06-14 09:57:53 +08:00
parent c19b662d7c
commit aef22ca2e7
3 changed files with 23 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ uv run pandoc <thesis.tex> \
# 过滤器补丁
本项目采用了名为`pandoc-tex-numbering`的过滤器,这是一个很棒的项目,但它在图表标题的事情上没有任何方法可以做到我期望的样子因此我不得不使用一种比较“脏”的手段来使其达到我想要的效果。我采用Git Diff的方式给下载下来的`pandoc-tex-numbering`的源码打补丁,使其符合我的需求。下面将介绍如何打补丁。
本项目采用了名为`pandoc-tex-numbering`的过滤器,这是一个很棒的项目,但它能够做到我期望的样子的新版本并没有及时在PyPI上发布因此我不得不使用一种比较“脏”的手段来使其达到我想要的效果。我采用Git Diff的方式给下载下来的最新版`pandoc-tex-numbering`的源码打补丁,使其符合我的需求。等新版本发布在PyPI上后这一步就不再需要了。下面将介绍如何打这个补丁。
## 应用补丁

View File

@@ -0,0 +1,19 @@
local function is_pagebreak(text)
return text:find('\\newpage') or text:find('\\clearpage')
end
function RawBlock(el)
if el.format:match('tex$') then
if is_pagebreak(el.text) then
return pandoc.RawBlock('openxml', '<w:p><w:r><w:br w:type="page"/></w:r></w:p>')
end
end
end
function RawInline(el)
if el.format:match('tex$') then
if is_pagebreak(el.text) then
return pandoc.RawInline('openxml', '<w:r><w:br w:type="page"/></w:r>')
end
end
end

View File

@@ -1,11 +1,13 @@
# ===== Pandoc =====
# 引用文献设置
csl: chinese-thesis.csl # 设置引用文献样式
link-citations: true # 正文中引用的文献需要交叉引用到文献列表
link-bibliography: false # 文献中的链接不要引出
# ===== pandoc-tex-numbering Filter =====
# 杂项设置
number-theorems: false
# numbering-caption-delimiter: " "
numbering-caption-delimiter: "\\ " # Do NOT delete \\. It is the escape for space.
prefix-space: true
section-max-levels: 3
number-reset-level: 0 # 编号不需要按章节重置因此设置为0表示在最顶层的层级的父级才重置编号即不重置编号