推荐一款全能的跨平台文档格式转换工具 Pandoc

公众号关注 「奇妙的 Linux 世界」

设为「星标」,每天带你玩转 Linux !



如果您需要将文件从一种标记格式转换为另一种标记格式,那么?pandoc就是您的瑞士军刀。


OpenSource: 总结的快捷键使用文档

Pandoc文档格式转换工具

1. 格式转换

Pandoc文档格式转换工具

2. 安装方式

几乎支持各种操作系统和平台,使用无忧

  • MacOS

# brew
brew install pandoc-citeproc
brew install librsvg python homebrew/cask/basictex
  • Linux

# apt
apt install pandoc
apt install pandoc-citeproc

# download dpkg
https://packages.ubuntu.com/pandoc
  • Windows

# download exe
https://github.com/jgm/pandoc/releases/latest

# using chocolatey
choco install pandoc
choco install rsvg-convert python miktex

3. 使用方式

转换原来,如此简单 => ?官网使用参考地址

  • xxx => docx

# txt to docx
$ pandoc -s MANUAL.txt -o example29.docx

# LaTeX math to docx
$ pandoc -s math.tex -o example30.docx

# Markdown to docx
$ pandoc -s m.md -o m.docx

# Docx with a reference docx:
$ pandoc --reference-doc twocolumns.docx -o UsersGuide.docx MANUAL.txt
  • md => xxx

# markdown转换为html
$ pandoc README.md -o README.html

# markdown转换为word
$ pandoc README.md -o README.docx

# markdown转换为pdf(latex之前是双短横线)
$ pandoc README.md -o README.pdf --latex-engine=xelatex
  • others

# EPUB to plain text
$ pandoc MANUAL.epub -t plain -o example36.text
  • 注意事项

# 通过-V参数指定中文字体
-V mainfont="SimSun"

# 解决中文乱码
$ pandoc -V mainfont="SimSun" --reference-doc twocolumns.docx -o UsersGuide.docx MANUAL.txt

本文转载自:「 Escape 的博客 」,原文:http://t.cn/A65f0DtI,版权归原作者所有。欢迎投稿,投稿邮箱: editor@hi-linux.com。


你可能还喜欢

点击下方图片即可阅读

如何在 Nginx 中启用 HTTP 3.0/QUIC 支持

点击上方图片,打开小程序,加入「玩转 Linux」圈子

更多有趣的互联网新鲜事,关注「奇妙的互联网」视频号全了解!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值