Skip to contents

Collapses all author names from a Quarto project or document into a single string.

Usage

collapse_authors(
  config = quarto::quarto_inspect()$config,
  reverse_first = TRUE,
  orcid_style = c("none", "icon", "plain"),
  orcid_icon = fontawesome::fa(name = "orcid"),
  sep = ", ",
  sep2 = " and ",
  last = ", and "
)

Arguments

config

Quarto configuration as returned by quarto::quarto_inspect()$config.

reverse_first

Whether or not to reverse the first and last name from the first author, meaning Jane Doe becomes Doe, Jane.

orcid_style

How to include the authors' ORCIDs in the output. One of

  • "none" to omit ORCIDs in the output.

  • "icon" to include an ORCID icon (specified via orcid_icon) after the author name that links to the respective author's ORCID page. Suitable for HTML output.

  • "plain" to simply include the ORCID as plain text in parentheses after the author name.

orcid_icon

SVG icon to be used for orcid_style = "icon".

sep

Separator. A character string.

sep2

Separator for the special case that x contains only two elements. A character string.

last

Last separator, if there is no truncation. E.g. use ", and " for the serial comma. A character string.

Value

A character scalar.

See also

Examples

if (quarto::is_using_quarto()) {
  quappo::collapse_authors()
}