% \begin{meta-comment}
%
-% $Id: strayman.dtx,v 1.1 2002/02/19 23:27:57 mdw Exp $
+% $Id: strayman.dtx,v 1.4 2003/11/07 11:32:53 mdw Exp $
%
-% Another rewrite of the tabular environment, and maths alignments
-%
-% (c) 1996 Mark Wooding
-%
-%----- Revision history -----------------------------------------------------
-%
-% $Log: strayman.dtx,v $
-% Revision 1.1 2002/02/19 23:27:57 mdw
-% Initial revision.
-%
-% Revision 1.8 1996/12/09 23:20:42 mdw
-% (\tab@setstrut): Fixed so that it uses \dimen\tw@ for the strut depth,
-% as advertised.
-%
-% Revision 1.7 1996/11/29 21:59:16 mdw
-% Fixed a little formatting mistake in a syntax diagram, and switched over
-% to the new syntax diagram commands on the grounds that they're slightly
-% less messy. Maybe.
-%
-% Revision 1.6 1996/11/19 20:54:33 mdw
-% Entered into RCS
+% Document class for Straylight manuals
%
+% (c) 1996 Straylight
%
% \end{meta-comment}
%
% \begin{meta-comment} <general public licence>
%%
-%% mdwtab package -- another rewrite of the tabular environment, etc.
-%% Copyright (c) 1996 Mark Wooding
+%% strayman -- a LaTeX document class for Straylight manuals
+%% Copyright (c) 1996 Straylight
%%
%% This program is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by
% \begin{meta-comment} <Package preamble>
%<+strayman>\NeedsTeXFormat{LaTeX2e}
%<+strayman>\ProvidesClass{strayman}
-%<+strayman> [1996/03/26 1.05 Straylight document class]
+%<+strayman> [2003/09/04 1.10 Straylight document class]
% \end{meta-comment}
%
-% \CheckSum{2919}
+% \CheckSum{2934}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% \begin{macrocode}
\renewcommand\normalsize{%
%<*8pt>
- \@setfontsize\normalsize\@viiipt\@xpt%
+ \@setfontsize\normalsize\@viiipt{9.6\p@}%
\abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
\abovedisplayshortskip\z@\@plus3\p@%
\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
\newcommand\LARGE{\@setfontsize\LARGE\@xiipt\@xivpt\@setparskip}
\newcommand\huge{\@setfontsize\huge\@xviipt{20}\@setparskip}
\newcommand\Huge{\@setfontsize\Huge\@xxpt{26}\@setparskip}
-\newcommand\listingsize{\@setfontsize\listingsize\@viipt\@viiipt\@setparskip}
%</8pt>
%<*9pt>
\newcommand\scriptsize{\@setfontsize\scriptsize\@vipt\@viipt\@setparskip}
\newcommand\LARGE{\@setfontsize\LARGE\@xivpt{17}\@setparskip}
\newcommand\huge{\@setfontsize\huge\@xviipt{20}\@setparskip}
\newcommand\Huge{\@setfontsize\Huge\@xxpt{26}\@setparskip}
-\newcommand\listingsize{\@setfontsize\listingsize\@viipt\@viiipt\@setparskip}
%</9pt>
%<*10pt>
\newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt\@setparskip}
\newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}\@setparskip}
\newcommand\huge{\@setfontsize\huge\@xxpt{25}\@setparskip}
\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}\@setparskip}
-\newcommand\listingsize{\@setfontsize\listingsize\@viipt\@viiipt\@setparskip}
%</10pt>
%<*11pt>
\newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}\@setparskip}
\newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}\@setparskip}
\newcommand\huge{\@setfontsize\huge\@xxpt{25}\@setparskip}
\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}\@setparskip}
-\newcommand\listingsize{\@setfontsize\listingsize\@viiipt{9.5}\@setparskip}
%</11pt>
%<*12pt>
\newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}\@setparskip}
\newcommand\LARGE{\@setfontsize\LARGE\@xxpt{25}\@setparskip}
\newcommand\huge{\@setfontsize\huge\@xxvpt{30}\@setparskip}
\let\Huge\huge
-\newcommand\listingsize{\@setfontsize\listingsize\@viiipt{9.5}\@setparskip}
%</12pt>
+%<+8pt|9pt|10pt|11pt|12pt>\let\listingsize\footnotesize
%<*text>
\def\scriptsize{\@setfontsize\scriptsize\@xpt\@xiipt\@setparskip}
\let\tiny\scriptsize
%
% \begin{macrocode}
\if@article
- \def\@topsect{\section*}
+ \def\@topsect@star{\section*}
+ \let\@topsect\section
\else
+ \let\@topsect@star\chapter
\let\@topsect\chapter
\fi
% \end{macrocode}
\leftmargin\leftmarginiii%
\labelwidth\leftmarginiii%
\advance\labelwidth-\labelsep%
- \partopsep\p@\@plus\z@\@minus\p@%
+% \partopsep\p@\@plus\z@\@minus\p@%
}
\def\@listiv{%
\leftmargin\leftmarginiv%
}
% \end{macrocode}
%
+% \subsection{Numbering things}
+%
+% \begin{macro}{\numberwithin}
+%
+% Does the obvious thing. Optional argument gives numbering style.
+%
+% \begin{macrocode}
+\def\numberwithin{\@testopt\nw@i\arabic}
+\def\nw@i[#1]#2#3{%
+ \@addtoreset{#2}{#3}%
+ \expandafter\xdef\csname the#2\endcsname{%
+ \expandafter\noexpand\csname the#3\endcsname.%
+ \noexpand#1{#2}}%
+}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\removefromreset}
+%
+% Does the obvious thing.
+%
+% \begin{macrocode}
+\def\removefromreset#1#2{%
+ \begingroup%
+ \def\@tempa{#1}%
+ \toks@{}%
+ \def\@elt##1{%
+ \def\@tempb{##1}%
+ \ifx\@tempa\@tempb%
+ \else\toks@\expandafter{\the\toks@\@elt{##1}}%
+ \fi%
+ }
+ \csname cl@#2\endcsname%
+ \expandafter\xdef\csname cl@#2\endcsname{\the\toks@}%
+ \endgroup%
+}
+% \end{macrocode}
+%
+% \end{macro}
+%
% \subsection{Enumerated lists}
%
% We busily redefine all the counters for enumerated lists, and how to
\abovecaptionskip10\p@
\belowcaptionskip0\p@
%
+\long\def\captionstyle#1#2{\itshape #1: #2}
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip%
- \sbox\@tempboxa{#1: #2}%
+ \sbox\@tempboxa{\captionstyle{#1}{#2}}%
\ifdim\wd\@tempboxa>\hsize%
- #1: #2\par%
+ \unhbox\@tempboxa\par%
\else%
- \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \hb@xt@\hsize{\hfil\unhbox\@tempboxa\hfil}%
\fi%
\vskip\belowcaptionskip%
}
% file, and then restore the old layout.
%
% \begin{macrocode}
-\newcommand\tableofcontents{%
- \if@twocolumn%
- \@restonecoltrue%
- \onecolumn%
- \else%
- \@restonecolfalse%
- \fi%
- \@topsect\contentsname%
- {\parskip\z@\@starttoc{toc}}%
- \if@restonecol%
- \twocolumn%
- \fi%
+\def\@tocthing#1#2{%
+ \@ifnextchar[{\@tocthing@i{#1}{#2}}{\@tocthing@i{#1}{#2}[\relax][\relax]}%
+}
+\def\@tocthing@i#1#2[#3][#4]{%
+ \if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi%
+ \@topsect@star{#1}#3{\parskip\z@\@starttoc{#2}}#4%
+ \if@restonecol\twocolumn\fi%
}
+\newcommand\tableofcontents{\@tocthing\contentsname{toc}}
% \end{macrocode}
% \end{macro}
%
% These macros are terribly similar to the other ones.
%
% \begin{macrocode}
-\newcommand\listoffigures{%
- \if@twocolumn%
- \@restonecoltrue\onecolumn%
- \else%
- \@restonecolfalse%
- \fi%
- \@topsect\listfigurename%
- {\parskip\z@ \@starttoc{lof}}%
- \if@restonecol\twocolumn\fi%
-}
-%
-\newcommand\l@figure{\@dottedtocline{1}{1.5em}{2.5em}}
-%
-\newcommand\listoftables{%
- \if@twocolumn%
- \@restonecoltrue\onecolumn%
- \else%
- \@restonecolfalse%
- \fi%
- \@topsect\listtablename%
- {\parksip\z@ \@starttoc{lot}}%
- \if@restonecol\twocolumn\fi%
-}
-%
+\newcommand\listoffigures{\@tocthing\listfigurename{lof}}
+\newcommand\l@figure{\@dottedtocline{0}{0pt}{2em}}
+\newcommand\listoftables{\@tocthing\listtablename{lot}}
\let\l@table\l@figure
% \end{macrocode}
%
%
% \begin{macrocode}
\newcommand\contentsname{Contents}
-\newcommand\listfigurename{List of Figures}
-\newcommand\listtablename{List of Tables}
+\newcommand\listfigurename{List of figures}
+\newcommand\listtablename{List of tables}
\if@article\newcommand\bibname{References}
\else\newcommand\bibname{Bibliography}\fi
\newcommand\indexname{Index}