GNU/Linux {docs}

Groff

Man pages

  • man groff
  • man groff_ms
  • man groff_char
  • man eqn
  • man tbl
  • man pic
  • man refer

Groff is a document formatting system. It is a typesetting system that creates formatted output when given plain text mixed with formatting commands.

All the instructions on this page are targeted to the ms macros. You can find the man pages by typing man groff_ms.

Conversions

From .ms to .pdf

groff -ms test.ms -T pdf > test.pdf

Mathematical from .ms to .pdf

groff -ms -e test.ms -T pdf > test.pdf

It uses the eqn preprocessor

Example

.TL
My Document Title
.AU
The author of the document
.NH
This is a numbered Header
.NH 2
This is a numbered sub header
.NH 3
This is a numbered sub sub header
.SH
This is a non numbered Header
.PP
This is an indented parapraph
.LP
This is an un-indented paragraph
.PP
This is another paragraph, but
.B "this text is in bold".
In addition,
.I "this text is in italics",
and
.BI "this is bold italic".

Tables

.TS
tab(#);
c c c .
Name#Surname#Position
John#Doe#Programmer
Alice#Doe#Publisher
.TE

To compile, you must use the tbl preprocessor:

groff -ms -t test.ms -T pdf > test.pdf

More info at man tbl

8 Bit Characters

If you want to convert a .ms document that uses non common 8 bit characters (basically all languages except English), you must use this command:

preconv test.ms | groff -ms -T pdf > test.pdf

For the full list of characters, visit man groff_char