PIC (markup language)
In computing, Pic is a domain-specific programming language by Brian Kernighan for specifying diagrams in terms of objects such as boxes with arrows between them. The pic compiler translates this description into concrete drawing commands. 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).
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 the document 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.[1] 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. 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.
Pic has some similarity with MetaPost and the DOT language.
Pic was implemented using Yacc compiler-compiler.[2]
References
- ^ Michel Goossens, Frank Mittelbach, Sebastian Rahtz, Denis Roegel, Herbert Voß (2008). The LaTeX Graphics Companion (2nd ed.). Addison-Wesley. pp. 17–20. ISBN 978-0-321-50892-8.
{{cite book}}
: CS1 maint: multiple names: authors list (link) - ^ "UNIX Special: Profs Kernighan & Brailsford". Computerphile. September 30, 2015.
- Notes
- Kernighan, Brian W. (1982). "PIC - A Language for Typesetting Graphics". Software Practice Experience. 12 (12): 1–20. doi:10.1002/spe.4380120102. S2CID 59543886.
- J. Bentley. More Programming Pearls, Addison-Wesley (1988).
External links
- Making Pictures With GNU PIC
- Troff resources (see the "pic" section)
- DPIC, an implementation of the PIC language by Dwight Aplevich. This implementation has a few nice extensions and outputs many different image formats.
- figr, web based pic renderer.
- Brian W. Kernighan (1991). PIC — A Graphics Language for Typesetting. User Manual (PDF). CSTR #116 (Technical report) (Revised ed.). Bell Laboratories.
- GNU pic2plot "takes one or more files in the pic language, and either displays the figures that they contain on an X Window System display, or produces an output file containing the figures. Many graphics file formats are supported."
- pikchr (pronounced "picture") is a language with partial pic commonality, for use with Markdown or similar markup languages, created in August 2020[1] by D._Richard_Hipp, initially for embedding diagrams into various document types supported by his Fossil SCM project.[2]
- pikchr is used in the Subplot Automated Acceptance Test Suite to to process embedded graphs.
- ^ Hipp, Richard. "Initial pikchr checkin". pikchr. Retrieved 13 September 2020.
- ^ Hipp, Richard. "pikchr home page". pikchr. Retrieved 13 September 2020.