]>
git.cameronkatri.com Git - mandoc.git/blob - man_term.c
1 /* $Id: man_term.c,v 1.150 2014/08/10 23:54:41 schwarze Exp $ */
3 * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
4 * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #include <sys/types.h>
29 #include "mandoc_aux.h"
35 #define MAXMARGINS 64 /* maximum number of indented scopes */
39 #define MANT_LITERAL (1 << 0)
40 size_t lmargin
[MAXMARGINS
]; /* margins (incl. visible page) */
41 int lmargincur
; /* index of current margin */
42 int lmarginsz
; /* actual number of nested margins */
43 size_t offset
; /* default offset to visible page */
44 int pardist
; /* vert. space before par., unit: [v] */
47 #define DECL_ARGS struct termp *p, \
49 const struct man_node *n, \
50 const struct man_meta *meta
53 int (*pre
)(DECL_ARGS
);
54 void (*post
)(DECL_ARGS
);
56 #define MAN_NOTEXT (1 << 0) /* Never has text children. */
59 static int a2width(const struct termp
*, const char *);
60 static size_t a2height(const struct termp
*, const char *);
62 static void print_man_nodelist(DECL_ARGS
);
63 static void print_man_node(DECL_ARGS
);
64 static void print_man_head(struct termp
*, const void *);
65 static void print_man_foot(struct termp
*, const void *);
66 static void print_bvspace(struct termp
*,
67 const struct man_node
*, int);
69 static int pre_B(DECL_ARGS
);
70 static int pre_HP(DECL_ARGS
);
71 static int pre_I(DECL_ARGS
);
72 static int pre_IP(DECL_ARGS
);
73 static int pre_OP(DECL_ARGS
);
74 static int pre_PD(DECL_ARGS
);
75 static int pre_PP(DECL_ARGS
);
76 static int pre_RS(DECL_ARGS
);
77 static int pre_SH(DECL_ARGS
);
78 static int pre_SS(DECL_ARGS
);
79 static int pre_TP(DECL_ARGS
);
80 static int pre_UR(DECL_ARGS
);
81 static int pre_alternate(DECL_ARGS
);
82 static int pre_ft(DECL_ARGS
);
83 static int pre_ign(DECL_ARGS
);
84 static int pre_in(DECL_ARGS
);
85 static int pre_literal(DECL_ARGS
);
86 static int pre_ll(DECL_ARGS
);
87 static int pre_sp(DECL_ARGS
);
89 static void post_IP(DECL_ARGS
);
90 static void post_HP(DECL_ARGS
);
91 static void post_RS(DECL_ARGS
);
92 static void post_SH(DECL_ARGS
);
93 static void post_SS(DECL_ARGS
);
94 static void post_TP(DECL_ARGS
);
95 static void post_UR(DECL_ARGS
);
97 static const struct termact termacts
[MAN_MAX
] = {
98 { pre_sp
, NULL
, MAN_NOTEXT
}, /* br */
99 { NULL
, NULL
, 0 }, /* TH */
100 { pre_SH
, post_SH
, 0 }, /* SH */
101 { pre_SS
, post_SS
, 0 }, /* SS */
102 { pre_TP
, post_TP
, 0 }, /* TP */
103 { pre_PP
, NULL
, 0 }, /* LP */
104 { pre_PP
, NULL
, 0 }, /* PP */
105 { pre_PP
, NULL
, 0 }, /* P */
106 { pre_IP
, post_IP
, 0 }, /* IP */
107 { pre_HP
, post_HP
, 0 }, /* HP */
108 { NULL
, NULL
, 0 }, /* SM */
109 { pre_B
, NULL
, 0 }, /* SB */
110 { pre_alternate
, NULL
, 0 }, /* BI */
111 { pre_alternate
, NULL
, 0 }, /* IB */
112 { pre_alternate
, NULL
, 0 }, /* BR */
113 { pre_alternate
, NULL
, 0 }, /* RB */
114 { NULL
, NULL
, 0 }, /* R */
115 { pre_B
, NULL
, 0 }, /* B */
116 { pre_I
, NULL
, 0 }, /* I */
117 { pre_alternate
, NULL
, 0 }, /* IR */
118 { pre_alternate
, NULL
, 0 }, /* RI */
119 { pre_ign
, NULL
, MAN_NOTEXT
}, /* na */
120 { pre_sp
, NULL
, MAN_NOTEXT
}, /* sp */
121 { pre_literal
, NULL
, 0 }, /* nf */
122 { pre_literal
, NULL
, 0 }, /* fi */
123 { NULL
, NULL
, 0 }, /* RE */
124 { pre_RS
, post_RS
, 0 }, /* RS */
125 { pre_ign
, NULL
, 0 }, /* DT */
126 { pre_ign
, NULL
, 0 }, /* UC */
127 { pre_PD
, NULL
, MAN_NOTEXT
}, /* PD */
128 { pre_ign
, NULL
, 0 }, /* AT */
129 { pre_in
, NULL
, MAN_NOTEXT
}, /* in */
130 { pre_ft
, NULL
, MAN_NOTEXT
}, /* ft */
131 { pre_OP
, NULL
, 0 }, /* OP */
132 { pre_literal
, NULL
, 0 }, /* EX */
133 { pre_literal
, NULL
, 0 }, /* EE */
134 { pre_UR
, post_UR
, 0 }, /* UR */
135 { NULL
, NULL
, 0 }, /* UE */
136 { pre_ll
, NULL
, MAN_NOTEXT
}, /* ll */
141 terminal_man(void *arg
, const struct man
*man
)
144 const struct man_node
*n
;
145 const struct man_meta
*meta
;
148 p
= (struct termp
*)arg
;
150 if (0 == p
->defindent
)
154 p
->maxrmargin
= p
->defrmargin
;
155 p
->tabwidth
= term_len(p
, 5);
157 if (NULL
== p
->symtab
)
158 p
->symtab
= mchars_alloc();
161 meta
= man_meta(man
);
163 term_begin(p
, print_man_head
, print_man_foot
, meta
);
164 p
->flags
|= TERMP_NOSPACE
;
166 memset(&mt
, 0, sizeof(struct mtermp
));
168 mt
.lmargin
[mt
.lmargincur
] = term_len(p
, p
->defindent
);
169 mt
.offset
= term_len(p
, p
->defindent
);
173 print_man_nodelist(p
, &mt
, n
->child
, meta
);
180 a2height(const struct termp
*p
, const char *cp
)
184 if ( ! a2roffsu(cp
, &su
, SCALE_VS
))
185 SCALE_VS_INIT(&su
, atoi(cp
));
187 return(term_vspan(p
, &su
));
191 a2width(const struct termp
*p
, const char *cp
)
195 if ( ! a2roffsu(cp
, &su
, SCALE_BU
))
198 return((int)term_hspan(p
, &su
));
202 * Printing leading vertical space before a block.
203 * This is used for the paragraph macros.
204 * The rules are pretty simple, since there's very little nesting going
205 * on here. Basically, if we're the first within another block (SS/SH),
206 * then don't emit vertical space. If we are (RS), then do. If not the
210 print_bvspace(struct termp
*p
, const struct man_node
*n
, int pardist
)
216 if (n
->body
&& n
->body
->child
)
217 if (MAN_TBL
== n
->body
->child
->type
)
220 if (MAN_ROOT
== n
->parent
->type
|| MAN_RS
!= n
->parent
->tok
)
224 for (i
= 0; i
< pardist
; i
++)
240 term_setwidth(p
, n
->nchild
? n
->child
->string
: NULL
);
248 term_fontrepl(p
, TERMFONT_UNDER
);
253 pre_literal(DECL_ARGS
)
258 if (MAN_nf
== n
->tok
|| MAN_EX
== n
->tok
)
259 mt
->fl
|= MANT_LITERAL
;
261 mt
->fl
&= ~MANT_LITERAL
;
264 * Unlike .IP and .TP, .HP does not have a HEAD.
265 * So in case a second call to term_flushln() is needed,
266 * indentation has to be set up explicitly.
268 if (MAN_HP
== n
->parent
->tok
&& p
->rmargin
< p
->maxrmargin
) {
269 p
->offset
= p
->rmargin
;
270 p
->rmargin
= p
->maxrmargin
;
272 p
->flags
&= ~(TERMP_NOBREAK
| TERMP_BRIND
);
273 p
->flags
|= TERMP_NOSPACE
;
288 assert(MAN_TEXT
== n
->type
);
289 mt
->pardist
= atoi(n
->string
);
294 pre_alternate(DECL_ARGS
)
296 enum termfont font
[2];
297 const struct man_node
*nn
;
302 font
[0] = TERMFONT_NONE
;
303 font
[1] = TERMFONT_BOLD
;
306 font
[0] = TERMFONT_NONE
;
307 font
[1] = TERMFONT_UNDER
;
310 font
[0] = TERMFONT_BOLD
;
311 font
[1] = TERMFONT_NONE
;
314 font
[0] = TERMFONT_BOLD
;
315 font
[1] = TERMFONT_UNDER
;
318 font
[0] = TERMFONT_UNDER
;
319 font
[1] = TERMFONT_NONE
;
322 font
[0] = TERMFONT_UNDER
;
323 font
[1] = TERMFONT_BOLD
;
329 savelit
= MANT_LITERAL
& mt
->fl
;
330 mt
->fl
&= ~MANT_LITERAL
;
332 for (i
= 0, nn
= n
->child
; nn
; nn
= nn
->next
, i
= 1 - i
) {
333 term_fontrepl(p
, font
[i
]);
334 if (savelit
&& NULL
== nn
->next
)
335 mt
->fl
|= MANT_LITERAL
;
336 print_man_node(p
, mt
, nn
, meta
);
338 p
->flags
|= TERMP_NOSPACE
;
348 term_fontrepl(p
, TERMFONT_BOLD
);
357 p
->flags
|= TERMP_NOSPACE
;
359 if (NULL
!= (n
= n
->child
)) {
360 term_fontrepl(p
, TERMFONT_BOLD
);
361 term_word(p
, n
->string
);
363 if (NULL
!= n
&& NULL
!= n
->next
) {
364 term_fontrepl(p
, TERMFONT_UNDER
);
365 term_word(p
, n
->next
->string
);
368 term_fontrepl(p
, TERMFONT_NONE
);
369 p
->flags
|= TERMP_NOSPACE
;
379 if (NULL
== n
->child
) {
384 cp
= n
->child
->string
;
391 term_fontrepl(p
, TERMFONT_BOLD
);
396 term_fontrepl(p
, TERMFONT_UNDER
);
406 term_fontrepl(p
, TERMFONT_NONE
);
423 if (NULL
== n
->child
) {
424 p
->offset
= mt
->offset
;
428 cp
= n
->child
->string
;
438 if ((len
= a2width(p
, ++cp
)) < 0)
444 p
->offset
-= p
->offset
> v
? v
: p
->offset
;
450 /* Don't let this creep beyond the right margin. */
452 if (p
->offset
> p
->rmargin
)
453 p
->offset
= p
->rmargin
;
465 if ((NULL
== n
->prev
&& n
->parent
)) {
466 switch (n
->parent
->tok
) {
489 if (NULL
== n
->child
) {
493 s
= n
->child
->string
;
498 len
= a2height(p
, s
);
507 for (i
= 0; i
< len
; i
++)
518 const struct man_node
*nn
;
522 print_bvspace(p
, n
, mt
->pardist
);
530 if ( ! (MANT_LITERAL
& mt
->fl
)) {
531 p
->flags
|= TERMP_NOBREAK
| TERMP_BRIND
;
535 len
= mt
->lmargin
[mt
->lmargincur
];
538 /* Calculate offset. */
540 if (NULL
!= (nn
= n
->parent
->head
->child
))
541 if ((ival
= a2width(p
, nn
->string
)) >= 0)
544 one
= term_len(p
, 1);
548 p
->offset
= mt
->offset
;
549 p
->rmargin
= mt
->offset
+ len
;
552 mt
->lmargin
[mt
->lmargincur
] = (size_t)ival
;
564 p
->flags
&= ~(TERMP_NOBREAK
| TERMP_BRIND
);
566 p
->offset
= mt
->offset
;
567 p
->rmargin
= p
->maxrmargin
;
580 mt
->lmargin
[mt
->lmargincur
] = term_len(p
, p
->defindent
);
581 print_bvspace(p
, n
, mt
->pardist
);
584 p
->offset
= mt
->offset
;
588 return(MAN_HEAD
!= n
->type
);
594 const struct man_node
*nn
;
600 p
->flags
|= TERMP_NOSPACE
;
603 p
->flags
|= TERMP_NOBREAK
;
607 print_bvspace(p
, n
, mt
->pardist
);
613 len
= mt
->lmargin
[mt
->lmargincur
];
616 /* Calculate the offset from the optional second argument. */
617 if (NULL
!= (nn
= n
->parent
->head
->child
))
618 if (NULL
!= (nn
= nn
->next
))
619 if ((ival
= a2width(p
, nn
->string
)) >= 0)
624 /* Handle zero-width lengths. */
626 len
= term_len(p
, 1);
628 p
->offset
= mt
->offset
;
629 p
->rmargin
= mt
->offset
+ len
;
633 /* Set the saved left-margin. */
634 mt
->lmargin
[mt
->lmargincur
] = (size_t)ival
;
636 savelit
= MANT_LITERAL
& mt
->fl
;
637 mt
->fl
&= ~MANT_LITERAL
;
640 print_man_node(p
, mt
, n
->child
, meta
);
643 mt
->fl
|= MANT_LITERAL
;
647 p
->offset
= mt
->offset
+ len
;
648 p
->rmargin
= p
->maxrmargin
> p
->offset
?
649 p
->maxrmargin
: p
->offset
;
665 p
->flags
&= ~TERMP_NOBREAK
;
667 p
->rmargin
= p
->maxrmargin
;
671 p
->offset
= mt
->offset
;
681 const struct man_node
*nn
;
687 p
->flags
|= TERMP_NOBREAK
;
691 p
->flags
|= TERMP_NOSPACE
;
694 print_bvspace(p
, n
, mt
->pardist
);
700 len
= (size_t)mt
->lmargin
[mt
->lmargincur
];
703 /* Calculate offset. */
705 if (NULL
!= (nn
= n
->parent
->head
->child
))
706 if (nn
->string
&& 0 == (MAN_LINE
& nn
->flags
))
707 if ((ival
= a2width(p
, nn
->string
)) >= 0)
712 /* Handle zero-length properly. */
714 len
= term_len(p
, 1);
716 p
->offset
= mt
->offset
;
717 p
->rmargin
= mt
->offset
+ len
;
719 savelit
= MANT_LITERAL
& mt
->fl
;
720 mt
->fl
&= ~MANT_LITERAL
;
722 /* Don't print same-line elements. */
724 while (NULL
!= nn
&& 0 == (MAN_LINE
& nn
->flags
))
728 print_man_node(p
, mt
, nn
, meta
);
733 mt
->fl
|= MANT_LITERAL
;
735 mt
->lmargin
[mt
->lmargincur
] = (size_t)ival
;
739 p
->offset
= mt
->offset
+ len
;
740 p
->rmargin
= p
->maxrmargin
> p
->offset
?
741 p
->maxrmargin
: p
->offset
;
743 p
->flags
&= ~TERMP_NOBREAK
;
762 p
->offset
= mt
->offset
;
776 mt
->fl
&= ~MANT_LITERAL
;
777 mt
->lmargin
[mt
->lmargincur
] = term_len(p
, p
->defindent
);
778 mt
->offset
= term_len(p
, p
->defindent
);
779 /* If following a prior empty `SS', no vspace. */
780 if (n
->prev
&& MAN_SS
== n
->prev
->tok
)
781 if (NULL
== n
->prev
->body
->child
)
785 for (i
= 0; i
< mt
->pardist
; i
++)
789 term_fontrepl(p
, TERMFONT_BOLD
);
790 p
->offset
= term_len(p
, 3);
793 p
->offset
= mt
->offset
;
825 mt
->fl
&= ~MANT_LITERAL
;
826 mt
->lmargin
[mt
->lmargincur
] = term_len(p
, p
->defindent
);
827 mt
->offset
= term_len(p
, p
->defindent
);
828 /* If following a prior empty `SH', no vspace. */
829 if (n
->prev
&& MAN_SH
== n
->prev
->tok
)
830 if (NULL
== n
->prev
->body
->child
)
832 /* If the first macro, no vspae. */
835 for (i
= 0; i
< mt
->pardist
; i
++)
839 term_fontrepl(p
, TERMFONT_BOLD
);
843 p
->offset
= mt
->offset
;
884 sz
= term_len(p
, p
->defindent
);
886 if (NULL
!= (n
= n
->parent
->head
->child
))
887 if ((ival
= a2width(p
, n
->string
)) >= 0)
891 p
->offset
= mt
->offset
;
892 p
->rmargin
= p
->maxrmargin
> p
->offset
?
893 p
->maxrmargin
: p
->offset
;
895 if (++mt
->lmarginsz
< MAXMARGINS
)
896 mt
->lmargincur
= mt
->lmarginsz
;
898 mt
->lmargin
[mt
->lmargincur
] = mt
->lmargin
[mt
->lmargincur
- 1];
918 sz
= term_len(p
, p
->defindent
);
920 if (NULL
!= (n
= n
->parent
->head
->child
))
921 if ((ival
= a2width(p
, n
->string
)) >= 0)
924 mt
->offset
= mt
->offset
< sz
? 0 : mt
->offset
- sz
;
925 p
->offset
= mt
->offset
;
927 if (--mt
->lmarginsz
< MAXMARGINS
)
928 mt
->lmargincur
= mt
->lmarginsz
;
935 return (MAN_HEAD
!= n
->type
);
942 if (MAN_BLOCK
!= n
->type
)
946 p
->flags
|= TERMP_NOSPACE
;
948 if (NULL
!= n
->child
->child
)
949 print_man_node(p
, mt
, n
->child
->child
, meta
);
951 p
->flags
|= TERMP_NOSPACE
;
956 print_man_node(DECL_ARGS
)
964 * If we have a blank line, output a vertical space.
965 * If we have a space as the first character, break
966 * before printing the line's data.
968 if ('\0' == *n
->string
) {
971 } else if (' ' == *n
->string
&& MAN_LINE
& n
->flags
)
974 term_word(p
, n
->string
);
982 * Tables are preceded by a newline. Then process a
983 * table line, which will cause line termination,
985 if (TBL_SPAN_FIRST
& n
->span
->flags
)
987 term_tbl(p
, n
->span
);
993 if ( ! (MAN_NOTEXT
& termacts
[n
->tok
].flags
))
994 term_fontrepl(p
, TERMFONT_NONE
);
997 if (termacts
[n
->tok
].pre
)
998 c
= (*termacts
[n
->tok
].pre
)(p
, mt
, n
, meta
);
1001 print_man_nodelist(p
, mt
, n
->child
, meta
);
1003 if (termacts
[n
->tok
].post
)
1004 (*termacts
[n
->tok
].post
)(p
, mt
, n
, meta
);
1005 if ( ! (MAN_NOTEXT
& termacts
[n
->tok
].flags
))
1006 term_fontrepl(p
, TERMFONT_NONE
);
1010 * If we're in a literal context, make sure that words
1011 * together on the same line stay together. This is a
1012 * POST-printing call, so we check the NEXT word. Since
1013 * -man doesn't have nested macros, we don't need to be
1014 * more specific than this.
1016 if (MANT_LITERAL
& mt
->fl
&& ! (TERMP_NOBREAK
& p
->flags
) &&
1017 (NULL
== n
->next
|| MAN_LINE
& n
->next
->flags
)) {
1019 rmax
= p
->maxrmargin
;
1020 p
->rmargin
= p
->maxrmargin
= TERM_MAXMARGIN
;
1021 p
->flags
|= TERMP_NOSPACE
;
1022 if (NULL
!= n
->string
&& '\0' != *n
->string
)
1026 if (rm
< rmax
&& n
->parent
->tok
== MAN_HP
) {
1031 p
->maxrmargin
= rmax
;
1033 if (MAN_EOS
& n
->flags
)
1034 p
->flags
|= TERMP_SENTENCE
;
1039 print_man_nodelist(DECL_ARGS
)
1042 print_man_node(p
, mt
, n
, meta
);
1045 print_man_nodelist(p
, mt
, n
->next
, meta
);
1049 print_man_foot(struct termp
*p
, const void *arg
)
1051 const struct man_meta
*meta
;
1055 meta
= (const struct man_meta
*)arg
;
1056 assert(meta
->title
);
1060 term_fontrepl(p
, TERMFONT_NONE
);
1066 * Temporary, undocumented option to imitate mdoc(7) output.
1067 * In the bottom right corner, use the source instead of
1071 if ( ! p
->mdocstyle
) {
1072 if (meta
->hasbody
) {
1076 mandoc_asprintf(&title
, "%s(%s)",
1077 meta
->title
, meta
->msec
);
1078 } else if (meta
->source
) {
1079 title
= mandoc_strdup(meta
->source
);
1081 title
= mandoc_strdup("");
1083 datelen
= term_strlen(p
, meta
->date
);
1085 /* Bottom left corner: manual source. */
1087 p
->flags
|= TERMP_NOSPACE
| TERMP_NOBREAK
;
1090 p
->rmargin
= (p
->maxrmargin
- datelen
+ term_len(p
, 1)) / 2;
1093 term_word(p
, meta
->source
);
1096 /* At the bottom in the middle: manual date. */
1098 p
->flags
|= TERMP_NOSPACE
;
1099 p
->offset
= p
->rmargin
;
1100 p
->rmargin
= p
->maxrmargin
- term_strlen(p
, title
);
1101 if (p
->offset
+ datelen
>= p
->rmargin
)
1102 p
->rmargin
= p
->offset
+ datelen
;
1104 term_word(p
, meta
->date
);
1107 /* Bottom right corner: manual title and section. */
1109 p
->flags
&= ~TERMP_NOBREAK
;
1110 p
->flags
|= TERMP_NOSPACE
;
1112 p
->offset
= p
->rmargin
;
1113 p
->rmargin
= p
->maxrmargin
;
1115 term_word(p
, title
);
1121 print_man_head(struct termp
*p
, const void *arg
)
1123 const struct man_meta
*meta
;
1126 size_t vollen
, titlen
;
1128 meta
= (const struct man_meta
*)arg
;
1129 assert(meta
->title
);
1132 volume
= NULL
== meta
->vol
? "" : meta
->vol
;
1133 vollen
= term_strlen(p
, volume
);
1135 /* Top left corner: manual title and section. */
1137 mandoc_asprintf(&title
, "%s(%s)", meta
->title
, meta
->msec
);
1138 titlen
= term_strlen(p
, title
);
1140 p
->flags
|= TERMP_NOBREAK
| TERMP_NOSPACE
;
1143 p
->rmargin
= 2 * (titlen
+1) + vollen
< p
->maxrmargin
?
1144 (p
->maxrmargin
- vollen
+ term_len(p
, 1)) / 2 :
1145 p
->maxrmargin
- vollen
;
1147 term_word(p
, title
);
1150 /* At the top in the middle: manual volume. */
1152 p
->flags
|= TERMP_NOSPACE
;
1153 p
->offset
= p
->rmargin
;
1154 p
->rmargin
= p
->offset
+ vollen
+ titlen
< p
->maxrmargin
?
1155 p
->maxrmargin
- titlen
: p
->maxrmargin
;
1157 term_word(p
, volume
);
1160 /* Top right corner: title and section, again. */
1162 p
->flags
&= ~TERMP_NOBREAK
;
1164 if (p
->rmargin
+ titlen
<= p
->maxrmargin
) {
1165 p
->flags
|= TERMP_NOSPACE
;
1166 p
->offset
= p
->rmargin
;
1167 p
->rmargin
= p
->maxrmargin
;
1168 term_word(p
, title
);
1172 p
->flags
&= ~TERMP_NOSPACE
;
1174 p
->rmargin
= p
->maxrmargin
;
1177 * Groff prints three blank lines before the content.
1178 * Do the same, except in the temporary, undocumented
1179 * mode imitating mdoc(7) output.
1183 if ( ! p
->mdocstyle
) {