ArticleslgStudy

computer science

PIC (markup language)

PIC (markup language) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand PIC (markup language) rather than just read about it. In short: 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 planar objects box, circle, ellipse, arc, and definable composite elements.

Key takeaways

  • PIC (markup language) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect PIC (markup language) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of PIC (markup language) from memory before moving on to harder problems.

Reference excerpt

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 planar objects 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 invokes default parameters when objects are incompletely specified. An interpreter translates this description into concrete 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.

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 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. 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. Created by D. Richard Hipp, in August 2020, it is used in Fossil, SQLite, and Subplot.

Alternatives Pic has some similarity with MetaPost and the DOT language.

See also Eqn language

References

Notes Kernighan, Brian W. (1982). "PIC - A Language for Typesetting Graphics". Software: Practice and 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. 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." The Circuit_macros distribution includes numerous examples of electric circuits and other objects of a sophistication well beyond the basic box-and-arrow diagrams in the original pic manuals. The examples employ dpic principally together with macros written in the pic and m4 macro languages. Pikchr

Worked examples

Example 1 — a first encounter with PIC (markup language)

Start with the simplest possible case. Write down what PIC (markup language) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to PIC (markup language) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about PIC (markup language) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of PIC (markup language)

In research
PIC (markup language) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses PIC (markup language) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
PIC (markup language) is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1980 software, Graph description languages, Markup languages, so understanding it makes those chapters shorter.
In everyday life
Look for PIC (markup language) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “PIC (markup language)” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study PIC (markup language) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what PIC (markup language) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain PIC (markup language) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is PIC (markup language) in simple terms?

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 planar objects box, circle, ellipse, arc, and definable composite elements.

Why does PIC (markup language) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study PIC (markup language)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on PIC (markup language).

Tags

  • 1980 software
  • Graph description languages
  • Markup languages
  • Programming languages
  • Programming languages created in 1980
  • Troff

Keep exploring