The R Project SVN R

Rev

Rev 7002 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

%%% Rd.sty ... Style for printing the R manual
%%%
%%% Modified 1998/01/05 by Friedrich.Leisch@ci.tuwien.ac.at
%%% Modified 1998/07/07 by Martin Maechler
%%% Modified 1999/11/20 by Brian Ripley

\RequirePackage{bm}              % standard boldsymbol
\RequirePackage{alltt}           % {verbatim} allowing \..
\RequirePackage{verbatim}        % small example code
\RequirePackage{url}             % set urls

\addtolength{\textheight}{12mm}
\addtolength{\topmargin}{-9mm}   % still fits on US paper
\addtolength{\textwidth}{24mm}   % still fits on US paper
\setlength{\oddsidemargin}{10mm}
\setlength{\evensidemargin}{\oddsidemargin}

\newlength{\middle}
\setlength{\middle}{\textwidth}
\addtolength{\middle}{-2.25in}
\addtolength{\middle}{-4pt}

\newenvironment{display}[0]%
  {\begin{list}{}{\setlength{\leftmargin}{30pt}}\item}%
  {\end{list}}
\newcommand{\HTML}{{\normalfont\textsc{html}}}
\newcommand{\R}{{\normalfont\textsf{R}}{}}

\def\href#1#2{\special{html:<a href="#1">}{#2}\special{html:</a>}}

