Intro

自己平时写文档主要是用md写,但是甲方和乙方有时候说喜欢pdf或者word. docsify没的自带的pdf转换,最基本的王者就是这个pandoc了

博客原文地址

pandoc

一个文档格式转换大神级工具,支持HTML、CSL YAML、Ebooks、Interactive notebook formats、Word processor formats

Pandoc installing

For PDF output, you’ll need LaTeX. We recommend installing TeX Live via your package manager. (On Debian/Ubuntu, apt-get install texlive.)

如果想输出为pdf,需要安装 LaTeX 引擎

install

# 安装pandoc
sudo pacman -S pandoc# 安装texlive和中文支持
sudo pacman -S texlive-core texlive-langchinese

test

$ pandoc --version
pandoc 2.11.4
Compiled with pandoc-types 1.22, texmath 0.12.1.1, skylighting 0.10.3,
citeproc 0.3.0.9, ipynb 0.1.0.1
User data directory: /home/kearney/.local/share/pandoc or /home/kearney/.pandoc
Copyright (C) 2006-2021 John MacFarlane. Web:  https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.

demo

$ tex '\empty Hello world!\bye'
This is TeX, Version 3.14159265 (TeX Live 2020/Arch Linux) (preloaded format=tex)
[1]
Output written on texput.dvi (1 page, 224 bytes).
Transcript written on texput.log.$ pdftex '\empty Hello world!\bye'
pdftex: error while loading shared libraries: libpoppler.so.108: cannot open shared object file: No such file or directory
# emm版本问题后面升级解决了这个问题,网上搜的基本是ls软连接,不能治本

中文问题继续往下说,如果在demo里直接加中文会报错Missing character: There is no � in font cmr10!

Demo: markdown

quickstart.md 的内容

# 快速入门## 环境准备软件使用需要满足的前置条件## 安装软件的安装方法## 设置软件的设置

除了输入输出的文件名,还有latex引擎,当然最主要的是中文字体,如何查看本机上的中文字体?

pandoc quickstart.md -o quickstart.md.pdf --pdf-engine=xelatex -V CJKmainfont='Sarasa UI SC'

Pandoc 使用及踩坑 点半久 Edited on 2019-08-31
使用 fc-list :lang=zh 命令查看一下你自己系统上都安装了哪些中文字体:
每一行第一个冒号到其后第一个逗号之间的内容

卸载

万一呢

