From ed78b2180ca698fa6bac2f0face9ffda53d95b05 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Wed, 15 Jan 2003 15:01:24 +0000 Subject: [PATCH] Make the front page look like the scsh manual by copying the .sty files from scsh-0.6.3/scsh-manual/ --- doc/latex/code.sty | 296 +++++++++++++++++++++++++++++++++++++++++ doc/latex/ct.sty | 6 + doc/latex/headings.sty | 16 +++ doc/latex/man.tex | 54 +++++++- doc/latex/mantitle.sty | 76 +++++++++++ doc/latex/matter.sty | 16 +++ doc/latex/mysize10.sty | 22 +++ doc/latex/pdfcond.tex | 14 ++ 8 files changed, 495 insertions(+), 5 deletions(-) create mode 100644 doc/latex/code.sty create mode 100644 doc/latex/ct.sty create mode 100644 doc/latex/headings.sty create mode 100644 doc/latex/mantitle.sty create mode 100644 doc/latex/matter.sty create mode 100644 doc/latex/mysize10.sty create mode 100644 doc/latex/pdfcond.tex diff --git a/doc/latex/code.sty b/doc/latex/code.sty new file mode 100644 index 0000000..2786d61 --- /dev/null +++ b/doc/latex/code.sty @@ -0,0 +1,296 @@ +% code.sty: -*- latex -*- +% Latex macros for a "weak" verbatim mode. +% -- like verbatim, except \, {, and } have their usual meanings. + +% Environments: code, tightcode, codeaux, codebox, centercode +% Commands: \dcd, \cddollar, \cdmath, \cd, \codeallowbreaks, \codeskip, \^ +% Already defined in LaTeX, but of some relevance: \#, \$, \%, \&, \_, \{, \} + +% Changelog at the end of the file. + +% These commands give you an environment, code, that is like verbatim +% except that you can still insert commands in the middle of the environment: +% \begin{code} +% for(x=1; x] option, then the following newline will +% be read *after* ^M is bound to \cr, so we're cool. If there isn't +% an option given (i.e., default to [c]), then the @\ifnextchar will +% gobble up the newline as it gobbles whitespace. So we insert the +% \cr explicitly. Isn't TeX fun? +\def\codebox{\leavevmode\@ifnextchar[{\@codebox}{\@codebox[c]\cr}} %] + +\def\@codebox[#1]% + {\hbox\bgroup$\if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi\bgroup% + \tabskip\z@\setupcode\cd@obeycr% just before cd@obey + \halign\bgroup##\hfil\span} + +\def\endcodebox{\crcr\egroup\egroup\m@th$\egroup} + +% Center the box on the page: +\newenvironment{centercode}% + {\begin{center}\begin{codebox}[c]}% + {\end{codebox}\end{center}} + + +%% code, codeaux, tightcode +%%============================================================================= +%% Code environment as described above. Lines are kept on one page. +%% This actually works by setting a huge penalty for breaking +%% between lines of code. Code is indented same as other displayed paras. +%% Note: to increase left margin, use \begin{codeaux}{\leftmargin=1in}. + +% To allow pagebreaks, say \codeallowbreaks immediately inside the env. +% You can allow breaks at specific lines with a \pagebreak form. + +%% N.B.: The \global\@ignoretrue command must be performed just inside +%% the *last* \end{...} before the following text. If not, you will +%% get an extra space on the following line. Blech. + +%% This environment takes two arguments. +%% The second, required argument is the \list parameters to override the +%% \@listi... defaults. +%% - Usefully set by clients: \topsep \leftmargin +%% - Possible, but less useful: \partopsep +%% The first, optional argument is the extra \parskip glue that you get around +%% \list environments. It defaults to the value of \parskip. +\def\codeaux{\@ifnextchar[{\@codeaux}{\@codeaux[\parskip]}} %] +\def\@codeaux[#1]#2{% + \bgroup\parskip#1% + \begin{list}{}% + {\parsep\z@\rightskip\z@\listparindent\z@\itemindent\z@#2}% + \item[]\setupcode\cd@obeylines}% +\def\endcodeaux{\end{list}\leavevmode\egroup\ignorespaces\global\@ignoretrue} + +%% Code env is codeaux with the default margin and spacing \list params: +\def\code{\codeaux{}} \let\endcode=\endcodeaux + +%% Like code, but with no extra vertical space above and below. +\def\tightcode{\codeaux[=0pt]{\topsep\z@}}% +\let\endtightcode\endcodeaux +% {\vspace{-1\parskip}\begin{codeaux}{\partopsep\z@\topsep\z@}}% +% {\end{codeaux}\vspace{-1\parskip}} + + + +% Reasonable separation between lines of code +\newcommand{\codeskip}{\penalty0\vspace{2ex}} + + +% \cd is used to build a code environment in the middle of text. +% Note: only difference from display code is that cr's are taken +% as unbreakable spaces instead of linebreaks. + +\def\cd{\leavevmode\begingroup\ifmmode\let\startcode=\startmcode\else% + \let\startcode\starttcode\fi% + \setupcode\cd@obeycrsp\startcode} + +\def\starttcode#1{#1\endgroup} +\def\startmcode#1{\hbox{#1}\endgroup} + + +% Restore $&#^_~% to their normal catcodes +% Define \^ to give the ^ char. +% \dcd points to this guy inside a code env. +\def\cd@dcd{\catcode`\$=3\catcode`\&=4\catcode`\#=6\catcode`\^=7% + \catcode`\_=8\catcode`\~=13\catcode`\%=14\def\^{\char`\^}} + +% Selectively enable $, and $^_ as special. +% \cd@mathspecial also defines \^ give the ^ char. +% \cddollar and \cdmath point to these guys inside a code env. +\def\cd@dollarspecial{\catcode`\$=3} +\def\cd@mathspecial{\catcode`\$=3\catcode`\^=7\catcode`\_=8% + \def\^{\char`\^}} + + +% Change log: +% Started off as some macros found in C. Rich's library. +% Olin 1/90: +% Removed \makeatletter, \makeatother's -- they shouldn't be there, +% because style option files are read with makeatletter. The terminal +% makeatother screwed things up for the following style options. +% Olin 3/91: +% Rewritten. +% - Changed things so blank lines don't get compressed out (the \leavevmove +% in \cd@cr and \cd@crwb). +% - Changed names to somewhat less horrible choices. +% - Added lots of doc, so casual hackers can more easily mess with all this. +% - Removed `'"@ from the set of hacked chars, since they are already +% non-special. +% - Removed the bigcode env, which effect can be had with the \codeallowbreaks +% command. +% - Removed the \@noligs command, since it's already defined in latex.tex. +% - Win big with the new \dcd, \cddollar, and \cdmath commands. +% - Now, *only* the chars \{} are special inside the code env. If you need +% more, use the \dcd command inside a group. +% - \cd now works inside math mode. (But if you use it in a superscript, +% it still comes out full size. You must explicitly put a \scriptsize\tt +% inside the \cd: $x^{\cd{\scriptsize\tt...}}$. A \leavevmode was added +% so that if you begin a paragraph with a \cd{...}, TeX realises you +% are starting a paragraph. +% - Added the codebox env. Tricky bit involving the first line hacked +% with help from David Long. +% Olin 8/94 +% Changed the font commands for LaTeX2e. diff --git a/doc/latex/ct.sty b/doc/latex/ct.sty new file mode 100644 index 0000000..1edfbc0 --- /dev/null +++ b/doc/latex/ct.sty @@ -0,0 +1,6 @@ +% Loads cmtt fonts in on \tt. -*- latex -*- +% I prefer these to the Courier fonts that latex gives you w/postscript styles. +% Courier is too spidery and too wide -- it's hard to get 80 chars on a line. +% -Olin + +\renewcommand{\ttdefault}{cmtt} diff --git a/doc/latex/headings.sty b/doc/latex/headings.sty new file mode 100644 index 0000000..c928f58 --- /dev/null +++ b/doc/latex/headings.sty @@ -0,0 +1,16 @@ +% headings.tex -*- latex -*- +% Quieter headings that the ones used in article.sty. +% This is not a style option. Don't say [headings]. +% Instead, say \input{headings} after the \documentstyle. +% -Olin 7/91 + +\makeatletter + +\def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus + -.2ex}{2.3ex plus .2ex}{\large\normalfont\bfseries}} +\def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus -1ex minus + -.2ex}{1.5ex plus .2ex}{\normalsize\normalfont\bfseries}} +\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus +-1ex minus -.2ex}{1.5ex plus .2ex}{\normalsize\normalfont\bfseries}} + +\makeatother diff --git a/doc/latex/man.tex b/doc/latex/man.tex index f4b501f..28f78f0 100644 --- a/doc/latex/man.tex +++ b/doc/latex/man.tex @@ -1,16 +1,56 @@ -\documentclass{report} +% -*- latex -*- + +% This is the reference manual for the Scheme Untergrund Networking Package. + +\documentclass[twoside]{report} +\usepackage{code,boxedminipage,makeidx,palatino,ct, + headings,mantitle,array,matter,mysize10,tex2page} \usepackage[latin1]{inputenc} \usepackage{alltt} -\usepackage{tex2page} -\author{Olin Shivers \and Mike Sperber \and Martin Gasbichler \and - Eric Marsden \and Andreas Bernauer} -\title{The Scheme Untergrund Networking Package} +\texonly +% tex2page defines \url and hyperref loads the package url +% but setting \url to \relax satisfies \newcommand +\let\url\relax +\input{pdfcond} +\ifpdf +\usepackage[pdftex,hyperindex, + pdftitle={sunet manual, release 2.0}, + pdfauthor={Olin Shivers, Mike Sperber, Martin Gasbichler, Eric Marsden + and Andreas Bernauer} + colorlinks=true,linkcolor=blue,pagecolor=blue,urlcolor=blue, + pdfstartview=FitH,pdfview=FitH]{hyperref} +\usepackage{thumbpdf} +\usepackage{tocbibind} +\else +\usepackage[dvipdfm,hyperindex,hypertex, + pdftitle={sunet manual, release 2.0}, + pdfauthor={Olin Shivers, Mike Sperber, Martin Gasbichler, Eric Marsden + and Andreas Bernauer} + colorlinks=true,linkcolor=blue,pagecolor=blue,urlcolor=blue, + pdfstartview=FitH,pdfview=FitH]{hyperref} +\fi +\endtexonly + +% Style issues +\parskip = 3pt plus 3pt +\sloppy \input{decls} +\makeindex +%%% End preamble + \begin{document} + +\frontmatter +\title{SUnet Reference Manual} +\subtitle{For SUnet release 2.0} +\author{Dr. S, Dr. S, Martin Gasbichler, Eric Marsden, Andreas Bernauer} +\date{January 2003} + +\mainmatter \maketitle \begin{abstract} \noindent The Scheme Untergrund Network Package (\textit{SUnet} for short) is @@ -35,4 +75,8 @@ \include{nettime} \include{smtp} \include{pop3} + +\backmatter +\printindex + \end{document} diff --git a/doc/latex/mantitle.sty b/doc/latex/mantitle.sty new file mode 100644 index 0000000..b17f5b5 --- /dev/null +++ b/doc/latex/mantitle.sty @@ -0,0 +1,76 @@ +% This is the title page style stolen from the Texinfo design, +% and expressed as a LaTeX style option. It is useful for manuals. +% +% Note that I play some *really* revolting games here to override +% the vertical and horizontal margins temporarily for the title page. +% The layout assumes you have 8.5" x 11" paper. You'd have to redo this +% for A4 or another size. +% -Olin 7/94 + + +% Fonts for title page: +\DeclareFixedFont{\titlefont}% + {\encodingdefault}{\familydefault}{bx}{\shapedefault}{20.5pt} +\DeclareFixedFont{\authorfnt}% + {\encodingdefault}{\familydefault}{bx}{\shapedefault}{14.4pt} +\DeclareFixedFont{\subtitlefnt}% + {\encodingdefault}{\familydefault}{m}{\shapedefault}{11} + +%\def\authorrm{\normalfont\selectfont\fontseries{bx}\fontsize{14.4}{14.4}} +%\def\subtitlefnt{\normalfont\selectfont\fontsize{11}{11}} + +\newskip\titlepagetopglue \titlepagetopglue = 2.5in + + +\newlength{\widewidth} +\setlength{\widewidth}{6.5in} +\newlength{\negwidemargin} +\setlength{\negwidemargin}{-\oddsidemargin} % Reset the margin +\addtolength{\negwidemargin}{-1in} % to edge of page +\addtolength{\negwidemargin}{1in} % Then move right one inch. + +%\def\wideline#1{\hbox to 0pt{\hspace\negwidemargin\hbox to\widewidth{#1}}} +\def\wideline#1{\hbox{\makebox[0pt][l]{\hspace\negwidemargin\hbox to\widewidth{#1}}}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\maketitle{\begin{titlepage} + \thispagestyle{empty} + \let\footnotesize\small \let\footnoterule\relax + \null + \parindent=0pt + \def\subtitlefont{\normalbaselineskip = 13pt \normalbaselines \subtitlefnt}% + \def\authorfont{\normalbaselineskip = 16pt \normalbaselines \authorfnt}% +% + % Leave some space at the very top of the page. + \vspace*{-1in}\vspace*{-\topmargin}\vspace*{-\headheight}\vspace*{-\headsep} + \vglue\titlepagetopglue +% + \wideline{\titlefont \@title \hfill} % title +% \vskip4pt + \vskip -0.3\baselineskip + \wideline{\leaders\hrule height 4pt\hfill} + \wideline{\hfill\subtitlefont\begin{tabular}[t]{@{}r@{}}\@subtitle% + \\\@date% + \end{tabular}} % subtitle +% + % author + \vskip 0pt plus 1filll + \wideline{\authorfont \begin{tabular}[t]{@{}c@{}}\@author + \end{tabular}\hfill} +% +% \vskip4pt + \vskip -0.3\baselineskip + \wideline{\leaders\hrule height 2pt\hfill} + + % This weirdness puts the bottom line 2.75 in from the bottom of + % an 11in page. + \vskip \textheight \vskip \headsep \vskip \headheight + \vskip \topmargin \vskip 1in \vskip -11in \vskip 2.75in + + \gdef\@author{}\gdef\@title{}\gdef\@subtitle{}\let\maketitle\relax + \end{titlepage} + \setcounter{page}{2} + } + +\def\subtitle#1{\gdef\@subtitle{#1}} +\def\@subtitle{} diff --git a/doc/latex/matter.sty b/doc/latex/matter.sty new file mode 100644 index 0000000..f0c4fda --- /dev/null +++ b/doc/latex/matter.sty @@ -0,0 +1,16 @@ +%&latex -*- latex -*- +% Implement the \frontmatter, \mainmatter, and \backmatter macros, +% so I can use them in reports, not just books. + +\newif\if@mainmatter \@mainmattertrue + +\newcommand\frontmatter{% + \cleardoublepage\@mainmatterfalse\pagenumbering{roman}} + +\newcommand\mainmatter{% + \cleardoublepage\@mainmattertrue% + \pagenumbering{arabic}\setcounter{page}{1}} + +\newcommand\backmatter{% + \if@openright\cleardoublepage\else\clearpage\fi% + \@mainmatterfalse} diff --git a/doc/latex/mysize10.sty b/doc/latex/mysize10.sty new file mode 100644 index 0000000..94c52c0 --- /dev/null +++ b/doc/latex/mysize10.sty @@ -0,0 +1,22 @@ +%&latex -*- latex -*- +\if@twoside + \oddsidemargin 44pt + \evensidemargin 82pt + \marginparwidth 107pt +\else + \oddsidemargin 63pt + \evensidemargin 63pt + \marginparwidth 90pt +\fi +\marginparsep 11pt + +\topmargin 27pt +\headheight 12pt +\headsep 25pt +\topskip = 10pt +\footskip 30pt + +\textheight = 43\baselineskip +\advance\textheight by \topskip +\textwidth 345pt +\endinput diff --git a/doc/latex/pdfcond.tex b/doc/latex/pdfcond.tex new file mode 100644 index 0000000..34d7cf2 --- /dev/null +++ b/doc/latex/pdfcond.tex @@ -0,0 +1,14 @@ +\newif\ifpdf +\ifx\pdfoutput\undefined +\pdffalse % we are not running PDFLaTeX +\else +\pdfoutput=1 % we are running PDFLaTeX +\pdftrue +\fi +% Then use your new variable \ifpdf +% \ifpdf +% \usepackage[pdftex]{graphicx} +% \pdfcompresslevel=9 +% \else +% \usepackage{graphicx} +% \fi