Skip to content
ddoherty03Public

About

Org Babel adapter for the pic graphics language using pic2plot from GNU plotutils.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

When released on MELPA, this package can be installed with package-install or a use-package block.

In order for it to work, you must have the GNU plotutils package installed on your system and in your path. It contains the pic2plot program on which this package depends.

For Ubuntu

sudo apt install plotutils

For Arch

sudo pacman -Sy plotutils

Usage

Source Blocks

This package allows a source block to use the pic language designator on a source block:

#+header: :file output.png
#+begin_src pic
  down;
  box "Emacs"; arrow;box "OrgMode"; arrow
  box "begin_src" "pic"; arrow; box "ob-pic"; arrow;
  box "pic2plot"; arrow; box "output.png"
#+end_src

output.png

The block requires a :file argument (except with the -T X output format). By default, it outputs a png file, but this can be adjusted by providing a :cmdline argument with the value -T <type>, where <type> is one of the types supported by pic2plot:

X
the X Window System (no :file argument needed)
png
PNG format
pnm
portable anymap (PBM/PGM/PPM) format
gif
pseudo-GIF format
svg
the XML-based Scalable Vector Graphics format
ai
the format used by Adobe Illustrator
ps
`idraw’-editable Postscript
cgm
the WebCGM format for Web-based vector graphics
fig
the format used by the `xfig’ drawing editor
pcl
the Hewlett-Packard PCL 5 printer language
hpgl
Hewlett-Packard Graphics Language (by default, HP-GL/2)
regis
the ReGIS (remote graphics instruction set) format developed by DEC
tek
Tektronix format
meta
device-independent GNU graphics metafile format

With the -T X argument, an X window containing the graphic will pop up.

In actual pic code, each picture must be started with a “.PS” directive and ended with “.PE”. ob-pic adds those delimiters automatically if you do not put them in the block yourself. If you want to pass parameters on the .PS line, then make the delimiters explicit.

Any other :cmdline parameters are passed on to pic2plot unaltered.

The pic Language

As for the pic language, the classic source is Brian Kernighan’s original Bell Labs Computing Science Technical Report No. 116 on the language from 1991, which can be found here. There is even an earlier paper from 1981.

Eric S. Raymond also describes the GNU implementation of the language, called gpic in this paper. It enhances pic language in several important respects, and pic2plot appears to support most of them, for example adding rounded corners to boxes.

In addition, Dwight Aplevitch has implemented a version of pic called dpic, which is capable of outputing several additional formats, including TikZ for LaTeX. His documentation is also available online.

The pic2plot Program

There is an info node for this program if you have installed the plotutils package, but it also has its documentation available here.

Report Bugs

Bugs should be reported on github at this URL.

About

Org Babel adapter for the pic graphics language using pic2plot from GNU plotutils.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages