Linux command
grap 命令
网络
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Process a grap script into PostScript via groff
grap [script.grap] | groff -Tps > [output.ps]
Pipe grap output through pic and groff
grap [script.grap] | pic | troff -Tps > [output.ps]
Define a variable from the command line
grap -d "[x=100]" [script.grap] | groff -Tps > [output.ps]
Read from standard input
cat [script.grap] | grap | groff -Tps > [output.ps]
说明
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.
参数
- -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.
FAQ
What is the grap command used for?
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.
How do I run a basic grap example?
Run `grap [script.grap] | groff -Tps > [output.ps]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -d _VAR=VALUE_ do in grap?
Define a variable and its value before processing.