163022Sbostic.\" Copyright (c) 1990, 1993 263022Sbostic.\" The Regents of the University of California. All rights reserved. 343435Scael.\" 448889Scael.\" %sccs.include.redist.roff% 543435Scael.\" 6*67339Sah.\" @(#)mdoc.samples.7 8.3 (Berkeley) 06/01/94 743435Scael.\" 850772Scael.\" This tutorial sampler invokes every macro in the package several 950772Scael.\" times and is guaranteed to give a worst case performance 1050363Sbostic.\" for an already extremely slow package. 1150772Scael.\" 1243435Scael.Dd 1350772Scael.Os 1443435Scael.Dt MDOC.SAMPLES 7 1543435Scael.Sh NAME 1650772Scael.Nm mdoc.samples 1750772Scael.Nd tutorial sampler for writing 1850772Scael.Bx 1950772Scaelmanuals with 2050772Scael.Nm \-mdoc 2143435Scael.Sh SYNOPSIS 2250772Scael.Nm man mdoc.samples 2343435Scael.Sh DESCRIPTION 2448888ScaelA tutorial sampler for writing 2548888Scael.Bx 2648888Scaelmanual pages with the 2743435Scael.Nm \-mdoc 2850362Scaelmacro package, a 2950362Scael.Em content Ns \-based 3050772Scaeland 3150772Scael.Em domain Ns \-based 3250362Scaelformatting 3348888Scaelpackage for 3448888Scael.Xr troff 1 . 3548888ScaelIts predecessor, the 3648888Scael.Xr \-man 7 3748888Scaelpackage, 3850785Scaeladdressed page layout leaving the 3948888Scaelmanipulation of fonts and other 4048888Scaeltypesetting details to the individual author. 4150772ScaelIn 4250772Scael.Nm \-mdoc , 4350772Scaelpage layout macros 4450772Scaelmake up the 4550772Scael.Em "page structure domain" 4650772Scaelwhich consists of macros for titles, section headers, displays 4750772Scaeland lists. Essentially items which affect the physical position 4850772Scaelof text on a formatted page. 4950772ScaelIn addition to the page structure domain, there are two more domains, 5050772Scaelthe manual domain and the general text domain. 5150772ScaelThe general text domain is defined as macros which 5250772Scaelperform tasks such as quoting or emphasizing pieces of text. 5350772ScaelThe manual domain is defined as macros that are a subset of the 5450772Scaelday to day informal language used to describe commands, routines 5550772Scaeland related 5650772Scael.Bx 5750772Scaelfiles. 5850772ScaelMacros in the manual domain handle 5950772Scaelcommand names, command line arguments and options, function names, 6050772Scaelfunction parameters, pathnames, variables, cross 6150772Scaelreferences to other manual pages, and so on. 6250772ScaelThese domain 6348888Scaelitems have value 6448888Scaelfor both the author and the future user of the manual page. 6548888ScaelIt is hoped the consistency gained 6648888Scaelacross the manual set will provide easier 6748888Scaeltranslation to future documentation tools. 6848888Scael.Pp 6965229SmckusickThroughout the 7048888Scael.Ux 7148888Scaelmanual pages, a manual entry 7248888Scaelis simply referred 7348888Scaelto as a man page, regardless of actual length and without 7448888Scaelsexist intention. 7550772Scael.Sh GETTING STARTED 7650772ScaelSince a tutorial document is normally read when a person 7750772Scaeldesires to use the material immediately, the assumption has 7850772Scaelbeen made that the user of this document may be impatient. 7950772ScaelThe material presented in the remained of this document is 8050772Scaeloutlined as follows: 8150772Scael.Bl -enum -offset indent 8250772Scael.It 8350772Scael.Tn "TROFF IDIOSYNCRASIES" 8450772Scael.Bl -tag -width flag -compact -offset indent 8565229Smckusick.It "Macro Usage" . 8665229Smckusick.It "Passing Space Characters in an Argument" . 8765229Smckusick.It "Trailing Blank Space Characters (a warning)" . 8865229Smckusick.It "Escaping Special Characters" . 8950772Scael.El 9050772Scael.It 9150772Scael.Tn "THE ANATOMY OF A MAN PAGE" 9250772Scael.Bl -tag -width flag -compact -offset indent 9365229Smckusick.It "A manual page template" . 9450772Scael.El 9550772Scael.It 9650772Scael.Tn "INTRODUCTION OF TITLE MACROS" . 9750772Scael.It 9850772Scael.Tn "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS" . 9950772Scael.Bl -tag -width flag -compact -offset indent 10065229Smckusick.It "What's in a name..." . 10165229Smckusick.It "General Syntax" . 10250772Scael.El 10350772Scael.It 10450772Scael.Tn "MANUAL DOMAIN" 10550772Scael.Bl -tag -width flag -compact -offset indent 10665229Smckusick.It "Addresses" . 10765229Smckusick.It "Arguments" . 10865229Smckusick.It "Configuration Declarations (section four only)" . 10965229Smckusick.It "Command Modifier . 11065229Smckusick.It "Defined Variables" . 11165229Smckusick.It "Errno's (Section two only)" . 11265229Smckusick.It "Environment Variables" . 11365229Smckusick.It "Function Argument" . 11465229Smckusick.It "Function Declaration" . 11565229Smckusick.It "Flags" . 11665229Smckusick.It "Functions (library routines)" . 11765229Smckusick.It "Function Types" . 11865229Smckusick.\" .It "Header File (including source code)" . 11965229Smckusick.It "Interactive Commands" . 12065229Smckusick.It "Literals" . 12165229Smckusick.It "Names" . 12265229Smckusick.It "Options" . 12365229Smckusick.It "Pathnames" . 12465229Smckusick.It "Variables" . 12565229Smckusick.It "Cross References" . 12650772Scael.El 12750772Scael.It 12850772Scael.Tn "GENERAL TEXT DOMAIN" 12950772Scael.Bl -tag -width flag -compact -offset indent 13065229Smckusick.It "AT&T Macro" . 13165229Smckusick.It "BSD Macro" . 13265229Smckusick.It "UNIX Macro" . 13365229Smckusick.It "Emphasis Macro" . 13465229Smckusick.It "Enclosure/Quoting Macros" 13550772Scael.Bl -tag -width flag -compact -offset indent 13665229Smckusick.It "Angle Bracket Quote/Enclosure" . 13765229Smckusick.It "Bracket Quotes/Enclosure" . 13865229Smckusick.It "Double Quote macro/Enclosure" . 13965229Smckusick.It "Parenthesis Quote/Enclosure" . 14065229Smckusick.It "Single Quotes/Enclosure" . 14165229Smckusick.It "Prefix Macro" . 14250772Scael.El 14365229Smckusick.It "Extended Arguments" . 14465229Smckusick.It "No\-Op or Normal Text Macro" . 14565229Smckusick.It "No Space Macro" . 14665229Smckusick.It "Section Cross References" . 14765229Smckusick.It "Symbolic Macro" . 14865229Smckusick.It "References and Citations" . 14965229Smckusick.It "Trade Names (Acronyms and Type Names)" . 15050772Scael.El 15150772Scael.It 15250772Scael.Tn "PAGE STRUCTURE DOMAIN" 15350772Scael.Bl -tag -width flag -compact -offset indent 15465229Smckusick.It "Section Headers" . 15565229Smckusick.It "Paragraphs and Line Spacing" . 15665229Smckusick.It "Keeps" . 15765229Smckusick.It "Displays" . 15865229Smckusick.It "Lists and Columns" . 15950772Scael.El 16050772Scael.It 16150772Scael.Tn "PREDEFINED STRINGS" 16250772Scael.It 16350772Scael.Tn "DIAGNOSTICS" 16450772Scael.It 16550772Scael.Tn "FORMATTING WITH GROFF, TROFF AND NROFF" 16650772Scael.It 16750772Scael.Tn "BUGS" 16850772Scael.El 16950772Scael.ne 7 17043435Scael.Sh TROFF IDIOSYNCRASIES 17148888ScaelThe 17248888Scael.Nm \-mdoc 17348888Scaelpackage attempts to simplify the process of writing a man page. 17448888ScaelTheoretically, one should not have to learn the dirty details of 17543435Scael.Xr troff 1 17648888Scaelto use 17748888Scael.Nm \-mdoc ; 17848888Scaelhowever, there are a few 17943435Scaellimitations which are unavoidable and best gotten out 18050772Scaelof the way. 18150772ScaelAnd, too, be forewarned, this package is 18248888Scael.Em not 18348888Scaelfast. 18443435Scael.Ss Macro Usage 18543435ScaelAs in 18643435Scael.Xr troff 1 , 18748888Scaela macro is called by placing a 18848888Scael.Ql \&\. 18943435Scael(dot character) 19043435Scaelat the beginning of 19143435Scaela line followed by the two character name for the macro. 19248888ScaelArguments may follow the macro separated by spaces. 19343435ScaelIt is the dot character at the beginning of the line which causes 19443435Scael.Xr troff 1 19548888Scaelto interpret the next two characters as a macro name. 19643435ScaelTo place a 19748888Scael.Ql \&\. 19843435Scael(dot character) 19943435Scaelat the beginning of a line in some context other than 20050772Scaela macro invocation, precede the 20148888Scael.Ql \&\. 20250772Scael(dot) with the 20350772Scael.Ql \e& 20450772Scaelescape sequence. 20550772ScaelThe 20650772Scael.Ql \e& 20750772Scaeltranslates literally to a zero width space, and is never displayed in the 20850772Scaeloutput. 20948888Scael.Pp 21048888ScaelIn general, 21148888Scael.Xr troff 1 21248888Scaelmacros accept up to nine arguments, any 21348888Scaelextra arguments are ignored. 21448888ScaelMost macros in 21548888Scael.Nm \-mdoc 21648888Scaelaccept nine arguments and, 21748888Scaelin limited cases, arguments may be continued or extended 21848888Scaelon the 21948888Scaelnext line (See 22050772Scael.Sx Extensions ) . 22150772ScaelA few macros handle quoted arguments (see 22248888Scael.Sx Passing Space Characters in an Argument 22348888Scaelbelow). 22450772Scael.Pp 22550772ScaelMost of the 22648888Scael.Nm \-mdoc 22750772Scaelgeneral text domain and manual domain macros are special 22850772Scaelin that their argument lists are 22950772Scael.Em parsed 23050772Scaelfor callable macro names. 23150772ScaelThis means an argument on the argument list which matches 23250772Scaela general text or manual domain macro name and is determined 23350772Scaelto be callable will be executed 23450772Scaelor called when it is processed. 23550772ScaelIn this case 23643435Scaelthe argument, although the name of a macro, 23743435Scaelis not preceded by a 23848888Scael.Ql \&\. 23950772Scael(dot). 24050772ScaelIt is in this manner that many macros are nested; for 24148888Scaelexample 24248888Scaelthe option macro, 24348888Scael.Ql \&.Op , 24448888Scaelmay 24543435Scael.Em call 24648888Scaelthe flag and argument macros, 24750772Scael.Ql \&Fl 24848888Scaeland 24950772Scael.Ql \&Ar , 25048888Scaelto specify an optional flag with an argument: 25148888Scael.Bl -tag -width "\&.Op \&Fl s \&Ar bytes" -offset indent 25248888Scael.It Op Fl s Ar bytes 25343435Scaelis produced by 25448888Scael.Li \&.Op \&Fl s \&Ar bytes 25548888Scael.El 25643435Scael.Pp 25748888ScaelTo prevent a two character 25848888Scaelstring from being interpreted as a macro name, precede 25948888Scaelthe string with the 26048888Scaelescape sequence 26148888Scael.Ql \e& : 26250785Scael.Bl -tag -width "\&.Op \&Fl s \&Ar bytes" -offset indent 26348888Scael.It Op \&Fl s \&Ar bytes 26448888Scaelis produced by 26548888Scael.Li \&.Op \e&Fl s \e&Ar bytes 26648888Scael.El 26743435Scael.Pp 26848888ScaelHere the strings 26948888Scael.Ql \&Fl 27048888Scaeland 27148888Scael.Ql \&Ar 27250785Scaelare not interpreted as macros. 27350785ScaelMacros whose argument lists are parsed for callable arguments 27450785Scaelare referred to 27550785Scaelas parsed and macros which may be called from an argument 27650785Scaellist are referred to as callable 27765229Smckusickthroughout this document and in the companion quick reference 27850785Scaelmanual 27950772Scael.Xr mdoc 7 . 28050785ScaelThis is a technical 28150785Scael.Em faux pas 28250785Scaelas almost all of the macros in 28350785Scael.Nm \-mdoc 28450785Scaelare parsed, but as it was cumbersome to constantly refer to macros 28550785Scaelas being callable and being able to call other macros, 28650785Scaelthe term parsed has been used. 28748888Scael.Ss Passing Space Characters in an Argument 28848888ScaelSometimes it is desirable to give as one argument a string 28950772Scaelcontaining one or more blank space characters. 29050772ScaelThis may be necessary 29148888Scaelto defeat the nine argument limit or to specify arguments to macros 29248888Scaelwhich expect particular arrangement of items in the argument list. 29348888ScaelFor example, 29448888Scaelthe function macro 29548888Scael.Ql \&.Fn 29648888Scaelexpects the first argument to be the name of a function and any 29750772Scaelremaining arguments to be function parameters. 29850772ScaelAs 29948888Scael.Tn "ANSI C" 30048888Scaelstipulates the declaration of function parameters in the 30148888Scaelparenthesized parameter list, each parameter is guaranteed 30250772Scaelto be at minimum a two word string. 30350772ScaelFor example, 30448888Scael.Fa int foo . 30550772Scael.Pp 30648888ScaelThere are two possible ways to pass an argument which contains 30750772Scaelan embedded space. 30850772Scael.Em Implementation note : 30950772ScaelUnfortunately, the most convenient way 31050772Scaelof passing spaces in between quotes by reassigning individual 31150772Scaelarguments before parsing was fairly expensive speed wise 31250772Scaeland space wise to implement in all the macros for 31350772Scael.Tn AT&T 31450772Scael.Xr troff . 31550772ScaelIt is not expensive for 31650772Scael.Xr groff 31750772Scaelbut for the sake of portability, has been limited 31850772Scaelto the following macros which need 31948888Scaelit the most: 32043435Scael.Pp 32148888Scael.Bl -tag -width 4n -offset indent -compact 32248888Scael.It Li \&Cd 32350772ScaelConfiguration declaration (section 4 32450772Scael.Sx SYNOPSIS ) 32548888Scael.It Li \&Bl 32648888ScaelBegin list (for the width specifier). 32748888Scael.It Li \&Em 32848888ScaelEmphasized text. 32948888Scael.It Li \&Fn 33048888ScaelFunctions (sections two and four). 33148888Scael.It Li \&It 33248888ScaelList items. 33348888Scael.It Li \&Li 33448888ScaelLiteral text. 33548888Scael.It Li \&Sy 33648888ScaelSymbolic text. 33748888Scael.It Li \&%B 33848888ScaelBook titles. 33948888Scael.It Li \&%J 34048888ScaelJournal names. 34148888Scael.It Li \&%O 34248888ScaelOptional notes for a reference. 34348888Scael.It Li \&%R 34448888ScaelReport title (in a reference). 34548888Scael.It Li \&%T 34648888ScaelTitle of article in a book or journal. 34748888Scael.El 34848888Scael.Pp 34948888ScaelOne way of passing a string 35048888Scaelcontaining blank spaces is to use the hard or unpaddable space character 35148888Scael.Ql \e\ , 35250772Scaelthat is, a blank space preceded by the escape character 35348888Scael.Ql \e . 35448888ScaelThis method may be used with any macro but has the side effect 35548888Scaelof interfering with the adjustment of text 35648888Scaelover the length of a line. 35748888Scael.Xr Troff 35848888Scaelsees the hard space as if it were any other printable character and 35948888Scaelcannot split the string into blank or newline separated pieces as one 36050772Scaelwould expect. 36150772ScaelThe method is useful for strings which are not expected 36250772Scaelto overlap a line boundary. 36350772ScaelFor example: 36448888Scael.Bl -tag -width "fetch(char *str)" -offset indent 36548888Scael.It Fn fetch char\ *str 36643435Scaelis created by 36748888Scael.Ql \&.Fn fetch char\e *str 36848888Scael.It Fn fetch "char *str" 36948888Scaelcan also be created by 37048888Scael.Ql \&.Fn fetch "\\*q*char *str\\*q" 37148888Scael.El 37248888Scael.Pp 37348888ScaelIf the 37448888Scael.Ql \e 37548888Scaelor quotes 37648888Scaelwere omitted, 37748888Scael.Ql \&.Fn 37848888Scaelwould see three arguments and 37948888Scaelthe result would be: 38048888Scael.Pp 38148888Scael.Dl Fn fetch char *str 38248888Scael.Pp 38350362ScaelFor an example of what happens when the parameter list overlaps 38450362Scaela newline boundary, see the 38550362Scael.Sx BUGS 38650362Scaelsection. 38748888Scael.Ss Trailing Blank Space Characters 38848888Scael.Xr Troff 38950772Scaelcan be confused by blank space characters at the end of a line. 39050772ScaelIt 39150772Scaelis a wise preventive measure to globally remove all blank spaces 39250772Scaelfrom <blank-space><end-of-line> character sequences. 39350772ScaelShould the need 39448888Scaelarise to force a blank character at the end of a line, 39548888Scaelit may be forced with an unpaddable space and the 39648888Scael.Ql \e& 39748888Scaelescape character. 39848888ScaelFor example, 39948888Scael.Ql string\e\ \e& . 40043435Scael.Ss Escaping Special Characters 40143435ScaelSpecial characters 40243435Scaellike the newline character 40348888Scael.Ql \en , 40443435Scaelare handled by replacing the 40548888Scael.Ql \e 40643435Scaelwith 40748888Scael.Ql \ee 40843435Scael(e.g. 40948888Scael.Ql \een ) 41043435Scaelto preserve 41143435Scaelthe backslash. 41250772Scael.Sh THE ANATOMY OF A MAN PAGE 41348888ScaelThe body of a man page is easily constructed from a basic 41448888Scaeltemplate found in the file: 41548888Scael.Bd -literal -offset indent 41650772Scael\&.\e" /usr/share/misc/man.template: 41748888Scael\&.\e" The following six lines are required. 41850772Scael\&.Dd Month day, year 41950772Scael\&.Os OPERATING_SYSTEM [version/release] 42048888Scael\&.Dt DOCUMENT_TITLE [section number] [volume] 42148888Scael\&.Sh NAME 42248888Scael\&.Sh SYNOPSIS 42348888Scael\&.Sh DESCRIPTION 42448888Scael\&.\e" The following requests should be uncommented and 42548888Scael\&.\e" used where appropriate. This next request is 42648888Scael\&.\e" for sections 2 and 3 function return values only. 42748888Scael\&.\e" .Sh RETURN VALUES 42848888Scael\&.\e" This next request is for sections 1, 6, 7 & 8 only 42948888Scael\&.\e" .Sh ENVIRONMENT 43048888Scael\&.\e" .Sh FILES 43148888Scael\&.\e" .Sh EXAMPLES 43248888Scael\&.\e" This next request is for sections 1, 6, 7 & 8 only 43348888Scael\&.\e" (command return values (to shell) and 43448888Scael\&.\e" fprintf/stderr type diagnostics) 43548888Scael\&.\e" .Sh DIAGNOSTICS 43648888Scael\&.\e" The next request is for sections 2 and 3 error 43748888Scael\&.\e" and signal handling only. 43848888Scael\&.\e" .Sh ERRORS 43948888Scael\&.\e" .Sh SEE ALSO 44048888Scael\&.\e" .Sh STANDARDS 44148888Scael\&.\e" .Sh HISTORY 44248888Scael\&.\e" .Sh AUTHORS 44348888Scael\&.\e" .Sh BUGS 44448888Scael.Ed 44548888Scael.Pp 44648888ScaelThe first items in the template are the macros 44750772Scael.Pq Li \&.Dd , \&.Os , \&.Dt ; 44850772Scaelthe document date, 44950772Scaelthe operating system the man page or subject source is developed 45050772Scaelor modified for, 45150772Scaeland the man page title 45250772Scael.Pq Em in upper case 45350772Scaelalong with the section of the manual the page 45450772Scaelbelongs in. 45550772ScaelThese macros identify the page, 45648888Scaeland are discussed below in 45748888Scael.Sx TITLE MACROS . 45848888Scael.Pp 45948888ScaelThe remaining items in the template are section headers 46048888Scael.Pq Li \&.Sh ; 46150772Scaelof which 46250772Scael.Sx NAME , 46350772Scael.Sx SYNOPSIS 46450772Scaeland 46550772Scael.Sx DESCRIPTION 46650772Scaelare mandatory. 46750772ScaelThe 46848888Scaelheaders are 46948888Scaeldiscussed in 47050772Scael.Sx PAGE STRUCTURE DOMAIN , 47148888Scaelafter 47248888Scaelpresentation of 47350772Scael.Sx MANUAL DOMAIN . 47448888ScaelSeveral content macros are used to demonstrate page layout macros; 47548888Scaelreading about content macros before page layout macros is 47648888Scaelrecommended. 47748888Scael.Sh TITLE MACROS 47850772ScaelThe title macros are the first portion of the page structure 47950772Scaeldomain, but are presented first and separate for someone who 48050772Scaelwishes to start writing a man page yesterday. 48143435ScaelThree header macros designate the document title or manual page title, 48243435Scaelthe operating system, 48348888Scaeland the date of authorship. 48443435ScaelThese macros are one called once at the very beginning of the document 48543435Scaeland are used to construct the headers and footers only. 48648888Scael.Bl -tag -width 6n 48748888Scael.It Li \&.Dt DOCUMENT_TITLE section# [volume] 48843435ScaelThe document title is the 48950772Scaelsubject of the man page and must be in 49050772Scael.Tn CAPITALS 49150772Scaeldue to troff 49243435Scaellimitations. 49348888ScaelThe section number may be 1,\ ...,\ 8, 49443435Scaeland if it is specified, 49543435Scaelthe volume title may be omitted. 49643435ScaelA volume title may be arbitrary or one of the following: 49743435Scael.\" .Cl 49843435Scael.\" USD UNIX User's Supplementary Documents 49943435Scael.\" .Cl 50050772Scael.\" PS1 UNIX Programmer's Supplementary Documents 50148888Scael.Pp 50248888Scael.Bl -column SMM -offset indent -compact 50350772Scael.It Li AMD UNIX Ancestral Manual Documents 50450772Scael.It Li SMM UNIX System Manager's Manual 50550772Scael.It Li URM UNIX Reference Manual 50650772Scael.It Li PRM UNIX Programmer's Manual 50748888Scael.El 50848888Scael.Pp 50950772ScaelThe default volume labeling is 51050772Scael.Li URM 51150772Scaelfor sections 1, 6, and 7; 51250772Scael.Li SMM 51350772Scaelfor section 8; 51450772Scael.Li PRM 51550772Scaelfor sections 2, 3, 4, and 5. 51643435Scael.\" .Cl 51743435Scael.\" MMI UNIX Manual Master Index 51843435Scael.\" .Cl 51943435Scael.\" CON UNIX Contributed Software Manual 52043435Scael.\" .Cl 52143435Scael.\" LOC UNIX Local Manual 52248888Scael.It Li \&.Os operating_system release# 52343435ScaelThe name of the operating system 52450772Scaelshould be the common acronym, e.g. 52550772Scael.Tn BSD 52650772Scaelor 52750772Scael.Tn ATT . 52850772ScaelThe release should be the standard release 52948888Scaelnomenclature for the system specified, e.g. 4.3, 4.3+Tahoe, V.3, 53050772ScaelV.4. 53150772ScaelUnrecognized arguments are displayed as given in the page footer. 53250772ScaelFor instance, a typical footer might be: 53343435Scael.Pp 53450772Scael.Dl \&.Os BSD 4.3 53550772Scael.Pp 53650772Scaelor for a locally produced set 53750772Scael.Pp 53850772Scael.Dl \&.Os CS Department 53950772Scael.Pp 54050772ScaelThe Berkeley default, 54150772Scael.Ql \&.Os 54250772Scaelwithout an argument, has been defined as 54350772Scael.Tn BSD 54450772ScaelExperimental in the 54550772Scaelsite specific file 54650772Scael.Pa /usr/src/share/tmac/doc-common . 54750772ScaelIt really should default to 54850772Scael.Tn LOCAL . 54950772ScaelNote, if the 55050772Scael.Ql \&.Os 55150772Scaelmacro is not present, the bottom left corner of the page 55250772Scaelwill be ugly. 55348888Scael.It Li \&.Dd month day, year 55443435ScaelThe date should be written formally: 55543435Scael.Pp 55650772Scael.ne 5 55743435Scael.Dl January 25, 1989 55848888Scael.El 55950772Scael.Sh MANUAL DOMAIN 56048888Scael.Ss What's in a name... 56150772ScaelThe manual domain macro names are derived from the day to day 56248888Scaelinformal language used to describe commands, subroutines and related 56350772Scaelfiles. 56450772ScaelSlightly 56548888Scaeldifferent variations of this language are used to describe 56648888Scaelthe three different aspects of writing a man page. 56748888ScaelFirst, there is the description of 56848888Scael.Nm \-mdoc 56948888Scaelmacro request usage. 57048888ScaelSecond is the description of a 57148888Scael.Ux 57248888Scaelcommand 57348888Scael.Em with 57448888Scael.Nm \-mdoc 57548888Scaelmacros and third, 57648888Scaelthe 57765229Smckusickdescription of a command to a user in the verbal sense; 57848888Scaelthat is, discussion of a command in the text of a man page. 57948888Scael.Pp 58048888ScaelIn the first case, 58148888Scael.Xr troff 1 58248888Scaelmacros are themselves a type of command; 58348888Scaelthe general syntax for a troff command is: 58448888Scael.Bd -filled -offset indent 58548888Scael\&.Va argument1 argument2 ... argument9 58648888Scael.Ed 58748888Scael.Pp 58848888ScaelThe 58948888Scael.Ql \&.Va 59048888Scaelis a macro command or request, and anything following it is an argument to 59148888Scaelbe processed. 59248888ScaelIn the second case, 59348888Scaelthe description of a 59448888Scael.Ux 59548888Scaelcommand using the content macros is a 59648888Scaelbit more involved; 59750772Scaela typical 59850772Scael.Sx SYNOPSIS 59950772Scaelcommand line might be displayed as: 60048888Scael.Bd -filled -offset indent 60148888Scael.Nm filter 60248888Scael.Op Fl flag 60348888Scael.Ar infile outfile 60448888Scael.Ed 60548888Scael.Pp 60648888ScaelHere, 60748888Scael.Nm filter 60848888Scaelis the command name and the 60948888Scaelbracketed string 61048888Scael.Fl flag 61148888Scaelis a 61248888Scael.Em flag 61348888Scaelargument designated as optional by the option brackets. 61448888ScaelIn 61548888Scael.Nm \-mdoc 61648888Scaelterms, 61748888Scael.Ar infile 61843435Scaeland 61948888Scael.Ar outfile 62048888Scaelare 62148888Scaelcalled 62248888Scael.Em arguments . 62348888ScaelThe macros which formatted the above example: 62450362Scael.Bd -literal -offset indent 62550362Scael\&.Nm filter 62650362Scael\&.Op \&Fl flag 62750362Scael\&.Ar infile outfile 62848888Scael.Ed 62948888Scael.Pp 63048888ScaelIn the third case, discussion of commands and command syntax 63150772Scaelincludes both examples above, but may add more detail. 63250772ScaelThe 63348888Scaelarguments 63448888Scael.Ar infile 63548888Scaeland 63648888Scael.Ar outfile 63750772Scaelfrom the example above might be referred to as 63848888Scael.Em operands 63948888Scaelor 64048888Scael.Em file arguments . 64148888ScaelSome command line argument lists are quite long: 64248888Scael.Bl -tag -width make -offset indent 64348888Scael.It Nm make 64448888Scael.Op Fl eiknqrstv 64548888Scael.Op Fl D Ar variable 64648888Scael.Op Fl d Ar flags 64748888Scael.Op Fl f Ar makefile 64850772Scael.Bk -words 64948888Scael.Op Fl I Ar directory 65050772Scael.Ek 65148888Scael.Op Fl j Ar max_jobs 65248888Scael.Op Ar variable=value 65350772Scael.Bk -words 65450772Scael.Op Ar target ... 65550772Scael.Ek 65648888Scael.El 65748888Scael.Pp 65848888ScaelHere one might talk about the command 65948888Scael.Nm make 66048888Scaeland qualify the argument 66148888Scael.Ar makefile , 66248888Scaelas an argument to the flag, 66348888Scael.Fl f , 66448888Scaelor discuss the optional 66548888Scaelfile 66648888Scaeloperand 66748888Scael.Ar target . 66848888ScaelIn the verbal context, such detail can prevent confusion, 66948888Scaelhowever the 67048888Scael.Nm \-mdoc 67148888Scaelpackage 67248888Scaeldoes not have a macro for an argument 67348888Scael.Em to 67448888Scaela flag. 67548888ScaelInstead the 67648888Scael.Ql \&Ar 67748888Scaelargument macro is used for an operand or file argument like 67848888Scael.Ar target 67948888Scaelas well as an argument to a flag like 68050772Scael.Ar variable . 68150772ScaelThe make command line was produced from: 68248888Scael.Bd -literal -offset indent 68348888Scael\&.Nm make 68448888Scael\&.Op Fl eiknqrstv 68548888Scael\&.Op Fl D Ar variable 68648888Scael\&.Op Fl d Ar flags 68748888Scael\&.Op Fl f Ar makefile 68848888Scael\&.Op Fl I Ar directory 68948888Scael\&.Op Fl j Ar max_jobs 69048888Scael\&.Op Ar variable=value 69150772Scael\&.Bk -words 69248888Scael\&.Op Ar target ... 69350772Scael\&.Ek 69448888Scael.Ed 69550772Scael.Pp 69650772ScaelThe 69750772Scael.Ql \&.Bk 69850772Scaeland 69950772Scael.Ql \&.Ek 70050785Scaelmacros are explained in 70150772Scael.Sx Keeps . 70248888Scael.Ss General Syntax 70350772ScaelThe manual domain and general text domain macros share a similar 70448888Scaelsyntax with a few minor deviations: 70548888Scael.Ql \&.Ar , 70648888Scael.Ql \&.Fl , 70748888Scael.Ql \&.Nm , 70848888Scaeland 70948888Scael.Ql \&.Pa 71048888Scaeldiffer only when called without arguments; 71148888Scael.Ql \&.Fn 71248888Scaeland 71348888Scael.Ql \&.Xr 71448888Scaelimpose an order on their argument lists 71548888Scaeland the 71650772Scael.Ql \&.Op 71748888Scaeland 71850772Scael.Ql \&.Fn 71948888Scaelmacros 72050772Scaelhave nesting limitations. 72150772ScaelAll content macros 72250772Scaelare capable of recognizing and properly handling punctuation, 72350772Scaelprovided each punctuation character is separated by a leading space. 72450772ScaelIf an request is given: 72550772Scael.Pp 72650772Scael.Dl \&.Li sptr, ptr), 72750772Scael.Pp 72850772ScaelThe result is: 72950772Scael.Pp 73050772Scael.Dl Li sptr, ptr), 73150772Scael.Pp 73250772ScaelThe punctuation is not recognized and all is output in the 73350772Scaelliteral font. If the punctuation is separated by a leading 73450772Scaelwhite space: 73550772Scael.Pp 73650772Scael.Dl \&.Li "sptr , ptr ) ," 73750772Scael.Pp 73850772ScaelThe result is: 73950772Scael.Pp 74050772Scael.Dl Li sptr , ptr ) , 74150772Scael.Pp 74250772ScaelThe punctuation is now recognized and is output in the 74350772Scaeldefault font distinguishing it from the strings in literal font. 74450772Scael.Pp 74550772ScaelTo remove the special meaning from a punctuation character 74650772Scaelescape it with 74750772Scael.Ql \e& . 74850772Scael.Xr Troff 74950772Scaelis limited as a macro language, and has difficulty 75050772Scaelwhen presented with a string containing 75150772Scaela member of the mathematical, logical or 75248888Scaelquotation set: 75350772Scael.Bd -literal -offset indent-two 75450772Scael\&{+,\-,/,*,\&%,<,>,<=,>=,=,==,&,`,',"} 75548888Scael.Ed 75650772Scael.Pp 75750772ScaelThe problem is that 75850772Scael.Xr troff 75950772Scaelmay assume it is supposed to actually perform the operation 76050772Scaelor evaluation suggested by the characters. To prevent 76150772Scaelthe accidental evaluation of these characters, 76250772Scaelescape them with 76348888Scael.Ql \e& . 76448888ScaelTypical syntax is shown in the first content macro displayed 76548888Scaelbelow, 76650772Scael.Ql \&.Ad . 76748888Scael.Ss Address Macro 76850772ScaelThe address macro identifies an address construct 76943435Scaelof the form addr1[,addr2[,addr3]]. 77043435Scael.Pp 77148888Scael.Dl Usage: .Ad address ... \*(Pu 77248888Scael.Bl -tag -width ".Ad f1 , f2 , f3 :" -compact -offset 14n 77348888Scael.It Li \&.Ad addr1 77443435Scael.Ad addr1 77548888Scael.It Li \&.Ad addr1\ . 77643435Scael.Ad addr1 . 77748888Scael.It Li \&.Ad addr1\ , file2 77843435Scael.Ad addr1 , file2 77948888Scael.It Li \&.Ad f1\ , f2\ , f3\ : 78043435Scael.Ad f1 , f2 , f3 : 78148888Scael.It Li \&.Ad addr\ )\ )\ , 78243435Scael.Ad addr ) ) , 78348888Scael.El 78448888Scael.Pp 78543435ScaelIt is an error to call 78643435Scael.Li \&.Ad 78743435Scaelwithout arguments. 78848888Scael.Li \&.Ad 78950785Scaelis callable by other macros and is parsed. 79048888Scael.Ss Argument Macro 79143435ScaelThe 79243435Scael.Li \&.Ar 79348888Scaelargument macro may be used whenever 79443435Scaela command line argument is referenced. 79543435Scael.Pp 79643435Scael.Dl Usage: .Ar argument ... \*(Pu 79748888Scael.Bl -tag -width ".Ar file1 file2" -compact -offset 15n 79848888Scael.It Li \&.Ar 79943435Scael.Ar 80048888Scael.It Li \&.Ar file1 80143435Scael.Ar file1 80248888Scael.It Li \&.Ar file1\ . 80343435Scael.Ar file1 . 80448888Scael.It Li \&.Ar file1 file2 80543435Scael.Ar file1 file2 80648888Scael.It Li \&.Ar f1 f2 f3\ : 80743435Scael.Ar f1 f2 f3 : 80848888Scael.It Li \&.Ar file\ )\ )\ , 80943435Scael.Ar file ) ) , 81048888Scael.El 81143435Scael.Pp 81243435ScaelIf 81343435Scael.Li \&.Ar 81448888Scaelis called without arguments 81548888Scael.Ql Ar 81650772Scaelis assumed. 81750772ScaelThe 81843435Scael.Li \&.Ar 81950785Scaelmacro is parsed and is callable. 82048888Scael.Ss Configuration Declaration (section four only) 82148888ScaelThe 82248888Scael.Ql \&.Cd 82348888Scaelmacro is used to demonstrate a 82448888Scael.Xr config 8 82548888Scaeldeclaration for a device interface in a section four manual. 82648888ScaelThis macro accepts quoted arguments (double quotes only). 82748888Scael.Pp 82848888Scael.Bl -tag -width "device le0 at scode?" -offset indent 82948888Scael.It Cd "device le0 at scode?" 83048888Scaelproduced by: 83148888Scael.Ql ".Cd device le0 at scode?" . 83248888Scael.El 83348888Scael.Ss Command Modifier 83448888ScaelThe command modifier is identical to the 83548888Scael.Ql \&.Fl 83648888Scael(flag) command with the exception 83748888Scaelthe 83848888Scael.Ql \&.Cm 83948888Scaelmacro does not assert a dash 84050772Scaelin front of every argument. 84150772ScaelTraditionally flags are marked by the 84248888Scaelpreceding dash, some commands or subsets of commands do not use them. 84348888ScaelCommand modifiers may also be specified in conjunction with interactive 84448888Scaelcommands such as editor commands. 84548888ScaelSee 84648888Scael.Sx Flags . 84748888Scael.Ss Defined Variables 84848888ScaelA variable which is defined in an include file is specified 84948888Scaelby the macro 85048888Scael.Ql \&.Dv . 85143435Scael.Pp 85248888Scael.Dl Usage: .Dv defined_variable ... \*(Pu 85348888Scael.Bl -tag -width ".Dv MAXHOSTNAMELEN" -compact -offset 14n 85448888Scael.It Li ".Dv MAXHOSTNAMELEN" 85548888Scael.Dv MAXHOSTNAMELEN 85648888Scael.It Li ".Dv TIOCGPGRP )" 85748888Scael.Dv TIOCGPGRP ) 85848888Scael.El 85948888Scael.Pp 86048888ScaelIt is an error to call 86148888Scael.Ql \&.Dv 86248888Scaelwithout arguments. 86348888Scael.Ql \&.Dv 86450785Scaelis parsed and is callable. 86548888Scael.Ss Errno's (Section two only) 86643435ScaelThe 86748888Scael.Ql \&.Er 86848888Scaelerrno macro specifies the error return value 86950772Scaelfor section two library routines. 87050772ScaelThe second example 87143435Scaelbelow shows 87248888Scael.Ql \&.Er 87343435Scaelused with the 87448888Scael.Ql \&.Bq 87550772Scaelgeneral text domain macro, as it would be used in 87648888Scaela section two manual page. 87743435Scael.Pp 87843435Scael.Dl Usage: .Er ERRNOTYPE ... \*(Pu 87948888Scael.Bl -tag -width ".Bq Er ENOTDIR" -compact -offset 14n 88048888Scael.It Li \&.Er ENOENT 88143435Scael.Er ENOENT 88248888Scael.It Li \&.Er ENOENT\ )\ ; 88348888Scael.Er ENOENT ) ; 88448888Scael.It Li \&.Bq \&Er ENOTDIR 88548888Scael.Bq Er ENOTDIR 88648888Scael.El 88743435Scael.Pp 88843435ScaelIt is an error to call 88948888Scael.Ql \&.Er 89043435Scaelwithout arguments. 89148888ScaelThe 89248888Scael.Ql \&.Er 89350785Scaelmacro is parsed and is callable. 89443435Scael.Ss Environment Variables 89543435ScaelThe 89648888Scael.Ql \&.Ev 89765229Smckusickmacro specifies an environment variable. 89843435Scael.Pp 89943435Scael.Dl Usage: .Ev argument ... \*(Pu 90048888Scael.Bl -tag -width ".Ev PRINTER ) ) ," -compact -offset 14n 90148888Scael.It Li \&.Ev DISPLAY 90243435Scael.Ev DISPLAY 90348888Scael.It Li \&.Ev PATH\ . 90443435Scael.Ev PATH . 90548888Scael.It Li \&.Ev PRINTER\ )\ )\ , 90643435Scael.Ev PRINTER ) ) , 90748888Scael.El 90843435Scael.Pp 90943435ScaelIt is an error to call 91048888Scael.Ql \&.Ev 91143435Scaelwithout arguments. 91248888ScaelThe 91348888Scael.Ql \&.Ev 91450785Scaelmacro is parsed and is callable. 91548888Scael.Ss Function Argument 91648888ScaelThe 91748888Scael.Ql \&.Fa 91848888Scaelmacro is used to refer to function arguments (parameters) 91950772Scaeloutside of the 92050772Scael.Sx SYNOPSIS 92150772Scaelsection of the manual or inside 92250772Scaelthe 92350772Scael.Sx SYNOPSIS 92450772Scaelsection should a parameter list be too 92548888Scaellong for the 92648888Scael.Ql \&.Fn 92748888Scaelmacro and the enclosure macros 92848888Scael.Ql \&.Fo 92948888Scaeland 93048888Scael.Ql \&.Fc 93148888Scaelmust be used. 93248888Scael.Ql \&.Fa 93348888Scaelmay also be used to refer to structure members. 93448888Scael.Pp 93548888Scael.Dl Usage: .Fa function_argument ... \*(Pu 93648888Scael.Bl -tag -width ".Fa d_namlen\ )\ )\ ," -compact -offset 14n 93748888Scael.It Li \&.Fa d_namlen\ )\ )\ , 93848888Scael.Fa d_namlen ) ) , 93948888Scael.It Li \&.Fa iov_len 94048888Scael.Fa iov_len 94148888Scael.El 94248888Scael.Pp 94348888ScaelIt is an error to call 94448888Scael.Ql \&.Fa 94548888Scaelwithout arguments. 94648888Scael.Ql \&.Fa 94750785Scaelis parsed and is callable. 94848888Scael.Ss Function Declaration 94948888ScaelThe 95048888Scael.Ql \&.Fd 95150772Scaelmacro is used in the 95250772Scael.Sx SYNOPSIS 95350772Scaelsection with section two or three 95450772Scaelfunctions. 95550772ScaelThe 95648888Scael.Ql \&.Fd 95748888Scaelmacro does not call other macros and is not callable by other 95848888Scaelmacros. 95948888Scael.Pp 96048888Scael.Dl Usage: .Fd include_file (or defined variable) 96148888Scael.Pp 96250772ScaelIn the 96350772Scael.Sx SYNOPSIS 96450772Scaelsection a 96548888Scael.Ql \&.Fd 96648888Scaelrequest causes a line break if a function has already been presented 96750772Scaeland a break has not occurred. 96850772ScaelThis leaves a nice vertical space 96948888Scaelin between the previous function call and the declaration for the 97048888Scaelnext function. 97143435Scael.Ss Flags 97243435ScaelThe 97348888Scael.Ql \&.Fl 97450772Scaelmacro handles command line flags. 97550772ScaelIt prepends 97643435Scaela dash, 97748888Scael.Ql \- , 97850772Scaelto the flag. 97950772ScaelFor interactive command flags, which 98043435Scaelare not prepended with a dash, the 98148888Scael.Ql \&.Cm 98248888Scael(command modifier) 98365229Smckusickmacro is identical, but without the dash. 98443435Scael.Pp 98543435Scael.Dl Usage: .Fl argument ... \*(Pu 98648888Scael.Bl -tag -width ".Fl \-s \-t \-v" -compact -offset 14n 98748888Scael.It Li \&.Fl 98843435Scael.Fl 98948888Scael.It Li \&.Fl cfv 99043435Scael.Fl cfv 99148888Scael.It Li \&.Fl cfv\ . 99243435Scael.Fl cfv . 99348888Scael.It Li \&.Fl s v t 99443435Scael.Fl s v t 99548888Scael.It Li \&.Fl -\ , 99643435Scael.Fl - , 99748888Scael.It Li \&.Fl xyz\ )\ , 99843435Scael.Fl xyz ) , 99948888Scael.El 100043435Scael.Pp 100143435ScaelThe 100248888Scael.Ql \&.Fl 100348888Scaelmacro without any arguments results 100448888Scaelin a dash representing stdin/stdout. 100543435ScaelNote that giving 100648888Scael.Ql \&.Fl 100743435Scaela single dash, will result in two dashes. 100848888ScaelThe 100948888Scael.Ql \&.Fl 101050785Scaelmacro is parsed and is callable. 101143435Scael.Ss Functions (library routines) 101248888ScaelThe .Fn macro is modeled on ANSI C conventions. 101348888Scael.Bd -literal 101450772ScaelUsage: .Fn [type] function [[type] parameters ... \*(Pu] 101548888Scael.Ed 101650362Scael.Bl -tag -width ".Fn .int align. .const * char *sptrsxx" -compact 101748888Scael.It Li "\&.Fn getchar" 101843435Scael.Fn getchar 101948888Scael.It Li "\&.Fn strlen ) ," 102043435Scael.Fn strlen ) , 102148888Scael.It Li \&.Fn "\\*qint align\\*q" "\\*qconst * char *sptrs\\*q" , 102248888Scael.Fn "int align" "const * char *sptrs" , 102348888Scael.El 102443435Scael.Pp 102543435ScaelIt is an error to call 102648888Scael.Ql \&.Fn 102743435Scaelwithout any arguments. 102848888ScaelThe 102948888Scael.Ql \&.Fn 103048888Scaelmacro 103150772Scaelis parsed and is callable, 103248888Scaelnote that any call to another macro signals the end of 103348888Scaelthe 103448888Scael.Ql \&.Fn 103550772Scaelcall (it will close-parenthesis at that point). 103648888Scael.Pp 103750772ScaelFor functions that have more than eight parameters (and this 103850772Scaelis rare), the 103950772Scaelmacros 104050772Scael.Ql \&.Fo 104150772Scael(function open) 104250772Scaeland 104350772Scael.Ql \&.Fc 104450772Scael(function close) 104550772Scaelmay be used with 104650772Scael.Ql \&.Fa 104750772Scael(function argument) 104850772Scaelto get around the limitation. For example: 104950772Scael.Bd -literal -offset indent 105050772Scael\&.Fo "int res_mkquery" 105150772Scael\&.Fa "int op" 105250772Scael\&.Fa "char *dname" 105350772Scael\&.Fa "int class" 105450772Scael\&.Fa "int type" 105550772Scael\&.Fa "char *data" 105650772Scael\&.Fa "int datalen" 105750772Scael\&.Fa "struct rrec *newrr" 105850772Scael\&.Fa "char *buf" 105950772Scael\&.Fa "int buflen" 106050772Scael\&.Fc 106150772Scael.Ed 106250772Scael.Pp 106350772ScaelProduces: 106450772Scael.Bd -filled -offset indent 106550772Scael.Fo "int res_mkquery" 106650772Scael.Fa "int op" 106750772Scael.Fa "char *dname" 106850772Scael.Fa "int class" 106950772Scael.Fa "int type" 107050772Scael.Fa "char *data" 107150772Scael.Fa "int datalen" 107250772Scael.Fa "struct rrec *newrr" 107350772Scael.Fa "char *buf" 107450772Scael.Fa "int buflen" 107550772Scael.Fc 107650772Scael.Ed 107750772Scael.Pp 107850772ScaelThe 107950772Scael.Ql \&.Fo 108050772Scaeland 108150772Scael.Ql \&.Fc 108250772Scaelmacros are parsed and are callable. 108350772ScaelIn the 108450772Scael.Sx SYNOPSIS 108550772Scaelsection, the function will always begin at 108650772Scaelthe beginning of line. 108750772ScaelIf there is more than one function 108850772Scaelpresented in the 108950772Scael.Sx SYNOPSIS 109050772Scaelsection and a function type has not been 109148888Scaelgiven, a line break will occur, leaving a nice vertical space 109248888Scaelbetween the current function name and the one prior. 109343435ScaelAt the moment, 109448888Scael.Ql \&.Fn 109543435Scaeldoes not check its word boundaries 109648888Scaelagainst troff line lengths and may split across a newline 109750772Scaelungracefully. 109850772ScaelThis will be fixed in the near future. 109948888Scael.Ss Function Type 110050772ScaelThis macro is intended for the 110150772Scael.Sx SYNOPSIS 110250772Scaelsection. 110350772ScaelIt may be used 110450772Scaelanywhere else in the man page without problems, but its main purpose 110550772Scaelis to present the function type in kernel normal form for the 110650772Scael.Sx SYNOPSIS 110748888Scaelof sections two and three 110848888Scael(it causes a page break allowing the function name to appear 110948888Scaelon the next line). 111048888Scael.Pp 111148888Scael.Dl Usage: .Ft type ... \*(Pu 111248888Scael.Bl -tag -width "\&.Ft struct stat" -offset 14n -compact 111348888Scael.It Li \&.Ft struct stat 111448888Scael.Ft struct stat 111548888Scael.El 111648888Scael.Pp 111743435ScaelThe 111848888Scael.Ql \&.Ft 111948888Scaelrequest is not callable by other macros. 112048888Scael.Ss Interactive Commands 112148888ScaelThe 112248888Scael.Ql \&.Ic 112348888Scaelmacro designates an interactive or internal command. 112448888Scael.Pp 112548888Scael.Dl Usage: .Li argument ... \*(Pu 112650785Scael.Bl -tag -width ".Ic setenv , unsetenvxx" -compact -offset 14n 112748888Scael.It Li \&.Ic :wq 112848888Scael.Ic :wq 112948888Scael.It Li \&.Ic do while {...} 113048888Scael.Ic do while {...} 113148888Scael.It Li \&.Ic setenv\ , unsetenv 113248888Scael.Ic setenv , unsetenv 113348888Scael.El 113448888Scael.Pp 113548888ScaelIt is an error to call 113648888Scael.Ql \&.Ic 113748888Scaelwithout arguments. 113848888ScaelThe 113948888Scael.Ql \&.Ic 114050785Scaelmacro is parsed and is callable. 114143435Scael.Ss Literals 114243435ScaelThe 114348888Scael.Ql \&.Li 114448888Scaelliteral macro may be used for special characters, 114543435Scaelvariable constants, anything which should be displayed as it 114643435Scaelwould be typed. 114743435Scael.Pp 114843435Scael.Dl Usage: .Li argument ... \*(Pu 114948888Scael.Bl -tag -width ".Li cntrl-D ) ," -compact -offset 14n 115048888Scael.It Li \&.Li \een 115143435Scael.Li \en 115248888Scael.It Li \&.Li M1 M2 M3\ ; 115343435Scael.Li M1 M2 M3 ; 115448888Scael.It Li \&.Li cntrl-D\ )\ , 115543435Scael.Li cntrl-D ) , 115648888Scael.It Li \&.Li 1024\ ... 115743435Scael.Li 1024 ... 115848888Scael.El 115943435Scael.Pp 116043435ScaelThe 116148888Scael.Ql \&.Li 116250785Scaelmacro is parsed and is callable. 116348888Scael.Ss Name Macro 116448888ScaelThe 116548888Scael.Ql \&.Nm 116648888Scaelmacro is used for the document title or subject name. 116748888ScaelIt has the peculiarity of remembering the first 116843435Scaelargument it was called with, which should 116950772Scaelalways be the subject name of the page. 117050772ScaelWhen called without 117143435Scaelarguments, 117248888Scael.Ql \&.Nm 117343435Scaelregurgitates this initial name for the sole purpose 117443435Scaelof making less work for the author. 117548888ScaelNote: 117648888Scaela section two 117743435Scaelor three document function name is addressed with the 117848888Scael.Ql \&.Nm 117950772Scaelin the 118050772Scael.Sx NAME 118150772Scaelsection, and with 118248888Scael.Ql \&.Fn 118350772Scaelin the 118450772Scael.Sx SYNOPSIS 118548888Scaeland remaining sections. 118643435ScaelFor interactive commands, such as the 118748888Scael.Ql while 118843435Scaelcommand keyword in 118943435Scael.Xr csh 1 , 119043435Scaelthe 119148888Scael.Ql \&.Ic 119248888Scaelmacro should be used. 119343435ScaelWhile the 119448888Scael.Ql \&.Ic 119543435Scaelis nearly identical 119643435Scaelto 119748888Scael.Ql \&.Nm , 119843435Scaelit can not recall the first argument it was invoked with. 119943435Scael.Pp 120043435Scael.Dl Usage: .Nm argument ... \*(Pu 120148888Scael.Bl -tag -width ".Nm mdoc.sample" -compact -offset 14n 120248888Scael.It Li \&.Nm mdoc.sample 120343435Scael.Nm mdoc.sample 120450785Scael.It Li \&.Nm \e-mdoc 120543435Scael.Nm \-mdoc . 120648888Scael.It Li \&.Nm foo\ )\ )\ , 120743435Scael.Nm foo ) ) , 120848888Scael.It Li \&.Nm 120943435Scael.Nm 121048888Scael.El 121143435Scael.Pp 121243435ScaelThe 121348888Scael.Ql \&.Nm 121450785Scaelmacro is parsed and is callable. 121548888Scael.Ss Options 121648888ScaelThe 121748888Scael.Ql \&.Op 121848888Scaelmacro 121948888Scaelplaces option brackets around the any remaining arguments on the command 122048888Scaelline, and places any 122150772Scaeltrailing punctuation outside the brackets. 122250772ScaelThe macros 122348888Scael.Ql \&.Oc 122448888Scaeland 122548888Scael.Ql \&.Oo 122648888Scaelmay be used across one or more lines. 122748888Scael.Pp 122848888Scael.Dl Usage: .Op options ... \*(Pu 122948888Scael.Bl -tag -width ".Op Fl c Ar objfil Op Ar corfil ," -compact -offset indent 123048888Scael.It Li \&.Op 123148888Scael.Op 123248888Scael.It Li ".Op Fl k" 123348888Scael.Op Fl k 123448888Scael.It Li ".Op Fl k ) ." 123548888Scael.Op Fl k ) . 123648888Scael.It Li ".Op Fl k Ar kookfile" 123748888Scael.Op Fl k Ar kookfile 123848888Scael.It Li ".Op Fl k Ar kookfile ," 123948888Scael.Op Fl k Ar kookfile , 124048888Scael.It Li ".Op Ar objfil Op Ar corfil" 124148888Scael.Op Ar objfil Op Ar corfil 124248888Scael.It Li ".Op Fl c Ar objfil Op Ar corfil ," 124348888Scael.Op Fl c Ar objfil Op Ar corfil , 124448888Scael.It Li \&.Op word1 word2 124548888Scael.Op word1 word2 124648888Scael.El 124748888Scael.Pp 124848888ScaelThe 124948888Scael.Ql \&.Oc 125048888Scaeland 125148888Scael.Ql \&.Oo 125248888Scaelmacros: 125348888Scael.Bd -literal -offset indent 125448888Scael\&.Oo 125548888Scael\&.Op \&Fl k \&Ar kilobytes 125648888Scael\&.Op \&Fl i \&Ar interval 125748888Scael\&.Op \&Fl c \&Ar count 125848888Scael\&.Oc 125948888Scael.Ed 126048888Scael.Pp 126148888ScaelProduce: 126248888Scael.Oo 126348888Scael.Op Fl k Ar kilobytes 126448888Scael.Op Fl i Ar interval 126548888Scael.Op Fl c Ar count 126648888Scael.Oc 126748888Scael.Pp 126848888ScaelThe macros 126948888Scael.Ql \&.Op , 127048888Scael.Ql \&.Oc 127148888Scaeland 127248888Scael.Ql \&.Oo 127350785Scaelare parsed and are callable. 127443435Scael.Ss Pathnames 127543435ScaelThe 127648888Scael.Ql \&.Pa 127748888Scaelmacro formats path or file names. 127843435Scael.Pp 127943435Scael.Dl Usage: .Pa pathname \*(Pu 128048888Scael.Bl -tag -width ".Pa /tmp/fooXXXXX ) ." -compact -offset 14n 128148888Scael.It Li \&.Pa /usr/share 128243435Scael.Pa /usr/share 128348888Scael.It Li \&.Pa /tmp/fooXXXXX\ )\ . 128443435Scael.Pa /tmp/fooXXXXX ) . 128548888Scael.El 128643435Scael.Pp 128748888ScaelThe 128848888Scael.Ql \&.Pa 128950785Scaelmacro is parsed and is callable. 129050772Scael.Ss Variables 129150772ScaelGeneric variable reference: 129250772Scael.Pp 129350772Scael.Dl Usage: .Va variable ... \*(Pu 129450772Scael.Bl -tag -width ".Va char s ] ) ) ," -compact -offset 14n 129550772Scael.It Li \&.Va count 129650772Scael.Va count 129750772Scael.It Li \&.Va settimer , 129850772Scael.Va settimer , 129950772Scael.It Li \&.Va int\ *prt\ )\ : 130050772Scael.Va int\ *prt ) : 130150772Scael.It Li \&.Va char\ s\ ]\ )\ )\ , 130250772Scael.Va char\ s ] ) ) , 130350772Scael.El 130450772Scael.Pp 130550772ScaelIt is an error to call 130650772Scael.Ql \&.Va 130750772Scaelwithout any arguments. 130848888ScaelThe 130950772Scael.Ql \&.Va 131050785Scaelmacro is parsed and is callable. 131150772Scael.Ss Manual Page Cross References 131250772ScaelThe 131350772Scael.Ql \&.Xr 131450772Scaelmacro expects the first argument to be 131550772Scaela manual page name, and the second argument, if it exists, 131650772Scaelto be either a section page number or punctuation. 131750772ScaelAny 131850772Scaelremaining arguments are assumed to be punctuation. 131948888Scael.Pp 132050772Scael.Dl Usage: .Xr man_page [1,...,8] \*(Pu 132150772Scael.Bl -tag -width ".Xr mdoc 7 ) ) ," -compact -offset 14n 132250772Scael.It Li \&.Xr mdoc 132350772Scael.Xr mdoc 132450772Scael.It Li \&.Xr mdoc\ , 132550772Scael.Xr mdoc , 132650772Scael.It Li \&.Xr mdoc 7 132750772Scael.Xr mdoc 7 132850772Scael.It Li \&.Xr mdoc 7\ )\ )\ , 132950772Scael.Xr mdoc 7 ) ) , 133050772Scael.El 133150772Scael.Pp 133250772ScaelThe 133350772Scael.Ql \&.Xr 133450785Scaelmacro is parsed and is callable. 133550772ScaelIt is an error to call 133650772Scael.Ql \&.Xr 133750772Scaelwithout 133850772Scaelany arguments. 133950772Scael.Sh GENERAL TEXT DOMAIN 134050772Scael.Ss AT&T Macro 134150772Scael.Bd -literal -offset indent -compact 134250772ScaelUsage: .At [v6 | v7 | 32v | V.1 | V.4] ... \*(Pu 134350772Scael.Ed 134450772Scael.Bl -tag -width ".At v6 ) ," -compact -offset 14n 134550772Scael.It Li ".At" 134650772Scael.At 134750772Scael.It Li ".At v6 ." 134850772Scael.At v6 . 134950772Scael.El 135050772Scael.Pp 135150772ScaelThe 135250772Scael.Ql \&.At 135350772Scaelmacro is 135450772Scael.Em not 135550772Scaelparsed and 135650772Scael.Em not 135750772Scaelcallable. It accepts at most two arguments. 135850772Scael.Ss BSD Macro 135950772Scael.Dl Usage: .Bx [Version/release] ... \*(Pu 136050772Scael.Bl -tag -width ".Bx 4.3 ) ," -compact -offset 14n 136150772Scael.It Li ".Bx" 136250772Scael.Bx 136350772Scael.It Li ".Bx 4.3 ." 136450772Scael.Bx 4.3 . 136550772Scael.El 136650772Scael.Pp 136750772ScaelThe 136850772Scael.Ql \&.Bx 136950772Scaelmacro is parsed and is callable. 137050772Scael.Ss UNIX Macro 137150772Scael.Dl Usage: .Ux ... \*(Pu 137250772Scael.Bl -tag -width ".Ux 4.3 ) ," -compact -offset 14n 137350772Scael.It Li ".Ux" 137450772Scael.Ux 137550772Scael.El 137650772Scael.Pp 137750772ScaelThe 137850772Scael.Ql \&.Ux 137950772Scaelmacro is parsed and is callable. 138050772Scael.Ss Emphasis Macro 138150772ScaelText may be stressed or emphasized with the 138250772Scael.Ql \&.Em 138350772Scaelmacro. 138450772ScaelThe usual font for emphasis is italic. 138550772Scael.Pp 138650772Scael.Dl Usage: .Em argument ... \*(Pu 138750772Scael.Bl -tag -width ".Em vide infra ) ) ," -compact -offset 14n 138850772Scael.It Li ".Em does not" 138950772Scael.Em does not 139050772Scael.It Li ".Em exceed 1024 ." 139150772Scael.Em exceed 1024 . 139250772Scael.It Li ".Em vide infra ) ) ," 139350772Scael.Em vide infra ) ) , 139450772Scael.El 139550772Scael.\" .Pp 139650785Scael.\" The emphasis can be forced across several lines of text by using 139750785Scael.\" the 139850785Scael.\" .Ql \&.Bf 139950785Scael.\" macro discussed in 140050785Scael.\" .Sx Modes 140150785Scael.\" under 140250785Scael.\" .Sx PAGE STRUCTURE DOMAIN . 140350785Scael.\" .Pp 140450785Scael.\" .Bf -emphasis 140550772Scael.\" We are certain the reason most people desire a Harvard MBA 140650772Scael.\" so they can become to be successful philanthropists. Only 140750772Scael.\" mathematicians and physicists go to graduate school strictly 140850772Scael.\" to acquire infinite wealthy and fame. Its that inifinity 140950772Scael.\" word that does it to them. Ruins them. 141050785Scael.\" .Ef 141150772Scael.Pp 141250772ScaelThe 141350772Scael.Ql \&.Em 141450785Scaelmacro is parsed and is callable. 141550772ScaelIt is an error to call 141650772Scael.Ql \&.Em 141750772Scaelwithout arguments. 141850772Scael.Ss Enclosure and Quoting Macros 141950772ScaelThe concept of enclosure is similar to quoting. 142050772ScaelThe object being to enclose one or more strings between 142150772Scaela pair of characters like quotes or parentheses. 142250772ScaelThe terms quoting and enclosure are used 142350772Scaelinterchangeably throughout this document. 142450772ScaelMost of the 142550772Scaelone line enclosure macros end 142665229Smckusickin small letter 142750772Scael.Ql q 142850772Scaelto give a hint of quoting, but there are a few irregularities. 142950772ScaelFor each enclosure macro 143050772Scaelthere is also a pair of open and close macros which end 143150772Scaelin small letters 143250772Scael.Ql o 143350772Scaeland 143450772Scael.Ql c 143550772Scaelrespectively. 143650772ScaelThese can be used across one or more lines of text 143750772Scaeland while they have nesting limitations, the one line quote macros 143850772Scaelcan be used inside 143950772Scaelof them. 144050772Scael.Pp 144150785Scael.ne 5 144250772Scael.Bd -filled -offset indent 144350772Scael.Bl -column "quote " "close " "open " "Enclose Stringx(in XX) " XXstringXX 144450772Scael.Em " Quote Close Open Function Result" 144550772Scael\&.Aq .Ac .Ao Angle Bracket Enclosure <string> 144650772Scael\&.Bq .Bc .Bo Bracket Enclosure [string] 144750772Scael\&.Dq .Dc .Do Double Quote ``string'' 144850772Scael .Ec .Eo Enclose String (in XX) XXstringXX 144950772Scael\&.Pq .Pc .Po Parenthesis Enclosure (string) 145050772Scael\&.Ql Quoted Literal `st' or string 145150772Scael\&.Qq .Qc .Qo Straight Double Quote "string" 145250772Scael\&.Sq .Sc .So Single Quote `string' 145350772Scael.El 145450772Scael.Ed 145550772Scael.Pp 145650785ScaelExcept for the irregular macros noted below, all 145750772Scaelof the quoting macros are parsed and callable. 145850772ScaelAll handle punctuation properly, as long as it 145950772Scaelis presented one character at a time and separated by spaces. 146050772ScaelThe quoting macros examine opening and closing punctuation 146150772Scaelto determine whether it comes before or after the 146250772Scaelenclosing string. This makes some nesting possible. 146350772Scael.Bl -tag -width xxx,xxxx 146450772Scael.It Li \&.Ec , \&.Eo 146550772ScaelThese macros expect the first argument to be the 146650772Scaelopening and closing strings respectively. 146750772Scael.It Li \&.Ql 146850772ScaelThe quoted literal macro behaves differently for 146950772Scael.Xr troff 147050772Scaelthan 147150772Scael.Xr nroff . 147250772ScaelIf formatted with 147350772Scael.Xr nroff , 147450772Scaela quoted literal is always quoted. If formatted with 147550772Scaeltroff, an item is only quoted if the width 147650772Scaelof the item is less than three constant width characters. 147750772ScaelThis is to make short strings more visible where the font change 147850772Scaelto literal (constant width) is less noticeable. 147950772Scael.It Li \&.Pf 148050772ScaelThe prefix macro is not callable, but it is parsed: 148150785Scael.Bl -tag -width "(namexx" -offset indent 148250785Scael.It Li ".Pf ( Fa name2" 148348888Scaelbecomes 148450772Scael.Pf ( Fa name2 . 148550785Scael.El 148650785Scael.Pp 148750772ScaelThe 148850772Scael.Ql \&.Ns 148950772Scael(no space) macro performs the analogous suffix function. 149048888Scael.El 149148888Scael.Pp 149250772Scael.ne 4 149350772ScaelExamples of quoting: 149450772Scael.Bl -tag -width ".Aq Pa ctype.h ) ,xxxxxxxx" -compact -offset indent 149550772Scael.It Li \&.Aq 149650772Scael.Aq 149750772Scael.It Li \&.Aq \&Ar ctype.h\ )\ , 149850772Scael.Aq Ar ctype.h ) , 149950772Scael.It Li \&.Bq 150050772Scael.Bq 150150772Scael.It Li \&.Bq \&Em Greek \&, French \&. 150250772Scael.Bq Em Greek , French . 150350772Scael.It Li \&.Dq 150450772Scael.Dq 150550772Scael.It Li ".Dq string abc ." 150650772Scael.Dq string abc . 150750772Scael.It Li ".Dq \'^[A-Z]\'" 150850772Scael.Dq \'^[A-Z]\' 150950772Scael.It Li "\&.Ql man mdoc" 151050772Scael.Ql man mdoc 151150772Scael.It Li \&.Qq 151250772Scael.Qq 151350772Scael.It Li "\&.Qq string ) ," 151450772Scael.Qq string ) , 151550785Scael.It Li "\&.Qq string Ns )," 151650785Scael.Qq string Ns ), 151750772Scael.It Li \&.Sq 151850772Scael.Sq 151950772Scael.It Li "\&.Sq string 152050772Scael.Sq string 152150772Scael.El 152250772Scael.Pp 152350772ScaelFor a good example of nested enclosure macros, see the 152450772Scael.Ql \&.Op 152550772Scaeloption macro. 152650772ScaelIt was created from the same 152750772Scaelunderlying enclosure macros as those presented in the list 152850772Scaelabove. 152948888ScaelThe 153050772Scael.Ql \&.Xo 153150772Scaeland 153250772Scael.Ql \&.Xc 153350772Scaelextended argument list macros 153450772Scaelwere also built from the same underlying routines and are a good 153550772Scaelexample of 153650772Scael.Nm \-mdoc 153750772Scaelmacro usage at its worst. 153850772Scael.Ss No\-Op or Normal Text Macro 153950772ScaelThe macro 154050772Scael.Li \&.No 154150772Scaelis 154250772Scaela hack for words in a macro command line which should 154350772Scael.Em not 154450772Scaelbe formatted and follows the conventional syntax 154550772Scaelfor content macros. 154650772Scael.Ss No Space Macro 154750772ScaelThe 154848888Scael.Ql \&.Ns 154950772Scaelmacro eliminates unwanted spaces in between macro requests. 155050772ScaelIt is useful for old style argument lists where there is no space 155150772Scaelbetween the flag and argument: 155250772Scael.Bl -tag -width ".Op Fl I Ns Ar directoryxx" -offset indent 155350772Scael.It Li ".Op Fl I Ns Ar directory" 155450772Scaelproduces 155550772Scael.Op Fl I Ns Ar directory 155650772Scael.El 155750772Scael.Pp 155850772ScaelNote: the 155950772Scael.Ql \&.Ns 156050772Scaelmacro always invokes the 156150772Scael.Ql \&.No 156250772Scaelmacro after eliminating the space unless another macro name 156350772Scaelfollows it. 156450772ScaelThe macro 156550772Scael.Ql \&.Ns 156650785Scaelis parsed and is callable. 156748888Scael.Ss Section Cross References 156848888ScaelThe 156948888Scael.Ql \&.Sx 157048888Scaelmacro designates a reference to a section header 157150772Scaelwithin the same document. 157250785ScaelIt is parsed and is callable. 157348888Scael.Pp 157448888Scael.Bl -tag -width "Li \&.Sx FILES" -offset 14n 157548888Scael.It Li \&.Sx FILES 157648888Scael.Sx FILES 157748888Scael.El 157850772Scael.Ss Symbolic 157950772ScaelThe symbolic emphasis macro is generally a boldface macro in 158050772Scaeleither the symbolic sense or the traditional English usage. 158150772Scael.Pp 158250772Scael.Dl Usage: .Sy symbol ... \*(Pu 158350772Scael.Bl -tag -width ".Sy Important Noticex" -compact -offset 14n 158450772Scael.It Li \&.Sy Important Notice 158550772Scael.Sy Important Notice 158650772Scael.El 158750772Scael.Pp 158850772ScaelThe 158950772Scael.Ql \&.Sy 159050785Scaelmacro is parsed and is callable. 159150772ScaelArguments to 159250772Scael.Ql \&.Sy 159350772Scaelmay be quoted. 159448888Scael.Ss References and Citations 159548888ScaelThe following macros make a modest attempt to handle references. 159650772ScaelAt best, the macros make it convenient to manually drop in a subset of 159748888Scaelrefer style references. 159848888Scael.Pp 159948888Scael.Bl -tag -width 6n -offset indent -compact 160048888Scael.It Li ".Rs" 160150772ScaelReference Start. 160250772ScaelCauses a line break and begins collection 160348888Scaelof reference information until the 160448888Scaelreference end macro is read. 160548888Scael.It Li ".Re" 160650772ScaelReference End. 160750772ScaelThe reference is printed. 160848888Scael.It Li ".%A" 160948888ScaelReference author name, one name per invocation. 161048888Scael.It Li ".%B" 161148888ScaelBook title. 161250772Scael.It Li ".\&%C" 161350772ScaelCity/place. 161450772Scael.It Li ".\&%D" 161550772ScaelDate. 161648888Scael.It Li ".%J" 161750772ScaelJournal name. 161848888Scael.It Li ".%N" 161948888ScaelIssue number. 162048888Scael.It Li ".%O" 162148888ScaelOptional information. 162250772Scael.It Li ".%P" 162350772ScaelPage number. 162448888Scael.It Li ".%R" 162548888ScaelReport name. 162648888Scael.It Li ".%T" 162748888ScaelTitle of article. 162848888Scael.It Li ".%V" 162948888ScaelVolume(s). 163048888Scael.El 163148888Scael.Pp 163250772ScaelThe macros beginning with 163348888Scael.Ql % 163450772Scaelare not callable, and are parsed only for the trade name macro which 163550772Scaelreturns to its caller. 163650772Scael(And not very predictably at the moment either.) 163750772ScaelThe purpose is to allow trade names 163850785Scaelto be pretty printed in 163950785Scael.Xr troff Ns / Ns Xr ditroff 164050785Scaeloutput. 164150772Scael.Ss Trade Names (or Acronyms and Type Names) 164250772ScaelThe trade name macro is generally a small caps macro for 164350772Scaelall upper case words longer than two characters. 164443435Scael.Pp 164550772Scael.Dl Usage: .Tn symbol ... \*(Pu 164650772Scael.Bl -tag -width ".Tn ASCII" -compact -offset 14n 164750772Scael.It Li \&.Tn DEC 164850772Scael.Tn DEC 164950772Scael.It Li \&.Tn ASCII 165050772Scael.Tn ASCII 165148888Scael.El 165243435Scael.Pp 165343435ScaelThe 165450772Scael.Ql \&.Tn 165548888Scaelmacro 165650772Scaelis parsed and is callable by other macros. 165748888Scael.Ss Extended Arguments 165848888ScaelThe 165948888Scael.Li \&.Xo 166048888Scaeland 166148888Scael.Li \&.Xc 166250772Scaelmacros allow one to extend an argument list 166350772Scaelon a macro boundary. 166450772ScaelArgument lists cannot 166548888Scaelbe extended within a macro 166648888Scaelwhich expects all of its arguments on one line such 166748888Scaelas 166848888Scael.Ql \&.Op . 166950772Scael.Pp 167050772ScaelHere is an example of 167150772Scael.Ql \&.Xo 167250772Scaelusing the space mode macro to turn spacing off: 167350772Scael.Bd -literal -offset indent 167450772Scael\&.Sm off 167550772Scael\&.It Xo Sy I Ar operation 167650785Scael\&.No \een Ar count No \een 167750772Scael\&.Xc 167850772Scael\&.Sm on 167950772Scael.Ed 168050772Scael.Pp 168150772ScaelProduces 168250772Scael.Bd -filled -offset indent 168350772Scael.Bl -tag -width flag -compact 168450772Scael.Sm off 168550772Scael.It Xo Sy I Ar operation 168650772Scael.No \en Ar count No \en 168750772Scael.Xc 168850772Scael.Sm on 168950772Scael.El 169050772Scael.Ed 169150772Scael.Pp 169250772ScaelAnother one: 169350772Scael.Bd -literal -offset indent 169450772Scael\&.Sm off 169550772Scael\&.It Cm S No \&/ Ar old_pattern Xo 169650772Scael\&.No \&/ Ar new_pattern 169750772Scael\&.No \&/ Op Cm g 169850772Scael\&.Xc 169950772Scael\&.Sm on 170050772Scael.Ed 170150772Scael.Pp 170250772ScaelProduces 170350772Scael.Bd -filled -offset indent 170450772Scael.Bl -tag -width flag -compact 170550772Scael.Sm off 170650772Scael.It Cm S No \&/ Ar old_pattern Xo 170750772Scael.No \&/ Ar new_pattern 170850772Scael.No \&/ Op Cm g 170950772Scael.Xc 171050772Scael.Sm on 171150772Scael.El 171250772Scael.Ed 171350772Scael.Pp 171450772ScaelAnother example of 171550772Scael.Ql \&.Xo 171650772Scaeland using enclosure macros: 171750772ScaelTest the value of an variable. 171850772Scael.Bd -literal -offset indent 171950772Scael\&.It Xo 172050772Scael\&.Ic .ifndef 172150772Scael\&.Oo \e&! Oc Ns Ar variable 172250772Scael\&.Op Ar operator variable ... 172350772Scael\&.Xc 172450772Scael.Ed 172550772Scael.Pp 172650772ScaelProduces 172750772Scael.Bd -filled -offset indent 172850772Scael.Bl -tag -width flag -compact 172950772Scael.It Xo 173050772Scael.Ic .ifndef 173150772Scael.Oo \&! Oc Ns Ar variable 173250772Scael.Op Ar operator variable ... 173350772Scael.Xc 173450772Scael.El 173550772Scael.Ed 173650772Scael.Pp 173750772ScaelAll of the above examples have used the 173850772Scael.Ql \&.Xo 173950772Scaelmacro on the argument list of the 174050772Scael.Ql \&.It 174150772Scael(list-item) 174250772Scaelmacro. 174350772ScaelThe extend macros are not used very often, and when they are 174450772Scaelit is usually to extend the list-item argument list. 174550772ScaelUnfortunately, this is also where the extend macros are the 174650772Scaelmost finicky. 174750772ScaelIn the first two examples, spacing was turned off; 174850772Scaelin the third, spacing was desired in part of the output but 174950772Scaelnot all of it. 175050772ScaelTo make these macros work in this situation make sure 175150772Scaelthe 175250772Scael.Ql \&.Xo 175350772Scaeland 175450772Scael.Ql \&.Xc 175550772Scaelmacros are placed as shown in the third example. 175650772ScaelIf the 175750772Scael.Ql \&.Xo 175850772Scaelmacro is not alone on the 175950772Scael.Ql \&.It 176050772Scaelargument list, spacing will be unpredictable. 176150772ScaelThe 176250772Scael.Ql \&.Ns 176350772Scael(no space macro) 176450772Scaelmust not occur as the first or last macro on a line 176550772Scaelin this situation. 176650785ScaelOut of 900 manual pages (about 1500 actual pages) 176750772Scaelcurrently released with 176850772Scael.Bx 176950772Scaelonly fifteen use the 177050772Scael.Ql \&.Xo 177150772Scaelmacro. 177250772Scael.Sh PAGE STRUCTURE DOMAIN 177343435Scael.Ss Section Headers 177448888ScaelThe first three 177548888Scael.Ql \&.Sh 177648888Scaelsection header macros 177748888Scaellist below are required in every 177850772Scaelman page. 177950772ScaelThe remaining section headers 178050772Scaelare recommended at the discretion of the author 178150772Scaelwriting the manual page. 178250772ScaelThe 178348888Scael.Ql \&.Sh 178450772Scaelmacro can take up to nine arguments. 178550785ScaelIt is parsed and but is not callable. 178648888Scael.Bl -tag -width ".Sh SYNOPSIS" 178748888Scael.It \&.Sh NAME 178843435ScaelThe 178948888Scael.Ql \&.Sh NAME 179050772Scaelmacro is mandatory. 179150772ScaelIf not specified, 179243435Scaelthe headers, footers and page layout defaults 179343435Scaelwill not be set and things will be rather unpleasant. 179450772ScaelThe 179550772Scael.Sx NAME 179650772Scaelsection consists of at least three items. 179743435ScaelThe first is the 179848888Scael.Ql \&.Nm 179948888Scaelname macro naming the subject of the man page. 180048888ScaelThe second is the Name Description macro, 180148888Scael.Ql \&.Nd , 180243435Scaelwhich separates the subject 180350772Scaelname from the third item, which is the description. 180450772ScaelThe 180543435Scaeldescription should be the most terse and lucid possible, 180643435Scaelas the space available is small. 180748888Scael.It \&.Sh SYNOPSIS 180850772ScaelThe 180950772Scael.Sx SYNOPSIS 181050772Scaelsection describes the typical usage of the 181150772Scaelsubject of a man page. 181250772ScaelThe macros required 181343435Scaelare either 181448888Scael.Ql ".Nm" , 181548888Scael.Ql ".Cd" , 181650772Scael.Ql ".Fn" , 181748888Scael(and possibly 181850772Scael.Ql ".Fo" , 181950772Scael.Ql ".Fc" , 182048888Scael.Ql ".Fd" , 182148888Scael.Ql ".Ft" 182248888Scaelmacros). 182343435ScaelThe function name 182448888Scaelmacro 182548888Scael.Ql ".Fn" 182643435Scaelis required 182743435Scaelfor manual page sections 2 and 3, the command and general 182848888Scaelname macro 182948888Scael.Ql \&.Nm 183048888Scaelis required for sections 1, 5, 6, 7, 8. 183148888ScaelSection 4 manuals require a 183248888Scael.Ql ".Nm" , ".Fd" 183348888Scaelor a 183448888Scael.Ql ".Cd" 183548888Scaelconfiguration device usage macro. 183648888ScaelSeveral other macros may be necessary to produce 183743435Scaelthe synopsis line as shown below: 183843435Scael.Pp 183948888Scael.Bd -filled -offset indent 184043435Scael.Nm cat 184143435Scael.Op Fl benstuv 184243435Scael.Op Fl 184343435Scael.Ar 184448888Scael.Ed 184543435Scael.Pp 184648888ScaelThe following macros were used: 184743435Scael.Pp 184843435Scael.Dl \&.Nm cat 184948888Scael.Dl \&.Op \&Fl benstuv 185048888Scael.Dl \&.Op \&Fl 185143435Scael.Dl \&.Ar 185250785Scael.Pp 185350772Scael.Sy Note : 185450772ScaelThe macros 185550772Scael.Ql \&.Op , 185650772Scael.Ql \&.Fl , 185750772Scaeland 185850772Scael.Ql \&.Ar 185950772Scaelrecognize the pipe bar character 186050785Scael.Ql \*(Ba , 186150785Scaelso a command line such as: 186250772Scael.Pp 186350772Scael.Dl ".Op Fl a | Fl b" 186450772Scael.Pp 186550785Scaelwill not go orbital. 186650772Scael.Xr Troff 186750772Scaelnormally interprets a \*(Ba as a special operator. 186850772ScaelSee 186950772Scael.Sx PREDEFINED STRINGS 187050772Scaelfor a usable \*(Ba 187150772Scaelcharacter in other situations. 187248888Scael.It \&.Sh DESCRIPTION 187350772ScaelIn most cases the first text in the 187450772Scael.Sx DESCRIPTION 187550772Scaelsection 187643435Scaelis a brief paragraph on the command, function or file, 187743435Scaelfollowed by a lexical list of options and respective 187850772Scaelexplanations. 187950772ScaelTo create such a list, the 188048888Scael.Ql \&.Bl 188148888Scaelbegin-list, 188248888Scael.Ql \&.It 188348888Scaellist-item and 188448888Scael.Ql \&.El 188548888Scaelend-list 188648888Scaelmacros are used (see 188748888Scael.Sx Lists and Columns 188848888Scaelbelow). 188948888Scael.El 189043435Scael.Pp 189143435ScaelThe following 189248888Scael.Ql \&.Sh 189343435Scaelsection headers are part of the 189443435Scaelpreferred manual page layout and must be used appropriately 189550772Scaelto maintain consistency. 189650772ScaelThey are listed in the order 189743435Scaelin which they would be used. 189848888Scael.Bl -tag -width SYNOPSIS 189948888Scael.It \&.Sh ENVIRONMENT 190050772ScaelThe 190150772Scael.Sx ENVIRONMENT 190250772Scaelsection should reveal any related 190343435Scaelenvironment 190450772Scaelvariables and clues to their behavior and/or usage. 190548888Scael.It \&.Sh EXAMPLES 190650772ScaelThere are several ways to create examples. 190750772ScaelSee 190850772Scaelthe 190950772Scael.Sx EXAMPLES 191050772Scaelsection below 191143435Scaelfor details. 191248888Scael.It \&.Sh FILES 191343435ScaelFiles which are used or created by the man page subject 191443435Scaelshould be listed via the 191548888Scael.Ql \&.Pa 191650772Scaelmacro in the 191750772Scael.Sx FILES 191850772Scaelsection. 191948888Scael.It \&.Sh SEE ALSO 192043435ScaelReferences to other material on the man page topic and 192143435Scaelcross references to other relevant man pages should 192250772Scaelbe placed in the 192350772Scael.Sx SEE ALSO 192450772Scaelsection. 192550772ScaelCross references 192643435Scaelare specified using the 192748888Scael.Ql \&.Xr 192850772Scaelmacro. 192950772ScaelAt this time 193043435Scael.Xr refer 1 193143435Scaelstyle references are not accommodated. 193248888Scael.It \&.Sh STANDARDS 193343435ScaelIf the command, library function or file adheres to a 193450772Scaelspecific implementation such as 193550772Scael.St -p1003.2 193650772Scaelor 193750772Scael.St -ansiC 193850772Scaelthis should be noted here. 193950772ScaelIf the 194043435Scaelcommand does not adhere to any standard, its history 194150772Scaelshould be noted in the 194250772Scael.Sx HISTORY 194350772Scaelsection. 1944*67339Sah.ne 1i 194548888Scael.It \&.Sh HISTORY 194643435ScaelAny command which does not adhere to any specific standards 194743435Scaelshould be outlined historically in this section. 194848888Scael.It \&.Sh AUTHORS 194943435ScaelCredits, if need be, should be placed here. 195048888Scael.It \&.Sh DIAGNOSTICS 195143435ScaelDiagnostics from a command should be placed in this section. 195248888Scael.It \&.Sh ERRORS 195343435ScaelSpecific error handling, especially from library functions 195450772Scael(man page sections 2 and 3) should go here. 195550772ScaelThe 195648888Scael.Ql \&.Er 195748888Scaelmacro is used to specify an errno. 195848888Scael.It \&.Sh BUGS 195943435ScaelBlatant problems with the topic go here... 196048888Scael.El 196143435Scael.Pp 196248888ScaelUser specified 196348888Scael.Ql \&.Sh 196448888Scaelsections may be added, 196548888Scaelfor example, this section was set with: 196648888Scael.Bd -literal -offset 14n 196748888Scael\&.Sh PAGE LAYOUT MACROS 196848888Scael.Ed 196943435Scael.Ss Paragraphs and Line Spacing. 197048888Scael.Bl -tag -width 6n 197148888Scael.It \&.Pp 197243435ScaelThe \&.Pp paragraph command may 197343435Scaelbe used to specify a line space where necessary. 197448888ScaelThe macro is not necessary after a 197548888Scael.Ql \&.Sh 197643435Scaelor 197748888Scael.Ql \&.Ss 197848888Scaelmacro or before 197943435Scaela 198048888Scael.Ql \&.Bl 198148888Scaelmacro. 198248888Scael(The 198348888Scael.Ql \&.Bl 198448888Scaelmacro asserts a vertical distance unless the -compact flag is given). 198548888Scael.El 198650772Scael.\" This worked with version one, need to redo for version three 198748888Scael.\" .Pp 198848888Scael.\" .Ds I 198948888Scael.\" .Cw (ax+bx+c) \ is\ produced\ by\ \& 199048888Scael.\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\& 199148888Scael.\" .Cl Cx \t\t 199248888Scael.\" .Li \&.Cx\ ( 199348888Scael.\" .Cx 199448888Scael.\" .Cl Cx \t\t 199548888Scael.\" .Li \&.Va ax 199648888Scael.\" .Cx 199748888Scael.\" .Cl Cx \t\t 199848888Scael.\" .Li \&.Sy \+ 199948888Scael.\" .Cx 200048888Scael.\" .Cl Cx \&(\& 200148888Scael.\" .Va ax 200248888Scael.\" .Cx + 200348888Scael.\" .Va by 200448888Scael.\" .Cx + 200548888Scael.\" .Va c ) 200648888Scael.\" .Cx \t 200748888Scael.\" .Em is produced by 200848888Scael.\" .Cx \t 200948888Scael.\" .Li \&.Va by 201048888Scael.\" .Cx 201148888Scael.\" .Cl Cx \t\t 201248888Scael.\" .Li \&.Sy \+ 201348888Scael.\" .Cx 201448888Scael.\" .Cl Cx \t\t 201548888Scael.\" .Li \&.Va c ) 201648888Scael.\" .Cx 201748888Scael.\" .Cl Cx \t\t 201848888Scael.\" .Li \&.Cx 201948888Scael.\" .Cx 202048888Scael.\" .Cw 202148888Scael.\" .De 202248888Scael.\" .Pp 202350772Scael.\" This example shows the same equation in a different format. 202450772Scael.\" The spaces 202548888Scael.\" around the 202648888Scael.\" .Li \&+ 202748888Scael.\" signs were forced with 202848888Scael.\" .Li \e : 202948888Scael.\" .Pp 203048888Scael.\" .Ds I 203148888Scael.\" .Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \& 203248888Scael.\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\& 203348888Scael.\" .Cl Cx \t\t 203448888Scael.\" .Li \&.Cx\ ( 203548888Scael.\" .Cx 203648888Scael.\" .Cl Cx \t\t 203748888Scael.\" .Li \&.Va a 203848888Scael.\" .Cx 203948888Scael.\" .Cl Cx \t\t 204048888Scael.\" .Li \&.Sy x 204148888Scael.\" .Cx 204248888Scael.\" .Cl Cx \t\t 204348888Scael.\" .Li \&.Cx \e\ +\e\ \e& 204448888Scael.\" .Cx 204548888Scael.\" .Cl Cx \&(\& 204648888Scael.\" .Va a 204748888Scael.\" .Sy x 204848888Scael.\" .Cx \ +\ \& 204948888Scael.\" .Va b 205048888Scael.\" .Sy y 205148888Scael.\" .Cx \ +\ \& 205248888Scael.\" .Va c ) 205348888Scael.\" .Cx \t 205448888Scael.\" .Em is produced by 205548888Scael.\" .Cl Cx \t\t 205648888Scael.\" .Li \&.Va b 205748888Scael.\" .Cx 205848888Scael.\" .Cl Cx \t\t 205948888Scael.\" .Li \&.Sy y 206048888Scael.\" .Cx 206148888Scael.\" .Cl Cx \t\t 206248888Scael.\" .Li \&.Cx \e\ +\e\ \e& 206348888Scael.\" .Cx 206448888Scael.\" .Cl Cx \t\t 206548888Scael.\" .Li \&.Va c ) 206648888Scael.\" .Cx 206748888Scael.\" .Cl Cx \t\t 206848888Scael.\" .Li \&.Cx 206948888Scael.\" .Cx 207048888Scael.\" .Cw 207148888Scael.\" .De 207248888Scael.\" .Pp 207348888Scael.\" The incantation below was 207448888Scael.\" lifted from the 207548888Scael.\" .Xr adb 1 207648888Scael.\" manual page: 207748888Scael.\" .Pp 207848888Scael.\" .Ds I 207948888Scael.\" .Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by 208048888Scael.\" .Cl Cx \t\t 208148888Scael.\" .Li \&.Cx Op Sy ?/ 208248888Scael.\" .Cx 208348888Scael.\" .Cl Cx \t\t 208448888Scael.\" .Li \&.Nm m 208548888Scael.\" .Cx 208648888Scael.\" .Cl Cx Op Sy ?/ 208748888Scael.\" .Nm m 208848888Scael.\" .Ad \ b1 e1 f1 208948888Scael.\" .Op Sy ?/ 209048888Scael.\" .Cx \t 209148888Scael.\" .Em is produced by 209248888Scael.\" .Cx \t 209348888Scael.\" .Li \&.Ar \e\ b1 e1 f1 209448888Scael.\" .Cx 209548888Scael.\" .Cl Cx \t\t 209648888Scael.\" .Li \&.Op Sy ?/ 209748888Scael.\" .Cx 209848888Scael.\" .Cl Cx \t\t 209948888Scael.\" .Li \&.Cx 210048888Scael.\" .Cx 210148888Scael.\" .Cw 210248888Scael.\" .De 210348888Scael.\" .Pp 210450772Scael.Ss Keeps 210550772ScaelThe only keep that is implemented at this time is for words. 210650772ScaelThe macros are 210750772Scael.Ql \&.Bk 210850772Scael(begin-keep) 210950772Scaeland 211050772Scael.Ql \&.Ek 211150772Scael(end-keep). 211250772ScaelThe only option that 211350772Scael.Ql \&.Bl 211450772Scaelaccepts is 211550772Scael.Fl words 211650772Scaeland is useful for preventing line breaks in the middle of options. 211750772ScaelIn the example for the make command line arguments (see 211850772Scael.Sx What's in a name ) , 211950772Scaelthe keep prevented 212050772Scael.Xr nroff 212150772Scaelfrom placing up the 212250772Scaelflag and the argument 212350772Scaelon separate lines. 212450772Scael(Actually, the option macro used to prevent this from occurring, 212550772Scaelbut was dropped when the decision (religious) was made to force 212650772Scaelright justified margins in 212750772Scael.Xr troff 212850772Scaelas options in general look atrocious when spread across a sparse 212950772Scaelline. 213050772ScaelMore work needs to be done with the keep macros, a 213150772Scael.Fl line 213250772Scaeloption needs to be added.) 213348888Scael.Ss Examples and Displays 213448888ScaelThere are five types of displays, a quickie one line indented display 213548888Scael.Ql \&.D1 , 213648888Scaela quickie one line literal display 213748888Scael.Ql \&.Dl , 213850772Scaeland a block literal, block filled and block ragged which use 213948888Scaelthe 214048888Scael.Ql \&.Bd 214148888Scaelbegin-display 214248888Scaeland 214348888Scael.Ql \&.Ed 214448888Scaelend-display macros. 214543435Scael.Pp 214650772Scael.Bl -tag -width \&.Dlxx 214748888Scael.It Li \&.D1 214848888Scael(D-one) Display one line of indented text. 214950772ScaelThis macro is parsed, but it is not callable. 215043435Scael.Pp 215150772Scael.Dl Fl ldghfstru 215243435Scael.Pp 215350772ScaelThe above was produced by: 215450772Scael.Li \&.Dl Fl ldghfstru . 215548888Scael.It Li \&.Dl 215648888Scael(D-ell) 215748888ScaelDisplay one line of indented 215848888Scael.Em literal 215950772Scaeltext. 216050772ScaelThe 216148888Scael.Ql \&.Dl 216248888Scaelexample macro has been used throughout this 216350772Scaelfile. 216450772ScaelIt allows 216548888Scaelthe indent (display) of one line of text. 216648888ScaelIts default font is set to 216748888Scaelconstant width (literal) however 216850772Scaelit is parsed and will recognized other macros. 216950772ScaelIt is not callable however. 217043435Scael.Pp 217150772Scael.Dl % ls -ldg /usr/local/bin 217248888Scael.Pp 217350772ScaelThe above was produced by 217450772Scael.Li \&.Dl % ls -ldg /usr/local/bin . 217548888Scael.It Li \&.Bd 217650772ScaelBegin-display. 217750772ScaelThe 217848888Scael.Ql \&.Bd 217948888Scaeldisplay must be ended with the 218048888Scael.Ql \&.Ed 218150772Scaelmacro. 218250772ScaelDisplays may be nested within displays and 218348888Scaellists. 218448888Scael.Ql \&.Bd 218548888Scaelhas the following syntax: 218643435Scael.Pp 218750772Scael.Dl ".Bd display-type [-offset offset_value] [-compact]" 218843435Scael.Pp 218948888ScaelThe display-type must be one of the following four types and 219048888Scaelmay have an offset specifier for indentation: 219148888Scael.Ql \&.Bd . 219243435Scael.Pp 219350772Scael.Bl -tag -width "file file_name " -compact 219448888Scael.It Fl ragged 219543435ScaelDisplay a block of text as typed, 219648888Scaelright (and left) margin edges are left ragged. 219748888Scael.It Fl filled 219848888ScaelDisplay a filled (formatted) block. 219948888ScaelThe block of text is formatted (the edges are filled \- 220050772Scaelnot left unjustified). 220148888Scael.It Fl literal 220248888ScaelDisplay a literal block, useful for source code or 220348888Scaelsimple tabbed or spaced text. 220448888Scael.It Fl file Ar file_name 220548888ScaelThe file name following the 220648888Scael.Fl file 220750772Scaelflag is read and displayed. 220850772ScaelLiteral mode is 220948888Scaelasserted and tabs are set at 8 constant width character 221048888Scaelintervals, however any 221148888Scael.Xr troff/ Ns Nm \-mdoc 221248888Scaelcommands in file will be processed. 221348888Scael.It Fl offset Ar string 221448888ScaelIf 221548888Scael.Fl offset 221648888Scaelis specified with one of the following strings, the string 221748888Scaelis interpreted to indicate the level of indentation for the 221848888Scaelforthcoming block of text: 221948888Scael.Pp 222050772Scael.Bl -tag -width "indent-two" -compact 222148888Scael.It Ar left 222243435ScaelAlign block on the current left margin, 222343435Scaelthis is the default mode of 222448888Scael.Ql \&.Bd . 222548888Scael.It Ar center 222650772ScaelSupposedly center the block. 222750772ScaelAt this time 222843435Scaelunfortunately, the block merely gets 222943435Scaelleft aligned about an imaginary center margin. 223048888Scael.It Ar indent 223150772ScaelIndents by one default indent value or tab. 223250772ScaelThe default 223348888Scaelindent value is also used for the 223448888Scael.Ql \&.D1 223550772Scaeldisplay so one is guaranteed the two types of displays 223650772Scaelwill line up. 223750772ScaelThis indent is normally set to 6n or about two 223848888Scaelthirds of an inch (six constant width characters). 223948888Scael.It Ar indent-two 224048888ScaelIndents two times the default indent value. 224148888Scael.It Ar right 224248888ScaelThis 224348888Scael.Em left 224448888Scaelaligns the block about two inches from 224550772Scaelthe right side of the page. 224650772ScaelThis macro needs 224750772Scaelwork and perhaps may never do the right thing by 224848888Scael.Xr troff . 224948888Scael.El 225048888Scael.El 225148888Scael.It ".Ed" 225248888ScaelEnd-display. 225348888Scael.El 225448888Scael.Ss Tagged Lists and Columns 225548888ScaelThere are several types of lists which may be initiated with the 225648888Scael.Ql ".Bl" 225750772Scaelbegin-list macro. 225850772ScaelItems within the list 225948888Scaelare specified with the 226048888Scael.Ql ".It" 226148888Scaelitem macro and 226248888Scaeleach list must end with the 226348888Scael.Ql ".El" 226450772Scaelmacro. 226550772ScaelLists may be nested within themselves and within displays. 226648888ScaelColumns may be used inside of lists, but lists are unproven 226748888Scaelinside of columns. 226843435Scael.Pp 226948888ScaelIn addition, several list attributes may be specified such as 227050785Scaelthe width of a tag, the list offset, and compactness 227148888Scael(blank lines between items allowed or disallowed). 227250772ScaelMost of this document has been formatted with a tag style list 227350772Scael.Pq Fl tag . 227450772ScaelFor a change of pace, the list-type used to present the list-types 227550772Scaelis an over-hanging list 227650772Scael.Pq Fl ohang . 227750772ScaelThis type of list is quite popular with 227850772Scael.Tn TeX 227950785Scaelusers, but might look a bit funny after having read many pages of 228050772Scaeltagged lists. 228148888ScaelThe following list types are accepted by 228250772Scael.Ql ".Bl" : 228343435Scael.Pp 228448888Scael.Bl -ohang -compact 228548888Scael.It Fl bullet 228648888Scael.It Fl item 228748888Scael.It Fl enum 228850772ScaelThese three are the simplest types of lists. 228950772ScaelOnce the 229048888Scael.Ql ".Bl" 229148888Scaelmacro has been given, items in the list are merely 229248888Scaelindicated by a line consisting solely of the 229348888Scael.Ql ".It" 229450772Scaelmacro. 229550772ScaelFor example, the source text for a simple enumerated list 229648888Scaelwould look like: 229748888Scael.Bd -literal -offset indent-two 229848888Scael\&.Bl -enum -compact 229948888Scael\&.It 230048888Scael\&Item one goes here. 230148888Scael\&.It 230248888Scael\&And item two here. 230348888Scael\&.It 230448888Scael\&Lastly item three goes here. 230548888Scael\&.El 230648888Scael.Ed 230743435Scael.Pp 230848888ScaelThe results: 230943435Scael.Pp 231048888Scael.Bl -enum -offset indent-two -compact 231148888Scael.It 231248888ScaelItem one goes here. 231348888Scael.It 231448888ScaelAnd item two here. 231548888Scael.It 231648888ScaelLastly item three goes here. 231748888Scael.El 231843435Scael.Pp 231948888ScaelA simple bullet list construction: 232048888Scael.Bd -literal -offset indent-two 232148888Scael\&.Bl -bullet -compact 232248888Scael\&.It 232348888Scael\&Bullet one goes here. 232448888Scael\&.It 232548888Scael\&Bullet two here. 232648888Scael\&.El 232748888Scael.Ed 232843435Scael.Pp 232948888ScaelProduces: 233048888Scael.Bl -bullet -offset indent-two -compact 233148888Scael.It 233248888ScaelBullet one goes here. 233348888Scael.It 233448888ScaelBullet two here. 233548888Scael.El 233643435Scael.Pp 233748888Scael.It Fl tag 233848888Scael.It Fl diag 233948888Scael.It Fl hang 234048888Scael.It Fl ohang 234148888Scael.It Fl inset 234248888ScaelThese list-types collect arguments specified with the 234348888Scael.Ql \&.It 234448888Scaelmacro and create a label which may be 234548888Scael.Em inset 234665229Smckusickinto the forthcoming text, 234748888Scael.Em hanged 234865229Smckusickfrom the forthcoming text, 234948888Scael.Em overhanged 235050785Scaelfrom above and not indented or 235150772Scael.Em tagged . 235250772ScaelThis 235348888Scaellist was constructed with the 235448888Scael.Ql Fl ohang 235550772Scaellist-type. 235650772ScaelThe 235748888Scael.Ql \&.It 235850785Scaelmacro is parsed only for the inset, hang 235950785Scaeland tag list-types and is not callable. 236048888ScaelHere is an example of inset labels: 236148888Scael.Bl -inset -offset indent 236248888Scael.It Em Tag 236348888ScaelThe tagged list (also called a tagged paragraph) is the 236448888Scaelmost common type of list used in the Berkeley manuals. 236548888Scael.It Em Diag 236648888ScaelDiag lists create section four diagnostic lists 236748888Scaeland are similar to inset lists except callable 236848888Scaelmacros are ignored. 236948888Scael.It Em Hang 237048888ScaelHanged labels are a matter of taste. 237148888Scael.It Em Ohang 237265229SmckusickOverhanging labels are nice when space is constrained. 237348888Scael.It Em Inset 237448888ScaelInset labels are useful for controlling blocks of 237548888Scaelparagraphs and are valuable for converting 237648888Scael.Nm \-mdoc 237748888Scaelmanuals to other formats. 237848888Scael.El 237943435Scael.Pp 238048888ScaelHere is the source text which produced the above example: 238148888Scael.Bd -literal -offset indent 238248888Scael\&.Bl -inset -offset indent 238348888Scael\&.It Em Tag 238448888Scael\&The tagged list (also called a tagged paragraph) is the 238548888Scael\&most common type of list used in the Berkeley manuals. 238648888Scael\&.It Em Diag 238748888Scael\&Diag lists create section four diagnostic lists 238848888Scael\&and are similar to inset lists except callable 238948888Scael\¯os are ignored. 239048888Scael\&.It Em Hang 239148888Scael\&Hanged labels are a matter of taste. 239248888Scael\&.It Em Ohang 239365229Smckusick\&Overhanging labels are nice when space is constrained. 239448888Scael\&.It Em Inset 239548888Scael\&Inset labels are useful for controlling blocks of 239648888Scael\¶graphs and are valuable for converting 239748888Scael\&.Nm \-mdoc 239848888Scael\&manuals to other formats. 239948888Scael\&.El 240048888Scael.Ed 240143435Scael.Pp 240248888ScaelHere is a hanged list with just one item: 240348888Scael.Bl -hang -offset indent 240448888Scael.It Em Hanged 240548888Scaellabels appear similar to tagged lists when the 240648888Scaellabel is smaller than the label width. 240748888Scael.It Em Longer hanged list labels 240848888Scaelblend in to the paragraph unlike 240948888Scaeltagged paragraph labels. 241048888Scael.El 241143435Scael.Pp 241250772ScaelAnd the unformatted text which created it: 241348888Scael.Bd -literal -offset indent 241448888Scael\&.Bl -hang -offset indent 241548888Scael\&.It Em Hanged 241648888Scael\&labels appear similar to tagged lists when the 241748888Scael\&label is smaller than the label width. 241848888Scael\&.It Em Longer hanged list labels 241948888Scael\&blend in to the paragraph unlike 242048888Scael\&tagged paragraph labels. 242148888Scael\&.El 242248888Scael.Ed 242348888Scael.Pp 242450772ScaelThe tagged list which follows uses an optional width specifier to control 242548888Scaelthe width of the tag. 242648888Scael.Pp 242750785Scael.Bl -tag -width "PAGEIN" -compact -offset indent 242850785Scael.It SL 242943435Scaelsleep time of the process (seconds blocked) 243050785Scael.It PAGEIN 243150785Scaelnumber of disk 243250785Scael.Tn I/O Ns 's 243350785Scaelresulting from references 243448888Scaelby the process to pages not loaded in core. 243550785Scael.It UID 243643435Scaelnumerical user-id of process owner 243750785Scael.It PPID 243848888Scaelnumerical id of parent of process process priority 243948888Scael(non-positive when in non-interruptible wait) 244048888Scael.El 244143435Scael.Pp 244243435ScaelThe raw text: 244348888Scael.Bd -literal -offset indent 244450785Scael\&.Bl -tag -width "PAGEIN" -compact -offset indent 244550785Scael\&.It SL 244648888Scael\&sleep time of the process (seconds blocked) 244750785Scael\&.It PAGEIN 244850785Scael\&number of disk 244950785Scael\&.Tn I/O Ns 's 245050785Scael\&resulting from references 245148888Scael\&by the process to pages not loaded in core. 245250785Scael\&.It UID 245348888Scael\&numerical user-id of process owner 245450785Scael\&.It PPID 245548888Scael\&numerical id of parent of process process priority 245648888Scael\&(non-positive when in non-interruptible wait) 245748888Scael\&.El 245848888Scael.Ed 245943435Scael.Pp 246048888ScaelAcceptable width specifiers: 246148888Scael.Bl -tag -width Ar -offset indent 246248888Scael.It Fl width Ar "\&Fl" 246350772Scaelsets the width to the default width for a flag. 246450772ScaelAll callable 246550772Scaelmacros have a default width value. 246650772ScaelThe 246748888Scael.Ql \&.Fl , 246848888Scaelvalue is presently 246948888Scaelset to ten constant width characters or about five sixth of 247048888Scaelan inch. 247148888Scael.It Fl width Ar "24n" 247248888Scaelsets the width to 24 constant width characters or about two 247350772Scaelinches. 247450772ScaelThe 247548888Scael.Ql n 247648888Scaelis absolutely necessary for the scaling to work correctly. 247748888Scael.It Fl width Ar "ENAMETOOLONG" 247848888Scaelsets width to the constant width length of the 247948888Scaelstring given. 248048888Scael.It Fl width Ar "\\*qint mkfifo\\*q" 248148888Scaelagain, the width is set to the constant width of the string 248248888Scaelgiven. 248348888Scael.El 248443435Scael.Pp 248548888ScaelIf a width is not specified for the tag list type, the first 248648888Scaeltime 248748888Scael.Ql \&.It 248848888Scaelis invoked, an attempt is made to determine an appropriate 248950772Scaelwidth. 249050772ScaelIf the first argument to 249148888Scael.Ql ".It" 249248888Scaelis a callable macro, the default width for that macro will be used 249350772Scaelas if the macro name had been supplied as the width. 249450772ScaelHowever, 249548888Scaelif another item in the list is given with a different callable 249650772Scaelmacro name, a new and nested list is assumed. 249750772Scael.Sh PREDEFINED STRINGS 249850772ScaelThe following strings are predefined as may be used by 249950772Scaelpreceding with the troff string interpreting sequence 250050772Scael.Ql \&\e*(xx 250150772Scaelwhere 250250772Scael.Em xx 250350772Scaelis the name of the defined string or as 250450772Scael.Ql \&\e*x 250550772Scaelwhere 250650772Scael.Em x 250750772Scaelis the name of the string. 250850772ScaelThe interpreting sequence may be used any where in the text. 250950772Scael.Pp 251050772Scael.Bl -column "String " "Nroff " "Troff " -offset indent 251150772Scael.It Sy "String Nroff Troff" 251250772Scael.It Li "<=" Ta \&<\&= Ta \*(<= 251350772Scael.It Li ">=" Ta \&>\&= Ta \*(>= 251450772Scael.It Li "Rq" Ta "''" Ta \*(Rq 251550772Scael.It Li "Lq" Ta "``" Ta \*(Lq 251650772Scael.It Li "ua" Ta ^ Ta \*(ua 251750772Scael.It Li "aa" Ta ' Ta \*(aa 251850772Scael.It Li "ga" Ta \` Ta \*(ga 251950772Scael.\" .It Li "sL" Ta ` Ta \*(sL 252050772Scael.\" .It Li "sR" Ta ' Ta \*(sR 252150772Scael.It Li "q" Ta \&" Ta \*q 252250772Scael.It Li "Pi" Ta pi Ta \*(Pi 252350772Scael.It Li "Ne" Ta != Ta \*(Ne 252450772Scael.It Li "Le" Ta <= Ta \*(Le 252550772Scael.It Li "Ge" Ta >= Ta \*(Ge 252650772Scael.It Li "Lt" Ta < Ta \*(Gt 252750772Scael.It Li "Gt" Ta > Ta \*(Lt 252850772Scael.It Li "Pm" Ta +- Ta \*(Pm 252950772Scael.It Li "If" Ta infinity Ta \*(If 253050772Scael.It Li "Na" Ta \fINaN\fP Ta \*(Na 253150772Scael.It Li "Ba" Ta \fR\&|\fP Ta \*(Ba 253250772Scael.El 253350772Scael.Pp 253450772Scael.Sy Note : 253550772ScaelThe string named 253650772Scael.Ql q 253750772Scaelshould be written as 253850785Scael.Ql \e*q 253950785Scaelsince it is only one char. 254048888Scael.Sh DIAGNOSTICS 254148888ScaelThe debugging facilities for 254248888Scael.Nm \-mdoc 254348888Scaelare limited, but can help detect subtle errors such 254448888Scaelas the collision of an argument name with an internal 254550772Scaelregister or macro name. 254650772Scael(A what?) 254748888ScaelA register is an arithmetic storage class for 254848888Scael.Xr troff 254948888Scaelwith a one or two character name. 255048888ScaelAll registers internal to 255148888Scael.Nm \-mdoc 255248888Scaelfor 255348888Scael.Xr troff 255448888Scaeland 255548888Scael.Xr ditroff 255648888Scaelare two characters and 255750772Scaelof the form <upper_case><lower_case> such as 255848888Scael.Ql \&Ar , 255950772Scael<lower_case><upper_case> as 256048888Scael.Ql \&aR 256143435Scaelor 256248888Scael<upper or lower letter><digit> as 256348888Scael.Ql \&C\&1 . 256448888ScaelAnd adding to the muddle, 256548888Scael.Xr troff 256648888Scaelhas its own internal registers all of which are either 256750772Scaeltwo lower case characters or a dot plus a letter or meta-character 256848888Scaelcharacter. 256948888ScaelIn one of the introduction examples, it was shown how to 257048888Scaelprevent the interpretation of a macro name with the escape sequence 257148888Scael.Ql \e& . 257248888ScaelThis is sufficient for the internal register names also. 257343435Scael.Pp 257448888Scael.\" Every callable macro name has a corresponding register 257550772Scael.\" of the same name (<upper_case><lower_case>). 257648888Scael.\" There are also specific registers which have 257748888Scael.\" been used for stacks and arrays and are listed in the 257848888Scael.\" .Sx Appendix . 257948888Scael.\" .Bd -ragged -offset 4n 258048888Scael.\" [A-Z][a-z] registers corresponding to macro names (example ``Ar'') 258148888Scael.\" [a-z][A-Z] registers corresponding to macro names (example ``aR'') 258248888Scael.\" C[0-9] argument types (example C1) 258348888Scael.\" O[0-9] offset stack (displays) 258448888Scael.\" h[0-9] horizontal spacing stack (lists) 258548888Scael.\" o[0-9] offset (stack) (lists) 258648888Scael.\" t[0-9] tag stack (lists) 258748888Scael.\" v[0-9] vertical spacing stack (lists) 258848888Scael.\" w[0-9] width tag/label stack 258948888Scael.\" .Ed 259048888Scael.\" .Pp 259148888ScaelIf a non-escaped register name is given in the argument list of a request 259250772Scaelunpredictable behavior will occur. 259350772ScaelIn general, any time huge portions 259448888Scaelof text do not appear where expected in the output, or small strings 259548888Scaelsuch as list tags disappear, chances are there is a misunderstanding 259648888Scaelabout an argument type in the argument list. 259748888ScaelYour mother never intended for you to remember this evil stuff - so here 259848888Scaelis a way to find out whether or not your arguments are valid: The 259948888Scael.Ql \&.Db 260048888Scael(debug) 260148888Scaelmacro displays the interpretation of the argument list for most 260250772Scaelmacros. 260350772ScaelMacros such as the 260448888Scael.Ql \&.Pp 260548888Scael(paragraph) 260650772Scaelmacro do not contain debugging information. 260750772ScaelAll of the callable macros do, 260848888Scaeland it is strongly advised whenever in doubt, 260948888Scaelturn on the 261048888Scael.Ql \&.Db 261148888Scaelmacro. 261243435Scael.Pp 261348888Scael.Dl Usage: \&.Db [on | off] 261443435Scael.Pp 261548888ScaelAn example of a portion of text with 261648888Scaelthe debug macro placed above and below an 261748888Scaelartificially created problem (a flag argument 261848888Scael.Ql \&aC 261948888Scaelwhich should be 262048888Scael.Ql \e&aC 262148888Scaelin order to work): 262248888Scael.Bd -literal -offset indent 262348888Scael\&.Db on 262448888Scael\&.Op Fl aC Ar file ) 262548888Scael\&.Db off 262648888Scael.Ed 262743435Scael.Pp 262848888ScaelThe resulting output: 262948888Scael.Bd -literal -offset indent 263048888ScaelDEBUGGING ON 263148888ScaelDEBUG(argv) MACRO: `.Op' Line #: 2 263248888Scael Argc: 1 Argv: `Fl' Length: 2 263348888Scael Space: `' Class: Executable 263448888Scael Argc: 2 Argv: `aC' Length: 2 263548888Scael Space: `' Class: Executable 263648888Scael Argc: 3 Argv: `Ar' Length: 2 263748888Scael Space: `' Class: Executable 263848888Scael Argc: 4 Argv: `file' Length: 4 263948888Scael Space: ` ' Class: String 264048888Scael Argc: 5 Argv: `)' Length: 1 264148888Scael Space: ` ' Class: Closing Punctuation or suffix 264248888Scael MACRO REQUEST: .Op Fl aC Ar file ) 264348888ScaelDEBUGGING OFF 264448888Scael.Ed 264543435Scael.Pp 264648888ScaelThe first line of information tells the name of the calling 264748888Scaelmacro, here 264848888Scael.Ql \&.Op , 264950772Scaeland the line number it appears on. 265050772ScaelIf one or more files are involved 265148888Scael(especially if text from another file is included) the line number 265250772Scaelmay be bogus. 265350772ScaelIf there is only one file, it should be accurate. 265448888ScaelThe second line gives the argument count, the argument 265548888Scael.Pq Ql \&Fl 265650772Scaeland its length. 265750772ScaelIf the length of an argument is two characters, the 265848888Scaelargument is tested to see if it is executable (unfortunately, any 265948888Scaelregister which contains a non-zero value appears executable). 266048888ScaelThe third line gives the space allotted for a class, and the 266150772Scaelclass type. 266250772ScaelThe problem here is the argument aC should not be 266350772Scaelexecutable. 266450772ScaelThe four types of classes are string, executable, closing 266550772Scaelpunctuation and opening punctuation. 266650772ScaelThe last line shows the entire 266750772Scaelargument list as it was read. 266850772ScaelIn this next example, the offending 266948888Scael.Ql \&aC 267048888Scaelis escaped: 267148888Scael.Bd -literal -offset indent 267248888Scael\&.Db on 267348888Scael\&.Em An escaped \e&aC 267448888Scael\&.Db off 267548888Scael.Ed 267648888Scael.Bd -literal -offset indent 2677*67339Sah.ne 1i 267848888ScaelDEBUGGING ON 267948888ScaelDEBUG(fargv) MACRO: `.Em' Line #: 2 268048888Scael Argc: 1 Argv: `An' Length: 2 268148888Scael Space: ` ' Class: String 268248888Scael Argc: 2 Argv: `escaped' Length: 7 268348888Scael Space: ` ' Class: String 268448888Scael Argc: 3 Argv: `aC' Length: 2 268548888Scael Space: ` ' Class: String 268648888Scael MACRO REQUEST: .Em An escaped &aC 268748888ScaelDEBUGGING OFF 268848888Scael.Ed 268943435Scael.Pp 269048888ScaelThe argument 269148888Scael.Ql \e&aC 269248888Scaelshows up with the same length of 2 as the 269348888Scael.Ql \e& 269448888Scaelsequence produces a zero width, but a register 269548888Scaelnamed 269648888Scael.Ql \e&aC 269748888Scaelwas not found and the type classified as string. 269848888Scael.Pp 269948888ScaelOther diagnostics consist of usage statements and are self explanatory. 270050785Scael.Sh GROFF, TROFF AND NROFF 270150785ScaelThe 270250785Scael.Nm \-mdoc 270350785Scaelpackage does not need compatibility mode with 270450785Scael.Xr groff . 270550785Scael.Pp 270650785ScaelThe package inhibits page breaks, and the headers and footers 270750785Scaelwhich normally occur at those breaks with 270850785Scael.Xr nroff , 270950785Scaelto make the manual more efficient for viewing on-line. 271050785ScaelAt the moment, 271150785Scael.Xr groff 271250785Scaelwith 271350785Scael.Fl T Ns Ar ascii 271450785Scaeldoes eject the imaginary remainder of the page at end of file. 271550785ScaelThe inhibiting of the page breaks makes 271650785Scael.Xr nroff Ns 'd 271750785Scaelfiles unsuitable for hardcopy. 271850785ScaelThere is a register named 271950785Scael.Ql \&cR 272050785Scaelwhich can be set to zero in the site dependent style file 272150785Scael.Pa /usr/src/share/tmac/doc-nroff 272250785Scaelto restore the old style behavior. 272343435Scael.Sh FILES 272448888Scael.Bl -tag -width /usr/share/man0/template.doc -compact 272548888Scael.It Pa /usr/share/tmac/tmac.doc 272643435Scaelmanual macro package 272748888Scael.It Pa /usr/share/man0/template.doc 272843435Scaeltemplate for writing a man page 272948888Scael.El 273043435Scael.Sh SEE ALSO 273148888Scael.Xr mdoc 7 , 273243435Scael.Xr man 1 , 273343435Scael.Xr troff 1 273443435Scael.Sh BUGS 273543435ScaelUndesirable hyphenation on the dash of a flag 273643435Scaelargument is not yet resolved, and causes 273750772Scaeloccasional mishaps in the 273850772Scael.Sx DESCRIPTION 273950772Scaelsection. 274048888Scael(line break on the hyphen). 274143435Scael.Pp 274243435ScaelPredefined strings are not declared in documentation. 274343435Scael.Pp 274443435ScaelSection 3f has not been added to the header routines. 274543435Scael.Pp 274648888Scael.Ql \&.Nm 274750772Scaelfont should be changed in 274850772Scael.Sx NAME 274950772Scaelsection. 275043435Scael.Pp 275148888Scael.Ql \&.Fn 275243435Scaelneeds to have a check to prevent splitting up 275350772Scaelif the line length is too short. 275450785ScaelOccasionally it 275543435Scaelseparates the last parenthesis, and sometimes 275643435Scaellooks ridiculous if a line is in fill mode. 275743435Scael.Pp 275843435ScaelThe method used to prevent header and footer page 275943435Scaelbreaks (other than the initial header and footer) when using 276050785Scaelnroff occasionally places an unsightly partially filled line (blank) 276150785Scaelat the would be bottom of the page. 276243435Scael.Pp 276348888ScaelThe list and display macros to not do any keeps 276443435Scaeland certainly should be able to. 276550772Scael.\" Note what happens if the parameter list overlaps a newline 276650772Scael.\" boundary. 276750772Scael.\" to make sure a line boundary is crossed: 276850772Scael.\" .Bd -literal 276950772Scael.\" \&.Fn struct\e\ dictionarytable\e\ *dictionarylookup struct\e\ dictionarytable\e\ *tab[] 277050772Scael.\" .Ed 277150772Scael.\" .Pp 277250772Scael.\" produces, nudge nudge, 277350772Scael.\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] , 277450772Scael.\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] , 277550772Scael.\" nudge 277650772Scael.\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] . 277750772Scael.\" .Pp 277850772Scael.\" If double quotes are used, for example: 277950772Scael.\" .Bd -literal 278050772Scael.\" \&.Fn \*qstruct dictionarytable *dictionarylookup\*q \*qchar *h\*q \*qstruct dictionarytable *tab[]\*q 278150772Scael.\" .Ed 278250772Scael.\" .Pp 278350772Scael.\" produces, nudge nudge, 278450772Scael.\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" , 278550772Scael.\" nudge 278650772Scael.\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" , 278750772Scael.\" nudge 278850772Scael.\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" . 278950772Scael.\" .Pp 279050772Scael.\" Not a pretty sight... 279150772Scael.\" In a paragraph, a long parameter containing unpaddable spaces as 279250772Scael.\" in the former example will cause 279350772Scael.\" .Xr troff 279450772Scael.\" to break the line and spread 279550772Scael.\" the remaining words out. 279650772Scael.\" The latter example will adjust nicely to 279750772Scael.\" justified margins, but may break in between an argument and its 279850772Scael.\" declaration. 279950772Scael.\" In 280050772Scael.\" .Xr nroff 280150772Scael.\" the right margin adjustment is normally ragged and the problem is 280250772Scael.\" not as severe. 2803