Skip to contents

Produces a structured citation block for a corpus that can be included in manuscripts. The block documents the number of works, sources queried, date range, scimapR version, and corpus hash for reproducibility.

The build date is the UTC date of metadata$build_date, which may be a POSIXct, a Date, numeric seconds since 1970-01-01 UTC or ISO 8601 text; a missing or implausible value is shown as unknown.

Usage

sm_cite_corpus(
  corpus,
  style = c("text", "bibtex", "yaml"),
  call = rlang::caller_env()
)

Arguments

corpus

An sm_corpus object.

style

Character. Citation style: "text" for a plain-text paragraph, "bibtex" for a BibTeX entry, or "yaml" for a YAML block.

call

Caller environment for error reporting.

Value

A character string containing the formatted citation. Printed to the console and returned invisibly.

Examples

corpus <- sm_example_corpus()
sm_cite_corpus(corpus)
#> Corpus assembled using scimapR v0.5.0 on 2026-11-22. Contains 200 works by 80 authors (2015-2024). Data sources: synthetic. Corpus hash: 61c0637eede7.