Org Export Ox
文章目录
ox-pandoc
latex 内嵌公式的支持
- 不推荐使用
$formula$格式,这种格式对中文支持不友好,会导致转换 mathjax 公式失败 - 推荐使用
\(formula\)格式
inline 图片支持
在 org 文件中添加设置:
| |
全部 resources 数据 inline 支持
修改 ox-pandoc
1 2(with-eval-after-load 'ox-pandoc (add-to-list 'org-pandoc-valid-options 'embed-resources))修改 org-mode 文件 header
1 2#+PANDOC_OPTIONS: standalone:t embed-resources:t reference-doc:./custom-reference_1.docx #+OPTIONS: ^:{}- 这里设置了 pandoc options:
standalone:t embed-resources:t
- 这里设置了 pandoc options:
- 导出
C-c C-e 特点:
- css, js, 图片等等,各种数据都会被下载下来,整合到单个 html 文件中
如何避免下划线格式文本被当做下标
比如:table_next, 这里 next 在 export 后的文档中变成了下标
修复方法:
| |
输出成 docx MS Word 文件方法
参考:
- An Org-mode to DOCX Pipeline | Erik L. Arneson — Writer and Software Developer
- My Org+Pandoc Workflow
步骤:
- 使用 ox-pandoc
C-c C-e选择 pandoc –> docx
已知问题:
- 转换后的 docx 文件中可能存在~字体~问题,需要手动修复
- 转换后的
图片大小和版式需要手动调整
版式模板文件设置 reference.docx
制作方法:
生成一个 custom-reference.docx
pandoc -o custom-reference.docx --print-default-data-file reference.docx
手动修改成自己满意的格式
- 比如中英文字体修改
- 排版风格
参考中文排版教程
使用 custom-reference.docx 的几种方法
在
ox-pandoc中使用:1 2#+PANDOC_OPTIONS: reference-doc:~/.config/pandoc/custom-reference.docx #+PANDOC_OPTIONS: reference-doc:~/.config/pandoc/custom-reference-chinese.docx在
pandoc-mode中使用- 设定
pandoc-data-dir 在 pandoc-data-dir 中存放一个 docx.pandoc 文件
- 设定
命令行添加参数
--reference-doc ./custom-reference.docxpandoc --reference-doc ./custom-reference.docx your.org your-output.docx
latex 公式编写注意事项
上下标编写
- 注意取消
pretty-entities模式,查看实际编写的代码 - 命令:
org-toggle-pretty-entities
- 注意取消
- 中文时少用
$formula$, 推荐使用\(formula\)
文章作者
上次更新 2025-09-24 (360d44c)