GROFF_MAN(7) GROFF_MAN(7)
名称
groff_man - マニュアルページ生成サポート用 groff ‘man’ マクロ
書式
groff -man [ options... ] [ files... ]
groff -m man [ options... ] [ files... ]
解説
groff で マニュアルページを生成するのに使用される man マクロは、James
Clark が書きました。このドキュメントは、パッケージ中の各マクロの使い 方
を、短くまとめたものです。
オプション
man マクロは、次のようなコマンドラインオプションを理解します (レジスタ
をいくつか定義します)。
-rcR=1 本オプション (nroff モードではデフォルト) は、複数ページの代りに
、長い単一ページを出力します。無効にするには、 -rcR=0 としてくだ
さい。
-rC1 コマンドラインに複数のマニュアルページを与えた場合、それぞれのペ
ージ番号が 1 から始まるのではなく、連続した番号になります。
-rD1 両面印字にします。偶数ページと奇数ページのフッタは、異なった整形
が成されます。
-rPnnn ページの数え始めを 1 ではなく nnn からにします。
-rSxx ベースドキュメントフォントサイズを 10 ポイントではなく xx ポイン
トにします (xx には 10, 11, 12 のいずれかが使用できます)。
-rXnnn ページ nnn の後のページを nnna, nnnb, nnnc などというように数え
ます。例えば、‘-rX2’ というオプションの場合、ページを 1, 2, 2a,
2b, 2c というように割り振ります。
使用法
こ のセクションは、マニュアルページ用に使用可能なマクロについて述べてい
ます。さらにカスタマイズしたい場合は、 man.local ファイル中に追加のマク
ロおよびリクエストを置いてください。このファイルは man の直後にロードさ
れます。
.TH title section [extra1] [extra2] [extra3]
このマニュアルページのタイトルを title に、セクションを section
に設定します。セクションは、 1 から 8 までの値をとらなくてはなり
ません。 section 値には、後ろに文字列を置くこともできます。例 え
ば 、 ‘.pm’ とすると、マニュアルページの特定のサブセクションを示
します。 title と section は、ともにヘッダ行の左端と右端に置かれ
ま す ( 括 弧 でくくられた section が title の直後に付きます)。
extra1 は、フッタ行の中央に置かれます。 extra2 は、フッタ行の 左
に置かれます (両面印字がアクティブになっている場合、偶数ページに
は左に、奇数ページには右に、置かれます)。 extra3 はヘッダ行の 中
央に置かれます。
HTML 出力用には、ヘッダおよびフッタは完全に取り除かれます。
さ らに、このマクロは改ページします。新しい行番号は、再度 1 にな
ります (コマンドラインで ‘-rC1’ オプションが指定されている場合を
除 きます)。この機能は、複数のマニュアルページを整形する場合のた
めだけにあります。マニュアルページが 1 つの場合、 TH は、ファ イ
ルの先頭において、まさに 1 つだけ存在すべきです。
.SH [text for a heading]
番号づけをしないセクション用の見出しを設定します。これは左詰めに
なります。 SH に続いたテキスト ( SH に引数がない場合は次の行のテ
キスト) は、行末までのものがすべてボールド体で、そしてベースドキ
ュメントサイズよりも 1 だけ大きなフォントサイズで表示されます 。
さらに、テキストの左側の余白はデフォルト値に戻されます。
.SS [text for a heading]
番 号づけしないセクションの 2 番目の見出しを設定します。 SS に続
いたテキスト ( SS に引数がない場合は次の行のテキスト) は、行末ま
でのものがすべてボールド体で、そしてベースドキュメントサイズと同
じ大きさのフォントで表示されます。さらに、テキストの左側の余白は
デフォルト値に戻されます。
.TP [nnn]
インデントされた、ラベルつきの段落を設定します。インデント幅は、
引数が与えられていれば nnn に設定されます (省略されていれば、 デ
フォルトの単位は ‘n’ です)。引数が与えられていなければ、インデン
ト幅はデフォルト値に設定されます。このマクロの後に続いたテキスト
の 1 行目は、左詰めに表示する文字列として解釈され、ラベルとして
使用するのに適切なものとなります。これは段落の一部であるとは解釈
は されませんので、引き続く入力行のテキストで 1 行目を満たそうと
はしません。それでも、ラベルがインデント幅ほど広がっていない場合
に は、同じ行から段落が始まり (ただし、インデントはされます)、次
の行へと続いていきます。ラベルがインデント幅よりも広い場合は、段
落の説明部分はラベルの次の行から始まり、すべてインデントされます
。ラベルのフォントの形もサイズもデフォルト値には設定されないこと
に注意してください。これに対して、残りのテキストはデフォルトのフ
ォント設定になります。 TP マクロは、あなたが今ちょうど読んでいる
この解説に使用されているマクロです。
.LP
.PP
.P これらのマクロは、共通の別名です。これらのうちのどれを使用しても
現在の位置で行を打ち切ります。そして、その後に PD マクロで指定し
た量だけ垂直方向にスペースを置きます。フォントのサイズおよび形は
デフォルト値に戻されます (10pt ローマン体)。最後に、現在の左側の
余白の量を復元します。
.IP [designator] [nnn]
インデントされた段落を設定します。その際、 designator を段落の始
まりに印をつけるためのタグとして使用します。インデント幅は、引数
が 与 え られている場合は nnn に設定されます (デフォルトの単位は
‘n’ です)。引数が与えられていない場合は、デフォルトのインデン ト
幅 が 使用されます。この段落 (ただし、指示子 (designator) を含ま
ず) のフォントサイズおよびフェースはデフォルト値に戻されます。特
定 の インデントをするが指示子をつけない段落を開始するには、第 2
引数に ‘""’ (ダブルクォート 2 つ) を使用してください。
例えば次の段落は、‘.IP \(bu 4’ を用いて、すべて指示子として中 点
をつけて設定されます:
· IP は、リストを整形するために man で使用される 3 つのマクロ
のうちの 1 つです。
· HP は、また別のマクロです。このマクロは、左側にぶら下げイ ン
デントされた段落を生成します。
· TP は、また別のマクロです。このマクロは、インデントされない
ラベルを生成し、その後にインデントされた段落が続きます。
.HP [nnn]
左側にぶら下げインデントされた段落を設定します。引数が与えられて
い る場合、インデント幅は nnn に設定されます (デフォルトの単位は
‘n’ です)。引数が与えられていない場合、デフォルトのインデント 幅
が使用されます。フォントサイズおよびフェースはデフォルト値に戻さ
れます。次の段落は、インデント幅を 4 に設定されているときのこ の
マクロの効果を示したものです:
この段落は、 HP マクロを実行したあとの段落です。見ての通り、この
マクロは、最初の行を除いた行すべてがインデントされた段落を生
成しています。
.RS [nnn]
こ の マクロは、値が与えられていれば (デフォルト単位は ‘n’ です)
その値だけ左側の余白を右に移動します。値が与えられていなければ、
デフォルトのインデント幅が使用されます。 RS マクロの呼び出しは入
れ子にできます。
.RE [nnn]
このマクロは、左側の余白を nnn レベルまで戻します。引数が与え ら
れていなければ、このマクロはレベルを 1 つだけ戻します。第 1 レベ
ル (すなわち、まだ RS を呼び出していない) は番号 1 を持ってお り
、 RS マクロを呼び出すごとにレベルが 1 ずつ増加します。
ま とめると、次のマクロは、垂直方向にスペースを入れた行の折り返しを行い
ます (スペースの量は PD マクロを使用すると変更できます): SH, SS, TP, LP
(PP, P), IP, HP 。マクロ RS および RE も行を折り返しますが、垂直方向に
スペースを入れません。
フォントを設定するためのマクロ
標準フォントはローマン体です。そして、デフォルトのテキストサイズは 10
ポイントです。
.SM [text]
同じ行にあるテキストあるいは次の行にあるテキストが、デフォルトの
フォントよりも 1 ポイントだけ小さいフォントで表示されるように な
ります。
.SB [text]
同じ行にあるテキストあるいは次の行にあるテキストが、ボールド体の
フォントで、そしてデフォルトのフォントよりも 1 ポイントだけ小 さ
いフォントで表示されるようになります。
.BI text
同じ行にあるテキストが、ボールド体とイタリック体を交互に使って表
示されるようになります。テキストはマクロ呼び出しと同じ行にあるこ
とが必要です。したがって、
.BI this "word and" that
と いう行は、‘this’ と ‘that’ がボールド体で表示され、それに対し
て ‘word and’ の部分はイタリック体で表示されます。
.IB text
テキストが、イタリック体とボールド体を交互に使って表示されるよう
になります。テキストはマクロ呼び出しと同じ行にあることが必要です
。
.RI text
マクロ呼び出しと同じ行にあるテキストが、ローマン体とイタリック体
を交互に使って表示されるようになります。テキストは、マクロ呼び出
しと同じ行にあることが必要です。
.IR text
マクロ呼び出しと同じ行にあるテキストが、イタリック体とローマン体
を交互に使って表示されるようになります。テキストは、マクロ呼び出
しと同じ行にあることが必要です。
.BR text
マクロ呼び出しと同じ行にあるテキストが、ボールド体とローマン体を
交互に使って表示されるようになります。テキストは、マクロ呼び出し
と同じ行にあることが必要です。
.RB text
マクロ呼び出しと同じ行にあるテキストが、ローマン体とボールド体を
交互に使って表示されるようになります。テキストは、マクロ呼び出し
と同じ行にあることが必要です。
.R [text]
text がローマン体フォントで表示されるようになります。マクロが 呼
び出された行にテキストがない場合は、次の行のテキストがローマン体
で表示されます。これが、他のマクロを処理し終わったときに返される
テキストのデフォルトのフォントです。
.B [text]
text がボールド体で表示されるようになります。マクロが呼び出され
た行にテキストがない場合は、次の行のテキストがボールド体で表示さ
れます。
.I [text]
text がイタリック体で表示されるようになります。マクロが呼び出さ
れた行にテキストがない場合は、次の行のテキストがイタリック体で表
示されます。
その他
grohtml を除いた出力デバイス用のインデント幅はすべて 7.2n です。 gro-
html の場合はインデントを無視します。
.DT 0.5 インチごとにタブを設定します。このマクロは常に TH リクエスト
中で呼ばれるため、タブ位置が変更された場合に限って呼び出すことに
は意味があります。
.PD [nnn]
新しい段落 (セクション) の前のスペースを調整します。オプションの
引 数は、スペースの量を与えます (デフォルトの単位は ‘v’)。パラメ
ータ無しの場合、この値はデフォルト値に戻されます (tty デバイスで
は 1 行で、それ以外では 0.4v)。このリクエストは、 SH, SS, TP, LP
(それぞれ PP および P), IP, HP マクロに影響を与えます。
次の文字列が定義されています:
\*S デフォルトのフォントサイズに戻します。
\*R 「登録」マークです。
\*(Tm 「商標」マークです。
\*(lq
\*(rq 左および右クォートです。これは、それぞれ ‘\(lq’ と ‘\(rq’ と同じ
です。
tbl あるいは eqn のようなプリプロセッサが必要な場合、マニュアルページの
1 行目を次のように見えるようにする例になります:
.\" word
ダブルクォートの後には空白文字 1 つが入ることに注意してください。 word
は 、必要なプリプロセッサを表す文字で成り立っています。 ‘e’ は eqn を表
し、 ‘r’ は refer を、そして ‘t’ は tbl を表します。最近の man プログラ
ムの実装では、この 1 行目を読んで自動的に正しいプリプロセッサを呼び出し
ます。
関連ファイル
man.tmac
an.tmac
これらは、 andoc.tmac を呼び出すラッパファイルです。
andoc.tmac
このファイルは、 man マクロまたは mdoc パッケージのいずれを使 用
すべきかを判定します。
an-old.tmac
全 man マクロが、このファイルに含まれます。
man.local
ローカルの修正とカスタマイズは、このファイルに入れます。
関連項目
man マクロは、 groff リクエストの集まりでできていますので、原理的には、
必要がある場合には自己流の groff リクエストを作って man の機能を追加 す
ることができます。これらのリクエストの完全なリストは WWW ページ
http://www.cs.pdx.edu/~trent/gnu/groff/groff_toc.html
から入手できます。
tbl(1), eqn(1), refer(1), man(1)
作者
こ の マ ニ ュアルページは、本来 Debian GNU/Linux システム用に Susan G.
Kleinmann
GROFF_MAN(7) GROFF_MAN(7)
NAME
groff_man - groff ‘man’ macros to support generation of man pages
SYNOPSIS
groff -man [ options... ] [ files... ]
groff -m man [ options... ] [ files... ]
DESCRIPTION
The man macros used to generate man pages with groff were written by
James Clark. This document provides a brief summary of the use of each
macro in that package.
OPTIONS
The man macros understand the following command line options (which
define various registers).
-rLL=line-length
Set line length. If this option is not given, the line length
defaults to 78n in nroff mode and 6.5i in troff mode.
-rLT=title-length
Set title length. If this option is not given, the title length
defaults to 78n in nroff mode and 6.5i in troff mode.
-rcR=1 This option (the default if in nroff mode) will create a single,
very long page instead of multiple pages. Say -rcR=0 to disable
it.
-rC1 If more than one manual page is given on the command line, num-
ber the pages continuously, rather than starting each at 1.
-rD1 Double-sided printing. Footers for even and odd pages are for-
matted differently.
-rPnnn Enumeration of pages will start with nnn rather than with 1.
-rSxx Base document font size is xx points (xx can be 10, 11, or 12)
rather than 10 points.
-rXnnn After page nnn, number pages as nnna, nnnb, nnnc, etc. For
example, the option ‘-rX2’ will produce the following page num-
bers: 1, 2, 2a, 2b, 2c, etc.
USAGE
This section describes the available macros for manual pages. For fur-
ther customization, put additional macros and requests into the file
man.local which will be loaded immediately after the man package.
.TH title section [extra1] [extra2] [extra3]
Sets the title of the man page to title and the section to sec-
tion, which must take on a value between 1 and 8. The value
section may also have a string appended, e.g. ‘.pm’, to indicate
a specific subsection of the man pages. Both title and section
are positioned at the left and right in the header line (with
section in parentheses immediately appended to title. extra1
will be positioned in the middle of the footer line. extra2
will be positioned at the left in the footer line (resp. at the
left on even pages and at the right on odd pages if double-sided
printing is active). extra3 is centered in the header line.
For HTML output, headers and footers are completely supressed.
Additionally, this macro starts a new page; the new line number
is 1 again (except if the ‘-rC1’ option is given on the command
line) -- this feature is intended only for formatting multiple
man pages; a single man page should contain exactly one TH macro
at the beginning of the file.
.SH [text for a heading]
Sets up an unnumbered section heading sticking out to the left.
Prints out all the text following SH up to the end of the line
(resp. the text in the next input line if there is no argument
to SH) in bold face, one size larger than the base document
size. Additionally, the left margin for the following text is
reset to its default value.
.SS [text for a heading]
Sets up an secondary, unnumbered section heading. Prints out
all the text following SS up to the end of the line (resp. the
text in the next input line if there is no argument to SS) in
bold face, at the same size as the base document size. Addi-
tionally, the left margin for the following text is reset to its
default value.
.TP [nnn]
Sets up an indented paragraph with label. The indentation is
set to nnn if that argument is supplied (the default unit is ‘n’
if omitted), otherwise it is set to the default indentation
value. The first input line of text following this macro is
interpreted as a string to be printed flush-left, as it is
appropriate for a label. It is not interpreted as part of a
paragraph, so there is no attempt to fill the first line with
text from the following input lines. Nevertheless, if the label
is not as wide as the indentation, then the paragraph starts at
the same line (but indented), continuing on the following lines.
If the label is wider than the indentation, then the descriptive
part of the paragraph begins on the line following the label,
entirely indented. Note that neither font shape nor font size
of the label is set to a default value; on the other hand, the
rest of the text will have default font settings. The TP macro
is the macro used for the explanations you are just reading.
.LP
.PP
.P These macros are mutual aliases. Any of them causes a line
break at the current position, followed by a vertical space
downwards by the amount specified by the PD macro. The font
size and shape are reset to the default value (10pt resp.
Roman). Finally, the current left margin is restored.
.IP [designator] [nnn]
Sets up an indented paragraph, using designator as a tag to mark
its beginning. The indentation is set to nnn if that argument
is supplied (default unit is ‘n’), otherwise the default inden-
tation value is used. Font size and face of the paragraph (but
not the designator) are reset to its default values. To start
an indented paragraph with a particular indentation but without
a designator, use ‘""’ (two doublequotes) as the second argu-
ment.
For example, the following paragraphs were all set up with bul-
lets as the designator, using ‘.IP \(bu 4’:
· IP is one of the three macros used in the man package to
format lists.
· HP is another. This macro produces a paragraph with a left
hanging indentation.
· TP is another. This macro produces an unindented label fol-
lowed by an indented paragraph.
.HP [nnn]
Sets up a paragraph with hanging left indentation. The indenta-
tion is set to nnn if that argument is supplied (default unit is
‘n’), otherwise the default indentation value is used. Font
size and face are reset to its default values. The following
paragraph illustrates the effect of this macro with hanging
indentation set to 4:
This is a paragraph following an invocation of the HP macro. As
you can see, it produces a paragraph where all lines but the
first are indented.
.RS [nnn]
This macro moves the left margin to the right by the value nnn
if specified (default unit is ‘n’); otherwise the default inden-
tation value is used. Calls to the RS macro can be nested.
.RE [nnn]
This macro moves the left margin back to level nnn; if no argu-
ment is given, it moves one level back. The first level (i.e.,
no call to RS yet) has number 1, and each call to RS increases
the level by 1.
To summarize, the following macros cause a line break with the inser-
tion of vertical space (which amount can be changed with the PD macro):
SH, SS, TP, LP (PP, P), IP, and HP. The macros RS and RE also cause a
break but no insertion of vertical space. Finally, the macros SH, SS,
LP (PP, P), and RS reset the indentation to its default value.
MACROS TO SET FONTS
The standard font is Roman; the default text size is 10 point.
.SM [text]
Causes the text on the same line or the text on the next input
line to appear in a font that is one point size smaller than the
default font.
.SB [text]
Causes the text on the same line or the text on the next input
line to appear in boldface font, one point size smaller than the
default font.
.BI text
Causes text on the same line to appear alternately in bold face
and italic. The text must be on the same line as the macro
call. Thus
.BI this "word and" that
would cause ‘this’ and ‘that’ to appear in bold face, while
‘word and’ appears in italics.
.IB text
Causes text to appear alternately in italic and bold face. The
text must be on the same line as the macro call.
.RI text
Causes text on the same line to appear alternately in roman and
italic. The text must be on the same line as the macro call.
.IR text
Causes text on the same line to appear alternately in italic and
roman. The text must be on the same line as the macro call.
.BR text
Causes text on the same line to appear alternately in bold face
and roman. The text must be on the same line as the macro call.
.RB text
Causes text on the same line to appear alternately in roman and
bold face. The text must be on the same line as the macro call.
.B [text]
Causes text to appear in bold face. If no text is present on
the line where the macro is called, then the text of the next
input line appears in bold face.
.I [text]
Causes text to appear in italic. If no text is present on the
line where the macro is called, then the text of the next input
line appears in italic.
MISCELLANEOUS
The default indentation is 7.2n for all output devices except for gro-
html which ignores indentation.
.DT Sets tabs every 0.5 inches. Since this macro is always called
during a TH request, it makes sense to call it only if the tab
positions have been changed.
.PD [nnn]
Adjusts the empty space before a new paragraph (resp. section).
The optional argument gives the amount of space (default units
are ‘v’); without parameter, the value is reset to its default
value (1 line for tty devices, 0.4v otherwise). This affects
the macros SH, SS, TP, LP (resp. PP and P), IP, and HP.
The following strings are defined:
\*S Switch back to the default font size.
\*R The ‘registered’ sign.
\*(Tm The ‘trademark’ sign.
\*(lq
\*(rq Left and right quote. This is equal to ‘\(lq’ and ‘\(rq’,
respectively.
If a preprocessor like tbl or eqn is needed, it has become usage to
make the first line of the man page look like this:
.\" word
Note the single space character after the double quote. word consists
of letters for the needed preprocessors: ‘e’ for eqn, ‘r’ for refer,
and ‘t’ for tbl. Modern implementations of the man program read this
first line and automatically call the right preprocessor(s).
FILES
man.tmac
an.tmac
These are wrapper files to call andoc.tmac.
andoc.tmac
This file checks whether the man macros or the mdoc package
should be used.
an-old.tmac
All man macros are contained in this file.
man.local
Local changes and customizations should be put into this file.
SEE ALSO
Since the man macros consist of groups of groff requests, one can, in
principle, supplement the functionality of the man macros with individ-
ual groff requests where necessary. A complete list of these requests
is available on the WWW at
http://www.cs.pdx.edu/~trent/gnu/groff/groff_toc.html
tbl(1), eqn(1), refer(1), man(1)
AUTHOR
This manual page was originally written for the Debian GNU/Linux system
by Susan G. Kleinmann
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa