PIC (markup language) explained

Pic
Author:Brian Kernighan
(AT&T Bell Laboratories)
Developer:Various
Programming Language:C (programming language), Yacc
Operating System:Unix, Unix-like, Plan 9
Platform:Cross-platform
Genre:Command, Graphics

In computing, Pic is a domain-specific programming language by Brian Kernighan for specifying line diagrams.The language contains predefined basic linear objects: line, move, arrow, and spline, the planarobjects box, circle, ellipse, arc, and definable composite elements.Objects are placed with respect to other objects or absolute coordinates.A liberal interpretation of the input invokesdefault parameters when objects are incompletely specified.An interpreter translates this description intoconcrete drawing commands in a variety of possible output formats.Pic is a procedural programming language, with variable assignment, macros, conditionals, and looping. The language is an example of a little language originally intended for the comfort of non-programmers in the Unix environment (Bentley 1988).

History

Pic was implemented using Yacc compiler-compiler.[1]

Implementations

Pic was first implemented as a preprocessor in the troff document processing system but is now often used with LaTeX. The pic preprocessor filters a source document, replacing diagram descriptions by drawing commands in a specified format, and passing the rest of the document through without change. Alternatively, diagram source is passed through the preprocessor to produce a file for insertion into thedocument source.

A version of pic is included in groff, the GNU version of troff. GNU pic can also act as a preprocessor for TeX documents, emitting its own tpic DVI specials, which aren't as widely supported as those of other TeX graphic facilities.[2] Arbitrary diagram text can be included for formatting by the word processor to which the pic output is directed, and arbitrary graphic processor commands can also be included.

DPIC

Dwight Aplevich's implementation, DPIC, can also generate pdf, postscript, svg, and other images by itself, as well as act as a preprocessor producing several LaTeX-compatible output formats. The three principal sources of pic processors are GNU pic, found on many Linux systems, and dpic, both of which are free, and the original AT&T pic.

Pikchr

Pikchr (pronounced "picture") is a modern replacement for Pic in some contexts, designed to be embedded in Markdown, instead of troff or LaTeX. It should run most of the example scripts contained in the original technical report on Pic with little to no change.[3] Created by D. Richard Hipp, in August 2020,[4] it is used in Fossil, SQLite, and Subplot.

Alternatives

Pic has some similarity with MetaPost and the DOT language.

See also

References

Notes

External links

Notes and References

  1. Web site: September 30, 2015 . UNIX Special: Profs Kernighan & Brailsford . live . https://ghostarchive.org/varchive/youtube/20211213/vT_J6xc-Az0 . 2021-12-13 . Computerphile.
  2. Book: The LaTeX Graphics Companion. 2008. Addison-Wesley. 978-0-321-50892-8. Michel Goossens, Frank Mittelbach, Sebastian Rahtz, Denis Roegel, Herbert Voß. 2nd. 17–20.
  3. Web site: Hipp . Richard . Differences Between Pikchr And Legacy-PIC . Pikchr . 16 August 2021.
  4. Web site: Hipp . Richard . Check-in [d06dd0ebe7] ]. Pikchr . 13 September 2020.