(file) Return to ccp4-man.cls CVS log (file) (dir) Up to [CCP4] / ccp4 / manual

File: [CCP4] / ccp4 / manual / ccp4-man.cls (download)
Revision: 1.4, Fri Dec 12 13:36:43 1997 UTC (12 years, 8 months ago) by mdw
Branch: MAIN
CVS Tags: series-6_1-root, series-6_1, series-6_0_99e-root, series-6_0_99e, series-6_0_99d-root, series-6_0_99d, release-6_1_3, release-6_1_24, release-6_1_2, release-6_1_13, release-6_1_1, release-6_1_0, release-6_0_patch, release-6_0_2, release-6_0_1, release-6_0, release-5_0_binaries, release-5_0_2, release-5_0_1_patch, release-5_0_1, release-5_0, release-4_2_2, release-4_2_1_patch, release-4_2_1, release-4_2, release-4_1_1_patch, release-4_1_1, release-4_1, release-4_0_1, release-4_0, release-3_5_1, release-3_5, release-3_4_1, release-3_4, pre_xia2_remove, pre_fft_swap, pre-merge-release-6_1_3, pre-merge-6_0_99e, pre-merge-6_0_99d, pre-merge-20_4_2009, pre-merge-13_08_2009, post_merge-13_08_2009, post-merge-release-6_1_3, post-merge-6_0_99d, post-merge-20_4_2009, merge-release_6_1_0, merge-6_0_patch_240407, merge-6_0_patch_100907, merge-5_8_2008, branch-merge-20_4_2009, branch-merge-13_08_2009, HEAD, CCP4-auto
Changes since 1.3: +4 -4 lines
Latest tidying ...

% random customisation and hacks for ccp4 manual.  bits of this come
% from refman.sty

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ccp4-man}

\RequirePackage{ifthen}

\newboolean{dvidoc}
\newboolean{letterpaper}
\newboolean{times}
\newboolean{hyper}

\DeclareOption{twocolumn}{\OptionNotUsed}
\DeclareOption{dvidoc}{\setboolean{dvidoc}{true}}
\DeclareOption{letterpaper}{\setboolean{letterpaper}{true}}
\DeclareOption{times}{\setboolean{times}{true}}
\DeclareOption{hyper}{\setboolean{hyper}{true}}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{report}}
\ExecuteOptions{}
\ProcessOptions

% we might now be better off with book, since that has built-in
% \frontmatter etc.
\LoadClass[twoside,openright]{report}

\RequirePackage{%
authordate1-4% citation style
,alltt%  for examples
,epsfig%  for postscript figures
,multicol%  for indices etc.
,index%  fancy indexing
,here%  figure placement
,fancyheadings%
}

% possible use of dvidoc
\ifthenelse{\boolean{dvidoc}}{
  }{
  % possible setting in Times
  \ifthenelse{\boolean{times}}{
    \RequirePackage{times,mathptm}
    }{
    \RequirePackage{times,mathptm}
    }
  }

