%% \VignetteIndexEntry{btable}
\documentclass[a4paper,11pt]{article}
\usepackage[left = 3cm, top = 2cm, bottom = 2cm, right = 4cm]{geometry}
\usepackage[noae,nogin]{Sweave}
\usepackage{libertine}
\usepackage[scaled=0.9]{inconsolata}
%% \usepackage[T1]{fontenc}
\renewcommand*\familydefault{\sfdefault}
\usepackage{amsmath,amstext}
\usepackage{hyperref}
\usepackage{natbib}
\usepackage{xcolor}
\usepackage{framed}
\definecolor{grau2}{rgb}{.2,.2,.2}
\definecolor{grau7}{rgb}{.7,.7,.7}
\DefineVerbatimEnvironment{Sinput}{Verbatim}{}
\DefineVerbatimEnvironment{Soutput}{Verbatim}{frame=single,xleftmargin=0em,%
  formatcom=\color{grau2},rulecolor=\color{grau7}}
\DefineVerbatimEnvironment{Scode}{Verbatim}{xleftmargin=2em}
\fvset{listparameters={\setlength{\topsep}{0pt}}}
\renewenvironment{Schunk}{\vspace{\topsep}}{\vspace{\topsep}}
\SweaveOpts{keep.source = TRUE, eps = TRUE}

<<echo=false>>=
options(continue = " ", digits = 3, width = 60, useFancyQuotes = FALSE)
@

\begin{document}
\title{Using btable}
\author{Enrico Schumann\\\url{mailto:es@enricoschumann.net}}

{\raggedright{\LARGE \texttt{btable}}}\medskip

\noindent Enrico Schumann\\
\noindent \url{mailto:es@enricoschumann.net}\\
\bigskip

<<echo=false,results=hide>>=
require("textutils")
@

\section{btable}

\texttt{btable} creates a simple barplot in a \LaTeX\ tabular. As an
example, add this to a Sweave file:
\begin{verbatim}
 \begin{tabular}{ll}
 <<echo=false, results=tex>>=
 x <- 1:5
 cat(btable(x, before = paste(x, "&"), after= "\\\\\n"))
 @
 \end{tabular}
\end{verbatim}

\noindent The output should be:

\begin{tabular}{ll}
<<echo=false, results=tex>>=
x <- 1:5
cat(btable(x, before = paste(1:5, "&"), after= "\\\\\n"))
@
\end{tabular}


\section{dctable}

<<>>=
x <- array(1:6, dim = c(3, 2))
@

\begin{tabular}{ll}
<<echo=false, results=tex>>=
cat(paste(dctable(x, circle.size = 1), "\\\\\n"))
@

\end{tabular}

%% \section{latexrule}

\newpage

\appendix

<<results=tex>>=
toLatex(sessionInfo())
@
\end{document}
