From: dscott Date: Tue, 12 Jan 2016 01:32:32 +0000 (+0000) Subject: Fixed bugs #6907 and #6260 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=38e5f0882e8d48b949e47d18522149c6c039e18d;p=xtable.git Fixed bugs #6907 and #6260 git-svn-id: svn://scm.r-forge.r-project.org/svnroot/xtable@90 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- diff --git a/pkg/NEWS b/pkg/NEWS index 4d24a5e..9687f7d 100644 --- a/pkg/NEWS +++ b/pkg/NEWS @@ -11,6 +11,17 @@ * Added option to produce math style exponents when sanitizing numbers, as suggested by Don Armstrong (don@donarmstrong.com), who also provided code + * Fixed bug #6907. Warning was created when the data frame as no + rows for type is 'html'. Added a test to create the matrix + requested specially in that case. Original code was + BTD2 <- matrix(align.tmp[(2-pos):(ncol(x)+1)], + nrow = nrow(x), ncol = ncol(x)+pos, byrow = TRUE) + which created a matrix with no rows, but gave a warning when + there were no rows in the data frame being processed. + * Fixed bug #6260. Accepted the change suggested by Claudius + Loehnert, which was to replace { and } by \begingroup and + \endgroup respectively as the delimiters when size was to changed + in a table. 1.8-0 diff --git a/pkg/R/print.xtable.R b/pkg/R/print.xtable.R index b3b4b9a..ce9c7bc 100644 --- a/pkg/R/print.xtable.R +++ b/pkg/R/print.xtable.R @@ -334,8 +334,11 @@ print.xtable <- function(x, if(length(grep("^\\\\", size)) == 0){ size <- paste("\\", size, sep = "") } - BSIZE <- paste("{", size, "\n", sep = "") - ESIZE <- "}\n" + ## Change suggested by Claudius Loehnert reported in Bug #6260 + ## BSIZE <- paste("{", size, "\n", sep = "") + ## ESIZE <- "{\n" + BSIZE <- paste("\\begingroup", size, "\n", sep = "") + ESIZE <- "\\endgroup\n" } BLABEL <- "\\label{" ELABEL <- "}\n" @@ -386,8 +389,12 @@ print.xtable <- function(x, BTD1 <- " ## in e-mail dated Wednesday, January 17, 2007 BTD2[regexpr("^p", BTD2)>0] <- "left"