link-citations | link-bibliography | plantuml-format | plot-configuration | chapters | chaptersDepth | figureTitle | tableTitle | titleDelim | chapDelim | figPrefix | tblPrefix | template | autoFigLabels | marp | footer | paginate | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
true |
true |
svg |
conf/plot.yaml |
true |
1 |
图 |
表 |
- |
conf/ncu.docx |
true |
false |
2025-05-23 |
true |
上面的摘要标题使用了 custom-style
而非直接使用 ##
标题是为了防止被自动编号。使用 {.unnumbered}
/{-}
尽管可以实现标题不会被编号,但是下一个标题的编号仍然会算上这个标题继续编号,所以使用了 custom-style
直接指定 Word 样式。
git clone https://github.com/AClon314/md2doc
wget https://github.com/lierdakil/pandoc-crossref/releases/latest/download/pandoc-crossref-Linux-X64.tar.xz # 自动编号,下载后解压到PATH
wget https://github.com/LaurentRDC/pandoc-plot/releases/latest/download/pandoc-plot-Linux-x86_64.zip
sudo dnf install graphviz # 还需要手动安装plantuml,见下方
# pip install pandoc-tex-numbering # tex → other
# npm install -g puppeteer pandoc-mermaid-chartjs-filter
# pnpm approve-builds -g
# sudo dnf install giflib-devel # linux依赖:apt install libgif-dev; yay giflib
- 下载最新包,解压:windows
- 为
plantuml
(full)或plantuml-headless
创建软链接到$PATH,windows下可以是C:\Windows
,linux下可以是~/.local/bin
(需要在.bashrc里添加PATH=...:$PATH) - 测试
plantuml -version
PlantUML version 1.2025.2 (Wed Jan 08 01:35:36 CST 2025)
(GPLv2 source distribution)
Java Runtime: GraalVM Runtime Environment
JVM: Substrate VM
Default Encoding: UTF-8
Language: null
Country: null
PLANTUML_LIMIT_SIZE: 4096
Dot version: dot - graphviz version 12.2.1 (20241206.2353)
Installation seems OK. File generation OK
在同目录下运行:
./convert.py README.md
./convert.py -h
查看帮助
./conver.py --diy
可以导出docx模板,记得再另存为一次。
感谢原教程[@pandoc_template_example]: https://st1020.com/write-thesis-with-markdown-part1/ [@ref_standard] [@md2pptx]
👍 draw.io 流程图后期编辑: 支持导入 mermaid plantuml sql csv
default table style 默认表格样式,✅MS-Word,❌WPS
markdown转markdown:$toc$自定义目录位置
关键词: Markdown;Pandoc
\newpage
Write abstract here.
Key Words: Markdown; Pandoc
首段落 First Paragraph.
正文Normal, 正文字体Body Text. Verbatim Char代码字体
超链接Hyperlink 脚注Footnote 1
Bold Italic Delete
- 有序列表
- 11
- 111
- 1111
- 11111
- 111111
- 11111
- 1111
- 111
- 12
- 11
- 2
- 无序列表
- 11
- 111
- 1111
- 11111
- 111111
- 11111
- 1111
- 111
- 12
- 11
- 2
如表[@tbl:table]。如图[@fig:ID]。
Compact | b |
---|---|
1 | 2 |
: simple_tables see https://pandoc.org/chunkedhtml-demo/8.9-tables.html {#tbl:table} |
::: {custom-style="Figure"}
a | b |
---|---|
1 | 2 |
表{} 表名 | |
::: |
digraph G {
rankdir=TB;
subgraph L {
rank = same;
b -> a [dir=back]; // b ← a
}
subgraph R {
rank = same;
c -> d; // c → d
}
b -> c
}
%%{init: {'flowchart': {'padding': 0, 'useMaxWidth': false, 'htmlLabels': false}} }%%
flowchart LR
A[Source] --> B{Condition}
zenuml
title optional
Alice->Bob: Hi Bob
Bob->Alice: Hi Alice
@startuml
Bob->Alice: Hi Alice
@enduml
{
"type": "pie",
"data": {
"labels": [
"Red",
"Blue",
"Yellow"
],
"datasets": [
{
"data": [
300,
50,
100
],
"backgroundColor": [
"#FF6384",
"#36A2EB",
"#FFCE56"
],
"hoverBackgroundColor": [
"#FF6384",
"#36A2EB",
"#FFCE56"
]
}
]
},
"options": {}
}
quote
#!/bin/env python
if __name__ == "__main__":
print("👻")
\newpage
::: {#refs} :::
Footnotes
-
footnote. ↩