首页 » Web前端 » chocolatey安装php技巧_Pandoc安装运用快速上手

chocolatey安装php技巧_Pandoc安装运用快速上手

访客 2024-12-04 0

扫一扫用手机浏览

文章目录 [+]

choco install pandoc# 其他Pandoc软件安装choco install rsvg-convert python miktexmacOS

brew install pandoc# Pandoc解析器brew install pandoc-citeproc# 其他Pandoc软件安装brew install librsvg python homebrew/cask/basictexLinux

sudo yum install pandoc# 如果想输出PDF,可以安装TeX Livesudo yum install texliveUbuntu/Debian

sudo apt install pandoc# 如果想输出PDF,可以安装TeX Livesudo apt install texlive利用

经由上面的安装,我们可以利用了。

验证

[frank@LAPTOP-0OCJTGJR ~]$ pandoc --versionpandoc 1.12.3.1Compiled with texmath 0.6.6, highlighting-kate 0.5.6.Syntax highlighting is supported for the following languages: actionscript, ada, apache, asn1, asp, awk, bash, bibtex, boo, c, changelog, clojure, cmake, coffee, coldfusion, commonlisp, cpp, cs, css, curry, d, diff, djangotemplate, doxygen, doxygenlua, dtd, eiffel, email, erlang, fortran, fsharp, gnuassembler, go, haskell, haxe, html, ini, java, javadoc, javascript, json, jsp, julia, latex, lex, literatecurry, literatehaskell, lua, makefile, mandoc, markdown, matlab, maxima, metafont, mips, modelines, modula2, modula3, monobasic, nasm, noweb, objectivec, objectivecpp, ocaml, octave, pascal, perl, php, pike, postscript, prolog, python, r, relaxngcompact, restructuredtext, rhtml, roff, ruby, rust, scala, scheme, sci, sed, sgml, sql, sqlmysql, sqlpostgresql, tcl, texinfo, verilog, vhdl, xml, xorg, xslt, xul, yacc, yamlDefault user data directory: /home/frank/.pandocCopyright (C) 2006-2013 John MacFarlaneWeb: http://johnmacfarlane.net/pandocThis is free software; see the source for copying conditions. There is nowarranty, not even for merchantability or fitness for a particular purpose.小试牛刀

虽然下面的方法不怎么常用,我们先通过命令行的一个大略例子认识一下Pandoc

chocolatey安装php技巧_Pandoc安装运用快速上手

例子一:markdown 转 html

[frank@LAPTOP-0OCJTGJR pandoc]$ pandoc# 标题一## 标题二> 择要

这是按下Ctrl-D,看看会发生什么?

chocolatey安装php技巧_Pandoc安装运用快速上手
(图片来自网络侵删)

<h1 id="标题一">标题一</h1><h2 id="标题二">标题二</h2><blockquote><p>择要</p></blockquote>例子二:html 转 LaTeX

[frank@LAPTOP-0OCJTGJR pandoc]$ pandoc -f html -t markdown<h1 id="标题一">标题一</h1><h2 id="标题二">标题二</h2><blockquote><p>择要</p></blockquote>

这时再次按下Ctrl-D,看看会发生了什么?

标题一======标题二------> 择要

我们是不是可以将markdown转换成LaTeX了?你会怎么利用命令组合呢?

文本转换

好了,玩够了,我们正式开始文本转换。

编辑文档

利用任意你喜好的文本编辑器编辑如下文档并保持为.md文件。
这里保持成test1.md

---title: Test...# Test!This is a test of pandoc.- list one- list twomarkdown 转 html

[frank@LAPTOP-0OCJTGJR pandoc]$ pandoc test1.md -f markdown -t html -s -o test1.html[frank@LAPTOP-0OCJTGJR pandoc]$ lltotal 4-rw-rw-r-- 1 frank frank 629 Feb 4 22:06 test1.html-rw-rw-r-- 1 frank frank 81 Feb 4 22:05 test1.md

