> Stuff like \s0 or \s12 may not be documented in the GNU troff manuals -
> i did not check - but the Nroff/Troff User's Manual by Ossanna,
> Kernighan, and Ritter, available as part of the Heirloom Documentation
> Tools, see http://heirloom.sourceforge.net/doctools.html
> does document it:
>
> "Alternatively the point size may be changed between any two
> characters by imbedding a \sN at the desired point to set the
> size to N, or a \sB1N (1<=N<=8) to increment/decrement the size
> by N; \s0 restores the previous size." (section 2.3)
>
> Oh, and by the way,
>
> \s39 appears to be equivalent to \s'36', while
> \s40 appears to be equivalent to \s'4'0 -
>
> that is, in the letter case, the character '0' appears
> in the output stream, in font size 4pt!
>
> But i'm not sure we really need to extend quirk-compatibility
> down to that level of ugliness. Looks like somebody applied the
> principle of biggest surprise when designing this.
I procrastinated this morning with a numeric subexpression filter, but
it's clear this won't end with super-pretty results. For example,
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
^ ^^^^^^^^^^^^^^^
The "I" is removed in troff -Tascii due to the subsequent \h (with -Tps,
it renders). I don't think mandoc should be going down this rabbithole:
even with a subexpression parser, which shouldn't be /too/ difficult, it
would need full \h intelligence, and thus numeric calculations, to
format this properly.
Take the pod2man preamble's "documentation" to heart:
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
Really? In production code? Thanks.
Furthermore, as you can see in the \h'-\w'I'u*3/5', the subexpression
needn't even be parenthesised.
I think the least complicated measure is to teach mandoc to have numeric
subexpressions, i.e., only for \s, \h, \v, and \w. The more pod2man we
can handle, the better.
Or better yet, maybe somebody wants to tackle a pod2mdoc? :-)
Kristaps