\newcommand{\vneed}[1]{%
  \penalty-1000\vskip#1 plus 10pt minus #1\penalty-1000\vspace{-#1}}

\newcommand{\Rdcontents}[1]{% modified \tableofcontents -- not \chapter
\section*{{#1}\@mkboth{\MakeUppercase#1}{\MakeUppercase#1}}
  \@starttoc{toc}}

\newcommand{\Header}[2]{%
  \vneed{1ex}
  \markboth{#1}{#1}
  \noindent
  \nopagebreak
  \begin{center}
    \def\@currentHref{page.\thepage}% as we seem to omit sections here!
    \hypertarget{Rfn.#1}{\index{#1}}%
    \myaddcontentsline{toc}{subsection}{#1}%
    \pdfbookmark[1]{#1}{Rfn.#1}
    \begin{tabular}{c}
      \hline \rule[-0.275cm]{0cm}{0.8cm}
      \makebox[1in][l]{\texttt{#1}}
      \makebox[\middle]{
        \begin{minipage}{\middle}
          \begin{center}
            \emph{#2}
          \end{center}
        \end{minipage}}
      \makebox[1in][r]{\texttt{#1}} \\ \hline
    \end{tabular}
  \end{center}}
%
%
\newcommand{\Link}[1]{#1\index{#1|textit}}
%
% \alias{<alias>}{<header>}
\newcommand{\alias}[2]{\index{#1@#1 \textit{(#2)}}}
% \keyword{<topic>}{<header>}
\newcommand{\keyword}[2]{\index{$*$Topic{\large\ \textbf{#1}}!#2@\textsf{#2}}}
%
\newcommand{\Itemize}[1]{\begin{itemize}{#1}\end{itemize}}
\newcommand{\Enumerate}[1]{\begin{enumerate}{#1}\end{enumerate}}
\newcommand{\describe}[1]{\begin{description}{#1}\end{description}}

\newcommand{\Tabular}[2]{%
  \par\begin{tabular}{#1}
    #2
  \end{tabular}}

\newlength{\ldescriptionwidth}
\newcommand{\ldescriptionlabel}[1]{%
  \settowidth{\ldescriptionwidth}{{#1}}%
  \ifdim\ldescriptionwidth>\labelwidth
    {\parbox[b]{\labelwidth}%
      {\makebox[0pt][l]{#1}\\[1pt]\makebox{}}}%
  \else
    \makebox[\labelwidth][l]{{#1}}%
  \fi
  \hfil\relax}
\newenvironment{ldescription}[1][1in]%
  {\begin{list}{}%
    {\setlength{\labelwidth}{#1}%
      \setlength{\leftmargin}{\labelwidth}%
      \addtolength{\leftmargin}{\labelsep}%
      \renewcommand{\makelabel}{\ldescriptionlabel}}}%
  {\end{list}}

\newenvironment{Rdsection}[1]{%
  \ifx\@empty#1\else\subsubsection*{#1}\fi
  \begin{list}{}{\setlength{\leftmargin}{0.25in}}\item}
  {\end{list}}

\newenvironment{Arguments}{%
  \begin{Rdsection}{Arguments}}{\end{Rdsection}}
\newenvironment{Author}{%
  \begin{Rdsection}{Author(s)}}{\end{Rdsection}}
\newenvironment{Description}{%
  \begin{Rdsection}{Description}}{\end{Rdsection}}
\newenvironment{Details}{%
  \begin{Rdsection}{Details}}{\end{Rdsection}}
\newenvironment{Examples}{%
  \begin{Rdsection}{Examples}}{\end{Rdsection}}
\newenvironment{Note}{%
  \begin{Rdsection}{Note}}{\end{Rdsection}}
\newenvironment{References}{%
  \begin{Rdsection}{References}}{\end{Rdsection}}
\newenvironment{SeeAlso}{%
  \begin{Rdsection}{See Also}}{\end{Rdsection}}
\newenvironment{Format}{%
  \begin{Rdsection}{Format}}{\end{Rdsection}}
\newenvironment{Source}{%
  \begin{Rdsection}{Source}}{\end{Rdsection}}
\newenvironment{Section}[1]{%
  \begin{Rdsection}{#1}}{\end{Rdsection}}
\newenvironment{Usage}{%
  \begin{Rdsection}{Usage}}{\end{Rdsection}}
\newenvironment{Value}{%
  \begin{Rdsection}{Value}}{\end{Rdsection}}

\newenvironment{ExampleCode}{\small\verbatim}{\endverbatim}

\ifx\textbackslash\undefined%-- e.g. for MM
\newcommand{\bsl}{\ifmmode\backslash\else$\backslash$\fi}
\else
\newcommand{\bsl}{\ifmmode\backslash\else\textbackslash\fi}
\fi
%fails for index (but is not used there...)
\newcommand{\SIs}{\relax\ifmmode\leftarrow\else$\leftarrow$\fi}
\newcommand{\SIIs}{\relax\ifmmode<\leftarrow\else$<\leftarrow$\fi}
\newcommand{\Sbecomes}{\relax\ifmmode\rightarrow\else$\rightarrow$\fi}
%
\newcommand{\deqn}[2]{\[#1\]}
\newcommand{\eqn}[2]{$#1$}
\newcommand{\bold}[1]{\ifmmode\bm{#1}\else\textbf{#1}\fi}
\newcommand{\code}[1]{\texttt{#1}}
\newcommand{\file}[1]{`\textsf{#1}'}
\newcommand{\link}[1]{#1\index{#1}}
\newcommand{\email}[1]{$\langle${#1}$\rangle$}

\RequirePackage[T1]{fontenc}
\RequirePackage{ae}
\input{t1aett.fd}
\DeclareFontShape{T1}{aett}{bx}{n}%
   {<->ssub*aett/m/n}{}

\RequirePackage{color}
\definecolor{Blue}{rgb}{0,0,0.8}
\definecolor{Red}{rgb}{0.7,0,0}

% Avoid the hyperref > 6.56 addcontentsline using too much string space.
\def\myaddcontentsline#1#2#3{%
  \addtocontents{#1}{\protect\contentsline{#2}{#3}{\thepage}{page.\thepage}}}
\RequirePackage{hyperref}
% next line needed in hyperref > 6.56
%\def\Hy@writebookmark#1#2#3#4#5{}%

\renewcommand\tableofcontents{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\contentsname
        \@mkboth{%
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
    \pdfbookmark{Contents}{contents}
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    }
\renewenvironment{theindex}
               {\if@twocolumn
                  \@restonecolfalse
                \else
                  \@restonecoltrue
                \fi
                \columnseprule \z@
                \columnsep 35\p@
                \twocolumn[\@makeschapterhead{\indexname}]%
                \@mkboth{\MakeUppercase\indexname}%
                        {\MakeUppercase\indexname}%
                \pdfbookmark{Index}{index}
                \myaddcontentsline{toc}{chapter}{Index}
                \thispagestyle{plain}\parindent\z@
                \parskip\z@ \@plus .3\p@\relax
                \let\item\@idxitem}
               {\if@restonecol\onecolumn\else\clearpage\fi}

% next one is not an index hyperlink.
\renewcommand{\Link}[1]{\hyperlink{Rfn.#1}{#1}\index{#1|textit}}
\renewcommand{\link}[1]{\hyperlink{Rfn.#1}{#1}\index{#1}}

\renewcommand{\alias}[2]{\hypertarget{Rfn.#1}{\index{#1@#1\textit{(#2)}}}}

\InputIfFileExists{Rd.cfg}{%
  \typeout{Reading personal defaults ...}}{}