troff reads text files (written using an instream formatting language, see nroff) and formats the text for typesetting or laser printing.
The most common modern implementation is GNU groff.
The connection to Tcl is that the Tcl man pages - the only documentation that comes with the source - uses the *roff markup formatting language.
Firstly, always remember to look at other manual pages to see what sort of things belong!
Tcl manual pages start with:
.so man.macros .TH name section version Tcl "Tcl Built-In Commands" .BS .SH NAME names \- description .SH SYNOPSIS .nf summary of commands/functions .fi .BE
The name is the name of the manual page.
The section is (typically) n for commands (e.g. lsearch), 3 for C API functions (e.g. Tcl_SetObjResult), or 1 for programs/shells (e.g. tclsh).
The version is the version of Tcl/extension where the page last had substantive changes.
The names is a comma-separated list of all the commands or functions documented on the page, and must (along with the description) be on a single line.
The description is a very short description of what the commands/functions do (e.g. lsearch's page says "See if a list contains a particular element"), and must be on a single line (along with the names).
The summary of commands/functions is what it says; check some examples for how to write them.
Sections start with a:
.SH "title of section in caps"
The quotes can be omitted if the title is a single word. If you want a subsection instead, use .SS instead of .SH
The following sections are normal for a Tcl manual page (and in this order):
Other sections may be added between DESCRIPTION and EXAMPLES, and many pages omit the EXAMPLES still.
Note that widget manual pages have additional sections.
Paragraphs (normally) start with a .PP directive (.LP and .P are equivalent). You indent a section of paragraphs by putting .RS before them and .RE afterwards.
To do a bulleted list, start each item in the list with:
.IP \(bu 3
To do a descriptive list item (like <DT><DD> in HTML) do this:
.TP
one line text that is the "name" of the item
.
rest of paragraph describing the item
The dot on a line by its own is optional, but makes things much more readable for you.
To do a table, start with .DS, finish with .DE, use a single line per row, and use real tab characters to separate the columns. (You might also need to use a .ta directive after the .DS to make things look right, but this is best tuned if you've got nroff or groff to hand!)