Skip to contents

Format a chunk of text with text formatting properties (bold, color, ...), the chunk is associated with an hyperlink.

Usage

hyperlink_ftext(text, prop = NULL, href)

Arguments

text

text value, a single character value

prop

formatting text properties returned by fp_text. It also can be NULL in which case, no formatting is defined (the default is applied).

href

URL value

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.

Examples

ft <- fp_text(font.size = 12, bold = TRUE)
hyperlink_ftext(
  href = "https://cran.r-project.org/index.html",
  text = "some text", prop = ft
)
#> $value
#> [1] "some text"
#> 
#> $pr
#>   font.size italic bold underlined color     shading fontname fontname_cs
#> 1        12  FALSE TRUE      FALSE black transparent    Arial       Arial
#>   fontname_eastasia fontname.hansi vertical_align
#> 1             Arial          Arial       baseline
#> 
#> $href
#> [1] "https://cran.r-project.org/index.html"
#> 
#> attr(,"class")
#> [1] "hyperlink_ftext" "cot"             "run"