```bash
$ sudo pacman -Rs pandoc
正在检查依赖关系...软件包 (127) ghc-libs-8.10.4-1  haskell-aeson-1.5.6.0-7  haskell-aeson-pretty-0.8.8-145haskell-ansi-terminal-0.11-94  haskell-asn1-encoding-0.9.6-97  haskell-asn1-parse-0.9.5-97haskell-asn1-types-0.3.4-76  haskell-assoc-1.0.2-66  haskell-async-2.2.3-15haskell-attoparsec-0.13.2.5-12  haskell-base-compat-0.11.2-4haskell-base-compat-batteries-0.11.2-87  haskell-base-orphans-0.8.4-76haskell-base16-bytestring-1.0.1.0-35  haskell-base64-bytestring-1.2.0.1-42haskell-basement-0.0.11-10  haskell-bifunctors-5.5.10-47  haskell-blaze-builder-0.4.2.1-2haskell-blaze-html-0.9.1.2-98  haskell-blaze-markup-0.8.2.8-4  haskell-byteable-0.1.1-22haskell-case-insensitive-1.2.1.0-78  haskell-cereal-0.5.8.1-9  haskell-citeproc-0.3.0.9-1haskell-cmdargs-0.10.21-1  haskell-colour-2.3.5-152  haskell-commonmark-0.1.1.4-11haskell-commonmark-extensions-0.2.0.4-42  haskell-commonmark-pandoc-0.2.0.1-81haskell-comonad-5.0.8-61  haskell-conduit-1.3.4.1-5  haskell-conduit-extra-1.3.5-117haskell-connection-0.3.1-108  haskell-cookie-0.4.5-9  haskell-cryptonite-0.28-18haskell-data-default-0.7.1.1-128  haskell-data-default-class-0.1.2.0-21haskell-data-default-instances-containers-0.0.1-33haskell-data-default-instances-dlist-0.0.1-141haskell-data-default-instances-old-locale-0.0.1-33  haskell-data-fix-0.3.1-14haskell-digest-0.0.1.2-22  haskell-distributive-0.6.2.1-65  haskell-dlist-1.0-64haskell-doclayout-0.3-85  haskell-doctemplates-0.9-30  haskell-emojis-0.1-86haskell-erf-2.0.0.0-21  haskell-errors-2.3.0-59  haskell-file-embed-0.0.13.0-3haskell-glob-0.10.1-67  haskell-haddock-library-1.9.0-118  haskell-hashable-1.3.1.0-13haskell-hourglass-0.2.12-121  haskell-hslua-1.3.0.1-17  haskell-hslua-module-system-0.2.2.1-72haskell-hslua-module-text-0.3.0.1-60  haskell-hsyaml-0.2.1.0-91  haskell-http-4000.3.15-130haskell-http-client-0.7.6-7  haskell-http-client-tls-0.3.5.3-398  haskell-http-types-0.12.3-143haskell-hxt-9.3.1.21-18  haskell-hxt-charproperties-9.5.0.0-1haskell-hxt-regex-xmlschema-9.2.0.7-2  haskell-hxt-unicode-9.0.2.4-22haskell-indexed-traversable-0.1.1-3  haskell-integer-logarithms-1.0.3.1-3haskell-ipynb-0.1.0.1-184  haskell-jira-wiki-markup-1.3.3-6  haskell-juicypixels-3.3.5-77haskell-memory-0.15.0-88  haskell-mime-types-0.1.0.9-11  haskell-mono-traversable-1.0.15.1-118haskell-network-3.1.2.1-40  haskell-network-uri-2.6.4.1-8  haskell-old-locale-1.0.0.7-27haskell-old-time-1.1.0.3-27  haskell-pandoc-types-1.22-63  haskell-pem-0.2.4-153haskell-primitive-0.7.1.0-106  haskell-quickcheck-2.14.2-124  haskell-random-1.2.0-178haskell-resourcet-1.2.4.2-70  haskell-safe-0.3.19-5  haskell-scientific-0.3.6.2-92haskell-sha-1.6.4.4-16  haskell-skylighting-0.10.3-3  haskell-skylighting-core-0.10.3-3haskell-socks-0.6.1-98  haskell-split-0.2.3.4-120  haskell-splitmix-0.1.0.3-82haskell-streaming-commons-0.2.2.1-68  haskell-strict-0.4.0.1-40  haskell-syb-0.7.2.1-31haskell-tagged-0.8.6.1-2  haskell-tagsoup-0.14.8-101  haskell-temporary-1.3-228haskell-texmath-0.12.1.1-18  haskell-text-conversions-0.3.1-56  haskell-text-icu-0.7.0.1-37haskell-th-abstraction-0.4.2.0-2  haskell-th-compat-0.1.2-1  haskell-these-1.1.1.1-67haskell-time-compat-1.9.5-40  haskell-tls-1.5.5-12  haskell-transformers-compat-0.6.6-3haskell-typed-process-0.2.6.0-102  haskell-unicode-transforms-0.3.7.1-51haskell-uniplate-1.6.13-44  haskell-unliftio-core-0.2.0.1-6haskell-unordered-containers-0.2.13.0-51  haskell-utf8-string-1.0.2-25haskell-uuid-types-1.0.3-97  haskell-vector-0.12.2.0-40  haskell-vector-algorithms-0.8.0.4-40haskell-x509-1.7.5-132  haskell-x509-store-1.6.7-131  haskell-x509-system-1.6.6-199haskell-x509-validation-1.6.11-131  haskell-xml-1.3.14-27  haskell-xml-conduit-1.9.1.0-6haskell-xml-types-0.3.8-5  haskell-zip-archive-0.4.1-106  haskell-zlib-0.6.2.3-8  lua53-5.3.6-1pandoc-2.11.4-7....

Refer

Pandoc

TeX Live (简体中文) - Arch WiKi

libpoppler.so.76: cannot open shared object file: No such file or directory carolynlmk 2019-01-25:已经有了libpoppler.so.19库,这个更新。所以通过建立19到18链接来暂时避免

Mangaro下安装TextLive遇到的问题 Tender_Li 2020-02-06:建立19到18链接,没有证明自己有没有存在这个库。。

error while loading shared libraries: libpoppler.so.101: cannot open shared object file: No such file or directory 2020

After check the directory /usr/lib/ I found there is no libpoppler.so.101, instead, we get libpoppler.so.102. Then I checked the pamac history and found the poppler related packages were updated from 0.90.1-1 to 20.08.1-1. I think this is why libpoppler.so updated from 101 to 102.
The problem here is, after the update, pdf-tools tries to rebuild itself. However, it does not really do the rebuild, which I don’t know why. (maybe make does not find the change of source code so it just skips all the rebuild. sorry, I only know little about compile.)
So, what I did is go to pdf-tools’ directory which is path/to/.emacs.d/elpa/pdf-tools-xxx/build and run make clean to remove these object files manually. I also did make clean in the server subdirectory under build, but I am not sure if it is necessary. Then reopen emacs and let it rebuild the pdf-tools (or run pdf-tools-install, to rebuild it manually).

所以问题无法确定是不是升级导致的

phodal/ebook-boilerplate:A Markdown convert to Ebook arrow_right html、mobi、epub、pdf、rtf Template

Shieber / Text2docx2pdf :linux下三个工具软件,可在命令行实现txt转docx,txt转pdf,docx转pdf。依赖python-docx

mstamy2/PyPDF2:PyPDF2 是一个纯 Python PDF 库,能够分割、合并、裁剪和转换 PDF 文件页面

Python 爬虫:把廖雪峰的教程转换成 PDF 电子书:pdfkit、wkhtmltopdf

英强 / MD2File:Java - 文档导出工具类,能将markdown格式的内容,转为office word,PDF,HTML等等格式的文档。不使用markdown格式的内容,直接调用MD2File的api,生成word,pdf等文档也是可以的。 另外,还可以将MD2File作为markdown转HTML的工具类。

Pandoc 使用及踩坑 点半久 Edited on 2019-08-31:Nice note, 不过同样是pacman安装的,我的没有sty文件问题。。或许是因为我安装了中文加持包的缘故吧

End

Arch Linux上使用 pandoc 将 markdown 转为 pdf 以及如何查看本机的中文字体 fc-list :lang=zh相关推荐

  1. archlinux php mysql,arch linux上安装 httpd+php+mysql+ openssl(转)

    arch linux上安装 httpd+php+mysql+ openssl(转)[@more@] 在arch linux安装则是非常的容易,只要执行: # pacman -Sy apache php ...

  2. 分段显示 linux_ArchAudit:一款在 Arch Linux 上检查易受攻击的软件包的工具 | Linux 中国...

    Arch-audit 是一个类似于 Arch Linux 的 pkg-audit 工具.它使用了令人称赞的 Arch 安全小组收集的数据.-- Prakash Subramanian 我们必须经常更新 ...

  3. linux分区出现hfs,在Arch Linux上挂载HFS +分区

    我在Arch Linux上安装hfs +分区时遇到一些问题. 运行时出现sudo mount -t hfsplus /dev/sda2 /mnt/mac此错误: mount: wrong fs typ ...

  4. linux avr,Arch linux上的AVR

    我的问题是如何在avr-c中创建文件,然后将它们编译为avr mkii isp. 我只是简单地创建一个c文件,将我的avr-c代码放入其中,然后在终端中键入命令将其导出到isp或者是否有更复杂的过程? ...

  5. 在 Arch Linux 上使用人脸识别(howdy)来登陆和认证

    干啥 是这样子的,我的笔记本使用的键盘是蓝牙的,然后无论是 win 还是 arch,蓝牙功能都是在登陆进系统之后才开启,这样每次输入密码我就得把身子往前靠.双手伸向笔记本输入密码...而 win 提供 ...

  6. linux 可以添加指纹识别,在Arch Linux上使用PAM设置内置指纹读取器身份验证

    本文目的是帮助你在Linux系统上设置和配置内置指纹识别器登录验证,我在HP Envy 15运行的Arch Linux 64位系统上进行了测试.你需要从源代码安装几个软件包才能使指纹识别器工作,我不能 ...

  7. pandoc讲html转换为pdf,使用Pandoc将Markdown转换为PDF时使用CSS

    我在OS X上尝试Pandoc,到目前为止的结果令人印象深刻.然而,一个阻塞问题是让CSS样式处理内联代码示例.我正在从Markdown转换为PDF. 我在源代码中有这个字符串: * Create a ...

  8. linux smb 所有者,python-3.x - 在Linux上使用python从smb共享中获取文件的所有者。 - SO中文参考 - www.soinside.com...

    这简直不是一件小事,可惜答案并不像我希望的那样简单. 如果以后有人会被这个同样的问题困扰,我就把这个答案贴出来,但希望也许有人能早点贴出更好的解决方案来 为了找到主人,我用 本库及其实例:from s ...

  9. markdown转为html及pdf

    markdown转为html markdown转html比较容易些,有很多方法都可以做到. 1. 通过markdown编辑器导出 linux下常用的markdown编辑器有retext,haroopa ...

最新文章

  1. CentOS安装crontab
  2. 图像处理-仿射变换 AffineTransform
  3. 机器学习XGBoost——后面的明天更
  4. Minimum supported Gradle version is 6.5. Current version is 6.1.1. If using the gradle wrapper, try
  5. 国二c语言操作题评分标准,全国计算机二级C语言操作题题库.doc
  6. html5 对比 HTML4 新增,HTML5对比HTML4的主要改变和改进总结
  7. Android中设置显示文本,TextView控件的使用(Android设置文本显示格式)
  8. Java八大基础数据类型转换
  9. cesium加载shp格式数据
  10. mdx 医学词典_有没有专门医学英语词典app?
  11. 《东周列国志》第七十一回 晏平仲二桃杀三士 楚平王娶媳逐世子
  12. 红外数据集 | 收集OTCBVS、KAIST、FLIR红外图像数据
  13. 刷算法第五天——P5594 模拟赛
  14. (附源码)springboot校园疫情管理系统 毕业设计021506
  15. sherwood算法
  16. 解决The package java.awt is not accessible或者javax.swing is not accessible的问题
  17. 【01Vue3 安装】Vue3 安装引入 Vue.js创建Vue实例编写Vue应用程序在HTML中使用Vue应用程序
  18. jQuery封装的表单验证,模仿网易或者腾讯登录的风格
  19. WEB之静态网页(模仿昆工主页)
  20. python迭代器面试题

热门文章

  1. 2018-2019赛季多校联合新生训练赛第四场
  2. idea 报错Output directory is not specified错误
  3. java中的variable是什么,Java POJO中的field,variable,attribute和property有什么区别?
  4. 给小学生科普计算机知识,小学生必懂的15个科普知识
  5. 四舍六入五成双(C语言版)
  6. 不得转载可以转发吗_微信公众号如何转发别人的文章,转载原创文章注意事项...
  7. supervisorctl error (no such process)
  8. 软件工程 个人学习笔记(第三章)
  9. python编程练习:求最大公约数和最小公倍数
  10. Gaussdb 存储过程