⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mdoc.samples.7

📁 早期freebsd实现
💻 7
📖 第 1 页 / 共 5 页
字号:
Literal mode isasserted and tabs are set at 8 constant width characterintervals, however any.Xr troff/ Ns Nm \-mdoccommands in file will be processed..It Fl offset Ar stringIf.Fl offsetis specified with one of the following strings, the stringis interpreted to indicate the level of indentation for theforthcoming block of text:.Pp.Bl -tag -width "indent-two" -compact.It Ar leftAlign block on the current left margin,this is the default mode of.Ql \&.Bd ..It Ar centerSupposedly center the block.At this timeunfortunately, the block merely getsleft aligned about an imaginary center margin..It Ar indentIndents by one default indent value or tab.The defaultindent value is also used for the.Ql \&.D1display so one is guaranteed the two types of displayswill line up.This indent is normally set to 6n or about twothirds of an inch (six constant width characters)..It Ar indent-twoIndents two times the default indent value..It Ar rightThis.Em leftaligns the block about two inches fromthe right side of the page.This macro needswork and perhaps may never do the right thing by.Xr troff ..El.El.It ".Ed"End-display..El.Ss Tagged Lists and ColumnsThere are several types of lists which may be initiated with the.Ql ".Bl"begin-list macro.Items within the listare specified with the.Ql ".It"item macro andeach list must end with the.Ql ".El"macro.Lists may be nested within themselves and within displays.Columns may be used inside of lists, but lists are unproveninside of columns..PpIn addition, several list attributes may be specified such asthe width of a tag, the list offset, and compactness(blank lines between items allowed or disallowed).Most of this document has been formatted with a tag style list.Pq Fl tag .For a change of pace, the list-type used to present the list-typesis an over-hanging list.Pq Fl ohang .This type of list is quite popular with.Tn TeXusers, but might look a bit funny after having read many pages oftagged lists.The following list types are accepted by.Ql ".Bl" :.Pp.Bl -ohang -compact.It Fl bullet.It Fl item.It Fl enumThese three are the simplest types of lists.Once the.Ql ".Bl"macro has been given, items in the list are merelyindicated by a line consisting solely of the.Ql ".It"macro.For example, the source text for a simple enumerated listwould look like:.Bd -literal -offset indent-two\&.Bl -enum -compact\&.It\&Item one goes here.\&.It\&And item two here.\&.It\&Lastly item three goes here.\&.El.Ed.PpThe results:.Pp.Bl -enum -offset indent-two -compact.ItItem one goes here..ItAnd item two here..ItLastly item three goes here..El.PpA simple bullet list construction:.Bd -literal -offset indent-two\&.Bl -bullet -compact\&.It\&Bullet one goes here.\&.It\&Bullet two here.\&.El.Ed.PpProduces:.Bl -bullet -offset indent-two -compact.ItBullet one goes here..ItBullet two here..El.Pp.It Fl tag.It Fl diag.It Fl hang.It Fl ohang.It Fl insetThese list-types collect arguments specified with the.Ql \&.Itmacro and create a label which may be.Em insetinto the forthcoming text,.Em hangedfrom the forthcoming text,.Em overhangedfrom above and not indented or.Em tagged .Thislist was constructed with the.Ql Fl ohanglist-type.The.Ql \&.Itmacro is parsed only for the inset, hangand tag list-types and is not callable.Here is an example of inset labels:.Bl -inset -offset indent.It Em TagThe tagged list (also called a tagged paragraph) is themost common type of list used in the Berkeley manuals..It Em DiagDiag lists create section four diagnostic listsand are similar to inset lists except callablemacros are ignored..It Em HangHanged labels are a matter of taste..It Em OhangOverhanging labels are nice when space is constrained..It Em InsetInset labels are useful for controlling blocks ofparagraphs and are valuable for converting.Nm \-mdocmanuals to other formats..El.PpHere is the source text which produced the above example:.Bd -literal -offset indent\&.Bl -inset -offset indent\&.It Em Tag\&The tagged list (also called a tagged paragraph) is the\&most common type of list used in the Berkeley manuals.\&.It Em Diag\&Diag lists create section four diagnostic lists\&and are similar to inset lists except callable\&macros are ignored.\&.It Em Hang\&Hanged labels are a matter of taste.\&.It Em Ohang\&Overhanging labels are nice when space is constrained.\&.It Em Inset\&Inset labels are useful for controlling blocks of\&paragraphs and are valuable for converting\&.Nm \-mdoc\&manuals to other formats.\&.El.Ed.PpHere is a hanged list with just one item:.Bl -hang -offset indent.It Em Hangedlabels appear similar to tagged lists when thelabel is smaller than the label width..It Em Longer hanged list labelsblend in to the paragraph unliketagged paragraph labels..El.PpAnd the unformatted text which created it:.Bd -literal -offset indent\&.Bl -hang -offset indent\&.It Em Hanged\&labels appear similar to tagged lists when the\&label is smaller than the label width.\&.It Em Longer hanged list labels\&blend in to the paragraph unlike\&tagged paragraph labels.\&.El.Ed.PpThe tagged list which follows uses an optional width specifier to controlthe width of the tag..Pp.Bl -tag -width "PAGEIN" -compact -offset indent.It SLsleep time of the process (seconds blocked).It PAGEINnumber of disk.Tn I/O Ns 'sresulting from referencesby the process to pages not loaded in core..It UIDnumerical user-id of process owner.It PPIDnumerical id of parent of process process priority(non-positive when in non-interruptible wait).El.PpThe raw text:.Bd -literal -offset indent\&.Bl -tag -width "PAGEIN" -compact -offset indent\&.It SL\&sleep time of the process (seconds blocked)\&.It PAGEIN\&number of disk\&.Tn I/O Ns 's\&resulting from references\&by the process to pages not loaded in core.\&.It UID\&numerical user-id of process owner\&.It PPID\&numerical id of parent of process process priority\&(non-positive when in non-interruptible wait)\&.El.Ed.PpAcceptable width specifiers:.Bl -tag -width Ar -offset indent.It Fl width Ar "\&Fl"sets the width to the default width for a flag.All callablemacros have a default width value.The.Ql \&.Fl ,value is presentlyset to ten constant width characters or about five sixth ofan inch..It Fl width Ar "24n"sets the width to 24 constant width characters or about twoinches.The.Ql nis absolutely necessary for the scaling to work correctly..It Fl width Ar "ENAMETOOLONG"sets width to the constant width length of thestring given..It Fl width  Ar "\\*qint mkfifo\\*q"again, the width is set to the constant width of the stringgiven..El.PpIf a width is not specified for the tag list type, the firsttime.Ql \&.Itis invoked, an attempt is made to determine an appropriatewidth.If the first argument to.Ql ".It"is a callable macro, the default width for that macro will be usedas if the macro name had been supplied as the width.However,if another item in the list is given with a different callablemacro name, a new and nested list is assumed..Sh PREDEFINED STRINGSThe following strings are predefined as may be used bypreceding with the troff string interpreting sequence.Ql \&\e*(xxwhere.Em xxis the name of the defined string or as.Ql \&\e*xwhere.Em xis the name of the string.The interpreting sequence may be used any where in the text..Pp.Bl -column "String " "Nroff " "Troff " -offset indent.It Sy "String	Nroff	Troff".It Li "<=" Ta \&<\&= Ta \*(<=.It Li ">=" Ta \&>\&= Ta \*(>=.It Li "Rq" Ta "''" Ta \*(Rq.It Li "Lq" Ta "``" Ta \*(Lq.It Li "ua" Ta ^ Ta \*(ua.It Li "aa" Ta ' Ta \*(aa.It Li "ga" Ta \` Ta \*(ga.\" .It Li "sL" Ta ` Ta \*(sL.\" .It Li "sR" Ta ' Ta \*(sR.It Li "q" Ta \&" Ta \*q.It Li "Pi" Ta pi Ta \*(Pi.It Li "Ne" Ta != Ta \*(Ne.It Li "Le" Ta <= Ta \*(Le.It Li "Ge" Ta >= Ta \*(Ge.It Li "Lt" Ta < Ta \*(Gt.It Li "Gt" Ta > Ta \*(Lt.It Li "Pm" Ta +- Ta \*(Pm.It Li "If" Ta infinity Ta \*(If.It Li "Na" Ta \fINaN\fP Ta \*(Na.It Li "Ba" Ta \fR\&|\fP Ta \*(Ba.El.Pp.Sy Note :The string named.Ql qshould be written as.Ql \e*qsince it is only one char..Sh DIAGNOSTICSThe debugging facilities for.Nm \-mdocare limited, but can help detect subtle errors suchas the collision of an argument name with an internalregister or macro name.(A what?)A register is an arithmetic storage class for.Xr troffwith a one or two character name.All registers internal to.Nm \-mdocfor.Xr troffand.Xr ditroffare two characters andof the form <upper_case><lower_case> such as.Ql \&Ar ,<lower_case><upper_case> as.Ql \&aRor<upper or lower letter><digit> as.Ql \&C\&1 .And adding to the muddle,.Xr troffhas its own internal registers all of which are eithertwo lower case characters or a dot plus a letter or meta-charactercharacter.In one of the introduction examples, it was shown how toprevent the interpretation of a macro name with the escape sequence.Ql \e& .This is sufficient for the internal register names also..Pp.\" Every callable macro name has a corresponding register.\" of the same name (<upper_case><lower_case>)..\" There are also specific registers which have.\" been used for stacks and arrays and are listed in the.\" .Sx Appendix ..\" .Bd -ragged -offset 4n.\" [A-Z][a-z]	registers corresponding to macro names (example ``Ar'').\" [a-z][A-Z]	registers corresponding to macro names (example ``aR'').\" C[0-9]		argument types (example C1).\" O[0-9]		offset stack (displays).\" h[0-9]		horizontal spacing stack (lists).\" o[0-9]		offset (stack) (lists).\" t[0-9]		tag stack (lists).\" v[0-9]		vertical spacing stack (lists).\" w[0-9]		width tag/label stack.\" .Ed.\" .PpIf a non-escaped register name is given in the argument list of a requestunpredictable behavior will occur.In general, any time huge portionsof text do not appear where expected in the output, or small stringssuch as list tags disappear, chances are there is a misunderstandingabout an argument type in the argument list.Your mother never intended for you to remember this evil stuff - so hereis a way to find out whether or not your arguments are valid: The.Ql \&.Db(debug)macro displays the interpretation of the argument list for mostmacros.Macros such as the.Ql \&.Pp(paragraph)macro do not contain debugging information.All of the callable macros do,and it is strongly advised whenever in doubt,turn on the.Ql \&.Dbmacro..Pp.Dl Usage: \&.Db [on | off].PpAn example of a portion of text withthe debug macro placed above and below anartificially created problem (a flag argument.Ql \&aCwhich should be.Ql \e&aCin order to work):.Bd -literal -offset indent\&.Db on\&.Op Fl aC Ar file )\&.Db off.Ed.PpThe resulting output:.Bd -literal -offset indentDEBUGGING ONDEBUG(argv) MACRO: `.Op'  Line #: 2	Argc: 1  Argv: `Fl'  Length: 2	Space: `'  Class: Executable	Argc: 2  Argv: `aC'  Length: 2	Space: `'  Class: Executable	Argc: 3  Argv: `Ar'  Length: 2	Space: `'  Class: Executable	Argc: 4  Argv: `file'  Length: 4	Space: ` '  Class: String	Argc: 5  Argv: `)'  Length: 1	Space: ` '  Class: Closing Punctuation or suffix	MACRO REQUEST: .Op Fl aC Ar file )DEBUGGING OFF.Ed.PpThe first line of information tells the name of the callingmacro, here.Ql \&.Op ,and the line number it appears on.If one or more files are involved(especially if text from another file is included) the line numbermay be bogus.If there is only one file, it should be accurate.The second line gives the argument count, the argument.Pq Ql \&Fland its length.If the length of an argument is two characters, theargument is tested to see if it is executable (unfortunately, anyregister which contains a non-zero value appears executable).The third line gives the space allotted for a class, and theclass type.The problem here is the argument aC should not beexecutable.The four types of classes are string, executable, closingpunctuation and opening punctuation.The last line shows the entireargument list as it was read.In this next example, the offending.Ql \&aCis escaped:.Bd -literal -offset indent\&.Db on\&.Em An escaped \e&aC\&.Db off.Ed.Bd -literal -offset indentDEBUGGING ONDEBUG(fargv) MACRO: `.Em'  Line #: 2	Argc: 1  Argv: `An'  Length: 2	Space: ` '  Class: String	Argc: 2  Argv: `escaped'  Length: 7	Space: ` '  Class: String	Argc: 3  Argv: `aC'  Length: 2	Space: ` '  Class: String	MACRO REQUEST: .Em An escaped &aCDEBUGGING OFF.Ed.PpThe argument.Ql \e&aCshows up with the same length of 2 as the.Ql \e&sequence produces a zero width, but a registernamed.Ql \e&aCwas not found and the type classified as string..PpOther diagnostics consist of usage statements and are self explanatory..Sh GROFF, TROFF AND NROFFThe.Nm \-mdocpackage does not need compatibility mode with.Xr groff ..PpThe package inhibits page breaks, and the headers and footerswhich normally occur at those breaks with.Xr nroff ,to make the manual more efficient for viewing on-line.At the moment,.Xr groffwith.Fl T Ns Ar asciidoes eject the imaginary remainder of the page at end of file.The inhibiting of the page breaks makes.Xr nroff Ns 'dfiles unsuitable for hardcopy.There is a register named.Ql \&cRwhich can be set to zero in the site dependent style file.Pa /usr/src/share/tmac/doc-nroffto restore the old style behavior..Sh FILES.Bl -tag -width /usr/share/man0/template.doc -compact.It Pa /usr/share/tmac/tmac.docmanual macro package.It Pa /usr/share/man0/template.doctemplate for writing a man page.El.Sh SEE ALSO.Xr mdoc 7 ,.Xr man 1 ,.Xr troff 1.Sh BUGSUndesirable hyphenation on the dash of a flagargument is not yet resolved, and causesoccasional mishaps in the.Sx DESCRIPTIONsection.(line break on the hyphen)..PpPredefined strings are not declared in documentation..PpSection 3f has not been added to the header routines..Pp.Ql \&.Nmfont should be changed in.Sx NAMEsection..Pp.Ql \&.Fnneeds to have a check to prevent splitting upif the line length is too short.Occasionally itseparates the last parenthesis, and sometimeslooks ridiculous if a line is in fill mode..PpThe method used to prevent header and footer pagebreaks (other than the initial header and footer) when usingnroff occasionally places an unsightly partially filled line (blank)at the would be bottom of the page..PpThe list and display macros to not do any keepsand certainly should be able to..\" Note what happens if the parameter list overlaps a newline

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -