Lem/Docs

citation add

Resolve one citation query and add it to a paper's bibliography.

Invocation#

Shell
lem-cli citation add <id-or-title> <query> [--bib <path>] [--document <path>]

Inputs and options#

  • id-or-title selects the paper. Every non-option word after it is joined into the required query.
  • --bib <path> overrides the bibliography. --document <path> overrides the LaTeX document.
  • The citation-adder script is the one LEM_CITATION_ADDER_PATH names; it is required, and Lem guesses no location for it.

Output and state#

Runs one citation-adder process, prints the LemCitationAddResult as JSON, and exits nonzero if its state is failed. A successful result names the command, document path, and bibliography path used. Success is read from the bibliography (an entry the file did not hold before the run); the result's message is then what the adder printed on standard output and standard error, in its own words, or `citation_adder wrote the entry and printed nothing`.

Refusals#

  • A missing query refuses with “citation add needs a query”; --bib or --document without a path refuses with “<option> needs a path”.
  • The tool returns a failed result for no local source directory, no local LaTeX document, an unset LEM_CITATION_ADDER_PATH (“LEM_CITATION_ADDER_PATH names no citation_adder script; set it to the script's path”), a script missing at that path, or an execution error; the CLI then exits nonzero. A file the document `\input`s or `\include`s that is missing or cannot be read fails the command with its read error, as LaTeX's `\input` does, instead of searching the document without it for a bibliography.
  • Paper lookup refuses an empty or unmatched selector.