Skip to content

deps.citedKeys ​

How to read this API

These are TypeScript APIs compiled into SnapTeX; a .tex project cannot load them at runtime.

  • function name(...) is a helper that your rule imports and calls.
  • apply(...), render(...), extract(...), and collect(...) are callbacks that your rule implements and SnapTeX calls.
  • renderer.name(...), context.name(...), input.name(...), and deps.name(...) are methods SnapTeX supplies to callbacks; do not import or construct them.
  • service.name(...) is an instance method called after your host or test constructs PreviewUpdateService.

Register extension declarations through SNAP_TEX_RULES in src/rules.ts. See Source API Scope for imports, value ownership, output safety, rebuilds, and testing.

Creates a dependency descriptor for the document's stable cited-key set. Call it through deps inside a bibliography dependency collector.

Signature ​

ts
deps.citedKeys(): RenderDependency

Returns ​

A descriptor with ID citations:list. Its current value is a renderer-provided fingerprint of deduplicated, sorted citation keys.

Call relationships ​

  • Called inside: bibliography dependency collectors.
  • Read by: SmartRenderer during dependency fingerprinting.
  • Can mark dirty: an unchanged bibliography block after citations elsewhere are added or removed.
text
deps.citedKeys() -> descriptor stored on bibliography block
                 -> current cited-key fingerprint -> dirty or unchanged
ts
const BIBLIOGRAPHY_DEPENDENCY = defineBlockDependencyRule(({ text, deps }) => text.includes('\\bibliography')
    ? [deps.citedKeys()]
    : []
);

The descriptor does not store a copy of every key. Sorting is appropriate for dependency comparison because SnapTeX's rendered bibliography is author-ordered, while getCitedKeys still exposes first-seen render order.

See also ​

A fast structural preview, not a replacement for a full TeX compiler.