run_tab: Tab for 'Word'

View source: R/ooxml_run_objects.R

run_tabR Documentation

Tab for 'Word'

Description

Object representing a tab in a Word document. The result must be used within a call to fpar. It will only have effects in Word output.

Tabulation marks settings can be defined with fp_tabs() in paragraph settings defined with fp_par().

Usage

run_tab()

usage

You can use this function in conjunction with fpar to create paragraphs consisting of differently formatted text parts. You can also use this function as an r chunk in an R Markdown document made with package officedown.

See Also

Other run functions for reporting: external_img(), ftext(), hyperlink_ftext(), run_autonum(), run_bookmark(), run_columnbreak(), run_comment(), run_footnote(), run_footnoteref(), run_linebreak(), run_pagebreak(), run_reference(), run_word_field(), run_wordtext()

Examples

z <- fp_tabs(
  fp_tab(pos = 0.5, style = "decimal"),
  fp_tab(pos = 1.5, style = "decimal")
)
par1 <- fpar(
  run_tab(), ftext("88."),
  run_tab(), ftext("987.45"),
  fp_p = fp_par(
    tabs = z
  )
)
par2 <- fpar(
  run_tab(), ftext("8."),
  run_tab(), ftext("670987.45"),
  fp_p = fp_par(
    tabs = z
  )
)
x <- read_docx()
x <- body_add(x, par1)
x <- body_add(x, par2)
print(x, target = tempfile(fileext = ".docx"))

davidgohel/officer documentation built on March 18, 2024, 4:06 p.m.