adaptations for ps, pdf and html generation
[scilab.git] / scilab_doc / LaTex-doc / tr2latex / troffman.sty
1 % -*-LaTeX-*-
2 % <BEEBE.TR2TEX>TROFFMAN.STY.6, 24-Feb-87 09:53:53, Edit by BEEBE
3 % These macros are intended to be referenced by a LaTeX
4 % \documentstyle[troffman]{article}
5 % command.  You can insert an 11pt or 12pt option if you like larger
6 % type--sizes set here are computed from the LaTeX point size setting.
7 % Size values have been chosen to closely match Unix manual page
8 % documents, which are actually too wide and too high for good
9 % typographic taste and readability.
10 %% Troffman customisation 
11 %% Added by J.P.Chancelier 21-avril-1993
12
13
14 \hbadness=10000                 % do not want underfull box messages--there are
15                                 % usually lots in man pages
16 \hfuzz=\maxdimen                % no overfull box messages either
17
18 \newcommand{\bs}{$\backslash$}
19 \def\under{\underline}
20 \def\dotdot{\ddot}
21 \def\nwl{\hfill\break}          % similar to LaTex's \newline but does not
22                                 % complain if there is no line to break
23 \def\ind#1{\par\everypar{\hangindent=#1\hangafter=0\hskip-\parindent}}
24 \def\tmpind#1{\par\hskip#1}
25 \newenvironment{SEPcntr}{\begin{center}}{\end{center}}
26 \def\cntr#1{\begin{SEPcntr} #1 \end{SEPcntr}}
27 % displayed text, indented, justification off
28 \def\displaybegin{\par\begingroup\medskip\narrower\narrower\noindent
29                   \obeylines\obeyspaces}
30 \def\displayend{\endgroup\smallskip\noindent}
31 % fill and nofill
32 \def\nofill{\par\begingroup\noindent\obeylines
33     \frenchspacing\@vobeyspaces\linepenalty1000}
34 {\catcode`\ =\active\gdef\@vobeyspaces{\catcode`\ \active \let \@xobeysp}}
35 \def\@xobeysp{\leavevmode{} }
36 \def\fill{\endgroup\noindent}
37
38 % define a boxing macro
39 \def\boxit#1{\vbox{\hrule\hbox{\vrule\kern10pt\vbox{\medskip\kern5pt#1\bigskip
40 \kern5pt}\kern10pt\vrule}\hrule}}
41
42 % try this TPlist environment
43 \newcommand{\TPlistlabel}[1]{\mbox{#1}\hfil}
44 \newenvironment{TPlist}[1]{
45 \begin{list}{}
46     {
47       \let\makelabel\TPlistlabel
48       \settowidth{\labelwidth}{#1mm}
49       \setlength{\leftmargin}{\parmargin}       % all paragraphs have this much
50       \addtolength{\leftmargin}{\labelwidth}    % space for label
51     }
52   }{
53 \end{list}}
54
55 %% Begin a new doc 
56
57 \def\phead#1#2#3#4#5{%
58   \renewcommand{\@oddhead}{\underline{\hbox to \textwidth{#1 \hfill #5}}}
59   \renewcommand{\@oddfoot}{\mbox{\hbox to \textwidth{#4\hfill #3\hfill \rm\thepage}}}
60   \renewcommand{\@evenfoot}{\@oddfoot}%
61   \renewcommand{\@evenhead}{\@oddhead}%
62 }
63 \setcounter{secnumdepth}{3}
64 % multi-line left-justified subheading
65 % since we want to use #1 as an index entry we must 
66 \def\Sdoc#1#2{
67         \typeout{[#1]}% maybe temporary, but nice for progress report
68         \subsection{{ #1} \hrulefill { #2}}
69 }
70 \def\SSdoc#1#2{
71         \typeout{[#1]}% maybe temporary, but nice for progress report
72         \subsubsection{{ #1} \hrulefill { #2}}
73 }
74
75 %  \def\index{\@bsphack\begingroup
76 %             \def\protect####1{\string####1\space}\@sanitize
77 %             \@wrindex}\typeout
78 %  {Writing index file \jobname.idx }\fi}
79
80 %\def\@wrindex#1{\let\thepage\relax
81 %   \edef\@tempa{\write\@indexfile{\string
82 %      \indexentry{#1}{\thepage}}}\expandafter\endgroup\@tempa
83 %   \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}
84  
85
86
87 % Headings for .SH 
88
89 %\def\Shead#1{\noindent\paragraph{\small\uppercase{#1}~:}}
90 \def\Shead#1{\smallskip\par\noindent{\small\bf{\uppercase{#1}~:\par\noindent}}}
91 \def\Seealso#1{\smallskip\par\noindent{\sc See Also}~:}
92 \def\Sauthor#1{\smallskip\par\hfill{\small\sc Author}~:}
93
94 % For stuff to ignore 
95 \def\ignore#1{}
96
97 %% Changing the default description Mode 
98
99 \def\scitemlabel#1{\hspace\labelsep#1}
100
101 \def\scitem{\list{}{\labelwidth\z@ \itemindent-\leftmargin 
102         \itemsep=-\parsep \let\makelabel\scitemlabel}}
103
104 \let\endscitem\endlist
105
106 \let\undertext=\underline
107
108 \def\trait{\begin{flushleft}\mbox{\hbox to \textwidth{\hrulefill}}
109         \end{flushleft}}