先容一下参数-s选项表示创建一个“独立”文件,个中包含页眉和页脚,而不仅仅是片段-o test1.html 将输出放入文件中test1.html-f markdown和-t html 表示,from markdown格式 to html格式,Pandoc模式便是从markdown转成html。

markdown 转 LaTeX

[frank@LAPTOP-0OCJTGJR pandoc]$ pandoc test1.md -f markdown -t latex -s -o test1.tex[frank@LAPTOP-0OCJTGJR pandoc]$ lltotal 8-rw-rw-r-- 1 frank frank 629 Feb 4 22:06 test1.html-rw-rw-r-- 1 frank frank 81 Feb 4 22:05 test1.md-rw-rw-r-- 1 frank frank 1627 Feb 4 22:17 test1.tex

当然,你也可以直接用下面的命令

[frank@LAPTOP-0OCJTGJR pandoc]$ pandoc test1.md -s -o test2.tex[frank@LAPTOP-0OCJTGJR pandoc]$ lltotal 12-rw-rw-r-- 1 frank frank 629 Feb 4 22:06 test1.html-rw-rw-r-- 1 frank frank 81 Feb 4 22:05 test1.md-rw-rw-r-- 1 frank frank 1627 Feb 4 22:17 test1.tex-rw-rw-r-- 1 frank frank 1627 Feb 4 22:18 test2.tex

以为你的文件后缀是.tex,那么Pandoc就会知道你是想天生LaTeX文档,够知心。

markdown 转 pdf

如果想转成pdf那么我们须要安装texlive这个工具包,在安装一节中我们已经做过这件事儿了。
那么我们就直接运行吧。

[frank@LAPTOP-0OCJTGJR pandoc]$ pandoc test1.md -s -o test1.pdf[frank@LAPTOP-0OCJTGJR pandoc]$ lltotal 92-rw-rw-r-- 1 frank frank 629 Feb 4 22:06 test1.html-rw-rw-r-- 1 frank frank 81 Feb 4 22:05 test1.md-rw-rw-r-- 1 frank frank 80599 Feb 4 22:20 test1.pdf-rw-rw-r-- 1 frank frank 1627 Feb 4 22:17 test1.tex-rw-rw-r-- 1 frank frank 1627 Feb 4 22:18 test2.tex进阶

更高等的用法可以参考《Pandoc用户指南》

标签:

相关文章

华蓥SEO推广,助力企业腾飞的网络营销之路

网络营销已成为企业拓展市场、提升品牌知名度的重要手段。华蓥作为一座具有悠久历史和丰富资源的城市,近年来在SEO推广方面取得了显著成...

Web前端 2025-03-24 阅读0 评论0

巴音SEO排名,介绍提升网站流量与优化步骤

网络营销已成为企业竞争的重要手段。SEO(搜索引擎优化)作为网络营销的核心,对于提升网站流量、提高品牌知名度具有重要意义。本文将围...

Web前端 2025-03-24 阅读0 评论0

怀化SEO优化,助力企业提升网络竞争力

越来越多的企业开始重视网络营销,而SEO(搜索引擎优化)作为网络营销的重要手段,已经成为企业提升网络竞争力的重要途径。怀化作为湖南...

Web前端 2025-03-24 阅读0 评论0

新塘SEO优化,介绍关键词布局的艺术

搜索引擎优化(SEO)已成为企业提升品牌知名度、拓展市场份额的重要手段。新塘SEO优化作为SEO领域的重要组成部分,其核心在于关键...

Web前端 2025-03-24 阅读0 评论0

北京网络营销新趋势,创新驱动,智慧赋能

网络营销已成为企业市场竞争的重要手段。北京,作为中国首都,拥有丰富的互联网资源和创新人才,网络营销在这里呈现出独特的魅力。本文将探...

Web前端 2025-03-24 阅读0 评论0