%% LyX 2.1.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[landscape]{geometry}
\geometry{verbose,tmargin=0cm,bmargin=0cm,lmargin=1cm,rmargin=1cm}
\setlength{\parskip}{0in}
\setlength{\parindent}{0pt}
\usepackage[unicode=true,pdfusetitle,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
 {hyperref}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{multicol}
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

\makeatother

\begin{document}

\title{knitr Reference Card}


\author{Yihui Xie}

\maketitle
\begin{multicols}{2}


\section{Syntax}

\begin{small}

\noindent \begin{center}
\begin{tabular}{l|l|l|l|l}
\hline 
format & start & end & inline & output\tabularnewline
\hline 
Rnw & \verb|<<*>>=| & \texttt{@} & \verb|\|\verb|Sexpr{x}| & \TeX{}\tabularnewline
\hline 
Rmd & \verb|```{r *}| & \verb|```| & \verb|`r x`| & MD\tabularnewline
\hline 
Rhtml & \verb|<!--begin.rcode *| & \verb|end.rcode-->| & \verb|<!--rinline x-->| & HTML\tabularnewline
\hline 
Rrst & \texttt{..~\{r {*}\}} & \texttt{..~..} & \verb|:r:`x`| & reST\tabularnewline
\hline 
Rtex & \texttt{\% begin.rcode {*}} & \texttt{\% end.rcode} & \verb|\rinline{x}| & \TeX{}\tabularnewline
\hline 
Rasciidoc & \texttt{// begin.rcode {*}} & \texttt{// end.rcode} & \texttt{+r x+} & AsciiDoc\tabularnewline
\hline 
Rtextile & \texttt{\#\#\# begin.rcode {*}} & \texttt{\#\#\# end.rcode} & \texttt{@r x@} & Textile\tabularnewline
\hline 
brew &  &  & \verb|<% x %>| & text\tabularnewline
\hline 
\end{tabular}
\par\end{center}

\end{small}

\texttt{{*}} denotes local chunk options, e.g. \verb|<<label, eval=FALSE>>=|;
\texttt{x} denotes inline R code, e.g. \verb|`r 1+2`| (MD stands
for \href{http://en.wikipedia.org/wiki/Markdown}{Markdown})


\section{Minimal Examples}

\begin{multicols}{2}


\subsection{Sweave ({*}.Rnw)}

\begin{verbatim}
\documentclass{article}
\begin{document}

Below is a code chunk.
<<foo, echo=TRUE>>=
z = 1+1
plot(cars)
@

The value of z is \Sexpr{z}.
\end{document}
\end{verbatim}


\subsection{R Markdown ({*}.Rmd)}

\begin{verbatim}
Hi _markdown_!

```{r foo, echo=TRUE}
z = 1+1
plot(cars)
```

The value of z is `r z`.
\end{verbatim}


\subsection{Brew ({*}.brew)}

\begin{verbatim}
The value of pi is <% pi %>.
\end{verbatim}

\end{multicols}

$body$

\end{multicols}
\end{document}
