]> git.donarmstrong.com Git - xtable.git/commitdiff
Vignette: no url package, no \R command, sort LaTeX pkgs, repaginate
authorarnima <arnima@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Fri, 10 Oct 2014 10:03:51 +0000 (10:03 +0000)
committerarnima <arnima@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Fri, 10 Oct 2014 10:03:51 +0000 (10:03 +0000)
git-svn-id: svn://scm.r-forge.r-project.org/svnroot/xtable@65 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

pkg/vignettes/xtableGallery.Rnw

index 88dd00b8c94d94657c3a749d9598049a9db7908c..cbab0d94950ae075b032adb895579092f0158587 100644 (file)
@@ -6,24 +6,20 @@
 % \VignetteEngine{knitr::knitr}\r
 %**************************************************************************\r
 \documentclass{article}\r
-\usepackage[a4paper,height=24cm]{geometry}\r
-\usepackage{parskip}\r
-\usepackage{titlesec}\r
-\titleformat\subsubsection{\bfseries\itshape}{}{0pt}{}\r
+\usepackage[a4paper,height=24cm]{geometry} % geometry first\r
+\usepackage{array}\r
 \usepackage{booktabs}\r
 \usepackage{longtable}\r
+\usepackage{parskip}\r
 \usepackage{rotating}\r
-\usepackage{array}\r
 \usepackage{tabularx}\r
+\usepackage{titlesec}\r
+\usepackage{hyperref} % hyperref last\r
+\titleformat\subsubsection{\bfseries\itshape}{}{0pt}{}\r
 \newcommand\p{\vspace{2ex}}\r
-\setcounter{tocdepth}{2}\r
-%% Define \code \proglang and \pkg commands\r
 \newcommand\code[1]{\texttt{#1}}\r
 \newcommand\pkg[1]{\textbf{#1}}\r
-\newcommand\R{\textsf{R}}\r
-%% url and hyperref\r
-\usepackage[hyphens]{url}\r
-\usepackage{hyperref}\r
+\setcounter{tocdepth}{2}\r
 \begin{document}\r
 \r
 \title{The \pkg{xtable} Gallery}\r
@@ -35,8 +31,6 @@
 \newpage\r
 \r
 \section{Introduction}\r
-\label{sec:introduction}\r
-\r
 This document gives a gallery of tables which can be made using the\r
 \pkg{xtable} package to create \LaTeX\ output. It doubles as a\r
 regression check for the package.\r
@@ -117,6 +111,8 @@ xtable(summary(pr1))
 # xtable(pr2)\r
 @\r
 \r
+\newpage\r
+\r
 \subsection{Time series}\r
 <<results='asis'>>=\r
 temp.ts <- ts(cumsum(1 + round(rnorm(100), 0)),\r
@@ -194,6 +190,8 @@ print(wanttex, sanitize.text.function =
       function(str) gsub("_", "\\_", str, fixed = TRUE))\r
 @\r
 \r
+\newpage\r
+\r
 \subsection{Markup in tables}\r
 Markup can be included in tables, including in column and row names, by using\r
 a custom \code{sanitize.text.function}.\r
@@ -206,9 +204,8 @@ mat <- xtable(mat)
 print(mat, sanitize.text.function = function(x) {x})\r
 @\r
 \r
-\newpage\r
 % By David Dahl to demonstrate contribution from David Whitting, 2007-10-09.\r
-\r
+\p\r
 You can also have sanitize functions that are specific to column or\r
 row names.  In the table below, the row name is not sanitized but\r
 column names and table elements are.\r
@@ -480,8 +477,6 @@ x.rescale <- xtable(x)
 print(x.rescale, scalebox = 0.7)\r
 @\r
 \r
-\newpage\r
-\r
 \subsection{Aligning fixed width columns}\r
 Note that using specifications such as \verb|p{2cm}| always\r
 produces a \textbf{left aligned} column. What if some other alignment\r
@@ -525,6 +520,8 @@ print(xtable(df, align = c("l", "|c", "|R{3cm}", "|L{3cm}", "| p{3cm}|")),
       floating = FALSE, include.rownames = FALSE)\r
 @\r
 \r
+\newpage\r
+\r
 \subsection{Table width}\r
 The \code{tabularx} environment is for typesetting tables whose overall width is\r
 fixed. The column alignment code \code{X} denotes columns that will be stretched\r
@@ -539,8 +536,6 @@ align(x.width) <- "|l|X|l|l|l|"
 print(x.width, tabular.environment = "tabularx", width = "\\textwidth")\r
 @\r
 \r
-\newpage\r
-\r
 \section{Suppressing printing}\r
 By default the \code{print} method will print the \LaTeX\ or HTML to standard\r
 output and also return the character strings invisibly.  The printing to\r
@@ -560,12 +555,14 @@ class(x.ltx)
 x.ltx\r
 @\r
 \r
+\newpage\r
+\r
 \section{Acknowledgements}\r
 Most of the examples in this gallery are taken from the \pkg{xtable}\r
 documentation. Two examples (\code{add.to.row} and `Aligning fixed width\r
 columns') are from Stack Exchange.\r
 \r
-\section{\R\ session information}\r
+\section{Session information}\r
 <<results='asis'>>=\r
 toLatex(sessionInfo())\r
 @\r