[comp.text.tex] Looking for .sty for a C Code function manual

fuller@kadsma.kodak.com (Bill Fuller) (04/08/91)

Hi,

	I'm looking for a .sty that will print pages similar to 
a man page.  Can anyone help me?

			Thanks

William H. Fuller		Dial: (716)-726-2311
Senior Systems Consultant	UUCP: ...!rochester!kodak!kadsma!fuller
Rochester, N.Y.			ARPA: fuller@kadsma.kodak.com

russell@ccu1.aukuni.ac.nz (Russell J Fulton;ccc032u) (04/12/91)

fuller@kadsma.kodak.com (Bill Fuller) writes:

>Hi,

>	I'm looking for a .sty that will print pages similar to 
>a man page.  Can anyone help me?

manpage.sty by Rong Chen is available from Clarkson and possibly other 
archives as well. It was explicitly designed for documenting C funtions.


-- 
Russell Fulton, Computer Center, University of Auckland, New Zealand.
<rj_fulton@aukuni.ac.nz>

pauld@stowe.cs.washington.edu (Paul Barton-Davis) (04/13/91)

For those who believe that competition makes the world go round, here
is my own unix manual style. I haven't seen the output of Rong's
style, but I gather its not quite as exactly similar to the [a-z]roff
man macros as this one is. I meant to post this two years ago, but
never got around to it. Documentation, using the style itself (of
course) follows at the end, but might be slightly dated.

The @truedocstyle macro reflects a change I made in the standard
style files so that they could be included in others, but not print
out their own message. Remove it as you wish.

This is not one of my more well-documented style files, but I've
used it for 2 years now for all the Unix documentation I've written
(a lot!). It does some nice things like "extra page numbering"
where you need to add new pages to an existing entry and not have
the numbers increase, but use 260a, 260b etc. It also knows the names
of manual sections. Again, see the documentation/example for more
details.

Needed to use:

- times.sty, a modified version of Sebastian Rahtz's style option of the
	same name. It make Times Roman the default font family.
	(You can remove this, and use it as an option instead; I don't,
	because (i) I hate CM, and (ii) this is supposed to produce pages that
	look like [a-z]roff ones)

- threepart.sty, for headers and footers.

I can post these if people want them.  If anyone uses this, please
report bugs et alia to me.

enjoy,

Paul Barton-Davis			<pauld@cs.washington.edu>
UW Computer Science Lab		``to shatter tradition makes us feel free''

---- cut here for unixman.sty ---------------------
%% Unix `man' macros for LaTeX
%% Paul Davis <davis%scr@sdr.slb.com> Feb 1989

\def\@truedocstyle{Document Style `Unix Manual' V1.1 29February 1989}
\input{article.sty}

%%
%% --------------- PAGE DIMENSIONS -------------------
%%

\newdimen\sectionindent
\newdimen\subsectionindent
\newdimen\subsubsectionindent

\sectionindent 0.5 true in
\subsectionindent 0.25 true in
\subsubsectionindent 0pt

\oddsidemargin \sectionindent
\evensidemargin \sectionindent

\hoffset -1.35 cm  %% I really don't know why it needs this ...
\textwidth 6 in
\textheight 21.5cm
\headsep 0.5 in
\topmargin 0pt
\topskip 0pt

\footskip 1.0 in
\parindent 0pt
\parskip \baselineskip

%%
%% Set up fonts
%%

\input{times.sty}


%%
%% ---------------- SECTIONING COMMANDS --------------
%%

\def\section{\@startsection
{section}{1}{-\sectionindent}
{0pt plus .5ex minus -.2ex}{-1sp}{\normalsize\bf}*}

\def\subsection{\@startsection
{subsection}{2}{-\subsectionindent}
{0pt plus .5ex minus -.2ex}{-1sp}{\normalsize\bf}*}

\def\subsubsection{\@startsection
{subsubsection}{3}{\subsubsectionindent}
{0pt plus .5ex minus -.2ex}{-1sp}{\normalsize\it}*}

%%
%% a modified version of \@xsect
%%

%% In this case, if AFTERSKIP is negative, we simply
%% backup by \parskip immediately after the section heading.
%% This has the net effect of leaving no extra vertical space
%% between the heading and any following material. We also set
%% \@nobreaktrue to avoid extra space when putting a \list
%% immediately after such a heading.

\def\@xsect#1{\@tempskipa #1\relax
      \ifdim \@tempskipa>\z@
       \par \nobreak
       \vskip \@tempskipa
       \@afterheading
    \else 
	\global\@nobreaktrue 
	\global\@noskipsectrue
        \everypar{\if@noskipsec \global\@noskipsecfalse
                   \clubpenalty\@M \hskip -\parindent
                   \begingroup \@svsechd \endgroup \unskip
                   \vskip -\parskip
                  \else \clubpenalty \@clubpenalty
                    \everypar{}\fi}%
   \fi
   \ignorespaces}


%%
%% --------------- MISCELLANEOUS MACROS ---------------
%%