\let\vect=\mathbf \let\vec=\mathbf
\let\mr=\mathrm
\newcommand{\acronym}[1]%  normally arg should be lower case (small caps)
    {\textsc{#1}\null}
\let\acr=\acronym               % abbreviation of it
\let\ac=\acronym
% (potentially) our logo -- always type as \ccp4 and it won't eat
% trailing space 
\newcommand{\ccp}[1]{CCP4} 

% these do fancy indexing:
\newcommand{\cprog}[1]% refer to ccp4 program
   {\scrap{#1}\index[cpg]{#1@\Scrap{#1}}} 
\newcommand{\inviscprog}[1]% index ccp4 program but don't print name
   {\index[cpg]{#1@\Scrap{#1}}} 
\newcommand{\prog}[1]% refer to non-ccp4 program
   {\scrap{#1}\index[prg]{ZZZ@\protect\scrap{#1}}}
\newcommand{\invisprog}[1]% index non-ccp4 program but don't print name
   {\index[prg]{ZZZ@\protect\scrap{#1}}}
\newcommand{\Scrap}[1]% eats following , in index
  {{\tt #1}\quad\gobble}
\newcommand{\progleader}[2]{\let\cprog\scrap \let\prog=\scrap
    \quad #1 \gobcom}           % eats following number and ,.
                                % should check if there actually is
                                % a ,
\let\gobble=\@gobble
\def\gobcom{\@ifnextchar ,{\def\@tempa,{}\@tempa}{}}

% use balanced columns
\renewenvironment{theindex}{\begin{multicols}{2}%
  [\@makeschapterhead{\indexname}
  \noindent Yes, this index is incomplete and untidy\dots
  ]
    \addcontentsline{toc}{chapter}{Index}
    \@mkboth{{\indexname}}{{\indexname}}%
    \thispagestyle{plain}\parindent\z@
    \parskip\z@ plus .3\p@\relax\let\item\@idxitem}{\end{multicols}}

\newenvironment{indexing}{%
  \parindent\z@ \parskip\z@ plus.3\p@\relax\let\item\@idxitem
}{}

% primarily for installation abbreviations:
\newcommand{\cm}{\$CCP4\_MASTER}
\newcommand{\cc}{\$CCP4}

\newenvironment{eg}% example of what to type
        {\@beginparpenalty=\@highpenalty
          \begin{quote}\begin{alltt}}{\end{alltt}\end{quote}}

\newcommand{\meta}[1]% `template' text
        {\mbox{$\langle$\rmfamily\mdseries\slshape #1\/$\rangle$}}
\newcommand{\file}[1]{\mbox{\texttt{#1}}\null}   % for file name (might index)
\newcommand{\introduce}[1]{\textsl{#1}} % introduce jargon term
\ifthenelse{\boolean{dvidoc}}{
  \newcommand{\scrap}[1]{\mbox{`#1'}\null}
}{
  \newcommand{\scrap}[1]{\mbox{\texttt{#1}}\null} % small bit of verbatim text e.g.,
                                % file extension
}

\renewcommand{\floatpagefraction}{.7}
\newcommand{\fixme}[1]% indicate need for check/fix
   {\marginpar{\begin{flushleft}! #1\end{flushleft}}}
\reversemarginpar

\hyphenation{centro-symmetric}

\newcommand{\idx}[1]{#1\index{#1}} % set arg and index it as is

%%% overall style parameters, cobbled together from various sources

% report: textwidth: 345pt, textehight 550pt oddsidemargin 62pt
% topmargin 16pt headsep 25pt footskip 30pt
\textwidth=345pt
\newdimen\leftmarginwidth % value of odd & evensidemargin, set below.
\newdimen\fullwidth % = \textwidth + \leftmarginwidth

\def\longhrule{\par\hbox to \linewidth{\hss
               \vrule width \fullwidth height 0.4pt depth 0pt}\par}
\def\longthickhrule{\par\hbox to \linewidth{\hss
               \vrule width \fullwidth height 1.0pt depth 0pt}\par}

% Re-definitions of the \section commands to use \fullwidth and smaller
% vertical skips and smaller fonts.
% (Note that the afterskip must be >zero, not =zero)

\def\secshape{\leftskip=-\leftmarginwidth % use \fullwidth
              \rightskip=\@flushglue % raggedright
              \hyphenpenalty=\@M} % no hyphenation
     
\def\section{\@startsection {section}{1}{\z@}{-2ex plus -1ex minus
    -.2ex}{0.5ex plus .2ex}{\secshape\reset@font\large\bfseries\sffamily}}
\def\subsection{\@startsection{subsection}{2}{\z@}{-1.5ex plus -.5ex minus
   -.2ex}{0.5ex plus .2ex}{\secshape\reset@font\normalsize\bfseries\sffamily}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-1.5ex plus
-.5ex minus -.2ex}{0.5ex plus .2ex}{\secshape\reset@font\normalsize\sffamily}}
\def\paragraph{\@startsection
  {paragraph}{4}{\z@}{2ex plus 1ex minus .2ex}{-1em}{\reset@font\normalsize
    \bfseries\sffamily}}
\def\subparagraph{\@startsection
     {subparagraph}{4}{\parindent}{2ex plus 1ex minus
     .2ex}{-1em}{\reset@font\normalsize\bfseries\sffamily}}

\def\@makechapterhead#1{\longthickhrule\bigskip
     {\secshape\parskip\z@\parindent\z@ \Large\bfseries\sffamily
      \ifnum \c@secnumdepth >\m@ne \@chapapp{} \thechapter.\quad \fi
      #1\par}
      \bigskip\longthickhrule\bigskip}
     
\def\@makeschapterhead#1{\longthickhrule\bigskip
     {\secshape\parskip\z@\parindent\z@ \Large\bfseries\sffamily #1\par}
     \bigskip\longthickhrule\bigskip}

\ifthenelse{\boolean{dvidoc}}{
  \advance \textwidth 0.5in
  \fullwidth=5.75in 
}{
 \fullwidth=6.5in 
}

\textheight=682pt
\ifthenelse{\boolean{letterpaper}}{
  % US letter is 0.69in shorter and 0.23in narrower than A4
  \advance\textheight by -7\baselineskip % 4*12pt ~= 0.69in
  \advance\fullwidth by 0.23in
  \advance\textwidth by 0.23in  % may not be advisable, but the lines
                                % aren't so wide
}{}
% attempt to mave page down half an inch if a4 isn't available
% I don't think this works.
\special{!userdict begin /bop-hook {statusdict /a4tray known not {0 36 translate}} def end}
\leftmarginwidth=\fullwidth \advance\leftmarginwidth by -\textwidth
\oddsidemargin=\leftmarginwidth %\advance\oddsidemargin by -3mm
\evensidemargin=\oddsidemargin
\marginparwidth=\leftmarginwidth \advance\marginparwidth by -\marginparsep
\advance\topmargin by -4.5\baselineskip
\advance\headsep by 0.5\baselineskip
\advance\footskip by 0.5\baselineskip
\@colht=\textheight \@colroom=\textheight

\def\@listI{\topsep 0.4ex \parsep \parskip \itemsep \parskip}
\let\@listi\@listI
\def\@listii{\leftmargin\leftmarginii
 \labelwidth\leftmarginii\advance\labelwidth-\labelsep
 \topsep \z@ \parsep \z@ \itemsep \parsep}
\def\@listiii{\leftmargin\leftmarginiii
 \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
 \parsep \z@ \topsep \z@ \partopsep \z@ \itemsep \topsep}

% for quotes at head of chapters:
\newenvironment{chapquote}{\begin{flushright}\sf\sl}{\end{flushright}
  \subsection*{}                % suppress following parindent
}

% Fiddle part headers (could copy definition of \part instead)
\def\partname{\sf\bf Part\thispagestyle{empty}}

% front/backmatter stuff included in TOC but no numbering
\newcommand{\frontmatter}{\pagenumbering{roman}\setcounter{secnumdepth}{-10}}
\newcommand{\bodymatter}{\clearpage\pagenumbering{arabic}\setcounter{secnumdepth}{3}}
\newcommand{\backmatter}{\clearpage\setcounter{secnumdepth}{-10}}

% for xfig LaTeX
\newcommand{\SetFigFont}[3]{\fontsize{#1}{#2pt}\expandafter\csname#3\endcsname}
     
\newif\ifmaxipagerule \maxipagerulefalse
\def\maxipage{\par % (here a \vskip\parskip will happen by the final \par)
              \mbox{}\kern-\leftmarginwidth \kern-\@totalleftmargin
              \begin{minipage}{\fullwidth}
              \medskip \ifmaxipagerule \hrule\medskip \fi
              \parskip = 0.5\baselineskip % <--- same as outside minipage
              \def\marginpar{\typeout{Marginpar not allowed within Maxipage.}}}
\def\endmaxipage{\par \vskip\parskip
                 \medskip \ifmaxipagerule \hrule\medskip \fi
                 \end{minipage}\par}

% fancyheadings stuff
% for fancyheadings (else the rule's in the wrong margin)
\def\ps@@fancy{
  \def\@oddhead{\@fancyhead\hss\@olhead\@ochead\@orhead\relax}
  \def\@oddfoot{\@fancyfoot\hss\@olfoot\@ocfoot\@orfoot\relax}
  \def\@evenhead{\@fancyhead\hss\@elhead\@echead\@erhead\relax}
  \def\@evenfoot{\@fancyfoot\hss\@elfoot\@ecfoot\@erfoot\relax}
}
\ifthenelse{\boolean{dvidoc}}{
  }{                            % dvidoc goes wild with it in...
  \pagestyle{fancyplain}}
\footrulewidth 0.4pt 
\headwidth=\fullwidth 
\plainfootrulewidth 0.4pt
\lfoot{\fancyplain{\large\bf\sf The \ccp4 manual}{}}
\rfoot{\fancyplain{\large\bf\sf\thepage}{}}
\lhead[\fancyplain{}{\large\bf\sf\thepage}]%
  {\fancyplain{}{\large\bf\sf\rightmark}}
\rhead[\fancyplain{}{\large\bf\sf\leftmark}]%
  {\fancyplain{}{\large\bf\sf\thepage}}
\cfoot{\fancyplain{}{\large\sf The \ccp4 manual}}
\renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\quad #1}}
\renewcommand{\subsectionmark}[1]{\markright{\thesubsection\quad #1}}
\addtolength{\headheight}{2pt}% \addtolength{\footheight}{2pt}

% (fancy) indexing
\makeindex
\newindex{prg}{prx}{prd}{Non-\ccp4 programs}
\newindex{cpg}{cpx}{cpd}{\ccp4 programs}

% Re-defintion of the \marginpar command to use always the left margin
% (never the right margin). Be careful that Marginpars do not come to
% near to each other!
     
\def\@addmarginpar{\@next\@marbox\@currlist{\@cons\@freelist\@marbox
    \@cons\@freelist\@currbox}\@latexbug\@tempcnta\@ne
%    \if@twocolumn
%        \if@firstcolumn \@tempcnta\m@ne \fi
%    \else
%      \if@mparswitch
%         \ifodd\c@page \else\@tempcnta\m@ne \fi
%      \fi
%      \if@reversemargin \@tempcnta -\@tempcnta \fi
%    \fi
    \@tempcnta\m@ne % always to left margin <---
    \ifnum\@tempcnta <\z@  \global\setbox\@marbox\box\@currbox \fi
    \@tempdima\@mparbottom
    \advance\@tempdima -\@pageht
    \advance\@tempdima\ht\@marbox
    \ifdim\@tempdima >\z@
      \@latex@warning@no@line {Marginpar on page \thepage\space moved}%
    \else
      \@tempdima\z@
    \fi
    \global\@mparbottom\@pageht
    \global\advance\@mparbottom\@tempdima
    \global\advance\@mparbottom\dp\@marbox
    \global\advance\@mparbottom\marginparpush
    \advance\@tempdima -\ht\@marbox
    \global\setbox \@marbox
                   \vbox {\vskip \@tempdima
                          \box \@marbox}%
    \global \ht\@marbox \z@
    \global \dp\@marbox \z@
    \kern -\@pagedp
    \nointerlineskip
    \hbox to\columnwidth
      {\ifnum \@tempcnta >\z@
          \hskip\columnwidth \hskip\marginparsep
       \else
          \hskip -\marginparsep \hskip -\marginparwidth
       \fi
       \box\@marbox \hss}%
    \nointerlineskip
    \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}}

\ifthenelse{\boolean{dvidoc}}{
  \def\S{section }
  \def\AA{A}}{}

%avoid even headers/footers
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
    \hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}

\ifthenelse{\boolean{dvidoc}}{
  \RequirePackage{dvidoc}}{}

\ifthenelse{\boolean{hyper}}{
  \RequirePackage{hyperref}
  % stuff below from hyperref.dtx with index.sty-type files
  \ifHyper@Index
  \def\@wrindex#1#2{\@@wrindex#2||\\{#1}}
  \def\@@wrindex#1|#2|#3\\#4{%
    \ifx\\#2\\
    \expandafter\protected@write\csname tf@#4\endcsname{}%
    {\string\indexentry{#1|hyperpage}{\thepage}}%
    \else
    \expandafter\protected@write\csname tf@#4\endcsname{}%
    {\string\indexentry{#1|#2}{\thepage}}%
    \fi
    %\endgroup
    \@esphack
    }
  \fi
  }{}

\ifthenelse{\boolean{hyper}}{
\ifHyper@Index
  \newcommand{\progdesc}[2]%  for programs index: args are name and description
  % set \thepage to 0 to arrange these entries to come first for
  % each program
  {{\def\thepage{0}\index[cpg]{#1@\Scrap{#1}|progleader{\hyperpage{#2}}}}}
\else
  \newcommand{\progdesc}[2]%  for programs index: args are name and description
  % set \thepage to 0 to arrange these entries to come first for
  % each program
  {{\def\thepage{0}\index[cpg]{#1@\Scrap{#1}|progleader{#2}}}}
\fi}{
  \newcommand{\progdesc}[2]%  for programs index: args are name and description
  % set \thepage to 0 to arrange these entries to come first for
  % each program
  {{\def\thepage{0}\index[cpg]{#1@\Scrap{#1}|progleader{#2}}}}
  }
\endinput

ccp4@ccp4.ac.uk
Powered by
ViewCVS 0.9.3