Print a section symbol

silcrow(section_number = "", nbsp = section_number != "")

Arguments

section_number

Numeric or character value to print after the symbol. Can also be a vector of such values.

nbsp

Logical. Include a non-breaking space between the symbol and the section number? Defaults to TRUE if there is a section number.

Value

Character (UTF-8): A silcrow and, if indicated, a section number.

For multiple sections, two silcrows are traditionally used. Accordingly, the function returns two silcrows if section_number includes an en-dash, a comma, or (not recommended) a hyphen, or if section_number is a vector of length greater than one. In that last scenario, sections will be separated by commas and spaces.

Examples

silcrow()
#> [1] "§"
silcrow(8.1)
#> [1] "§ 8.1"
silcrow("8.1.1")
#> [1] "§ 8.1.1"
silcrow("8.1.1", nbsp = FALSE)
#> [1] "§8.1.1"
silcrow(en("8.1", "8.2"))
#> [1] "§ 8.1–8.2"
silcrow("8.1 - 8.2") # hyphen not recommended; use en-dash for ranges
#> [1] "§§ 8.1 - 8.2"
silcrow("8.1, 8.7")
#> [1] "§§ 8.1, 8.7"
silcrow(c("8.1", "8.7"))
#> [1] "§§ 8.1, 8.7"