🔤 Figure checks: the ASCII twin¶
Status: reference.
The rules about a figure's ASCII twin. Every figure exists as a TikZ
picture, <name>.tex, for the PDF and LaTeX renders, and as a 7-bit
ASCII diagram, <name>.txt, beside it. The twin is the only figure the
md, docx and html renders show, so it must name what the TikZ
names (WRITING-STANDARDS.md §10).
README.md explains how to read a report and record an
exception.
The twin is written by hand, so the two drift. These rules read both
files from source, so they hold whether or not the figure compiles.
"Appears in the twin" means every word, as a whole word, in any order,
case aside, after markup is stripped and maths dropped (ASCII cannot
spell \hat{x}). A gloss is never compared: the twin may reword it to
fit. Whether the arrows join the same boxes is yours to check by eye.
Each rule shows a faulty figure, its report line and the fixed one, all
real files in examples/ that
tests/core/figure/test_figure_check_examples.py compiles. TikZ listings show the
picture only. A pair's renders look the same, so this page shows the
twins instead of images.
🧠Rules on this page¶
Each rule below says what it catches and how to fix it.
twin-missing¶
Catches. No <name>.txt beside the figure. Target: figure. The
three comparisons below are then listed under "not measured". This rule
cannot be allowed: a figure without a twin is fixed, never excused.
Faulty: faulty.tex has no faulty.txt beside it.
1 2 3 | |
1 2 3 4 5 | |
Fixed: the same picture, with fixed.txt written beside it.
1 2 3 4 | |
Fix. Write <name>.txt beside the figure (the twin step of the
skill). Cannot be allowed.
t1-labels¶
Catches. A name in the TikZ that is not in the twin: a node
label's first line (\cglab's name), a zone title or a legend entry.
Target: the node, or the name's text for an unnamed node.
Faulty: the TikZ names the gate Citation gate.
1 2 3 | |
The twin shortens it to Gate.
1 2 3 4 | |
1 | |
Fixed: the twin uses the TikZ's words.
1 2 3 4 | |
Fix. Use the TikZ's words for that name in the twin: 4-ch relay
for 4-channel relay drops channel. A gloss is not compared, so
reword those freely.
t2-tags¶
Catches. A line of a node placed on a \draw or \path (a tag,
whatever its style) that is not in the twin, compared as t1-labels.
Target: the edge, a->b, or the tag's text where it joins no two
names.
Faulty: the TikZ tags the arrow writes passages.
1 2 3 | |
The twin's arrow has no tag.
1 2 3 4 | |
1 | |
Only writes is missing: passages is in Index's gloss.
Fixed: the tag goes on the twin's arrow.
1 2 3 4 5 | |
Fix. Put the tag on the twin's arrow, in the TikZ's words.
t3-panels¶
Catches. The panel letters opening a label line in the TikZ,
(a), (b), that are not the set of (<letter>) tokens in the twin.
Target: figure. Only a letter in parentheses counts, so a) or (A)
is not a panel letter.
Faulty: the TikZ letters its two panels (a) before and (b) after.
1 2 3 4 5 6 7 8 9 10 11 12 | |
The twin writes a) and b).
1 2 3 4 5 6 7 8 9 10 11 | |
1 | |
Fixed: the twin's last line.
1 | |
Fix. Letter the twin's panels as the TikZ's: the same (a), (b).