Linux command
chem 命令
文件
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Process a chem file and view the output
chem [path/to/file.chem] | groffer
Process and convert to PostScript
chem [path/to/file.chem] | groff -p -Tps > [output.ps]
Process from stdin
echo '.cstart\nCH3\nbond\nCH3\n.cend' | chem | groffer
Display version information
chem --version
说明
chem is a groff preprocessor for producing chemical structure diagrams. It translates chemical notation into pic language diagrams, which can then be processed by groff for rendering. The tool is best suited for organic chemistry, supporting bonds, rings, moieties (like CH3, NH3), and strings. Chemical diagrams are enclosed between .cstart and .cend markers. Example input: ``` .cstart CH3 bond CH3 .cend ``` Since chem is a pic preprocessor, raw pic statements can be included within diagrams for custom drawings.
参数
- -h, --help
- Display usage message and exit
- -v, --version
- Display version information and exit
- filespec
- Input file or - for stdin. Without arguments, reads stdin
FAQ
What is the chem command used for?
chem is a groff preprocessor for producing chemical structure diagrams. It translates chemical notation into pic language diagrams, which can then be processed by groff for rendering. The tool is best suited for organic chemistry, supporting bonds, rings, moieties (like CH3, NH3), and strings. Chemical diagrams are enclosed between .cstart and .cend markers. Example input: ``` .cstart CH3 bond CH3 .cend ``` Since chem is a pic preprocessor, raw pic statements can be included within diagrams for custom drawings.
How do I run a basic chem example?
Run `chem [path/to/file.chem] | groffer` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -h, --help do in chem?
Display usage message and exit