margins: Return or set margins

Description Usage Arguments Value Examples

View source: R/properties.R

Description

These property functions return or set the margin attribute of a rtf_doc object. These are stored as a named vector. Names should be top, bottom, left, and right. Margins are measured in inches.

Usage

1
2
3
4
5
margins(x, ...)

margins(x) <- value

set_margins(x, value)

Arguments

x

A rtf_doc object

...

Additonal arguments passed to method dispatch

value

A named list or vector detailing the page margins

Value

For margin(), a named vector of the margin attribute of the supplied rtf_doc. For `margin<-()` and set_margin() the modified object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(huxtable)
ht <- huxtable(
  column1 = 1:5,
  column2 = letters[1:5]
)
rtf <- rtf_doc(ht, list(hf_line("aTitle")))

margins(rtf)
# Returns c(top = 1, bottom = 1, left = 1, right = 1)

margins(rtf) <- c(top = 2)
# Sets top margin to 2

pharmaRTF documentation built on Sept. 28, 2021, 5:08 p.m.