%%
%% *****************************************
%% This file is defunct: for R Journal files please visit:
%% https://journal.r-project.org/
%% *****************************************
%%
\title{An R Journal Article Template}
\author{by the R Journal Editors}

\maketitle

This is a \LaTeX{} template for R Journal authors.
R Journal welcomes article submissions on any topic related to 
\R{} (\citep{R:Ihaka+Gentleman:1996}).

The file {\tt RJwrap.tex} (that you should have downloaded
at the same time you downloaded this template) plays the role
of the complete R Journal issue document.  It includes this file
({\tt RJtempl.tex}), which is not itself a complete
\LaTeX{} document (it has no \verb|\begin{document}| or
\verb|\end{document}|).

Running {\tt pdflatex} on {\tt RJwrap.tex} a couple of times
(to get the Figure references right) will produce
{\tt RJwrap.pdf} which shows how this template file would be 
typeset within an R Journal issue.

\section*{Two-column figures and tables}

Currently, R Journal is typeset in two columns.
By default, figures and tables will occupy only one
column (see Figure \ref{figure:onecolfig}), 
but you can use the \verb|figure*| or
\verb|table*| environments to create a figure or
table that spans both columns (see Figures \ref{figure:bibexample}
and \ref{figure:bblexample}).

\begin{figure}
\vspace*{.1in}
\framebox[\textwidth]{\hfill \raisebox{-.45in}{\rule{0in}{1in}}
                      A picture goes here \hfill}
\caption{\label{figure:onecolfig}
A normal figure only occupies one column.}
\end{figure}

\section*{References}

The standard way to produce citations for R Journal is via the 
\verb|\citep| and \verb|\citet| commands 
and a {\tt .bib} file that contains the 
references in {\sc Bib}\TeX{} format.\footnote{We use the {\tt natbib}
package for citations.}  The citation in the very first 
paragraph of this template is of the form
\verb|\citep{R:Ihaka+Gentleman:1996}|.  Figure \ref{figure:bibexample}
shows an example file called {\tt example.bib} which contains 
a single reference.  

A bibliography is produced from {\tt example.bib}
by placing the following line in {\tt RJtempl.tex} (or 
whatever you end up calling it:
\begin{verbatim}
\bibliography{example}
\end{verbatim}
and running {\tt pdflatex} then {\tt bibtex} on the file 
{\tt RJwrap.tex}.

You can make the R Journal editors job a bit easier if, at this point,
you replace the line:
\begin{verbatim}
\bibliography{example}
\end{verbatim}
with the contents of the file {\tt RJwrap.bbl}.  Figure
\ref{figure:bblexample} shows what this{\tt RJwrap.bbl}
looks like when produced from {\tt example.bib} 
(in Figure \ref{figure:bibexample}).

\begin{figure*}[b]
\begin{center}
\begin{boxedverbatim}
@ARTICLE{R:Ihaka+Gentleman:1996,
  AUTHOR = {Ross Ihaka and Robert Gentleman},
  TITLE = {R: A Language for Data Analysis and Graphics},
  JOURNAL = {Journal of Computational and Graphical Statistics},
  YEAR = 1996,
  VOLUME = 5,
  NUMBER = 3,
  PAGES = {299--314},
  URL = {http://www.amstat.org/publications/jcgs/}
}
\end{boxedverbatim}
\end{center}
\caption{\label{figure:bibexample}
The contents of a file called {\tt example.bib}.  This figure 
uses the {\tt figure*} environment to span
two columns.}
\end{figure*}

\begin{figure*}[b]
\begin{center}
\begin{boxedverbatim}
\begin{thebibliography}{1}
\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi
\expandafter\ifx\csname url\endcsname\relax
  \def\url#1{{\tt #1}}\fi

\bibitem[Ihaka and Gentleman(1996)]{R:Ihaka+Gentleman:1996}
R.~Ihaka and R.~Gentleman.
\newblock R: A language for data analysis and graphics.
\newblock {\em Journal of Computational and Graphical Statistics}, 5\penalty0
  (3):\penalty0 299--314, 1996.
\newblock URL \url{http://www.amstat.org/publications/jcgs/}.

\end{thebibliography}
\end{boxedverbatim}
\end{center}
\caption{\label{figure:bblexample}
The contents of a file called {\tt RJwrap.bbl}.  This figure also
uses the {\tt figure*} environment to span
two columns.}
\end{figure*}

\section*{Summary}

The steps involved in preparing an article for submission to R Journal
are as follows:

\begin{itemize}
\setlength{\itemsep}{0in}
\item download {\tt RJwrap.tex}, {\tt RJtempl.tex}, and {\tt RJournal.sty}.
\item rename {\tt RJtempl.tex} to something more appropriate,
{\tt yourarticle.tex} say, and replace its
contents with the contents of your article.
\item (if appropriate) create a {\tt yourarticle.bib} file
and add \\
\verb|\bibliography{yourarticle}|\\
at the end of {\tt yourarticle.tex}.  
\item modify {\tt RJwrap.tex} to include {\tt yourarticle} rather
than {\tt RJtempl}.
\item (if appropriate) run {\tt pdflatex} then
 {\tt bibtex} on {\tt RJwrap.tex}
to create {\tt RJwrap.bbl}. Replace \\
\verb|\bibliography{yourarticle}|\\
in {\tt yourarticle.tex} with
the contents of {\tt RJwrap.bbl}.
\item run {\tt pdflatex} on {\tt RJwrap.tex} a couple of times
(until all figure references are resolved) to produce {\tt RJwrap.pdf}.
\item iterate until {\tt RJwrap.pdf} looks right, then submit
  \begin{itemize}
  \item {\tt RJwrap.pdf}
  \item {\tt yourarticle.tex}
  \item all necessary figure files 
  \end{itemize}
\end{itemize}


\begin{thebibliography}{1}
\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi
\expandafter\ifx\csname url\endcsname\relax
  \def\url#1{{\tt #1}}\fi

\bibitem[Ihaka and Gentleman(1996)]{R:Ihaka+Gentleman:1996}
R.~Ihaka and R.~Gentleman.
\newblock R: A language for data analysis and graphics.
\newblock {\em Journal of Computational and Graphical Statistics}, 5\penalty0
  (3):\penalty0 299--314, 1996.
\newblock URL \url{http://www.amstat.org/publications/jcgs/}.

\end{thebibliography}
