1.6-1 (NOT YET RELEASED)
-
* Added some vectorization code to improve performance.
* Added "toLatex" method.
- * Included "print" in the exported methods in the NAMESPACE file.
* Added "print.results" argument to "print" that can be used to
suppress the printing.
+ * Added "format.args" argument to "print" that can be used to
+ pass additional arguments such as "big.marks" to "formatC()".
+ * Added "short.caption" argument to "print" to let the user
+ specify a Latex short caption used when creating a list of tables.
* Added an "is.null()" check on the "table.placement" argument.
+ * Included "print.xtable" in the exported methods in the NAMESPACE file.
* Added an example of header and footer specification with longtable
to the vignette.
- * Added "format.args" argument to "print" that can be used to
- pass additional arguments such as "big.marks" to "formatC()".
-
+
1.6-0 (2011-10-07)
* Allow "table*" as a value for "floating.environment" in print.xtable().
* Fix bug under which multiple logical columns were formatted incorrectly.
* Accommodated logicals by converting to characters.
* Add an extra space at end of each line for LaTeX tables.
* Fixed typographical error in documentation.
-
html.table.attributes="border=1",\r
print.results=TRUE,\r
format.args=NULL,\r
+ short.caption=NULL,\r
...) {\r
# Claudio Agostinelli <claudio@unive.it> dated 2006-07-28 hline.after\r
# By default it print an \hline before and after the columns names independently they are printed or not and at the end of the table\r
## fix 10-26-09 (robert.castelo@upf.edu) the following 'if' condition is added here to support\r
## a caption on the top of a longtable\r
if (tabular.environment == "longtable" && caption.placement=="top") {\r
- BCAPTION <- "\\caption{"\r
+ if (is.null(short.caption)){\r
+ BCAPTION <- "\\caption{"\r
+ } else {\r
+ BCAPTION <- paste("\\caption[", short.caption, "]{", sep="")\r
+ } \r
ECAPTION <- "} \\\\ \n"\r
if ((!is.null(attr(x,"caption",exact=TRUE))) && (type=="latex")) BTABULAR <- paste(BTABULAR, BCAPTION, attr(x,"caption",exact=TRUE), ECAPTION, sep="")\r
}\r
}\r
BLABEL <- "\\label{"\r
ELABEL <- "}\n"\r
- BCAPTION <- "\\caption{"\r
+ if (is.null(short.caption)){\r
+ BCAPTION <- "\\caption{"\r
+ } else {\r
+ BCAPTION <- paste("\\caption[", short.caption, "]{", sep="")\r
+ } \r
ECAPTION <- "}\n"\r
BROW <- ""\r
EROW <- " \\\\ \n"\r
sanitize.colnames.function=sanitize.text.function, math.style.negative=FALSE,
html.table.attributes="border=1",
print.results=TRUE,
- format.args=NULL, ...)}
+ format.args=NULL,
+ short.caption=NULL, ...)}
\arguments{
\item{x}{An object of class \code{"xtable"}.}
\item{type}{Type of table to produce. Possible values for \code{type} are \code{"latex"} or \code{"html"}.
\item{html.table.attributes}{In an HTML table, attributes associated with the \code{<TABLE>} tag. Default value is \code{border=1}.}
\item{print.results}{If \code{TRUE}, the generated table is printed to standard output. Set this to \code{FALSE} if you will just be using the character vector that is returned invisibly.}
\item{format.args}{List of arguments for the \code{formatC} function. For example, standard German number separators can be specified as \code{format.args=list(big.mark = "'", decimal.mark = ","))}.}
+ \item{short.caption}{A "short caption" can be specified that gets used as the table descriptor when LaTeX generates a "List of Tables".}
\item{...}{Additional arguments. (Currently ignored.)}
}
\details{
## Demonstration of additional formatC() arguments.
print(fm1.table, format.args=list(big.mark = "'", decimal.mark = ","))
+## Demonstration of short caption support.
+fm1sc <- aov(tlimth ~ sex + ethnicty + grade, data=tli)
+fm1sc.table <- xtable(fm1sc,
+ caption="ANOVA Model with Predictors Sex, Ethnicity, and Grade")
+print(fm1sc.table,
+ short.caption="ANOVA: Sex, Ethnicity, Grade")
+
## Demonstration of longtable support.
## Remember to insert \usepackage{longtable} on your LaTeX preamble
x <- matrix(rnorm(1000), ncol = 10)