pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

HTML rendering of \tabular{} with double \cr statements

Open SebKrantz opened this issue 1 year ago • 1 comments

In my documentation I have some large \tabular's where I have used double line breaks \cr\cr to increase the space between two lines. This does not render well to HTML. Example is GRP.Rd: https://sebkrantz.github.io/collapse/reference/GRP.html (see Value section)

Source:

  \tabular{lllllll}{\emph{ List-index }  \tab\tab \emph{ Element-name }   \tab\tab \emph{ Content type } \tab\tab \emph{ Content description} \cr\cr

                 [[1]] \tab\tab N.groups   \tab\tab \code{integer(1)} \tab\tab Number of Groups \cr\cr
                 [[2]] \tab\tab group.id \tab\tab \code{integer(NROW(X))} \tab\tab An integer group-identifier \cr\cr
                 [[3]] \tab\tab group.sizes    \tab\tab \code{integer(N.groups)} \tab\tab Vector of group sizes \cr\cr
                 [[4]] \tab\tab groups    \tab\tab \code{unique(X)} or \code{NULL} \tab\tab Unique groups (same format as input, except for \code{fgroup_by} which uses a plain list, sorted if \code{sort = TRUE}), or \code{NULL} if \code{return.groups = FALSE} \cr\cr
                 [[5]] \tab\tab group.vars   \tab\tab \code{character} \tab\tab The names of the grouping variables \cr\cr
                 [[6]] \tab\tab ordered   \tab\tab \code{logical(2)} \tab\tab \code{[1]} Whether the groups are ordered: equal to the \code{sort} argument in the default method, or \code{TRUE} if converted objects inherit a class \code{"ordered"} and \code{NA} otherwise, \code{[2]} Whether the data (\code{X}) is already sorted: the result of \code{!is.unsorted(group.id)}. If \code{sort = FALSE} (default method) the second entry is \code{NA}. \cr\cr
                 [[7]] \tab\tab order     \tab\tab \code{integer(NROW(X))} or \code{NULL} \tab\tab Ordering vector from \code{radixorderv} (with \code{"starts"} attribute), or \code{NULL} if \code{return.order = FALSE} \cr\cr
                 [[8]] \tab\tab group.starts \tab\tab \code{integer(N.groups)} or \code{NULL} \tab\tab The first-occurrence positions/rows of the groups. Useful e.g. with \code{ffirst(x, g, na.rm = FALSE)}. \code{NULL} if \code{return.groups = FALSE}. \cr\cr
                 [[9]] \tab\tab call \tab\tab \code{match.call()} or \code{NULL} \tab\tab The \code{GRP()} call, obtained from \code{match.call()}, or \code{NULL} if \code{call = FALSE}
                 }
}

Thanks for considering!

SebKrantz avatar Aug 15 '22 14:08 SebKrantz

Is there any progress on this issue? I'm using it in several places in the collapse documentation because it just looks better in R to have some extra space. But also with pkgdown 2.0.7 I get strange breaks in tables where multiple \cr's are used, see e.g. tables here https://sebkrantz.github.io/collapse/reference/pivot.html.

SebKrantz avatar Oct 12 '23 07:10 SebKrantz

In general, I don't think it's a good idea to the modify the semantics of your Rd files in order to improve display in one specific venue. So unfortunately, I don't think this is something that pkgdown is every likely to support. Nevertheless, I appreciate you using pkgdown and thanks for filing this issue!

hadley avatar Apr 17 '24 22:04 hadley