pandoc-plot

授权协议 GPL-2.0 License
开发语言
所属分类 应用工具、 科研计算工具
软件类型 开源软件
地区 不详
投 递 者 华凡
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

pandoc-plot

A Pandoc filter to generate figures from code blocks in documents

pandoc-plot turns code blocks present in your documents (Markdown, LaTeX, etc.) into embedded figures, using your plotting toolkit of choice, including Matplotlib, ggplot2, MATLAB, Mathematica, and more.

Overview

This program is a Pandoc filter. It can thereforebe used in the middle of conversion from input format to output format,replacing code blocks with figures.

The filter recognizes code blocks with classes that match plottingtoolkits. For example, using the matplotlib toolkit:

# My document

This is a paragraph.

```{.matplotlib}
import matplotlib.pyplot as plt

plt.figure()
plt.plot([0,1,2,3,4], [1,2,3,4,5])
plt.title('This is an example figure')
```

Putting the above in input.md, we can then generate the plot and embedit in an HTML page:

pandoc --filter pandoc-plot input.md --output output.html

The resulting output.html looks like this:

<h1 id="my-document">My document</h1>

<p>This is a paragraph.</p>

<figure>
<img src="plots\9671478262050082276.png" />
</figure>

Supported toolkits

pandoc-plot currently supports the following plotting toolkits(installed separately):

  • matplotlib: plots using the matplotlibPython library;
  • plotly_python : plots using theplotly Python library;
  • plotly_r: plots using the plotly Rlibrary
  • matlabplot: plots using MATLAB;
  • mathplot : plots usingMathematica;
  • octaveplot: plots using GNUOctave;
  • ggplot2: plots using ggplot2;
  • gnuplot: plots using gnuplot;
  • graphviz: graphs using Graphviz;
  • bokeh: plots using the Bokeh visualization library;
  • plotsjl: plots using the Julia Plots.jl package;
  • plantuml: diagrams using the PlantUML software suite.

To know which toolkits are useable on your machine (and which ones arenot available), you can check with the toolkits command:

pandoc-plot toolkits

Wish your plotting toolkit of choice was available? Please raise anissue!

Documentation

You can find more information in the documentation, available either in thesource repository file MANUAL.md, on the webpage, or via the command pandoc-plot --manual.

Installation

Binaries and Installers

Windows, Linux, and Mac OS binaries are available on the GitHub releasepage. There arealso Windows installers.

conda

Like pandoc, pandoc-plot is available as a package installable withconda. Click here to see thepackage page.

To install in the current environment:

conda install -c conda-forge pandoc-plot

Homebrew

pandoc-plot is available as a package via Homebrew. Click here to see the package page.

To install:

brew install pandoc-plot

winget

You can install pandoc-plot from the Windows PackageManager winget (just likepandoc). To install:

winget install pandoc-plot

Arch Linux

You can install pandoc-plot from the archlinux user repository as pandoc-plot-bin. You can install using e.g. yay:

yay -S pandoc-plot-bin

From Hackage/Stackage

pandoc-plot is available onHackage andStackage. Usingthe cabal-install tool:

cabal update
cabal install

From source

Building from source can be done using cabal:

git clone https://github.com/LaurentRDC/pandoc-plot
cd pandoc-plot
cabal install # Alternatively, `stack install`
 相关资料
  • Pandoc 可将多种文档格式,包括:markdown, reStructuredText, textile, HTML, DocBook, or LaTeX 转成: HTML formats: XHTML, HTML5, and HTML slide shows using Slidy, Slideous, S5, or DZSlides. Word processor formats: Mic

  • 来源:Markdown+Pandoc,打通写作界的任督二脉! Markdown+Pandoc,可以把自己的写作内容,变成世界上已有的任何格式的文件,包括很炫的slide,html5。没有人(或者我没看到)总结过这些内容,导致我走了很多弯路才最终打通任督二脉,特此纪念。 了解Markdwon以后,我的写作世界,只有它;看到Pandoc格式转换以后,对生成的slide和pdf羡慕的不行。那时,自己期望

  • Pandoc Starter This repository contains a number of files for getting started with Pandoc. Eachexample comes with: A README.md, describing the type of document and usage A Makefile, for building the d

  • Using pandoc with GitHub Actions You can use pandoc, the universal markup converter, on GitHub Actions to convert documents. GitHub Actions is an Infrastructure as a Service (IaaS) from GitHub, that a

  • Pandoc Markdown template This repository is a small collection of personal Markdown templates for Pandoc. Each directory contains a working template and example PDF output. Requirements Be sure to hav

  • Eisvogel A clean pandoc LaTeX template to convert your markdown files to PDF or LaTeX. It is designed for lecture notes and exercises with a focus on computer science. The template is compatible with