summaryrefslogtreecommitdiff
path: root/contrib/hdtbl
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2020-11-04 21:41:11 +1100
committerG. Branden Robinson <g.branden.robinson@gmail.com>2020-11-04 22:24:25 +1100
commitdfa7b3108f24c30a1fe7b723d2c7fee7ebbd9671 (patch)
treeb1f1b1d1be95577b88dece48576fdc8d4747ca5c /contrib/hdtbl
parent4296d411bddc57f4917bfb070285f109f417c542 (diff)
downloadgroff-git-dfa7b3108f24c30a1fe7b723d2c7fee7ebbd9671.tar.gz
man pages: Convert .nf/fi/nh/hy nonense to .EX/EE.
Prompted by John Gardner on the groff mailing list. I hadn't realized how close we were to killing the last of these off. Several examples render in roman (Courier roman on typesetters) now instead of bold, or in bold only for portions of mixed I/O that are user input, just as groff_man_style(7) recommends. No textual changes (well, not to _words_) despite severe temptation. * contrib/chem/chem.1.man: * contrib/hdtbl/groff_hdtbl.7.man: * contrib/mm/groff_mm.7.man: * man/groff_out.5.man: * src/devices/grops/grops.1.man: * src/preproc/pic/pic.1.man: * tmac/groff_ms.7.man: * tmac/groff_www.7.man: Replace nf/(nh)/(ft)/.../(ft)/(hy)/fi sequences with .EX/EE. That is what the macros are there for: to turn off filling and hyphenation, and select a font family that will stand out (Courier) so that all three styles are available, and unlike bold, allows character-cell alignment since it is monospaced. As part of groff's unwritten man page style guide, examples are always indented as well, which mitigates the absense of a font family change. * contrib/hdtbl/groff_hdtbl.7.man: Also use .ne requests in troff mode consistently for table examples (two examples already did). I'm conflicted about this; it's against our current portability advice but keeps are a pretty basic typographical thing to want/have. Maybe we should bring ms(7)'s .KS/.KE into man(7)--muahahahahaha. (Less radically, we could make .EX and .EE use diversions.) * src/preproc/pic/pic.1.man: Also fix bizarre use of matched, directional, single-quote special character escapes in a code example. Use the _correct_ special character escape, \[aq], instead. e375837773f99ea0de14ebebe5fb69e22b39fb28 (18 September 2014) is a perversely fascinating commit, not least for its misleading summary.
Diffstat (limited to 'contrib/hdtbl')
-rw-r--r--contrib/hdtbl/groff_hdtbl.7.man297
1 files changed, 139 insertions, 158 deletions
diff --git a/contrib/hdtbl/groff_hdtbl.7.man b/contrib/hdtbl/groff_hdtbl.7.man
index 729ea34f3..e88416e41 100644
--- a/contrib/hdtbl/groff_hdtbl.7.man
+++ b/contrib/hdtbl/groff_hdtbl.7.man
@@ -216,15 +216,15 @@ there are two possibilities to do so:
.
Either add the line
.
+.
.PP
-.nf
-.nh
.RS
-.CR .mso hdtbl.tmac
-.fi
-.hy
+.EX
+\&.mso hdtbl.tmac
+.EE
.RE
.
+.
.PP
to your
.I roff
@@ -233,14 +233,13 @@ file before using any macros of the
package, or add the option
.
.PP
-.nf
-.nh
.RS
-.CR \-m hdtbl
-.fi
-.hy
+.EX
+\-m hdtbl
+.EE
.RE
.
+.
.PP
to the command line of groff (before the document file which contains
.B hdtbl
@@ -268,17 +267,16 @@ four base table macros in the right order.
.
Here we construct a table with only one cell.
.
+.
.PP
.RS
-.nf
-.nh
-.CR .TBL
-.CR .TR
-.CR .TD
-.CI contents of the table cell
-.CR .ETB
-.fi
-.hy
+.EX
+\&.TBL
+\&.TR
+\&.TD
+.I contents of the table cell
+\&.ETB
+.EE
.RE
.
.
@@ -287,30 +285,28 @@ A
.I tty
representation is
.
+.
.PP
-.nf
-.nh
-.ft CR
+.if t .ne 3v
.RS
+.EX
+------------------------------------------------------+
-| contents-of-the-table-cell |
+.\" That's 27 spaces below.
+.RI "| " contents-of-the-table-cell " |"
+------------------------------------------------------+
+.EE
.RE
-.ft
-.hy
-.fi
.
.
.PP
Equivalent to the above is the following notation.
.
+.
.PP
.RS
-.nh
-.nf
-.CRI ".TBL .TR .TD \[dq]" "contents of the table cell" "\[dq] .ETB"
-.fi
-.hy
+.EX
+.RI ".TBL .TR .TD \[dq]" "contents of the table cell" "\[dq] .ETB"
+.EE
.RE
.
.
@@ -333,14 +329,12 @@ can be written as
.
.PP
.RS
-.nf
-.nh
-.CR ".TBL cols=2"
-.CR ". TR .TD 1*1 .TD 1*2"
-.CR ". TR .TD 2*1 .TD 2*2"
-.CR ".ETB"
-.fi
-.hy
+.EX
+\&.TBL cols=2
+\&. TR .TD 1*1 .TD 1*2
+\&. TR .TD 2*1 .TD 2*2
+\&.ETB
+.EE
.RE
.
.
@@ -351,19 +345,16 @@ representation is
.
.
.PP
-.nf
-.nh
-.ft CR
+.if t .ne 5v
.RS
+.EX
+--------------------------+---------------------------+
| 1*1 | 1*2 |
+--------------------------+---------------------------+
| 2*1 | 2*2 |
+--------------------------+---------------------------+
+.EE
.RE
-.ft
-.hy
-.fi
.
.
.PP
@@ -390,49 +381,49 @@ and
.
Note, however, that this table
.
+.
.PP
.RS
-.nf
-.nh
-.CR ".TBL"
-.CR ". TR"
-.CR ". TD"
-.CR ". nop 1*1 1*2"
-.CR ". TR"
-.CR ". TD"
-.CR ". TBL cols=2 border="
-.CR ". TR"
-.CR ". TD"
-.CR ". nop 2*1"
-.CR ". TD"
-.CR ". nop 2*2"
-.CR ". ETB"
-.CR ".ETB"
-.fi
-.hy
+.EX
+\&.TBL
+\&. TR
+\&. TD
+\&. nop 1*1 1*2
+\&. TR
+\&. TD
+\&. TBL cols=2 border=
+\&. TR
+\&. TD
+\&. nop 2*1
+\&. TD
+\&. nop 2*2
+\&. ETB
+\&.ETB
+.EE
.RE
.
+.
.PP
and this table
.
+.
.PP
.RS
-.nf
-.nh
-.CR ".TBL cols=2"
-.CR ". TR"
-.CR ". TD colspan=2"
-.CR ". nop 1*1 1*2"
-.CR ". TR"
-.CR ". TD"
-.CR ". nop 2*1"
-.CR ". TD"
-.CR ". nop 2*2"
-.CR ".ETB"
-.fi
-.hy
+.EX
+\&.TBL cols=2
+\&. TR
+\&. TD colspan=2
+\&. nop 1*1 1*2
+\&. TR
+\&. TD
+\&. nop 2*1
+\&. TD
+\&. nop 2*2
+\&.ETB
+.EE
.RE
.
+.
.PP
are similar but not identical (the use of
.CR .nop
@@ -443,10 +434,9 @@ is purely cosmetic to get proper indentation).
The first table looks like
.
.PP
-.nf
-.nh
-.ft CR
+.if t .ne 7v
.RS
+.EX
+------------------------------------------------------+
| 1*1 1*2 |
+------------------------------------------------------+
@@ -454,40 +444,36 @@ The first table looks like
| 2*1 2*2 |
| |
+------------------------------------------------------+
+.EE
.RE
-.ft
-.hy
-.fi
+.
.
.PP
and the second one like
.
+.
.PP
-.nf
-.nh
-.ft CR
+.if t .ne 5v
.RS
+.EX
+------------------------------------------------------+
| 1*1 1*2 |
+---------------------------+--------------------------+
| 2*1 | 2*2 |
+---------------------------+--------------------------+
+.EE
.RE
-.ft
-.hy
-.fi
+.
.
.PP
Here the latter table in a more compact form.
.
.PP
.RS
-.nf
-.nh
-.CR ".TBL cols=2 .TR \[dq].TD colspan=2\[dq] 1*1 1*2"
-.CR ". TR .TD 2*1 .TD 2*2 .ETB"
-.fi
-.hy
+.EX
+\&.TBL cols=2 .TR \[dq].TD colspan=2\[dq] 1*1 1*2
+\&. TR .TD 2*1 .TD 2*2 .ETB
+.EE
.RE
.
.
@@ -805,45 +791,42 @@ as in the following table fragment
(the overlapping happens in the second cell in the second row),
is invalid and causes incorrect results.
.
+.
.RS
.IP
-.nh
-.nf
-.CR ".TR .TD 1*1 \[dq].TD 1*2 rowspan=2\[dq] .TD 1*3"
-.CR ".TR \[dq].TD 2*1 colspan=2\[dq] .TD 2*3"
-.fi
-.hy
+.EX
+\&.TR .TD 1*1 \[dq].TD 1*2 rowspan=2\[dq] .TD 1*3
+\&.TR \[dq].TD 2*1 colspan=2\[dq] .TD 2*3
+.EE
.RE
.
+.
.PP
A working example for headers and cells with
.B colspan
is
.
+.
.PP
.RS
-.nf
-.nh
-.CR .TBL cols=3
-.CR ". TR" \[dq].TH colspan=2\[dq] header1+2 .TH header3
-.CR ". TR" .TD 1*1 .TD 1*2 .TD 1*3
-.CR ". TR" .TD 2*1 \[dq].TD colspan=2\[dq] 2*2+3
-.CR .ETB
-.fi
-.hy
+.EX
+\&.TBL cols=3
+\&. TR \[dq].TH colspan=2\[dq] header1+2 .TH header3
+\&. TR .TD 1*1 .TD 1*2 .TD 1*3
+\&. TR .TD 2*1 \[dq].TD colspan=2\[dq] 2*2+3
+\&.ETB
+.EE
.RE
.
+.
.PP
This looks like
.
+.
.PP
-.ft CR
-.if t \{\
-. ne 7v
-.\}
+.if t .ne 7v
.RS
-.nf
-.nh
+.EX
+------------------------------+---------------+
| header1+2 | header3 |
+--------------+---------------+---------------+
@@ -851,57 +834,54 @@ This looks like
+--------------+---------------+---------------+
| 2*1 | 2*2+3 |
+--------------+-------------------------------+
+.EE
.RE
-.ft
-.hy
-.fi
+.
.
.PP
A working example with
.B rowspan
is
.
+.
.PP
.RS
-.nf
-.nh
-.CR .TBL cols=3
-.CR ". TR"
-.CR ". TD" 1*1
-.CR ". TD" rowspan=2 1+2*2
-.CR ". TD" 1*3
-.CR .
-.CR ". TR"
-.CR ". TD" 2*1
-.CR ". TD" 2*3
-.CR .ETB
-.fi
-.hy
+.EX
+\&.TBL cols=3
+\&. TR
+\&. TD 1*1
+\&. TD rowspan=2 1+2*2
+\&. TD 1*3
+\&.
+\&. TR
+\&. TD 2*1
+\&. TD 2*3
+\&.ETB
+.EE
.RE
.
+.
.PP
which looks like
.
+.
.PP
-.ft CR
+.if t .ne 5v
.RS
-.nf
-.nh
+.EX
+--------------+---------------+---------------+
| 1*1 | 1+2*2 | 1*3 |
+--------------+ +---------------+
| 2*1 | | 2*3 |
+--------------+---------------+---------------+
-.hy
-.fi
+.EE
.RE
-.ft CR
-.
.RE
.RE
.
.\"==================================================================
.
+.
.TP
.CB ".ETB \[lB]hold\[rB]"
End of the table.
@@ -1185,12 +1165,12 @@ to minimize the markup needed in each table.
The following example sets up defaults suitable for typical papers:
.PP
.RS
-.nf
-.CR ".ds t*bgc white\e\[dq] background color
-.CR ".ds t*fgc black\e\[dq] foreground color
-.CR ".ds t*bc black\e\[dq] border color
-.CR ".nr t*cpd 0.1n\e\[dq] cell padding
-.fi
+.EX
+\&.ds t*bgc white\[rs]\[dq] background color
+\&.ds t*fgc black\[rs]\[dq] foreground color
+\&.ds t*bc black\[rs]\[dq] border color
+\&.nr t*cpd 0.1n\[rs]\[dq] cell padding
+.EE
.RE
.
.
@@ -1210,13 +1190,14 @@ to the page header macro of your document's main macro package.
.
For example, say
.
+.
.PP
.RS
-.nf
-.CR ".am pg@top"
-.CR ". t*hm"
-.CR ".."
-.fi
+.EX
+\&.am pg@top
+\&. t*hm
+\&..
+.EE
.RE
.
.
@@ -1239,17 +1220,17 @@ to the \[lq]end\[rq] macro of your document's main macro package.
.
For example:
.
+.
.PP
.RS
-.nf
-.nh
-.CR ".am pg@end-text"
-.CR ". t*EM"
-.CR ".."
-.fi
-.hy
+.EX
+\&.am pg@end-text
+\&. t*EM
+\&..
+.EE
.RE
.
+.
.PP
If you use the
.B ms