Learn R Programming

lazyWeave (version 3.0.2)

lazy.section: Open Sections in LaTeX Documents

Description

Provides the code to start a new section, chapter, or subsection.

Usage

lazy.section(heading, type = c("section", "sub", "subsub", "chapter", "sub2"),
  ordered = FALSE, counter, counterSet = NULL, label = NULL,
  font = getOption("html.font.font"),
  family = getOption("html.font.family"),
  size = getOption("html.font.size"), leadspace = TRUE,
  floatBarrier = TRUE)

Arguments

heading

The name of the section or subsection

type

Type of section. "section" for section; "sub" for subsection; and "subsub" for subsubsection. The option "sub2" is a relic of me trying to avoid typing two extra characters. I decided it would be better to keep true to the LaTeX descriptors. Thus, "sub2" is available for back-compatibility, but I recommend against its use

ordered

Logical. Determines if the section is numbered

counter

Name of a the counter to be used for this section. When NULL, the value defaults to the counter corresponding to the type of section. See lazy.counter for more details about counters

counterSet

Value to which counter should be set. In other words, the number for this section (or similar division).

label

The label to be used with lazy.ref.

font

Font to be used in HTML files

family

Font family to be used in HTML files

size

Font size. I'm pretty sure this doesn't actually get used, but haven't gotten around to verifying this. Heading sizes are set using the HTML <H ... > tags

leadspace

For HTML reports, should several lines of white space be placed before the section header. This helps to create a visual break between sections

floatBarrier

Figures and tables in LaTeX are floating objects that LaTeX may choose to place somewhere other than where specified in order to optimize appearance. This is not always desirable. floatBarrier prevents floats from overlapping a section break. This may be turned off if placement of figures and tables is of little consequence

Details

For HTML, Sections titles are printed using the <Hx ...> tags, where x is the heading number. H1 is the largest heading size and H6 is the smallest. Chapter headings use <H2>; sections use <H3>; subsections use <H4>; and subsubsections use <H5>.

Examples

Run this code
# NOT RUN {
  lazy.write(
  lazy.file.start(),
  lazy.section("Section A", ordered=TRUE),
  lazy.text("Notice that Section A is numbered"),
  lazy.section("Subsection", type="sub", ordered=FALSE),
  lazy.text("But the subsection is not numbered"),
  lazy.file.end(),
  OutFile="Example-1.tex")
  
  unlink("Example-1.tex")
 
# }
# NOT RUN {
 
# }

Run the code above in your browser using DataLab