📄 mdoc.samples.7
字号:
given, a line break will occur, leaving a nice vertical spacebetween the current function name and the one prior.At the moment,.Ql \&.Fndoes not check its word boundariesagainst troff line lengths and may split across a newlineungracefully.This will be fixed in the near future..Ss Function TypeThis macro is intended for the.Sx SYNOPSISsection.It may be usedanywhere else in the man page without problems, but its main purposeis to present the function type in kernel normal form for the.Sx SYNOPSISof sections two and three(it causes a page break allowing the function name to appearon the next line)..Pp.Dl Usage: .Ft type ... \*(Pu.Bl -tag -width "\&.Ft struct stat" -offset 14n -compact.It Li \&.Ft struct stat.Ft struct stat.El.PpThe.Ql \&.Ftrequest is not callable by other macros..Ss Interactive CommandsThe.Ql \&.Icmacro designates an interactive or internal command..Pp.Dl Usage: .Li argument ... \*(Pu.Bl -tag -width ".Ic setenv , unsetenvxx" -compact -offset 14n.It Li \&.Ic :wq.Ic :wq.It Li \&.Ic do while {...}.Ic do while {...}.It Li \&.Ic setenv\ , unsetenv.Ic setenv , unsetenv.El.PpIt is an error to call.Ql \&.Icwithout arguments.The.Ql \&.Icmacro is parsed and is callable..Ss LiteralsThe.Ql \&.Liliteral macro may be used for special characters,variable constants, anything which should be displayed as itwould be typed..Pp.Dl Usage: .Li argument ... \*(Pu.Bl -tag -width ".Li cntrl-D ) ," -compact -offset 14n.It Li \&.Li \een.Li \en.It Li \&.Li M1 M2 M3\ ;.Li M1 M2 M3 ;.It Li \&.Li cntrl-D\ )\ ,.Li cntrl-D ) ,.It Li \&.Li 1024\ ....Li 1024 ....El.PpThe.Ql \&.Limacro is parsed and is callable..Ss Name MacroThe.Ql \&.Nmmacro is used for the document title or subject name.It has the peculiarity of remembering the firstargument it was called with, which shouldalways be the subject name of the page.When called withoutarguments,.Ql \&.Nmregurgitates this initial name for the sole purposeof making less work for the author.Note:a section twoor three document function name is addressed with the.Ql \&.Nmin the.Sx NAMEsection, and with.Ql \&.Fnin the.Sx SYNOPSISand remaining sections.For interactive commands, such as the.Ql whilecommand keyword in.Xr csh 1 ,the.Ql \&.Icmacro should be used.While the.Ql \&.Icis nearly identicalto.Ql \&.Nm ,it can not recall the first argument it was invoked with..Pp.Dl Usage: .Nm argument ... \*(Pu.Bl -tag -width ".Nm mdoc.sample" -compact -offset 14n.It Li \&.Nm mdoc.sample.Nm mdoc.sample.It Li \&.Nm \e-mdoc.Nm \-mdoc ..It Li \&.Nm foo\ )\ )\ ,.Nm foo ) ) ,.It Li \&.Nm.Nm.El.PpThe.Ql \&.Nmmacro is parsed and is callable..Ss OptionsThe.Ql \&.Opmacroplaces option brackets around the any remaining arguments on the commandline, and places anytrailing punctuation outside the brackets.The macros.Ql \&.Ocand.Ql \&.Oomay be used across one or more lines..Pp.Dl Usage: .Op options ... \*(Pu.Bl -tag -width ".Op Fl c Ar objfil Op Ar corfil ," -compact -offset indent.It Li \&.Op.Op.It Li ".Op Fl k".Op Fl k.It Li ".Op Fl k ) .".Op Fl k ) ..It Li ".Op Fl k Ar kookfile".Op Fl k Ar kookfile.It Li ".Op Fl k Ar kookfile ,".Op Fl k Ar kookfile ,.It Li ".Op Ar objfil Op Ar corfil".Op Ar objfil Op Ar corfil.It Li ".Op Fl c Ar objfil Op Ar corfil ,".Op Fl c Ar objfil Op Ar corfil ,.It Li \&.Op word1 word2.Op word1 word2.El.PpThe.Ql \&.Ocand.Ql \&.Oomacros:.Bd -literal -offset indent\&.Oo\&.Op \&Fl k \&Ar kilobytes\&.Op \&Fl i \&Ar interval\&.Op \&Fl c \&Ar count\&.Oc.Ed.PpProduce:.Oo.Op Fl k Ar kilobytes.Op Fl i Ar interval.Op Fl c Ar count.Oc.PpThe macros.Ql \&.Op ,.Ql \&.Ocand.Ql \&.Ooare parsed and are callable..Ss PathnamesThe.Ql \&.Pamacro formats path or file names..Pp.Dl Usage: .Pa pathname \*(Pu.Bl -tag -width ".Pa /tmp/fooXXXXX ) ." -compact -offset 14n.It Li \&.Pa /usr/share.Pa /usr/share.It Li \&.Pa /tmp/fooXXXXX\ )\ ..Pa /tmp/fooXXXXX ) ..El.PpThe.Ql \&.Pamacro is parsed and is callable..Ss VariablesGeneric variable reference:.Pp.Dl Usage: .Va variable ... \*(Pu.Bl -tag -width ".Va char s ] ) ) ," -compact -offset 14n.It Li \&.Va count.Va count.It Li \&.Va settimer ,.Va settimer ,.It Li \&.Va int\ *prt\ )\ :.Va int\ *prt ) :.It Li \&.Va char\ s\ ]\ )\ )\ ,.Va char\ s ] ) ) ,.El.PpIt is an error to call.Ql \&.Vawithout any arguments.The.Ql \&.Vamacro is parsed and is callable..Ss Manual Page Cross ReferencesThe.Ql \&.Xrmacro expects the first argument to bea manual page name, and the second argument, if it exists,to be either a section page number or punctuation.Anyremaining arguments are assumed to be punctuation..Pp.Dl Usage: .Xr man_page [1,...,8] \*(Pu.Bl -tag -width ".Xr mdoc 7 ) ) ," -compact -offset 14n.It Li \&.Xr mdoc.Xr mdoc.It Li \&.Xr mdoc\ ,.Xr mdoc ,.It Li \&.Xr mdoc 7.Xr mdoc 7.It Li \&.Xr mdoc 7\ )\ )\ ,.Xr mdoc 7 ) ) ,.El.PpThe.Ql \&.Xrmacro is parsed and is callable.It is an error to call.Ql \&.Xrwithoutany arguments..Sh GENERAL TEXT DOMAIN.Ss AT&T Macro.Bd -literal -offset indent -compactUsage: .At [v6 | v7 | 32v | V.1 | V.4] ... \*(Pu.Ed.Bl -tag -width ".At v6 ) ," -compact -offset 14n.It Li ".At".At.It Li ".At v6 .".At v6 ..El.PpThe.Ql \&.Atmacro is.Em notparsed and.Em notcallable. It accepts at most two arguments..Ss BSD Macro.Dl Usage: .Bx [Version/release] ... \*(Pu.Bl -tag -width ".Bx 4.3 ) ," -compact -offset 14n.It Li ".Bx".Bx.It Li ".Bx 4.3 .".Bx 4.3 ..El.PpThe.Ql \&.Bxmacro is parsed and is callable..Ss UNIX Macro.Dl Usage: .Ux ... \*(Pu.Bl -tag -width ".Ux 4.3 ) ," -compact -offset 14n.It Li ".Ux".Ux.El.PpThe.Ql \&.Uxmacro is parsed and is callable..Ss Emphasis MacroText may be stressed or emphasized with the.Ql \&.Emmacro.The usual font for emphasis is italic..Pp.Dl Usage: .Em argument ... \*(Pu.Bl -tag -width ".Em vide infra ) ) ," -compact -offset 14n.It Li ".Em does not".Em does not.It Li ".Em exceed 1024 .".Em exceed 1024 ..It Li ".Em vide infra ) ) ,".Em vide infra ) ) ,.El.\" .Pp.\" The emphasis can be forced across several lines of text by using.\" the.\" .Ql \&.Bf.\" macro discussed in.\" .Sx Modes.\" under.\" .Sx PAGE STRUCTURE DOMAIN ..\" .Pp.\" .Bf -emphasis.\" We are certain the reason most people desire a Harvard MBA.\" so they can become to be successful philanthropists. Only.\" mathematicians and physicists go to graduate school strictly.\" to acquire infinite wealthy and fame. Its that inifinity.\" word that does it to them. Ruins them..\" .Ef.PpThe.Ql \&.Emmacro is parsed and is callable.It is an error to call.Ql \&.Emwithout arguments..Ss Enclosure and Quoting MacrosThe concept of enclosure is similar to quoting.The object being to enclose one or more strings betweena pair of characters like quotes or parentheses.The terms quoting and enclosure are usedinterchangeably throughout this document.Most of theone line enclosure macros endin small letter.Ql qto give a hint of quoting, but there are a few irregularities.For each enclosure macrothere is also a pair of open and close macros which endin small letters.Ql oand.Ql crespectively.These can be used across one or more lines of textand while they have nesting limitations, the one line quote macroscan be used insideof them..Pp.ne 5.Bd -filled -offset indent.Bl -column "quote " "close " "open " "Enclose Stringx(in XX) " XXstringXX.Em " Quote Close Open Function Result"\&.Aq .Ac .Ao Angle Bracket Enclosure <string>\&.Bq .Bc .Bo Bracket Enclosure [string]\&.Dq .Dc .Do Double Quote ``string'' .Ec .Eo Enclose String (in XX) XXstringXX\&.Pq .Pc .Po Parenthesis Enclosure (string)\&.Ql Quoted Literal `st' or string\&.Qq .Qc .Qo Straight Double Quote "string"\&.Sq .Sc .So Single Quote `string'.El.Ed.PpExcept for the irregular macros noted below, allof the quoting macros are parsed and callable.All handle punctuation properly, as long as itis presented one character at a time and separated by spaces.The quoting macros examine opening and closing punctuationto determine whether it comes before or after theenclosing string. This makes some nesting possible..Bl -tag -width xxx,xxxx.It Li \&.Ec , \&.EoThese macros expect the first argument to be theopening and closing strings respectively..It Li \&.QlThe quoted literal macro behaves differently for.Xr troffthan.Xr nroff .If formatted with.Xr nroff ,a quoted literal is always quoted. If formatted withtroff, an item is only quoted if the widthof the item is less than three constant width characters.This is to make short strings more visible where the font changeto literal (constant width) is less noticeable..It Li \&.PfThe prefix macro is not callable, but it is parsed:.Bl -tag -width "(namexx" -offset indent.It Li ".Pf ( Fa name2"becomes.Pf ( Fa name2 ..El.PpThe.Ql \&.Ns(no space) macro performs the analogous suffix function..El.Pp.ne 4Examples of quoting:.Bl -tag -width ".Aq Pa ctype.h ) ,xxxxxxxx" -compact -offset indent.It Li \&.Aq.Aq.It Li \&.Aq \&Ar ctype.h\ )\ ,.Aq Ar ctype.h ) ,.It Li \&.Bq.Bq.It Li \&.Bq \&Em Greek \&, French \&..Bq Em Greek , French ..It Li \&.Dq.Dq.It Li ".Dq string abc .".Dq string abc ..It Li ".Dq \'^[A-Z]\'".Dq \'^[A-Z]\'.It Li "\&.Ql man mdoc".Ql man mdoc.It Li \&.Qq.Qq.It Li "\&.Qq string ) ,".Qq string ) ,.It Li "\&.Qq string Ns ),".Qq string Ns ),.It Li \&.Sq.Sq.It Li "\&.Sq string.Sq string.El.PpFor a good example of nested enclosure macros, see the.Ql \&.Opoption macro.It was created from the sameunderlying enclosure macros as those presented in the listabove.The.Ql \&.Xoand.Ql \&.Xcextended argument list macroswere also built from the same underlying routines and are a goodexample of.Nm \-mdocmacro usage at its worst..Ss No\-Op or Normal Text MacroThe macro.Li \&.Noisa hack for words in a macro command line which should.Em notbe formatted and follows the conventional syntaxfor content macros..Ss No Space MacroThe.Ql \&.Nsmacro eliminates unwanted spaces in between macro requests.It is useful for old style argument lists where there is no spacebetween the flag and argument:.Bl -tag -width ".Op Fl I Ns Ar directoryxx" -offset indent.It Li ".Op Fl I Ns Ar directory"produces.Op Fl I Ns Ar directory.El.PpNote: the.Ql \&.Nsmacro always invokes the.Ql \&.Nomacro after eliminating the space unless another macro namefollows it.The macro.Ql \&.Nsis parsed and is callable..Ss Section Cross ReferencesThe.Ql \&.Sxmacro designates a reference to a section headerwithin the same document.It is parsed and is callable..Pp.Bl -tag -width "Li \&.Sx FILES" -offset 14n.It Li \&.Sx FILES.Sx FILES.El.Ss SymbolicThe symbolic emphasis macro is generally a boldface macro ineither the symbolic sense or the traditional English usage..Pp.Dl Usage: .Sy symbol ... \*(Pu.Bl -tag -width ".Sy Important Noticex" -compact -offset 14n.It Li \&.Sy Important Notice.Sy Important Notice.El.PpThe.Ql \&.Symacro is parsed and is callable.Arguments to.Ql \&.Symay be quoted..Ss References and CitationsThe following macros make a modest attempt to handle references.At best, the macros make it convenient to manually drop in a subset ofrefer style references..Pp.Bl -tag -width 6n -offset indent -compact.It Li ".Rs"Reference Start.Causes a line break and begins collectionof reference information until thereference end macro is read..It Li ".Re"Reference End.The reference is printed..It Li ".%A"Reference author name, one name per invocation..It Li ".%B"Book title..It Li ".\&%C"City/place..It Li ".\&%D"Date..It Li ".%J"Journal name..It Li ".%N"Issue number..It Li ".%O"Optional information..It Li ".%P"Page number..It Li ".%R"Report name..It Li ".%T"Title of article..It Li ".%V"Volume(s)..El.PpThe macros beginning with.Ql %are not callable, and are parsed only for the trade name macro whichreturns to its caller.(And not very predictably at the moment either.)The purpose is to allow trade namesto be pretty printed in.Xr troff Ns / Ns Xr ditroffoutput..Ss Trade Names (or Acronyms and Type Names)The trade name macro is generally a small caps macro forall upper case words longer than two characters..Pp.Dl Usage: .Tn symbol ... \*(Pu.Bl -tag -width ".Tn ASCII" -compact -offset 14n.It Li \&.Tn DEC.Tn DEC
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -