glossary {glossary}R Documentation

Display glossary entry

Description

Display a glossary term with an optional popup of the definition, and add the term to the table created by glossary_table. This function is mainly meant to be used via inline R in R Markdown or quarto documents, e.g.:

`r glossary("Alpha")` does not always have to equal .05.

Usage

glossary(
  term,
  display = term,
  def = NULL,
  add_to_table = TRUE,
  show = c("term", "def"),
  popup = glossary_popup(),
  path = glossary_path()
)

Arguments

term

The glossary term to link to, can contain spaces

display

The text to display (if different than the term)

def

The short definition to display on hover and in the glossary table; if NULL, this will be looked up from the file in the path argument

add_to_table

whether to add to the table created by glossary_table

show

whether to show the term or just the definition

popup

whether to show the popup on "click" or "hover" (or "none"); set default with glossary_popup

path

the path to the glossary file, or NULL for local definitions; set default with glossary_path

Details

If the path is set to "psyteachr", the glossary term will link to the PsyTeachR glossary. Set show = "def" to just show the definition.

Value

character string

Examples

# set glossary path to example file
path <- system.file("glossary.yml", package = "glossary")
glossary_path(path)

glossary("alpha")
glossary("alpha", "$\\alpha$")
glossary("alpha", def = "The first letter of the Greek alphabet")
glossary("alpha", show = "term")
glossary("alpha", show = "def")

[Package glossary version 1.0.0 Index]