This function creates a glossary with terms and definitions, rendering them as a formatted gt table with customizable styling, optimized for both HTML and PDF output, with text wrapping for definitions and visible borders between cells.
create_glossary_table(
terms,
table_title = "Glossary of Terms",
term_color = "purple",
term_decoration = "underline",
def_bg = "gray",
def_color = "white",
font_size = "12pt",
table_width = "100%",
max_height = "400px",
border_color = "black",
border_style = "solid",
border_weight = "2pt"
)
A named list where names are terms and values are definitions.
Title for the glossary table (default: "Glossary of Terms").
Color for glossary terms in the table (default: "purple").
Text decoration for terms (default: "underline"). Supports "underline", "overline", "line-through" (requires LaTeX package ulem
for line-through).
Background color for definitions (default: "gray").
Text color for definitions (default: "white").
Font size for the table (default: "12pt").
Width of the table (default: "100%").
Maximum height of the table (default: "400px").
Color of cell borders (default: "black").
Style of cell borders (default: "solid"). Supports "solid", "dashed", "dotted".
Weight of cell borders (default: "2pt" for better visibility).
A gt table object displaying the glossary.