Pandoc Integration

TL;DR:

Typora requires Pandoc (≥ v2.0). If you do not have Pandoc or only old version of Pandoc installed on your machine, you could:

Download installer from Download Page and install or update Pandoc.

For windows users, if typora still saying it cannot found Pandoc, you may need try to restart your PC.

Pandoc Integration

In Typora, import function and export function for some file formats (including docx, odt, rtf, epub, LaTeX and wiki) are powered by a 3rd party software named Pandoc. Those features requires Pandoc (≥ v2.0) to be installed.

Please note that install Pandoc is optional for Typora, if you do not need those advanced import/export support in typora, then you do not have to install Pandoc on your computer.

This document would show how to install Pandoc and use Typora with Pandoc for full import/export functions.

What is Pandoc

Pandoc is a universal document text converter. Typora use it to support file import/export features for several file types.

Install Pandoc

For Mac User

Briefly speaking, there are two recommended ways.

Install from downloaded package installer

Download a package installer from pandoc’s download page, open it and follow the instructions for installation.

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-wlTSlEY4-1634805934069)(img/Snip20160502_1.png)]

Install from homebrew

For developers using homebrew, installing pandoc can be one line from terminal:

brew install pandoc

For Windows User

Download the pandoc-*-window.msi from pandoc’s download page, open it and follow the instructions for installation.

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-fpfELzkz-1634805934072)(img/pandoc-win.PNG)]

Use Pandoc

After Pandoc is installed, then you could import supported file types by clicking File -> Import from menubar, or simple drag and drop a file into typora. Export function is also fully functional from menubar. Pandoc will run in backgrounds for those tasks and then exit automatically, so you may not feel it.

FAQ

Which version of pandoc is supported ?

Versions ≥ 2.0 is required. The latest version, the better. So updating pandoc is encouraged if your pandoc version is too old.

Can typora work without pandoc ?

Yes, only import and export (other than html/PDF file types) needs it.

Which file types can be imported or exported by typora ?

Import supports file with extesion: .docx, .latex, .tex, .ltx, .rst, .rest, .org, .wiki, .dokuwiki, .textile, .opml, .epub.

Export supports file formats of: HTML, PDF (these two does not need Pandoc), Docx, odt, rtf, Epub, LaTeX, Media Wiki.

Pandoc should support more file types which typora did not integrate, detailed info is here.

What’s the difference between exporting by typora and exporting by using pandoc from command line ?

Exporting by typora is also powered by Pandoc, yet typora will not convert directly from markdown to target file type, instead, it converts to an inner format pandoc can read and then write as target file type, so, in detail:

  • If you run pandoc from command line, then you need to specify its markdown parser from (pandoc Markdown, CommonMarkPHP Markdown ExtraGitHub-Flavored Markdown), while exporting using typora, typora will pass its inner AST to pandoc for file conversion. In other words, the format of blocks or inline elements in exported output will always be consistent as what you see in typora and exported HTML/PDF. Yet, the styling maybe different.
  • Some markdown syntax invented by pandoc Markdown, like citations, are not supported when you exporting from typora, since only markdown syntax typora support will be correctly exported. But we may support more extended markdown syntax in future.
  • If you use typora for exporting, then[TOC] will be correctly exported for all file types. Highlight and underline will be supported for LaTeX, rtf, Epub, wiki formats and sometimes Docx. Yet, they are only supported for HTML based file formats in raw Pandoc. Other block and inline elements is basically both supported by raw pandoc and typora+pandoc.
Can all block/inline element types be exported correctly ?

Task list is not supported yet. Underline and highlight for .docx is supported only if they are not used inside or outside other inline styles. Underline and highlight is not support for OpenOffice(.odt). Embedded .gif file is not support for LaTeX. Other block or inline elements can basically be exported. But the styles cannot be 100% match when import/export.

How to uninstall pandoc for mac ?

This is the instruction from pandoc’s official site:

If you later want to uninstall the package, you can do so by downloading this script and running it with perl uninstall-pandoc.pl".

Found bug and unsupported syntax for exporting ?

Contact us hi@typora.io, better to provide a sample .md file, so we could reproduce the bug.

If you found it is a bug/feature request for pandoc, you could contact the community via pandoc-discuss.

pandoc: 如果您需要将文件从一种标记格式转换为另一种标记格式,那么pandoc就是您的瑞士军刀。Pandoc可以转换文件(几种方言)Markdown,reStructuredText,纺织品,HTML,DocBook,LaTeX,MediaWiki标记,TWiki标记,TikiWiki标记,Creole 1.0,Vimwiki标记,OPML,Emacs 组织模式,Emacs Muse,txt2tags,Microsoft Word docx,LibreOffice ODT,EPUB或黑线鳕标记到 HTML格式 使用Slidy,reveal.js,Slideous,S5或DZSlides的 XHTML,HTML5和HTML幻灯片演示 字处理器格式 Mi crosoft Word docx,OpenOffice / LibreOffice ODT,OpenDocument XML,Microsoft PowerPoint。 电子书 EPUB版本2或3,FictionBook2 文档格式 DocBook版本4或5,TEI Simple,GNU TexInfo,Groff man,Groff ms,Haddock标记 档案格式 JATS 页面布局格式 InDesign ICML 大纲格式 OPML TeX格式 LaTeX,ConTeXt,LaTeX Beamer幻灯片 PDF 通过pdflatex,xelatex,lualatex,pdfroff,wkhtml2pdf,prince,或weasyprint。 轻量级标记格式 Markdown(包括CommonMark和GitHub风格的Markdown),reStructuredText,AsciiDoc,Emacs Org-Mode,Emacs Muse,Textile,txt2tags,MediaWiki标记,DokuWiki标记,TikiWiki标记,TWiki标记,Vimwiki标记和ZimWiki标记。 自定义格式 自定义编写器可以用lua编写。 Pandoc了解许多有用的markdown语法扩展,包括文档元数据(标题,作者,日期); 脚注; 表; 定义清单; 上标和下标; 三振出局; 增强的有序列表(起始编号和编号样式很重要); 运行示例列表; 带语法高亮的分隔代码块; 聪明的引号,短划线和椭圆; HTML块内的markdown; 和内联LaTeX。如果需要严格的降价兼容性,则可以关闭所有这些扩展。 LaTeX数学(甚至宏)可用于降价文档。提供了几种不同的HTML渲染数学方法,包括MathJax和MathML的翻译。LaTeX数学被转换(根据输出格式的需要)到unicode,本机Word方程对象,MathML或groff eqn。 Pandoc包含一个强大的系统,用于自动引用和参考书目,使用pandoc-citeproc(源自Andrea Rossato的citeproc-hs)。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值