I'm trying to write a manpage by using the man
macro package of Groff. Specifically, I would like to write some text like the following:
The daemon can be configured by means of a configuration file. The default location of such file is /etc/trolls.conf, and this is quite nice.
Desired text proprieties:
/etc/trolls.conf
is rendered in Italic/etc/trols.conf
and the comma.It is incredibly hard to get a text which satisfies such proprieties! For example, the following will result in an Italic comma:
.SH DESCRIPTION The daemon can be configured by means of a configuration file. The default location of such file is .I /etc/trolls.conf, and this is quite nice.
On the other hand, this second attempt will put a space between /etc/trolls.conf
and the roman comma:
.SH DESCRIPTION The daemon can be configured by means of a configuration file. The default location of such file is .I /etc/trolls.conf , and this is quite nice.
Is there some way to get this to work?
This typesetting language is incredibly hard (well, it's also incredibly old), and eventually I solved this by looking at existing manpages!
The solution follows:
.SH DESCRIPTION The daemon can be configured by means of a configuration file. The default location of such file is .IR /etc/trolls.conf , and this is quite nice.
The .IR
macro will in fact alternate between Italic (I
) and Roman (R
), resulting in the correct rendering effect: