[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [groff] Bold v Italics: Dawn of Justice
From: |
John Gardner |
Subject: |
Re: [groff] Bold v Italics: Dawn of Justice |
Date: |
Fri, 16 Nov 2018 17:34:00 +1100 |
Concerning the issue of emphasising fixed-width text differently in nroff
and troff, here's a weird hack
<https://github.com/Alhadis/Mono/blob/eee9a367f9894a9a2f4f775f3f6f0eea32bef84f/ono.tmac#L34-L54>
I've used that works:
.\" Adaptive monospace fonts
> .ie t \{
> . ds ` \\f(CR
> . ds ' \\fP
> . ds C? \\f(CR
> . ds C! \\f(CR
> . ds CW \\f(CR
> . ds CI \\f(CI
> . ds CB \\f(CB
> . ie \\n(.g .ds CE \\f[CBI]
> . el .ds CE \\f(CB \}
> .el \{
> . ds ` \\(lq\\fI
> . ds ' \\fP\\(rq
> . ds C? \\fI
> . ds C! \\fB
> . ds CW \\f1
> . ds CI \\fI
> . ds CB \\fB
> . ds CE \\f(BI \}
> .\" End of font setup
For *troff*(1), the input and output, respectively:
Foo \*`fixed-width\*' Bar
Foo fixed-width Bar
The same source rendered by *nroff*(1):
Foo \*`fixed-width\*' Bar
Foo “*fixed‐width*” Bar
(I was split on whether the underline was necessary if the quotes were
added)
I used this to format things that clearly needed to be distinguished in
some way, but differently so the reader wouldn't confuse them in a terminal
as referencing an argument or option...
On Fri, 16 Nov 2018 at 16:46, Werner LEMBERG <address@hidden> wrote:
>
> Thanks, Brandon, for that list!
>
> > [how I present the difficult issue to the reader]
> > Because font styles are presentational rather than semantic,
> > conflicting traditions have arisen regarding which font styles should be
> > used to mark file or path names,
> > environment variables,
> > in-line literals,
> > and even man page cross-references.
>
> Perhaps adding a few words that the man page macros unfortunately
> don't offer support for a `literal' tag like a typewriter font (even
> if that gets eventually mapped to bold or italic), which enforces the
> man page writer to directly use either bold or italic.
>
> > Use italics
> > for file and path names,
> > for environment variables,
> > for enumeration or preprocessor constants in C,
>
> Personally, I would use bold for these three things, ...
>
>
> Werner
>
>