LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

grap

Graph language preprocessor for groff documents

TLDR

Process a grap script into PostScript via groff
$ grap [script.grap] | groff -Tps > [output.ps]
copy
Pipe grap output through pic and groff
$ grap [script.grap] | pic | troff -Tps > [output.ps]
copy
Define a variable from the command line
$ grap -d "[x=100]" [script.grap] | groff -Tps > [output.ps]
copy
Read from standard input
$ cat [script.grap] | grap | groff -Tps > [output.ps]
copy

SYNOPSIS

grap [options] [file]

DESCRIPTION

grap is a preprocessor for creating graphs within groff/troff documents. Input is written in a simple declarative language enclosed between .G1 and .G2 macros, and the output is pic(1) code suitable for further processing by pic and troff/groff.The tool creates publication-quality graphs for technical documents, supporting features like labeled axes, multiple data sets, logarithmic scales, and coordinate systems. It integrates seamlessly with the troff document processing pipeline.

PARAMETERS

FILE

Grap input file. If omitted, reads from standard input.
-d VAR=VALUE
Define a variable and its value before processing.
-l
Use the graph's default line thickness.
-R
Do not load the default macro startup file.
--help
Display help information.

CAVEATS

Part of the groff ecosystem. Outputs pic format that must be further processed by pic(1) and troff/groff. Not installed by default on most distributions; often available as a separate package.

HISTORY

grap was developed at Bell Labs as part of the Unix document preparation tools, described by Kernighan and Bentley.

SEE ALSO

groff(1), pic(1), troff(1), tbl(1), eqn(1), gnuplot(1)

Copied to clipboard
Kai