chem-pdf2ppt 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +235 -0
- package/README_EN.md +239 -0
- package/SKILL.md +469 -0
- package/SKILL_EN.md +473 -0
- package/assets/academic_template.html +197 -0
- package/cli.js +57 -0
- package/examples/example_usage.py +407 -0
- package/index.js +109 -0
- package/package.json +50 -0
- package/references/chemistry_templates.md +228 -0
- package/references/chemistry_templates_en.md +228 -0
- package/references/visual_style.md +172 -0
- package/references/visual_style_en.md +172 -0
- package/requirements.txt +20 -0
- package/scripts/analyze_paper.py +334 -0
- package/scripts/convert_to_images.py +67 -0
- package/scripts/create_ppt.py +712 -0
- package/scripts/extract_charts.py +425 -0
- package/scripts/generate_html.py +288 -0
package/cli.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* PDF2PPT CLI — Cross-platform entry point
|
|
4
|
+
*/
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const { execSync } = require('child_process');
|
|
7
|
+
|
|
8
|
+
const SKILL_ROOT = __dirname;
|
|
9
|
+
const cmd = process.argv[2];
|
|
10
|
+
const args = process.argv.slice(3);
|
|
11
|
+
|
|
12
|
+
function run(scriptName, extraArgs = []) {
|
|
13
|
+
const scriptPath = path.join(SKILL_ROOT, 'scripts', scriptName);
|
|
14
|
+
const allArgs = [...extraArgs, ...args];
|
|
15
|
+
const quoted = allArgs.map(a => `"${a}"`).join(' ');
|
|
16
|
+
try {
|
|
17
|
+
execSync(`python "${scriptPath}" ${quoted}`, { stdio: 'inherit' });
|
|
18
|
+
} catch (e) {
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const help = `
|
|
24
|
+
chem-pdf2ppt v2.0 — Chemistry Academic Paper to PPT/HTML Converter
|
|
25
|
+
|
|
26
|
+
Commands:
|
|
27
|
+
analyze <paper.pdf> [--json report.json] Analyze paper structure and type
|
|
28
|
+
extract <paper.pdf> <output_dir> [dpi] [--report] Extract figures from PDF
|
|
29
|
+
help Show this help
|
|
30
|
+
|
|
31
|
+
Examples:
|
|
32
|
+
chem-pdf2ppt analyze paper.pdf --json analysis.json
|
|
33
|
+
chem-pdf2ppt extract paper.pdf figures/ 300 --report
|
|
34
|
+
|
|
35
|
+
For building PPT/HTML presentations, use the Python API directly:
|
|
36
|
+
from create_ppt import ChemistryPPT
|
|
37
|
+
from generate_html import HtmlPPT
|
|
38
|
+
|
|
39
|
+
Full docs: https://github.com/s1lencewill/PDF2PPT
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
switch (cmd) {
|
|
43
|
+
case 'analyze':
|
|
44
|
+
run('analyze_paper.py');
|
|
45
|
+
break;
|
|
46
|
+
case 'extract':
|
|
47
|
+
run('extract_charts.py');
|
|
48
|
+
break;
|
|
49
|
+
case 'help':
|
|
50
|
+
case '--help':
|
|
51
|
+
case '-h':
|
|
52
|
+
console.log(help);
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
console.log(help);
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
PDF2PPT 完整使用示例 — 三种化学论文类型的 PPT 生成
|
|
4
|
+
Complete examples for experimental, computational, and hybrid chemistry papers.
|
|
5
|
+
"""
|
|
6
|
+
import sys
|
|
7
|
+
import os
|
|
8
|
+
|
|
9
|
+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'scripts'))
|
|
10
|
+
from create_ppt import ChemistryPPT
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# ================================================================
|
|
14
|
+
# 示例 1: 实验化学论文 — 催化类
|
|
15
|
+
# Example 1: Experimental Chemistry — Catalysis Paper
|
|
16
|
+
# ================================================================
|
|
17
|
+
|
|
18
|
+
def example_experimental_catalysis():
|
|
19
|
+
ppt = ChemistryPPT(theme="academic")
|
|
20
|
+
|
|
21
|
+
# 封面
|
|
22
|
+
ppt.add_title_slide(
|
|
23
|
+
title_cn="Ru₁/Cu 单原子合金高效电催化 CO₂ 还原制 C₂₊ 产物",
|
|
24
|
+
title_en="Single-Atom Ru Alloyed with Cu for Efficient Electrochemical CO₂ Reduction to C₂₊ Products",
|
|
25
|
+
authors="Zhang, L. et al.",
|
|
26
|
+
journal="J. Am. Chem. Soc., 2024, 146, 12345-12356",
|
|
27
|
+
doi="10.1021/jacs.4c01234"
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# 章节 1: 研究背景
|
|
31
|
+
ppt.add_section_slide("第一部分:研究背景与设计策略")
|
|
32
|
+
|
|
33
|
+
ppt.add_content_slide(
|
|
34
|
+
title="电催化 CO₂ 还原面临的核心挑战",
|
|
35
|
+
bullets=[
|
|
36
|
+
"CO₂RR 可将温室气体转化为高附加值燃料和化学品(CO, C₂H₄, EtOH 等)",
|
|
37
|
+
"Cu 基催化剂是目前唯一能有效生成 C₂₊ 产物的金属,但法拉第效率通常 < 50%",
|
|
38
|
+
"关键瓶颈:*CO 中间体的吸附能难以独立调控,C-C 偶联动力学受限",
|
|
39
|
+
"单原子合金(SAA)策略可精确调控活性位点的电子结构和几何环境"
|
|
40
|
+
]
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
ppt.add_content_slide(
|
|
44
|
+
title="本文设计策略",
|
|
45
|
+
bullets=[
|
|
46
|
+
"设计思路:将 Ru 单原子分散于 Cu(111) 表面,利用 Ru 的强 *CO 吸附能力",
|
|
47
|
+
"预期效果:Ru 位点富集 *CO,邻近 Cu 位点促进 C-C 偶联",
|
|
48
|
+
"表征策略:HAADF-STEM + XAS 确认单原子分散,Operando FTIR 追踪中间体",
|
|
49
|
+
"理论支撑:DFT 计算验证 Ru 位点的 *CO 富集效应和 C-C 偶联能垒降低"
|
|
50
|
+
]
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
# 章节 2: 表征
|
|
54
|
+
ppt.add_section_slide("第二部分:催化剂结构与组成表征")
|
|
55
|
+
|
|
56
|
+
ppt.add_figure_slide(
|
|
57
|
+
title="HAADF-STEM 确认 Ru 以单原子形式分散在 Cu 表面",
|
|
58
|
+
figure_path="figures/HAADF_STEM.png",
|
|
59
|
+
figure_label="Figure 1",
|
|
60
|
+
bullets=[
|
|
61
|
+
"HAADF-STEM 图像显示 Ru 原子(亮点)均匀分散,无纳米颗粒或团簇形成",
|
|
62
|
+
"EDS elemental mapping 证实 Ru 在 Cu 基体上的均匀空间分布",
|
|
63
|
+
"Ru 负载量经 ICP-OES 测定为 1.2 wt%,与投料比一致"
|
|
64
|
+
],
|
|
65
|
+
caption="Source: Fig. 1a-d, adapted from original paper",
|
|
66
|
+
layout="figure_right"
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
ppt.add_figure_slide(
|
|
70
|
+
title="XAS 揭示 Ru 的氧化态和配位环境",
|
|
71
|
+
figure_path="figures/XAS.png",
|
|
72
|
+
figure_label="Figure 2",
|
|
73
|
+
bullets=[
|
|
74
|
+
"XANES:Ru K-edge 白线峰位置介于 Ru 箔 (0) 和 RuO₂ (+4) 之间,表明 Ruᵟ⁺(0<δ<3)",
|
|
75
|
+
"EXAFS 拟合:Ru-Cu 配位路径 (~2.55 Å) 为主,无 Ru-Ru 键 (~2.68 Å),确认单原子分散",
|
|
76
|
+
"小波变换(WT-EXAFS):进一步排除 Ru 团簇的存在"
|
|
77
|
+
],
|
|
78
|
+
caption="Source: Fig. 2a-e, adapted from original paper",
|
|
79
|
+
layout="figure_right"
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
# 章节 3: 性能
|
|
83
|
+
ppt.add_section_slide("第三部分:催化性能评价")
|
|
84
|
+
|
|
85
|
+
ppt.add_figure_slide(
|
|
86
|
+
title="Ru₁/Cu 在 -0.9 V vs RHE 实现 82% C₂₊ 法拉第效率",
|
|
87
|
+
figure_path="figures/performance.png",
|
|
88
|
+
figure_label="Figure 3",
|
|
89
|
+
bullets=[
|
|
90
|
+
"C₂₊ FE 在 -0.9 V 时达到峰值 82%,远超纯 Cu NPs (45%)",
|
|
91
|
+
"部分电流密度 j(C₂₊) = 300 mA/cm²,优于大多数文献报道的 Cu 基催化剂",
|
|
92
|
+
"100 小时恒电位电解稳定性测试:FE(C₂₊) 仅下降 8%",
|
|
93
|
+
"主要产物分布:C₂H₄ (48%), EtOH (22%), C₂H₅OH (12%)"
|
|
94
|
+
],
|
|
95
|
+
caption="Source: Fig. 3a-f, adapted from original paper",
|
|
96
|
+
layout="figure_right"
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
ppt.add_table_slide(
|
|
100
|
+
title="与文献代表性 Cu 基催化剂的性能对比",
|
|
101
|
+
headers=["催化剂", "FE(C₂₊)%", "j(C₂₊) (mA/cm²)", "电解液", "稳定性 (h)", "Ref"],
|
|
102
|
+
rows=[
|
|
103
|
+
["Ru₁/Cu", "82", "300", "1M KOH", "100", "This work"],
|
|
104
|
+
["Cu NPs", "45", "150", "1M KOH", "20", "Nat. Catal. 2019"],
|
|
105
|
+
["Ag/Cu NWs", "60", "200", "1M KHCO₃", "50", "JACS 2022"],
|
|
106
|
+
["F-Cu", "65", "180", "1M KOH", "40", "Nature 2021"],
|
|
107
|
+
["B-Cu", "55", "120", "0.1M KHCO₃", "30", "Science 2020"],
|
|
108
|
+
]
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
# 章节 4: 机理
|
|
112
|
+
ppt.add_section_slide("第四部分:反应机理探究")
|
|
113
|
+
|
|
114
|
+
ppt.add_figure_slide(
|
|
115
|
+
title="Operando ATR-SEIRAS 揭示 *CO 中间体的表面富集",
|
|
116
|
+
figure_path="figures/SEIRAS.png",
|
|
117
|
+
figure_label="Figure 4",
|
|
118
|
+
bullets=[
|
|
119
|
+
"Ru₁/Cu 表面的 *COₐₜₒₚ 峰面积是纯 Cu 的 2.3 倍",
|
|
120
|
+
"出现低频 *CO 峰 (~1880 cm⁻¹),归属于 Ru 位点上桥式吸附的 *CO",
|
|
121
|
+
"*CO 覆盖度增加促进 C-C 偶联:邻近 *CO 距离缩短",
|
|
122
|
+
"无 *CHO/*COH 信号,排除了卡宾/类卡宾路径"
|
|
123
|
+
],
|
|
124
|
+
caption="Source: Fig. 4a-d, adapted from original paper",
|
|
125
|
+
layout="figure_right"
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
ppt.add_figure_slide(
|
|
129
|
+
title="DFT 揭示 Ru 位点促进 *CO 富集并降低 C-C 偶联能垒",
|
|
130
|
+
figure_path="figures/DFT_mechanism.png",
|
|
131
|
+
figure_label="Figure 5",
|
|
132
|
+
bullets=[
|
|
133
|
+
"*CO 在 Ru 位点的吸附能 (-1.32 eV) 显著强于 Cu (-0.87 eV)",
|
|
134
|
+
"Ru 位点捕获的 *CO 与邻近 Cu 位点上的 *CO 发生 C-C 偶联,能垒仅 0.45 eV",
|
|
135
|
+
"Bader charge 分析:Ru→Cu 的电荷转移增强 *CO 的 π 反馈键",
|
|
136
|
+
"PDOS 分析:Ru 的 d-band center (-1.85 eV) 比 Cu (-2.45 eV) 更接近 Fermi 能级"
|
|
137
|
+
],
|
|
138
|
+
caption="Source: Fig. 5a-f, adapted from original paper",
|
|
139
|
+
layout="figure_right"
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
# 总结
|
|
143
|
+
ppt.add_section_slide("总结与展望")
|
|
144
|
+
|
|
145
|
+
ppt.add_summary_slide(
|
|
146
|
+
title="全文总结",
|
|
147
|
+
bullets=[
|
|
148
|
+
"1. 成功制备 Ru₁/Cu 单原子合金催化剂,实现 CO₂RR 到 C₂₊ 的 FE 82%,j = 300 mA/cm²",
|
|
149
|
+
"2. HAADF-STEM + XAS 确证 Ru 的单原子分散状态和 Ruᵟ⁺ 氧化态",
|
|
150
|
+
"3. Operando SEIRAS + DFT 联合揭示 Ru 位点促进 *CO 富集和 C-C 偶联的协同机制",
|
|
151
|
+
"4. 该 SAA 设计策略为高选择性 CO₂RR 电催化剂提供了新的设计范式"
|
|
152
|
+
]
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
ppt.add_thankyou_slide()
|
|
156
|
+
|
|
157
|
+
ppt.save("output/example_experimental.pptx")
|
|
158
|
+
print("Example 1 saved: output/example_experimental.pptx")
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
# ================================================================
|
|
162
|
+
# 示例 2: 理论计算化学论文 — DFT 计算类
|
|
163
|
+
# Example 2: Computational Chemistry — DFT Paper
|
|
164
|
+
# ================================================================
|
|
165
|
+
|
|
166
|
+
def example_computational_dft():
|
|
167
|
+
ppt = ChemistryPPT(theme="molecular")
|
|
168
|
+
|
|
169
|
+
ppt.add_title_slide(
|
|
170
|
+
title_cn="第一性原理筛选过渡金属单原子催化剂用于电催化氮还原",
|
|
171
|
+
title_en="First-Principles Screening of Transition Metal Single-Atom Catalysts for Electrocatalytic Nitrogen Reduction",
|
|
172
|
+
authors="Wang, Y. et al.",
|
|
173
|
+
journal="ACS Catal., 2024, 14, 5678-5690",
|
|
174
|
+
doi="10.1021/acscatal.4c00567"
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
ppt.add_section_slide("研究背景与计算方法")
|
|
178
|
+
|
|
179
|
+
ppt.add_content_slide(
|
|
180
|
+
title="电催化 NRR 面临的挑战",
|
|
181
|
+
bullets=[
|
|
182
|
+
"NRR 是实现常温常压合成氨的理想替代路径,但 FE 和产率远低于 Haber-Bosch 法",
|
|
183
|
+
"竞争反应 HER 在 NRR 电位区间热力学更有利,严重抑制 NH₃ 选择性",
|
|
184
|
+
"单原子催化剂(SACs)因独特的电子结构和最大原子效率成为 NRR 研究热点",
|
|
185
|
+
"关键问题:如何理性筛选和设计高活性、高选择性的 NRR SAC?"
|
|
186
|
+
]
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
ppt.add_content_slide(
|
|
190
|
+
title="计算方法与模型",
|
|
191
|
+
bullets=[
|
|
192
|
+
"软件:VASP 6.3,PAW 赝势,PBE 泛函 + DFT-D3(BJ) 范德华校正",
|
|
193
|
+
"截断能 520 eV, k-point: 3×3×1 (slab 模型), 真空层 20 Å",
|
|
194
|
+
"模型:4×4 石墨烯超胞 (含 N₄ 空位缺陷) + 单原子 TM (TM = Sc-Zn, Mo, Ru, Rh, Pd, Ag, W, Pt, Au)",
|
|
195
|
+
"自由能计算:CHE 模型 (Computational Hydrogen Electrode)",
|
|
196
|
+
"溶剂化效应:VASPsol 隐式溶剂模型 (ε = 78.4 for H₂O)",
|
|
197
|
+
"过渡态搜索:CI-NEB 方法 + dimer method 验证"
|
|
198
|
+
]
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
ppt.add_section_slide("关键计算结果")
|
|
202
|
+
|
|
203
|
+
ppt.add_figure_slide(
|
|
204
|
+
title="NRR 自由能图揭示 Mo-N₄/C 具有最优的决速步能垒",
|
|
205
|
+
figure_path="figures/free_energy.png",
|
|
206
|
+
figure_label="Figure 3",
|
|
207
|
+
bullets=[
|
|
208
|
+
"Mo-N₄/C 的 PDS(*NH₂ → *NH₃)自由能变化仅 +0.35 eV",
|
|
209
|
+
"ΔG(*N₂ → *N₂H) = +0.28 eV,表明第一步质子化可自发进行",
|
|
210
|
+
"对比:Fe-N₄/C 的 PDS 能垒为 +0.89 eV, Co-N₄/C 为 +0.72 eV",
|
|
211
|
+
"Mo-N₄/C 遵循 alternating 路径, 远端路径(distal)能垒更高"
|
|
212
|
+
],
|
|
213
|
+
caption="Source: Fig. 3a-d, adapted from original paper",
|
|
214
|
+
layout="figure_right"
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
ppt.add_figure_slide(
|
|
218
|
+
title="PDOS 分析揭示 Mo 的 d 轨道与 N₂ 的 π* 轨道杂化机制",
|
|
219
|
+
figure_path="figures/PDOS.png",
|
|
220
|
+
figure_label="Figure 4",
|
|
221
|
+
bullets=[
|
|
222
|
+
"Mo 的 d₂² 轨道与 N₂ 的 2π* 轨道在 -0.5 to +0.5 eV 区间显著杂化",
|
|
223
|
+
"Bader charge: Mo 向 N₂ 转移 0.62 e⁻,活化 N≡N 键",
|
|
224
|
+
"N≡N 键长从气相的 1.10 Å 伸长至吸附态的 1.18 Å",
|
|
225
|
+
"COHP 分析:N≡N 的 ICOHP 从 -21.3 降至 -17.8 eV,键级削弱"
|
|
226
|
+
],
|
|
227
|
+
caption="Source: Fig. 4a-e, adapted from original paper",
|
|
228
|
+
layout="figure_right"
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
ppt.add_figure_slide(
|
|
232
|
+
title="NRR vs HER 选择性描述符:ΔG(*N₂H) vs ΔG(*H)",
|
|
233
|
+
figure_path="figures/selectivity.png",
|
|
234
|
+
figure_label="Figure 5",
|
|
235
|
+
bullets=[
|
|
236
|
+
"构建 ΔG(*N₂H) vs ΔG(*H) 选择性图,筛选同时满足强 N₂ 吸附和弱 H 吸附的催化剂",
|
|
237
|
+
"Mo-N₄/C 位于最优区域:ΔG(*N₂H) < -0.5 eV 且 ΔG(*H) > +0.3 eV",
|
|
238
|
+
"Cr, W, Re 也是潜在的 NRR 候选催化剂的候选",
|
|
239
|
+
"Ag, Au, Cu 位于 HER 主导区(ΔG(*H) < 0),不适合 NRR"
|
|
240
|
+
],
|
|
241
|
+
caption="Source: Fig. 5a-c, adapted from original paper",
|
|
242
|
+
layout="figure_right"
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
ppt.add_content_slide(
|
|
246
|
+
title="微动力学模拟验证 DFT 预测",
|
|
247
|
+
bullets=[
|
|
248
|
+
"基于 DFT 计算的所有基元步能垒进行微动力学模拟 (CatMAP)",
|
|
249
|
+
"Mo-N₄/C 的理论 TOF 为 2.1×10⁻³ s⁻¹ site⁻¹ (300 K, pH=7)",
|
|
250
|
+
"NH₃ 理论产率 ~5.2×10⁻¹¹ mol s⁻¹ cm⁻² at -0.3 V vs RHE",
|
|
251
|
+
"理论 FE(NH₃) = 72%,与实验结果 (FE=65%, 文献值) 定性一致"
|
|
252
|
+
]
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
ppt.add_section_slide("总结与展望")
|
|
256
|
+
|
|
257
|
+
ppt.add_summary_slide(
|
|
258
|
+
title="全文总结",
|
|
259
|
+
bullets=[
|
|
260
|
+
"1. 高通量 DFT 筛选了 20 种 TM-N₄/C SAC 的 NRR 催化活性",
|
|
261
|
+
"2. Mo-N₄/C 的理论过电位最低 (0.35 V),归因于 Mo 的 d 轨道与 N₂ 的 2π* 轨道杂化",
|
|
262
|
+
"3. 建立了 ΔG(*N₂H) vs ΔG(*H) 选择性描述符,可快速筛选 NRR 催化剂",
|
|
263
|
+
"4. 微动力学模拟与实验趋势一致,验证了计算预测的可靠性"
|
|
264
|
+
]
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
ppt.add_thankyou_slide()
|
|
268
|
+
|
|
269
|
+
ppt.save("output/example_computational.pptx")
|
|
270
|
+
print("Example 2 saved: output/example_computational.pptx")
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
# ================================================================
|
|
274
|
+
# 示例 3: 实验+理论混合论文
|
|
275
|
+
# Example 3: Experimental + Computational Hybrid Paper
|
|
276
|
+
# ================================================================
|
|
277
|
+
|
|
278
|
+
def example_hybrid():
|
|
279
|
+
ppt = ChemistryPPT(theme="green")
|
|
280
|
+
|
|
281
|
+
ppt.add_title_slide(
|
|
282
|
+
title_cn="单原子 Fe-N/C 催化剂的活性位点辨识与氧还原反应机理",
|
|
283
|
+
title_en="Identification of Active Sites and Mechanism of Oxygen Reduction Reaction on Single-Atom Fe-N/C Catalysts",
|
|
284
|
+
authors="Chen, X. et al.",
|
|
285
|
+
journal="Nat. Catal., 2024, 7, 234-245",
|
|
286
|
+
doi="10.1038/s41929-024-01012-3"
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
ppt.add_section_slide("研究背景与策略")
|
|
290
|
+
|
|
291
|
+
ppt.add_content_slide(
|
|
292
|
+
title="Fe-N/C ORR 催化剂的活性位点争议",
|
|
293
|
+
bullets=[
|
|
294
|
+
"Fe-N/C 是最有希望替代 Pt/C 的非贵金属 ORR 催化剂",
|
|
295
|
+
"活性位点长期存在争议:Fe-N₄ (吡咯型 vs 吡啶型)、Fe-N₂O₂、Fe 纳米颗粒?",
|
|
296
|
+
"不同前驱体和热解条件可能导致不同的位点分布,难以单独通过实验分辨",
|
|
297
|
+
"本文策略:XAS + Mössbauer 实验确定位点结构 → DFT 计算验证活性 → 实验-理论互验"
|
|
298
|
+
]
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
ppt.add_section_slide("实验结果")
|
|
302
|
+
|
|
303
|
+
ppt.add_figure_slide(
|
|
304
|
+
title="Fe K-edge XAS 确认 Fe-N₄ 平面四方配位结构",
|
|
305
|
+
figure_path="figures/Fe_XAS.png",
|
|
306
|
+
figure_label="Figure 2",
|
|
307
|
+
bullets=[
|
|
308
|
+
"XANES:Fe K-edge 吸收边位置确认 Fe 以 +2/+3 混合价态存在",
|
|
309
|
+
"EXAFS 拟合:第一壳层 Fe-N ~1.98 Å (CN=4.1),无 Fe-Fe (~2.50 Å)",
|
|
310
|
+
"WT-EXAFS:排除了 Fe 纳米颗粒和 Fe₂O₃ 的存在",
|
|
311
|
+
"Mössbauer 谱:D1 (Fe²⁺-N₄, LS) 和 D2 (Fe³⁺-N₄, HS) 双峰"
|
|
312
|
+
],
|
|
313
|
+
caption="Source: Fig. 2a-f, adapted from original paper",
|
|
314
|
+
layout="figure_right"
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
ppt.add_figure_slide(
|
|
318
|
+
title="ORR 性能:Fe-N/C 在酸性介质中半波电位达 0.82 V vs RHE",
|
|
319
|
+
figure_path="figures/ORR_performance.png",
|
|
320
|
+
figure_label="Figure 3",
|
|
321
|
+
bullets=[
|
|
322
|
+
"E₁/₂ = 0.82 V vs RHE (0.1M HClO₄),与 Pt/C (0.85 V) 仅差 30 mV",
|
|
323
|
+
"Tafel 斜率 58 mV/dec,表明第一个电子转移是决速步",
|
|
324
|
+
"H₂O₂ 产率 < 1%,电子转移数 n ≈ 3.95,接近完全 4e⁻ 路径",
|
|
325
|
+
"加速老化测试 (0.6-1.0 V, 10k 圈) 后 E₁/₂ 仅衰减 15 mV"
|
|
326
|
+
],
|
|
327
|
+
caption="Source: Fig. 3a-e, adapted from original paper",
|
|
328
|
+
layout="figure_right"
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
ppt.add_section_slide("DFT 计算:活性位点与机理")
|
|
332
|
+
|
|
333
|
+
ppt.add_content_slide(
|
|
334
|
+
title="DFT 计算模型与方法",
|
|
335
|
+
bullets=[
|
|
336
|
+
"VASP 6.3, PBE+U (Ueff=4.0 eV for Fe 3d), PAW 赝势, 截断能 500 eV",
|
|
337
|
+
"模型:6×6 石墨烯超胞,分别构建 Fe-N₄-C₁₀ (吡咯型), Fe-N₄-C₁₂ (吡啶型), Fe-N₂O₂-C₁₀",
|
|
338
|
+
"隐式溶剂化 (VASPsol, ε=78.4) 模拟酸性电解质环境",
|
|
339
|
+
"ORR 自由能计算:4e⁻ 缔合路径 (O₂ → *OOH → *O → *OH → H₂O)"
|
|
340
|
+
]
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
ppt.add_figure_slide(
|
|
344
|
+
title="DFT 自由能图:Fe-N₄ (吡咯型) 的 ORR 过电位最低",
|
|
345
|
+
figure_path="figures/DFT_ORR.png",
|
|
346
|
+
figure_label="Figure 5",
|
|
347
|
+
bullets=[
|
|
348
|
+
"Fe-N₄-C₁₀ (吡咯型): 理论过电位 η = 0.38 V,与实验值 η = 0.41 V 一致",
|
|
349
|
+
"Fe-N₄-C₁₂ (吡啶型): η = 0.58 V,活性显著低于吡咯型",
|
|
350
|
+
"Fe-N₂O₂: η = 0.92 V,几乎无 ORR 活性",
|
|
351
|
+
"决速步:*OH → H₂O(吡咯型,ΔG = 1.61 eV)"
|
|
352
|
+
],
|
|
353
|
+
caption="Source: Fig. 5a-d, adapted from original paper",
|
|
354
|
+
layout="figure_right"
|
|
355
|
+
)
|
|
356
|
+
|
|
357
|
+
ppt.add_content_slide(
|
|
358
|
+
title="实验-理论互验:活性位点为吡咯型 Fe-N₄",
|
|
359
|
+
bullets=[
|
|
360
|
+
"EXAFS 获得的 Fe-N 键长 (1.98 Å) 与 DFT 优化的吡咯型 Fe-N₄ (1.97 Å) 一致",
|
|
361
|
+
"XANES 模拟谱:吡咯型 Fe-N₄ 的模拟 XANES 与实验谱吻合最佳",
|
|
362
|
+
"理论过电位 (0.38 V) 与实验值 (0.41 V) 高度吻合",
|
|
363
|
+
"CO 毒化实验 + DFT 的 CO 吸附能计算均表明 Fe 为活性中心"
|
|
364
|
+
]
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
ppt.add_section_slide("总结与展望")
|
|
368
|
+
|
|
369
|
+
ppt.add_summary_slide(
|
|
370
|
+
title="全文总结",
|
|
371
|
+
bullets=[
|
|
372
|
+
"1. XAS + Mössbauer 联合确证 Fe-N/C 的活性位点为吡咯型 Fe-N₄ 结构",
|
|
373
|
+
"2. DFT 计算揭示吡咯型 Fe-N₄ 的 ORR 过电位 (0.38 V) 远低于吡啶型和 Fe-N₂O₂",
|
|
374
|
+
"3. 实验-理论互验:键长、XANES 谱、过电位三方面高度一致",
|
|
375
|
+
"4. 为理性设计高性能单原子 ORR 催化剂提供了明确的位点结构指导"
|
|
376
|
+
]
|
|
377
|
+
)
|
|
378
|
+
|
|
379
|
+
ppt.add_thankyou_slide()
|
|
380
|
+
|
|
381
|
+
ppt.save("output/example_hybrid.pptx")
|
|
382
|
+
print("Example 3 saved: output/example_hybrid.pptx")
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
# ================================================================
|
|
386
|
+
# 运行所有示例
|
|
387
|
+
# ================================================================
|
|
388
|
+
|
|
389
|
+
if __name__ == "__main__":
|
|
390
|
+
os.makedirs("output", exist_ok=True)
|
|
391
|
+
|
|
392
|
+
print("=" * 60)
|
|
393
|
+
print("PDF2PPT — Chemistry Academic PPT Examples")
|
|
394
|
+
print("=" * 60)
|
|
395
|
+
|
|
396
|
+
print("\n[1/3] Experimental Catalysis Example...")
|
|
397
|
+
example_experimental_catalysis()
|
|
398
|
+
|
|
399
|
+
print("\n[2/3] Computational DFT Example...")
|
|
400
|
+
example_computational_dft()
|
|
401
|
+
|
|
402
|
+
print("\n[3/3] Hybrid Paper Example...")
|
|
403
|
+
example_hybrid()
|
|
404
|
+
|
|
405
|
+
print("\n" + "=" * 60)
|
|
406
|
+
print("All examples generated successfully in output/")
|
|
407
|
+
print("=" * 60)
|
package/index.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* PDF2PPT — Chemistry Academic Paper to Presentation Converter
|
|
4
|
+
*
|
|
5
|
+
* Usage (Python API via require):
|
|
6
|
+
* const { analyze, extract, createPPT, createHTML } = require('pdf2ppt');
|
|
7
|
+
*
|
|
8
|
+
* CLI:
|
|
9
|
+
* npm install -g pdf2ppt
|
|
10
|
+
* pdf2ppt-analyze paper.pdf
|
|
11
|
+
* pdf2ppt-extract paper.pdf figures/ 300
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const path = require('path');
|
|
15
|
+
const { execSync } = require('child_process');
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
|
|
18
|
+
const SKILL_ROOT = __dirname;
|
|
19
|
+
|
|
20
|
+
function python(cmd) {
|
|
21
|
+
try {
|
|
22
|
+
return execSync(cmd, { encoding: 'utf-8', stdio: 'pipe', cwd: SKILL_ROOT });
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.error('Python execution failed:', e.message);
|
|
25
|
+
throw e;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = {
|
|
30
|
+
SKILL_ROOT,
|
|
31
|
+
version: '2.0.0',
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Analyze a chemistry paper PDF
|
|
35
|
+
* @param {string} pdfPath - path to PDF file
|
|
36
|
+
* @param {object} opts - { json?: boolean, outputPath?: string }
|
|
37
|
+
* @returns {object} analysis result
|
|
38
|
+
*/
|
|
39
|
+
analyze(pdfPath, opts = {}) {
|
|
40
|
+
const args = [path.join(SKILL_ROOT, 'scripts', 'analyze_paper.py'), pdfPath];
|
|
41
|
+
if (opts.json) {
|
|
42
|
+
const outPath = opts.outputPath || pdfPath.replace('.pdf', '_analysis.json');
|
|
43
|
+
args.push('--json', outPath);
|
|
44
|
+
}
|
|
45
|
+
const cmd = `python ${args.map(a => `"${a}"`).join(' ')}`;
|
|
46
|
+
return python(cmd);
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Extract figures from a chemistry paper PDF
|
|
51
|
+
* @param {string} pdfPath - path to PDF
|
|
52
|
+
* @param {string} outputDir - output directory for figures
|
|
53
|
+
* @param {number} dpi - resolution (default 200)
|
|
54
|
+
* @param {object} opts - { report?: boolean }
|
|
55
|
+
*/
|
|
56
|
+
extract(pdfPath, outputDir, dpi = 200, opts = {}) {
|
|
57
|
+
const args = [path.join(SKILL_ROOT, 'scripts', 'extract_charts.py'), pdfPath, outputDir, String(dpi)];
|
|
58
|
+
if (opts.report) args.push('--report');
|
|
59
|
+
const cmd = `python ${args.map(a => `"${a}"`).join(' ')}`;
|
|
60
|
+
return python(cmd);
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Build a PPTX presentation from slide data
|
|
65
|
+
*/
|
|
66
|
+
async createPPT(config) {
|
|
67
|
+
// For Node.js usage, write config to temp file and run Python
|
|
68
|
+
const tmpDir = require('os').tmpdir();
|
|
69
|
+
const configPath = path.join(tmpDir, `pdf2ppt-config-${Date.now()}.json`);
|
|
70
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
71
|
+
|
|
72
|
+
const script = path.join(SKILL_ROOT, 'scripts', 'create_ppt.py');
|
|
73
|
+
// User should use the Python API directly for complex PPT building
|
|
74
|
+
const cmd = `python -c "
|
|
75
|
+
import sys; sys.path.insert(0, '${SKILL_ROOT}/scripts')
|
|
76
|
+
from create_ppt import ChemistryPPT
|
|
77
|
+
import json
|
|
78
|
+
with open('${configPath}') as f:
|
|
79
|
+
cfg = json.load(f)
|
|
80
|
+
ppt = ChemistryPPT(theme=cfg.get('theme', 'academic'))
|
|
81
|
+
for slide in cfg['slides']:
|
|
82
|
+
getattr(ppt, slide['method'])(**slide['args'])
|
|
83
|
+
ppt.save(cfg['output'])
|
|
84
|
+
"`;
|
|
85
|
+
return python(cmd);
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Build an HTML presentation from slide data
|
|
90
|
+
*/
|
|
91
|
+
async createHTML(config) {
|
|
92
|
+
const tmpDir = require('os').tmpdir();
|
|
93
|
+
const configPath = path.join(tmpDir, `pdf2ppt-html-config-${Date.now()}.json`);
|
|
94
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
95
|
+
|
|
96
|
+
const cmd = `python -c "
|
|
97
|
+
import sys; sys.path.insert(0, '${SKILL_ROOT}/scripts')
|
|
98
|
+
from generate_html import HtmlPPT
|
|
99
|
+
import json
|
|
100
|
+
with open('${configPath}') as f:
|
|
101
|
+
cfg = json.load(f)
|
|
102
|
+
html = HtmlPPT(title=cfg.get('title', 'Presentation'), theme=cfg.get('theme', 'molecular'))
|
|
103
|
+
for slide in cfg['slides']:
|
|
104
|
+
getattr(html, slide['method'])(**slide['args'])
|
|
105
|
+
html.save(cfg['output'])
|
|
106
|
+
"`;
|
|
107
|
+
return python(cmd);
|
|
108
|
+
},
|
|
109
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chem-pdf2ppt",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Chemistry academic paper PDF to PowerPoint/HTML converter with figure extraction, paper type classification, and academic slide generation",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pdf",
|
|
7
|
+
"ppt",
|
|
8
|
+
"powerpoint",
|
|
9
|
+
"chemistry",
|
|
10
|
+
"academic",
|
|
11
|
+
"paper",
|
|
12
|
+
"presentation",
|
|
13
|
+
"claude-code",
|
|
14
|
+
"skill",
|
|
15
|
+
"research",
|
|
16
|
+
"slide-deck",
|
|
17
|
+
"html-presentation"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://github.com/s1lencewill/PDF2PPT#readme",
|
|
20
|
+
"bugs": "https://github.com/s1lencewill/PDF2PPT/issues",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/s1lencewill/PDF2PPT.git"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"author": "s1lencewill",
|
|
27
|
+
"main": "index.js",
|
|
28
|
+
"bin": {
|
|
29
|
+
"chem-pdf2ppt": "./cli.js"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"SKILL.md",
|
|
33
|
+
"SKILL_EN.md",
|
|
34
|
+
"README.md",
|
|
35
|
+
"README_EN.md",
|
|
36
|
+
"scripts/",
|
|
37
|
+
"references/",
|
|
38
|
+
"assets/",
|
|
39
|
+
"examples/",
|
|
40
|
+
"bin/",
|
|
41
|
+
"requirements.txt"
|
|
42
|
+
],
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=16.0.0"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"test": "echo \"Run python scripts/analyze_paper.py test.pdf to test\"",
|
|
48
|
+
"postinstall": "node bin/postinstall.js"
|
|
49
|
+
}
|
|
50
|
+
}
|