Tables of predefined sections and types of pieces of Rd objects.
Rdo_predefined_sectionsRdo_piece_types
rdo_top_tags
for Rdo_predefined_sections
, the name-value pairs are given in
the following table. For example, Rdo_predefined_sections["examples"]
results
in Rdo_predefined_sections["examples"].
require(Rdpack); paste( "\\ifelse{latex}{\\out{", "\\begin{tabular}{ll|lll}", paste(names(Rdo_predefined_sections)[1:5], Rdo_predefined_sections[1:5], " ", names(Rdo_predefined_sections)[-(1:5)], Rdo_predefined_sections[-(1:5)], sep=" & ", collapse="\\\\\\\\ \n"), "\\end{tabular}", "}}{", "\\tabular{lllll}{", paste(names(Rdo_predefined_sections)[1:5], Rdo_predefined_sections[1:5], " | ", names(Rdo_predefined_sections)[-(1:5)], Rdo_predefined_sections[-(1:5)], sep=" \\tab ", collapse="\\cr\n"), "}", "}" )
for Rdo_piece_types
, the name-value pairs are:
paste( "\\ifelse{latex}{\\out{", "\\begin{tabular}{ll|ll|ll|ll|ll|ll}", paste(names(Rdo_piece_types), " & ", Rdo_piece_types, c(rep(" & ",2),"\\\\\\\\"), sep="", collapse="\n"), "\\end{tabular}", "}}{", "\\tabular{llllllllllll}{", paste(names(Rdo_piece_types), "\\tab ", Rdo_piece_types, c(rep(paste("\\tab ", "|", sep=""),2), "\\cr"), sep="", collapse="\n"), "}", "}" )
for rdo_top_tags
, the values are:
paste("\\tabular{lllll}{", paste(sub("^[#]", "\\\\verb{#}", sub("^([\\])", "\\\\\\1", rdo_top_tags)), c(rep("\\tab ",4),"\\cr"), sep="", collapse="\n"), "}")
Note that most, but not all, are prefixed with a backslash.
The Rd syntax defines several tables if(!exists(".Rdpack.currefs")) .Rdpack.currefs <- new.env();Rdpack::insert_citeOnly(keys="parseRd",package="Rdpack", cached_env=.Rdpack.currefs). Rdpack stores them in the variables described here.
Rdo_predefined_sections
is a named character vector providing
the types of the top level sections in an Rd object.
Rdo_piece_types
is a named character vector giving the types of
the core (all possible?) Rd macros.
NOTE: These objects are hard coded and need to be updated if the specifications of the Rd format are updated.
todo: write functions that go through existing Rd documentation to discover missing or wrong items.
if(!exists(".Rdpack.currefs")) .Rdpack.currefs <- new.env();Rdpack::insert_all_ref(.Rdpack.currefs)