While I was writing a man page, an issue arising, the code is like:
Something is .B bold .
.B is a font setting macro of groff_man(7). The period won’t be in final output because it’s ignored according to groff(7):
. Empty line, ignored. Useful for structuring documents.
And \. doesn’t work either, it’s not the escape I’d hope is:
\. The same as a dot (.). Necessary in nested macro definitions so that \\.. expands to ...
A quick search returned an answer of how to escape period, which is at the beginning of a line:
Something is .B bold \[char46]
It works, but later I found another way to achieve something even better with escape sequence:
Something is \fBbold\fP.
It’s better because, in my case, the “bold” can get broken into two lines with a hyphen, and spacing between words looks nicer.
I am no expert of writing man pages, the pages I have written could be counted with just my ten fingers, there probably is a better way than these two above. For now, I will settle down with them.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.