I'm trying to write a man page for a software, and would like to include some code snippets. I'm currently using the .RS and .RE macros as part of a custom-made .SAMPLE macro, but for some reason that doesn't work. Here is the man page:
.TH MYMANPAGE 1
.de SAMPLE
.br
.RS
.nf
.nh
..
.de ESAMPLE
.hy
.fi
.RE
..
.SH TEST SECTION HEADING
This is a test section heading.
.TP
.B Test Paragraph Label
This is some test paragraph text. This is some test paragraph text. This
is some test paragraph text. This is some indented test code:
.SAMPLE
int main(void) {
return 42;
}
.ESAMPLE
This is more text after the test code. This is more text after the test
code.
What ends up happening is that the text after .ESAMPLE is not indented as much as the paragraph text. Instead, it's lined up with the paragraph label. What would be the proper .[E]SAMPLE macro definitions to get them to play nice with .TP?