\def\commmand#1#2{{\bf #1}\/(#2)}%
\def\code#1{{\bf #1}}
\def\>{$>$\ignorespaces}%
\def\<{$<$\ignorespaces}%
\def\tilde{\~{}}%
\def\HOME{\tilde}%
\def\bs{$\backslash$}
\def\file#1{{\bi #1\/}}
\def\prog#1{{\sf #1}}
%%\gdef\[{\char'133}
%%\gdef\]{\char'135}
\def\pipe{{\tt |}}
\def\ltrl#1{{\bf #1}}
\def\arg#1{{\it #1}}

\def\name#1#2{%
\section{NAME}
#1 -- #2}
\def\synopsis{\section{SYNOPSIS}}
\def\description{\section{DESCRIPTION}}
\def\usage{\section{USAGE}}
\def\options{\section{OPTIONS}}
\def\diagnostics{\section{DIAGNOSTICS}}
\def\files{\section{FILES}}
\def\see{\section{SEE ALSO}}

% super speedy font switching

\def\I #1 {{\it #1}\ }
\def\R #1 {{\rm #1}\ }
\def\B #1 {{\bf #1}\ }
\def\T #1 {{\tt #1}\ }
\def\S #1 {{\sf #1}\ }

\def\BI #1 #2 {{\bf #1}\ {\it #2}\ }
\def\BR #1 #2 {{\bf #1}\ {\rm #2}\ }
\def\RB #1 #2 {{\rm #1}\ {\bf #2}\ }
\def\RI #1 #2 {{\rm #1}\ {\it #2}\ }
\def\IB #1 #2 {{\it #1}\ {\bf #2}\ }
\def\IR #1 #2 {{\it #1}\ {\rm #2}\ }


%%
%% ---------------- HEADERS AND FOOTERS ------------------
%%

%% first we define `thing' to expand to the name of whatever this
%% manpage is about. Then, we case on #2 and define the manual section
%% that this fits under. It is in this section that we have some
%% local specialities - sections numbered above 8 define local
%% manual sections.

%% Here is a map -

%%   9 - Operations
%%  10 - Communications
%%  11 - Checklists
%%  12 - Procedures
%%  13 - Standards
%%  14 - Devices

%%
%% page numbering
%%
%% This allows us to have selected `extra pages' in the style
%% of some of the newer troff filters - Pages normally numbered
%% with a pagenumber after \@xpgstart are subsequently numbered

%%        \@xpgstart{a,b,c ...}

%% where \@xpgstart is (hopefully obviously) a number !

\newcount\@xpgstart
\newcounter{@xpg}
\setcounter{@xpg}{1}
\newif\ifxpg \xpgfalse

\def\startpage#1{\setcounter{page}{#1}}
\def\extrapagesfrom#1{\@xpgstart #1 \xpgtrue}

%%
%% now define the header and footer
%%

\input{threepart.sty}
\def\@foottxt{\hbox to 0pt{\hfill}}
\def\@date{\hbox to 0pt{\hfill}}

%%\version{VERSION-NUMBER}{DATE}

\def\version#1#2{%
	\def\@foottxt{#1}
	\def\@date{#2}}

%%\header{NAME}{SECTION}[HEADER][FOOTER]

\newif\if@userhead 

\def\header#1#2{
	\@userheadfalse
	\def\@mansecnum{#2}	
	\@ifnextchar[%
	   {\@bhead{#1}{#2}}
	   {\@head{#1}{#2}}}

\def\@bhead#1#2[#3]{%
	\def\@mansect{\uppercase{#3}}%
	\@ifnextchar[%
		{\@chead{#1}{0}}
		{\@head{#1}{0}}}

\def\@chead#1#2[#3]{\def\@foottxt{#3}
	\@head{#1}{#2}}


\def\@head#1#2{%
\def\this{{\bf #1}}
\ifcase #2
	  \relax
	\or
	  \def\@mansect{USER COMMANDS}
	\or
	  \def\@mansect{SYSTEM CALLS}
   	\or
	  \def\@mansect{LIBRARY FUNCTIONS}
	\or
	  \def\@mansect{SPECIAL FILES}
	\or
	  \def\@mansect{FILE FORMATS}
	\or
	  \def\@mansect{GAMES AND DEMOS}
	\or
	  \def\@mansect{TABLES}
	\or
	  \def\@mansect{MAINTAINANCE COMMANDS}
	\or
	  \def\@mansect{OPERATIONS}
	\or
	  \def\@mansect{COMMUNCIATIONS}
	\or
	  \def\@mansect{PROCEDURES}
	\or
	  \def\@mansect{STANDARDS}
	\or
	  \def\@mansect{DEVICES}
\fi
%%
%% head line
%%
\rhead{\normalsize\uppercase{#1\/(\@mansecnum)}}
\chead{\normalsize\@mansect}
\lhead{\normalsize\uppercase{#1(\@mansecnum)}}
%%
%% footline
%%
\rfoot{\ifxpg%
	  \ifnum \thepage < \@xpgstart%
	     \normalsize\thepage
 	  \else%
	     \normalsize\the\@xpgstart\alph{@xpg}%
	     \addtocounter{@xpg}{1}
	  \fi
	\else
	     \normalsize\thepage
	\fi}
\cfoot{\normalsize Last change: \@date}
\lfoot{\normalsize Version: \@foottxt}}

%% redefine outputpage so as to ensure that the headline and
%% the footline cover the sectional headings as well.

\def\@outputpage{\begingroup\catcode`\ =10 \if@specialpage 
  \global\@specialpagefalse\@nameuse{ps@\@specialstyle}\fi
  \if@twoside 
    \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
      \let\@themargin\oddsidemargin
    \else
      \let\@thehead\@evenhead \let\@thefoot\@evenfoot
      \let\@themargin\evensidemargin
  \fi\fi
  \@tempdima \textwidth %% calculate total page width
  \advance\@tempdima \sectionindent
  \shipout
  \vbox{\normalsize \baselineskip\z@ \lineskip\z@
        \vskip \topmargin \moveright\@themargin
        \vbox{\setbox\@tempboxa
              \vbox to\headheight{\hbox to\@tempdima{\strut\@thehead}
				  \vfil}%
              \box\@tempboxa
              \vskip \headsep
              \hbox to\@tempdima{\hss\box\@outputbox}
              \baselineskip\footskip
              \hbox to\@tempdima{\@thefoot}}}%
  \global\@colht\textheight\endgroup
  \stepcounter{page}\let\firstmark\botmark}


%%   --------------- ENVIRONMENTS --------------------

%% a kludge to get correct spacing of a list environment 
%% immediately after a section name (used within given environments)

\newdimen\@ughamount 
\@ughamount -14pt %% Don't ask ...

\def\@ugh{\vskip \@ughamount}

\def\@item[#1]{%
  \if@noparitem \@donoparitem 
  \else
         \if@inlabel \indent \par \fi
         \ifhmode \unskip\unskip \par \fi 
         \if@newlist 
		\if@nobreak 
			\@nbitem 
	 	\else
                        \addpenalty\@beginparpenalty
                        \addvspace\@topsep \addvspace{-\parskip}
		\fi
           \else \addpenalty\@itempenalty \addvspace\itemsep 
          \fi 
    \global\@inlabeltrue 
  \fi
\everypar{\global\@minipagefalse\global\@newlistfalse 
          \if@inlabel\global\@inlabelfalse \hskip -\parindent \box\@labels
             \penalty\z@ \fi
          \everypar{}}\global\@nobreakfalse
\if@noitemarg \@noitemargfalse \if@nmbrlist \refstepcounter{\@listctr}\fi \fi
\setbox\@tempboxa\hbox{\makelabel{#1}}%
\global\setbox\@labels
 \hbox{\unhbox\@labels \hskip \itemindent
       \hskip -\labelwidth \hskip -\labelsep 
       \ifdim \wd\@tempboxa >\labelwidth 
                \box\@tempboxa
          \else \hbox to\labelwidth {\makelabel{#1}}\fi
       \hskip \labelsep}\ignorespaces}

%% A new makelabel command that attempts to set
%% the item label flushleft in a box of width \labelwdith.
%% If the label is too wide, then we throw in an additional hbox
%% the end, so that the item text is on a new line (kludge-y !)
%% This matches the conventional method of displaying options
%% in the Unix manuals.

\def\flmakelabel#1{\setbox\@tempboxa\hbox{#1}%
		   \ifdim \wd\@tempboxa > \labelwidth%
			 \hbox to \labelwidth{%
				\vbox{%
				    \hbox to 0pt{#1\hss}%
				    \hbox to 0pt{\hfil}}%
			    \hfil}%
		    \else%
			 #1\hfil\relax
		    \fi}
%%
%% Options environment
%%

%% \opt{OPTION} option text ...
%% \optarg{OPTION}{ARGUMENT} option text ...

\def\opt#1{\item[{\bf #1}]}
\def\optarg#1#2{%
	 \def\arg{{\it #2}\ }%
	 \item[{\bf #1}\ {\it #2}]}

\newdimen\optionwidth
\optionwidth\sectionindent

\def\options{%
\list{}{%
\leftmargin \optionwidth
\rightmargin 0pt
\labelwidth \optionwidth
\topsep -\parskip
\partopsep -\parskip
\labelsep 0pt
\let\@nbitem=\@ugh
\let\makelabel=\flmakelabel}}

\let\endoptions=\endlist

%%
%% file lists
%%

\newdimen\filenamewidth
\filenamewidth 2.0in
\let\filelistfont=\bf

\def\filelist{%
\list{}{%
\leftmargin \filenamewidth
\rightmargin 0pt
\labelwidth \filenamewidth
\topsep -\parskip
\partopsep -\parskip
\itemsep 0pt
\parsep 0pt
\labelsep 0pt
\let\@nbitem=\@ugh
\let\makelabel=\flmakelabel}}

\let\endfilelist=\endlist

%% \fileref{FILENAME} description ...

\def\fileref#1{\item[{\filelistfont #1}]\relax}

%% description

\newdimen\descriptionwidth
\descriptionwidth 1.5 in

\def\descriptionlabel#1{\flmakelabel{\bf #1}}

\def\description{\list{}{%
\labelwidth \descriptionwidth
\leftmargin \descriptionwidth
\rightmargin 0pt
\topsep 0pt plus 1pt
\partopsep 0pt plus 1pt
\labelsep 0pt
\let\makelabel=\descriptionlabel}}

\let\enddescription=\endlist

%% a kludge for use immediately after a section heading:

\def\sdescription{\list{}{%
\labelwidth \descriptionwidth
\leftmargin \descriptionwidth
\rightmargin 0pt
\topsep 0pt plus 1pt
\partopsep 0pt plus 1pt
\labelsep 0pt
\let\@nbitem=@ugh
\let\makelabel=\descriptionlabel}}

\let\endsdescription=\endlist

%% examples

\let\examplefont=\tt

\def\example{\list{}{%
\leftmargin 1cm
\rightmargin 1cm
\topsep 0pt
\partopsep 0pt
\examplefont}
\item[]}

\let\endexample=\endlist

-----------------------------------------------------
---- cut here for unixman.tex (the documentation) ---
-----------------------------------------------------
\documentstyle{unixman} 

%%
%% a few macros we need for this document alone
%%
\filenamewidth 3.5 in
\def\met#1{{\it #1}}
\def\meta#1{{$<${\it #1}$>$}}
\gdef\[{\char'133}
\gdef\]{\char'135}

\begin{document} 

\version{1.0}{27 February 1989}
\header{unixman}{1L}[\LaTeX\ styles]

\section{NAME}

unixman -- \LaTeX\ document style produce Unix-style manual pages

\section{SYNOPSIS} 

{\tt
\bs documentstyle[unixman]\\
\bs begin\{document\}\\
\bs header\{\met{name}\}\{\met{section-number}\}[\met{section-name}]\\
\bs version\{\met{version-id}\}\{\met{date}\}

\bs section\{NAME\}

\hbox to 2cm{\hfil \vdots \hfil}

\bs end\{document\}
}

\section{DESCRIPTION} 

The \this\ document style produces documents conforming to the conventions
of the Unix manual, as embodied in the \command{troff}{1} ``man'' macros.
It uses the standard \LaTeX\ sectioning commands, and defines several
new commands and environments to make manual page formatting easier.
These include facilities for printing lists of command line flags and
doing rapid font switches, which tend to be common to reference manuals.

\subsection{Commands}

\begin{description}

\item[\bs version\{{\it version-id}\}\{{\it date}\}]
define the version number and date of modification of this manual entry.


\item[\bs header\{\I name \}\{\I section-number \}\[\I section-name \]]
define the name of the command and the section number in which it is
to appear. \I section-name is an optional argument used to override
the default name for \I section-number.

\item[\bs startpage\{{\it page-number}\}] 
start page numbering from {\it pagenumber}.

\item[\bs extrapagesfrom\{{\it page-number}\}] 
number all pages beyond {\it pagenumber} in the style {\it
pagenumber}a, {\it pagenumber}b and so on. For use when adding extra
pages to an existing manual. For instance, if you use
{\tt \bs extrapagesfrom\{260\}}, then instead of 260, 261, 262 you will 
get 260, 260a, 260b and so on.

\item[\bs file\{{\it file}\}] 
prints the name of a file in the default
font for such items\\
(e.g. {\tt \bs file\{/usr/lib\}} $\rightarrow$ \file{/usr/lib})

\item[\bs prog\{{\it program}\}] 
prints a program in the default font
for such items\\ 
(e.g. {\tt \bs prog\{awk\}} $\rightarrow$ \prog{awk}).

\item[\bs this] 
prints the name of this manual page, emboldened.

\item[\bs R, \bs T, \bs I, \bs S]
print the next word in a \R roman, \T typewriter, \I italic, and \S san-serif
font respectively. The word must be delimited by white space.

\item[\bs RB, \bs RI, \bs IB, \bs IR, \bs BI, \bs BR]
print the next two words in alternating fonts, where the two letters
specify the font according to the single word version described above.
The words must be delimited by whitespace.

\item[\bs tilde] 
prints a tilde (\tilde)

\item[\bs pipe]
prints a vertical bar (\pipe).

\item[\bs bs]
prints a backslash (\bs). Useful for manual pages about \LaTeX.

\item[\bs\<\ \R \& \bs\>] 
print left- and right- arrow brackets (\<\ \& \>).
These commands ignore following spaces completely.

\item[\bs \[\ \R and \bs \]]
print left and right square brackets (\[\ \& \]). Necessary in {\tt item} labels
within a list environment. 

\end{description}

\subsection{Environments}

The \this\ style defines several new environments to make the
formatting of manual pages easier and more consistent.

\subsubsection{Options}

The {\tt options} environment is intended for creating lists of
command line flags. Within it there are two special commands, {\tt \bs
opt} and {\tt \bs optarg}. The first is used to describe an flag that
has no arguments; the second is used in the case where there are
arguments.  With the {\tt optarg} command, you can use the command
{\tt \bs arg} to simply print the argument in the same style and
without retyping it.  An example -- the following \LaTeX\ specification:

\begin{example}
\begin{verbatim}
\begin{options}
\opt{-p} print top value on the stack
\optarg{-s}{x} put top of stack into register named \arg
\optarg{-I}{directory} add \arg to the list of directories searched.
\end{options}
\end{verbatim}
\end{example}

produces the following results

\begin{example}
\rm
\begin{options}
\opt{-p} print top value on the stack
\optarg{-s}{x} put top of stack into register named \arg
\optarg{-I}{directory} add \arg to the list of directories searched.
\end{options}
\end{example}

Note how the description is positioned when the argument associated
with an option flag is especially long (see PARAMETERS, below).

\subsubsection{Filelist}

The {\tt filelist} environment provides a simple means of formatting
lists of files for the standard FILES section of a manual page, or
elsewhere if desired.
 		       
\begin{example}
\bs begin\{filelist\}\\
\bs fileref\{\I filename\} \I description \ldots\\
\bs end\{filelist\}
\end{example}

{\tt \bs fileref} sets its argument in a default face. The description
part is optional, and its position in the case of very long filenames
follows the pattern for the `options' environment described above (see
PARAMETERS, below).

\subsubsection{Example}

The example environment provides an indented environment with a
typewriter font (Courier) as the default. If you wish to be able to
use all letters and symbols easily, you should use a verbatim
environment within an example.

\subsection{Parameters}

\begin{description}
\item[\bs filenamewidth] the width of a filename in a filelist that
when exceeded, causes the description (if present) to be wrapped to
the next line.  The default is 2.0 inches.

\item[\bs optionwidth] the width of an option in an options list that
when exceeded, causes the description (if present) to be wrapped to
the next line. The default is 0.5 inches

\item[\bs descriptionwidth] as {\tt \bs optionwidth}, but for
description environments. The default is 1.5 inches.

\item[\bs examplefont] the font to use in the 
{\tt example} environment. The defaut is typewriter (Courier).

\end{description}

\subsection{Conventions}

A typical manual page for a command  or  function  is
laid out as follows:

any old string
%%{\tt \bs header}\{TITLE\}\{1-8\}

The name of the  command  or  function  in  upper-case,
which  serves  as the title of the manual page. This is
followed by the number  of  the  section  in  which  it
appears.

{\tt \bs version}\{VERSION\}\{DATE\}

The version number and last modification of this manual page.

{\tt \bs section}\{NAME\}

{\tt name} (or comma-separated list of names) --  one-line summary

The name, or list of names, by  which  the  command  is
called,  followed by a dash and then a one-line summary
of the action performed. The summary should contain no
\LaTeX\ macros since it is used to contribute to the
`whatis' database.

{\tt \bs section}\{SYNOPSIS\}

{\bf Commands:}

The syntax of the command and  its  arguments,  as
typed  on  the  command line.  When in boldface, a
word must be typed exactly as  printed.   When  in
italics,  a  word can be replaced with an argument
that you supply.  References to bold or italicized
items  are not capitalized in other sections, even
when they begin a sentence.

Syntactic symbols appear in roman face:

\begin{description}
\item[\[\ \]] An argument, when surrounded by  brackets  is
                    optional.
\item[\pipe] Arguments separated by  a  vertical  bar  are
                    exclusive.   You  can  supply  only item from
                    such a list.
\item[\ldots] Arguments  followed  by  an  elipsis  can  be
                    repeated.   When  an elipsis follows a bracketed
                    set, the expression within the  brackets
                    can be repeated. 
\end{description}

{\bf Functions:}

If required, the data declaration, or \#include directive, is shown
first, followed by the function declaration.  Otherwise, the function
declaration is shown.

{\tt \bs section}\{DESCRIPTION\}

A narrative overview of the command or function's external behavior.
This includes how it interacts with files or data, and how it handles
the standard input, standard output and standard error.  Internals and
implementation details are normally omitted.  This section attempts to
provide a succinct overview in answer to the question, "what does it
do?"

Literal text from the synopsis appears in boldface, as do literal
filenames and references to items that appear elsewhere in a reference
manual.  Arguments are italicized.

If a command interprets either subcommands or an input grammar, its
command interface or input grammar is normally described in a USAGE
section, which follows the OPTIONS section.  (The DESCRIPTION section
only describes the behavior of the command itself, not that of
subcommands.)

{\tt \bs section}\{OPTIONS\}

The list of options along with  a  description  of  how
each affects the command's operation. These should be
formatted within an {\tt options} environment.

{\tt \bs section}\{FILES\}

A list of files associated with the  command  or  function. 
These should be formatted within a {\tt filelist}
environment.

{\tt \bs section}\{SEE ALSO\}

A  comma-separated list of related  manual  pages,  followed
by references to other published materials.

{\tt \bs section}\{DIAGNOSTICS\}

A list of diagnostic messages  and  an  explanation  of
each.

{\tt \bs section}\{BUGS\}

A description of limitations, known defects, and possible
problems associated with the command or function.

\section{FILES}

\begin{filelist}
\fileref{/usr/local/lib/tex/macros/unixman.sty} The base style file
\fileref{/usr/local/lib/tex/macros/psfonts.sty} PostScript font definitions
\fileref{/usr/local/lib/tex/macros/postscript.sty} PostScript font loading
\fileref{/usr/local/lib/tex/macros/*.sty} other style options
\end{filelist}
   
\section{SEE ALSO} 

\command{addison-wesley}{1L}, \command{man}{7}, \command{troff}{1}

{\it Formatting Documents, Chapter 3: the \T -man macro package}

\section{BUGS}

There is an \bs hoffset in the page dimensions whose function is not
clear.

There is a grotesque kludge used to get lists after section headings
spaced from the latter as if they were pure text, consisting of 
{\tt\bs vskip}'ing 14pt's back up the page. This is highly non-portable and
very bad style. Any better ideas~?

An \T verbatim environment immediately within another environment
other than \T example will not leave the normal amount of vertical space
before it. In fact, it leaves less than none at all.
\end{document}

-- 
Paul Barton-Davis			<pauld@cs.washington.edu>
UW Computer Science Lab		``to shatter tradition makes us feel free''

form@tbird.uucp (71133-thomas a rowe(l670)m000) (04/16/91)

In article <1991Apr12.173053.9936@beaver.cs.washington.edu> pauld@cs.washington.edu (Paul Barton-Davis) writes:
>
>Needed to use:
>
>- times.sty, a modified version of Sebastian Rahtz's style option of the
>	same name. It make Times Roman the default font family.
>	(You can remove this, and use it as an option instead; I don't,
>	because (i) I hate CM, and (ii) this is supposed to produce pages that
>	look like [a-z]roff ones)
>
>- threepart.sty, for headers and footers.
>
>I can post these if people want them.  If anyone uses this, please
>report bugs et alia to me.


Please post these files.

Christopher Rath

pauld@stowe.cs.washington.edu (Paul Barton-Davis) (04/17/91)

as requested. I have palatino.sty, dingbats.sty, bookman.sty
et alia, but a look at you dvi[2t]*ps manual should make
it fairly clear how to transform Times into something else.
You just need to use whatever fontname mapping scheme your
dvi driver uses ion place of t-rom, t-ita etc.

Please note the addition of new font switches:

	\tb	"typewriter" bold
	\ho	helvetica oblique (if you use helvetica as sf, 
			consider this san-serif oblique)
	\hb	helvetica bold (as above)
	\bi	bold italics (roman family)
	\bo	bold oblique (roman family)

Normal LaTeX doesn't need these, because normal LaTeX doesn't
have the TFM files to use for these fonts. I don't use them
a lot, but they are handy, especially \tb.

enjoy,
Paul Barton-Davis			<pauld@cs.washington.edu>
UW Computer Science Lab		``to shatter tradition makes us feel free''

--- cut here for times.sty ------
%% times.sty - use Times Roman as the basic font family

\def\@mrm{t-rom}% 	Times Roman
\def\@mit{t-ita}% 	Times Italic
\def\@msl{t-obl}% 	Times Oblique
\def\@mbf{t-bol}% 	Times Bold
\def\@mbi{t-bolita}%	Times Bold Italic
\def\@mbo{t-bolobl}%	Times Bold Oblique
\def\@mtt{c-med}% 	Courier
\def\@mtb{c-bol}% 	Courier Bold
\def\@mcsc{t-romsc}% 	Times Roman Small Caps
\def\@mss{h-med}% 	Helvetica
\def\@hob{h-obl}% 	Helvetica Oblique
\def\@hbf{h-bol}% 	Helvetica Bold

%% and do the fonts themselves

\input{psdef.sty}

----- cut here for psdef.sty

%% Font stuff for lots of PostScript fonts, 
%% 	with Times-Roman as the main family
%% Paul Davis <davis%scr@sdr.slb.com> January 1989

%% This file makes a number of extra font switches available:
%% This borrowed from the file palatino.sty, obtained from Sebastian Rahtz,
%% (actual author unknown).

\def\@@getfont#1#2#3#4#5#6#7{%
\@ifundefined{\string #1\string #5}{\global\expandafter
    \font \csname \string #1\string #5\endcsname #4\@ptscale{#5}\relax}{}%
\@ifundefined{\string #1\string #6}{\global\expandafter
    \font \csname \string #1\string #6\endcsname #4\@ptscale{#6}\relax}{}%
\@ifundefined{\string #1\string #7}{\global\expandafter
    \font \csname \string #1\string #7\endcsname #4\@ptscale{#7}\relax}{}%
\@ifundefined{\string #1\string #3}{\global\expandafter
    \let \csname \string #1\string #3\endcsname #3\relax 
     \@addfontinfo#3{\textfont #2\csname \string #1\string #5\endcsname 
     \scriptfont #2\csname \string #1\string #6\endcsname 
     \scriptscriptfont #2\csname \string #1\string #7\endcsname 
     \def#1{\fam #2\csname\string #1\string #5\endcsname}}}{}#3#1}
\def\@@@getfont#1#2#3#4#5{%
\@ifundefined{\string #1\string #5}{\global\expandafter
    \font \csname \string #1\string #5\endcsname #4\@ptscale{#5}\relax}{}%
\@ifundefined{\string #1\string #3}{\global\expandafter
    \let \csname \string #1\string #3\endcsname #3\relax 
     \@addfontinfo#3{\def#1{\fam #2\csname\string #1\string #5\endcsname}}}{}#3#1}

%% note the added new font specs (\pho, \phb, \ptb etc.) for
%% extra fonts needed.

\def\@psfonts#1#2#3#4{%
\def\prm{\@@@getfont\prm\z@#1\@mrm{#2}}%
\def\pit{\@@getfont\pit\itfam#1\@mit{#2}{#3}{#4}}%
\def\pbi{\@@getfont\pbi\itfam#1\@mbi{#2}{#3}{#4}}%
\def\pbo{\@@getfont\pbo\bffam#1\@mbo{#2}{#3}{#4}}%
\def\psl{\@@getfont\psl\slfam#1\@msl{#2}{#3}{#4}}%
\def\pbf{\@@getfont\pbf\bffam#1\@mbf{#2}{#3}{#4}}%
\def\ptt{\@@getfont\ptt\ttfam#1\@mtt{#2}{#3}{#4}%
\@nohyphens\ptt {#2}\@nohyphens\ptt {#3}\@nohyphens\ptt {#4}}%
\def\psf{\@@getfont\psf\sffam#1\@mss{#2}{#3}{#4}}%
\def\psc{\@@getfont\psc\scfam#1\@mcsc{#2}{#3}{#4}}%
\def\pho{\@@getfont\pho\sffam#1\@hob{#2}{#3}{#4}}%
\def\phb{\@@getfont\phb\bffam#1\@hbf{#2}{#3}{#4}}%
\def\ptb{\@@getfont\ptb\bffam#1\@mtb{#2}{#3}{#4}}}%

%% define new font switch for extra fonts

\def\ho{\protect\pho}% 	helvetica oblique
\def\hb{\protect\phb}% 	helvetica bold
\def\tb{\protect\ptb}%  courier ("typewriter") bold
\def\bi{\protect\pbi}%  times bold italic
\def\bo{\protect\pbo}%	times bold oblique

\def\vpt{\textfont\z@\fivrm 
  \scriptfont\z@\fivrm \scriptscriptfont\z@\fivrm
\textfont\@ne\fivmi \scriptfont\@ne\fivmi \scriptscriptfont\@ne\fivmi
\textfont\tw@\fivsy \scriptfont\tw@\fivsy \scriptscriptfont\tw@\fivsy
\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
\def\unboldmath{\everymath{}\everydisplay{}\@nomath
  \unboldmath\fam\@ne\@boldfalse}\@boldfalse
\def\boldmath{\@subfont\boldmath\unboldmath}%
\@psfonts\@vpt555%
\def\ly{\fam\lyfam\fivly}\textfont\lyfam\fivly 
    \scriptfont\lyfam\fivly \scriptscriptfont\lyfam\fivly 
\@setstrut\rm}
\def\@vpt{}
\def\vipt{\textfont\z@\sixrm 
  \scriptfont\z@\sixrm \scriptscriptfont\z@\sixrm
\textfont\@ne\sixmi \scriptfont\@ne\sixmi \scriptscriptfont\@ne\sixmi
\textfont\tw@\sixsy \scriptfont\tw@\sixsy \scriptscriptfont\tw@\sixsy
\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
\def\unboldmath{\everymath{}\everydisplay{}\@nomath
  \unboldmath\@boldfalse}\@boldfalse
\def\boldmath{\@subfont\boldmath\unboldmath}%
\@psfonts\@vipt666
\def\ly{\fam\lyfam\sixly}\textfont\lyfam\sixly 
    \scriptfont\lyfam\sixly \scriptscriptfont\lyfam\sixly 
\@setstrut\rm}
\def\@vipt{}
\def\viipt{\textfont\z@\sevrm 
  \scriptfont\z@\sixrm \scriptscriptfont\z@\fivrm
\textfont\@ne\sevmi \scriptfont\@ne\fivmi \scriptscriptfont\@ne\fivmi
\textfont\tw@\sevsy \scriptfont\tw@\fivsy \scriptscriptfont\tw@\fivsy
\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
\def\unboldmath{\everymath{}\everydisplay{}\@nomath
\unboldmath\@boldfalse}\@boldfalse
\def\boldmath{\@subfont\boldmath\unboldmath}%
\@psfonts\@viipt755%
\def\ly{\fam\lyfam\sevly}\textfont\lyfam\sevly 
    \scriptfont\lyfam\fivly \scriptscriptfont\lyfam\fivly 
\@setstrut \rm}
\def\@viipt{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\viiipt{\textfont\z@\egtrm 
  \scriptfont\z@\sixrm \scriptscriptfont\z@\fivrm
\textfont\@ne\egtmi \scriptfont\@ne\sixmi \scriptscriptfont\@ne\fivmi
\textfont\tw@\egtsy \scriptfont\tw@\sixsy \scriptscriptfont\tw@\fivsy
\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
\def\unboldmath{\everymath{}\everydisplay{}\@nomath
\unboldmath\@boldfalse}\@boldfalse
\def\boldmath{\@subfont\boldmath\unboldmath}%
\@psfonts\@viiipt865%
\def\ly{\fam\lyfam\egtly}\textfont\lyfam\egtly 
    \scriptfont\lyfam\sixly \scriptscriptfont\lyfam\fivly 
\@setstrut \rm}
\def\@viiipt{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\ixpt{\textfont\z@\ninrm 
  \scriptfont\z@\sixrm \scriptscriptfont\z@\fivrm
\textfont\@ne\ninmi \scriptfont\@ne\sixmi \scriptscriptfont\@ne\fivmi
\textfont\tw@\ninsy \scriptfont\tw@\sixsy \scriptscriptfont\tw@\fivsy
\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
\def\unboldmath{\everymath{}\everydisplay{}\@nomath\unboldmath
    \@boldfalse}\@boldfalse
\def\boldmath{\@subfont\boldmath\unboldmath}%
\@psfonts\@ixpt965%
\def\ly{\fam\lyfam\ninly}\textfont\lyfam\ninly 
   \scriptfont\lyfam\sixly \scriptscriptfont\lyfam\fivly 
\@setstrut \rm}
\def\@ixpt{}
\def\xpt{\textfont\z@\tenrm 
  \scriptfont\z@\sevrm \scriptscriptfont\z@\fivrm
\textfont\@ne\tenmi \scriptfont\@ne\sevmi \scriptscriptfont\@ne\fivmi
\textfont\tw@\tensy \scriptfont\tw@\sevsy \scriptscriptfont\tw@\fivsy
\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
\def\unboldmath{\everymath{}\everydisplay{}\@nomath\unboldmath
          \textfont\@ne\tenmi 
          \textfont\tw@\tensy \textfont\lyfam\tenly
          \@boldfalse}\@boldfalse
\def\boldmath{\@ifundefined{tenmib}{\global\font\tenmib\@mbi 
   \global\font\tensyb\@mbsy 
   \global\font\tenlyb\@lasyb\relax\@addfontinfo\@xpt
   {\def\boldmath{\everymath{\mit}\everydisplay{\mit}\@prtct\@nomathbold
        \textfont\@ne\tenmib \textfont\tw@\tensyb 
        \textfont\lyfam\tenlyb \@prtct\@boldtrue}}}{}\@xpt\boldmath}%
\@psfonts\@xpt{10}75%
\def\ly{\fam\lyfam\tenly}\textfont\lyfam\tenly 
   \scriptfont\lyfam\sevly \scriptscriptfont\lyfam\fivly 
\@setstrut \rm}
\def\@xpt{}
\def\xipt{\textfont\z@\elvrm 
  \scriptfont\z@\egtrm \scriptscriptfont\z@\sixrm
\textfont\@ne\elvmi \scriptfont\@ne\egtmi \scriptscriptfont\@ne\sixmi
\textfont\tw@\elvsy \scriptfont\tw@\egtsy \scriptscriptfont\tw@\sixsy
\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
\def\unboldmath{\everymath{}\everydisplay{}\@nomath\unboldmath
          \textfont\@ne\elvmi \textfont\tw@\elvsy 
          \textfont\lyfam\elvly \@boldfalse}\@boldfalse
\def\boldmath{\@ifundefined{elvmib}{\global\font\elvmib\@mbi\@halfmag 
         \global\font\elvsyb\@mbsy\@halfmag
         \global\font\elvlyb\@lasyb\@halfmag\relax\@addfontinfo\@xipt
         {\def\boldmath{\everymath{\mit}\everydisplay{\mit}\@prtct\@nomathbold
                \textfont\@ne\elvmib \textfont\tw@\elvsyb 
                \textfont\lyfam\elvlyb\@prtct\@boldtrue}}}{}\@xipt\boldmath}%
\@psfonts\@xipt{11}86%
\def\ly{\fam\lyfam\elvly}\textfont\lyfam\elvly 
   \scriptfont\lyfam\egtly \scriptscriptfont\lyfam\sixly 
\@setstrut \rm}
\def\@xipt{}
\def\xiipt{\textfont\z@\twlrm 
  \scriptfont\z@\egtrm \scriptscriptfont\z@\sixrm
\textfont\@ne\twlmi \scriptfont\@ne\egtmi \scriptscriptfont\@ne\sixmi
\textfont\tw@\twlsy \scriptfont\tw@\egtsy \scriptscriptfont\tw@\sixsy
\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
\def\unboldmath{\everymath{}\everydisplay{}\@nomath\unboldmath
          \textfont\@ne\twlmi 
          \textfont\tw@\twlsy \textfont\lyfam\twlly
          \@boldfalse}\@boldfalse
\def\boldmath{\@ifundefined{twlmib}{\global\font\twlmib\@mbi\@magscale1\global
        \font\twlsyb\@mbsy \@magscale1\global\font
         \twllyb\@lasyb\@magscale1\relax\@addfontinfo\@xiipt
              {\def\boldmath{\everymath
                {\mit}\everydisplay{\mit}\@prtct\@nomathbold
                \textfont\@ne\twlmib \textfont\tw@\twlsyb 
                \textfont\lyfam\twllyb\@prtct\@boldtrue}}}{}\@xiipt\boldmath}%
\@psfonts\@xiipt{12}86%
\def\ly{\fam\lyfam\twlly}\textfont\lyfam\twlly 
   \scriptfont\lyfam\egtly \scriptscriptfont\lyfam\sixly
 \@setstrut \rm}
\def\@xiipt{}
\def\xivpt{\textfont\z@\frtnrm 
  \scriptfont\z@\tenrm \scriptscriptfont\z@\sevrm
\textfont\@ne\frtnmi \scriptfont\@ne\tenmi \scriptscriptfont\@ne\sevmi
\textfont\tw@\frtnsy \scriptfont\tw@\tensy \scriptscriptfont\tw@\sevsy
\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
\def\unboldmath{\everymath{}\everydisplay{}\@nomath\unboldmath 
          \textfont\@ne\frtnmi \textfont\tw@\frtnsy 
          \textfont\lyfam\frtnly \@boldfalse}\@boldfalse
\def\boldmath{\@ifundefined{frtnmib}{\global\font
        \frtnmib\@mbi\@magscale2\global\font\frtnsyb\@mbsy\@magscale2
         \global\font\frtnlyb\@lasyb\@magscale2\relax\@addfontinfo\@xivpt
               {\def\boldmath{\everymath
                {\mit}\everydisplay{\mit}\@prtct\@nomathbold
              \textfont\@ne\frtnmib \textfont\tw@\frtnsyb 
              \textfont\lyfam\frtnlyb\@prtct\@boldtrue}}}{}\@xivpt\boldmath}%
\@psfonts\@xivpt{14}{10}7%
\def\ly{\fam\lyfam\frtnly}\textfont\lyfam\frtnly 
   \scriptfont\lyfam\tenly \scriptscriptfont\lyfam\sevly 
\@setstrut \rm}
\def\@xivpt{}
\def\xviipt{\textfont\z@\svtnrm 
  \scriptfont\z@\twlrm \scriptscriptfont\z@\tenrm
\textfont\@ne\svtnmi \scriptfont\@ne\twlmi \scriptscriptfont\@ne\tenmi
\textfont\tw@\svtnsy \scriptfont\tw@\twlsy \scriptscriptfont\tw@\tensy
\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
\def\unboldmath{\everymath{}\everydisplay{}\@nomath\unboldmath
          \textfont\@ne\svtnmi \textfont\tw@\svtnsy \textfont\lyfam\svtnly
          \@boldfalse}\@boldfalse
\def\boldmath{\@subfont\boldmath\unboldmath}%
\@psfonts\@xviipt{17}{12}{10}%
\def\ly{\fam\lyfam\svtnly}\textfont\lyfam\svtnly 
   \scriptfont\lyfam\twlly   \scriptscriptfont\lyfam\tenly
\@setstrut \rm}
\def\@xviipt{}
\def\xxpt{\textfont\z@\twtyrm 
  \scriptfont\z@\frtnrm \scriptscriptfont\z@\twlrm
\textfont\@ne\twtymi \scriptfont\@ne\frtnmi \scriptscriptfont\@ne\twlmi
\textfont\tw@\twtysy \scriptfont\tw@\frtnsy \scriptscriptfont\tw@\twlsy
\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
\def\unboldmath{\everymath{}\everydisplay{}\@nomath\unboldmath
        \textfont\@ne\twtymi \textfont\tw@\twtysy \textfont\lyfam\twtyly
        \@boldfalse}\@boldfalse
\def\boldmath{\@subfont\boldmath\unboldmath}%
\@psfonts\@xxpt{20}{14}{12}%
\def\ly{\fam\lyfam\twtyly}\textfont\lyfam\twtyly 
   \scriptfont\lyfam\frtnly \scriptscriptfont\lyfam\twlly 
\@setstrut \rm}
\def\@xxpt{}
\def\xxvpt{\textfont\z@\twfvrm 
  \scriptfont\z@\twtyrm \scriptscriptfont\z@\svtnrm
\textfont\@ne\twtymi \scriptfont\@ne\twtymi \scriptscriptfont\@ne\svtnmi
\textfont\tw@\twtysy \scriptfont\tw@\twtysy \scriptscriptfont\tw@\svtnsy
\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
\def\unboldmath{\everymath{}\everydisplay{}\@nomath\unboldmath
        \textfont\@ne\twtymi \textfont\tw@\twtysy \textfont\lyfam\twtyly
        \@boldfalse}\@boldfalse
\def\boldmath{\@subfont\boldmath\unboldmath}%
\@psfonts\@xxvpt{25}{20}{17}%
\def\ly{\fam\lyfam\twtyly}\textfont\lyfam\twtyly 
   \scriptfont\lyfam\twtyly \scriptscriptfont\lyfam\svtnly 
\@setstrut \rm}
\def\@xxvpt{}

---- cut here for threepart.sty ----

% Three part head and foot macros. 1/87
% Lance Berc
% Olsen & Associates	mcvax!unizh!olsen!lance@seismo.css.gov
% Seefeldstrasse 233
% CH-8008 Zurich

% How users can set the head and foot text.
\def\lhead#1{\gdef\@lhead{#1}} \def\lfoot#1{\gdef\@lfoot{#1}}
\def\chead#1{\gdef\@chead{#1}} \def\cfoot#1{\gdef\@cfoot{#1}}
\def\rhead#1{\gdef\@rhead{#1}} \def\rfoot#1{\gdef\@rfoot{#1}}

% Initialization of the head and foot text.
% By default the page number is at the center of the foot and everything
% else is empty.
\def\@lhead{} \def\@lfoot{}
\def\@chead{} \def\@cfoot{{\rm \thepage}}
\def\@rhead{} \def\@rfoot{}

% Put together a three part header or footer given the left, center and
% right text. The \lap commands put the text into an hbox of zero size,
% so overlapping text is not detected (it just overlaps).
\def\@threepart#1#2#3{\rlap{#1} \hfil {#2} \hfil \llap{#3}}

% Swap the notices on odd and even pages when twosided.
\def\ps@threepartheadings
    {
    \def\@oddhead{\@threepart{\@lhead}{\@chead}{\@rhead}}
    \def\@oddfoot{\@threepart{\@lfoot}{\@cfoot}{\@rfoot}}

    \if@twoside
	\def\@evenhead{\@threepart{\@rhead}{\@chead}{\@lhead}}
	\def\@evenfoot{\@threepart{\@rfoot}{\@cfoot}{\@lfoot}}
    \else
	\def\@evenhead{\@threepart{\@lhead}{\@chead}{\@rhead}}
	\def\@evenfoot{\@threepart{\@lfoot}{\@cfoot}{\@rfoot}}
    \fi
    }

% Default page style
\ps@threepartheadings

% Default footers
\cfoot{\thepage}

-- 
Paul Barton-Davis			<pauld@cs.washington.edu>
UW Computer Science Lab		``to shatter tradition makes us feel free''