Learn R Programming

formatters (version 0.5.0)

page_lcpp: Determine lines per page (LPP) and characters per page (CPP) based on font and page type

Description

Determine lines per page (LPP) and characters per page (CPP) based on font and page type

Usage

page_lcpp(
  page_type = page_types(),
  landscape = FALSE,
  font_family = "Courier",
  font_size = 8,
  lineheight = 1,
  margins = c(top = 0.5, bottom = 0.5, left = 0.75, right = 0.75),
  pg_width = NULL,
  pg_height = NULL
)

Value

a named list containing lpp (lines per page) and cpp (characters per page) elements suitable for use by the pagination machinery.

Arguments

page_type

character(1). Name of a page type. See page_types. Ignored when pg_width and pg_height are set directly.

landscape

logical(1). Should the dimensions of page_type be inverted for landscape? Defaults to FALSE, ignored when pg_width and pg_height are set directly.

font_family

character(1). Name of a font family. An error will be thrown if the family named is not monospaced. Defaults to Courier.

font_size

numeric(1). Font size, defaults to 12.

lineheight

numeric(1). Line height, defaults to 1.

margins

numeric(4). Named numeric vector containing 'bottom', 'left', 'top', and 'right' margins in inches. Defaults to .5 inches for both vertical margins and .75 for both horizontal margins.

pg_width

numeric(1). Page width in inches.

pg_height

numeric(1). Page height in inches.

Examples

Run this code
page_lcpp()
page_lcpp(font_size = 10)
page_lcpp("a4", font_size = 10)

page_lcpp(margins = c(top = 1, bottom = 1, left = 1, right = 1))
page_lcpp(pg_width = 10, pg_height = 15)

Run the code above in your browser using DataLab