Lem/Docs

figure tikz

Create editable TikZ from a generated or supplied SVG reference.

Invocation#

Shell
lem-cli figure tikz <id-or-title> [--label <label>] [--caption <caption>] [--output-name <name>] [--source-image <path>] [--feedback <text>]

Inputs and options#

  • --label and --caption override the automatic brief. --output-name controls the TikZ output stem.
  • --source-image <path> uses an existing reference; without it, Lem first writes a generated SVG preview.
  • --feedback <text> revises the figure with the text a previous Probierz rejection printed.

Output and state#

Generates exactly one TikZ candidate in the paper's figures directory and prints JSON including asset_path and tikz_path. When installed Probierz evaluates a reference, the result also carries quality_report_path and quality_passed.

A Probierz rejection returns a failed result whose message is the revision feedback to pass back as --feedback; no candidate is regenerated without being asked.

Probierz renders the candidate under the manuscript's own preamble — the \\usepackage, \\newcommand and kindred lines before \\begin{document} of the paper's main .tex, written beside the quality report as <report>.preamble.tex. A paper without a manuscript renders with no preamble; a manuscript that is there but cannot be read is a failed result naming it, “manuscript source <path> cannot be read: <cause>”, never a render without its macros whose verdict blames the figure.

Refusals#

  • Any unknown argument is refused with “figure tikz does not take a description; unexpected argument: <value>”. Each supported option requires a value.
  • No automatic brief, no local source directory, a failed preview, conversion failure, or a Probierz rejection yields a failed result and nonzero exit.
  • A figure id the manuscript does not hold is refused naming the ids it does hold; a --source-image, or a selected figure's image, that is not on disk is refused as “the reference image <path> is not on disk” instead of running without a reference. A run given only --feedback must name its output (--output-name or --label) and state --caption, since feedback is no caption; an unstated label is formed from the written file's name as fig:<file name>.
  • A `~/.lem/brama.json` that exists but cannot be read or parsed (including a `url` or `skarbiec.url` that is not a URL) fails the TikZ conversion with the file and the cause (`<path> is not readable JSON: <cause>. It overrides the gateway, the alias and which vault item holds the bearer; fix the syntax, or delete the file to keep Lem's own declarations and Stado's routes.`), the same refusal as the SVG stage; Lem's declared figure alias is never substituted for a configuration the operator wrote. Every failed figure result carries the error's own sentence, not Foundation's generic one.
  • Paper lookup refuses an empty or unmatched selector.