70 lines
2.0 KiB
Plaintext
Raw Normal View History

2025-01-12 00:52:51 +08:00
%\VignetteIndexEntry{xtable margintable}
%\VignetteKeywords{LaTeX, HTML, table, margintable}
% !Rnw weave = knitr
% \VignetteEngine{knitr::knitr}
\documentclass{tufte-handout}
\title{
A Margin Table Example
}
\author{David J. Scott}
<<include=FALSE>>=
library(knitr)
@
\usepackage{rotating}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{hyperref}
\usepackage{fancyvrb}
\fvset{fontsize=\normalsize}
\begin{document}
\section{The Example}
\label{sec:example}
This document uses the Tufte handout \LaTeX\ document style. This is
specified by the use of the document class as
\Verb|\documentclass{tufte-handout}|.
The Tufte-\LaTeX\ document classes define a style similar to the
style Edward Tufte uses in his books and handouts. Tufte's style is known
for its extensive use of sidenotes, tight integration of graphics with
text, and well-set typography.
One of the most prominent and distinctive features of this style is the
extensive use of sidenotes. There is a wide margin to provide ample room
for sidenotes and small figures. Any \Verb|\footnote|s will automatically
be converted to sidenotes.
Here is an example of a margin table, suggested by Felix Sch\"onbrodt
\Verb|<nicebread@gmx.net>|. I am not sure about its usefullness in
practice however. Note that \Verb|latex.environments = ""| avoids the
default option of tables being centered, which in this example would
lead to the caption not being directly under the table. Most
importantly, \Verb|table.placement = NULL| is required to ensure that
the default table placement options \Verb|[ht]| being inserted after
\Verb|\begin{margintable}|. This is necessary because the margintable
environment does not allow placement options like \Verb|[ht]|.
<<>>=
library(xtable)
x <- matrix(rnorm(6), ncol = 2)
x.small <- xtable(x, label = 'tabsmall', caption = 'A margin table')
@
<<results='asis'>>=
print(x.small,floating.environment='margintable',
latex.environments = "",
table.placement = NULL)
@
\end{document}