Home – Frequently asked questions

Frequently asked questions

The comp.text Usenet newsgroup FAQ by Chris Lewis contains a section on troff. Suggestions welcome for a troff-specific FAQ.

How to generate reversed output for a film-setter

The easiest way is to modify the PostScript output to flip the page over along its left-hand edge, and then slide it to the right so it occupies the original space. The width of the page in 72ths of an inch is required to slide it the correct amount. An A4 page is 210mm wide which is 595 72ths of an inch. It's easy to use awk as a filter to insert the required line at all the relevant points.

    awk '/^%%EndPageSetup/ {print "-1 1 scale -595 0 translate"} 1'

Why won't tbl wrap text instead of making the column very wide?

Place the cell's text in a text block using T{ and T}.

.TS
tab(:);
c c c
l l l.
Person:Work:Quote
_
Sherlock Holmes:The Norwood Builder:T{
You mentioned your name as if I should recognize it, but beyond the
obvious facts that you are a bachelor, a solicitor, a freemason, and
an asthmatic, I know nothing whatever about you.
T}
.TE

Example table showing text wrapped
within a column

Can tbl align numbers that use a comma for the decimal point?

GNU tbl has the decimalpoint option, similar to the standard tab option, that allows a single character to be specified as the decimal point for numeric column formats, e.g. ‘decimalpoint(,)’.

How can I generate rotated text?

There's no way to specify rotated text in pure troff. However, if the output is PostScript then groff's pic can be used to align text with an invisible line. The table is not required, it's just part of the example.

.TS
tab(:) allbox;
cw(1i) cw(1i) cw(1i).
A quick:T{
.PS
line invis up "and" aligned
move right
line invis down then right "dirty" aligned
.PE
T}:hack
.TE

Example of rotated text using pic

My old pic drawings appear fainter with GNU groff

Traditional pic draws dotted lines using full stops. GNU groff's pic draws each dot of the line using a zero-length line. These are a lot smaller in diameter than a full stop resulting in a overall fainter appearance. GNU groff's pic's -n option has the side-effect of reverting to using full stops.


To Do

Add ‘How do I write a man page?’ The Linux Man Page HOWTO by Jens Schweikhardt, should be helpful.

Add the backlog of tips from the groff list in the form of a FAQ, e.g. how to produce a drop-capital.

-mtrace.


Copyright Ralph Corderoy, 2001, 2002, 2003.