Add source linter, negative test fixtures, and fallback guidance

- scripts/lint.py: reject raw rectangles, absolute coordinates, hue-budget
  and callout/group/formula-order violations at the source level
- tests/invalid/ + tests/lint-invalid/: negative fixtures proving the
  package and linter reject bad input; test.sh now runs both directions
- references/fallback.md: degraded path when no LaTeX is available
- tests/group-callout.tex: exercise \stgroup and \stcallout
- agents/openai.yaml: agent config
- Docs and .sty updated to match
This commit is contained in:
dela
2026-08-05 16:41:22 +08:00
parent 7b59c81d02
commit 866173a831
34 changed files with 786 additions and 54 deletions
+7
View File
@@ -0,0 +1,7 @@
\documentclass{standalone}
\usepackage[en]{supertensor}
\stdim{d}{3}
\begin{document}\begin{tikzpicture}
\stface{A}{(0,0)}{d}{d}
\sttopformula{F}{$A$}
\end{tikzpicture}\end{document}
+12
View File
@@ -0,0 +1,12 @@
% A callout anchored to a face rather than to a band: the card lands beside a
% single operand and reads as a step in the computation.
\documentclass{standalone}
\usepackage[en]{supertensor}
\stdim{T}{4}
\begin{document}\begin{tikzpicture}
\strow{R1}{T}
\stface{A}{}{T}{T}
\strowend
\stcallout{N1}{3cm}{A}{aside}{anchored to a face, not to the band}
\sttopformula{F}{$A$}
\end{tikzpicture}\end{document}
+13
View File
@@ -0,0 +1,13 @@
% Two asides on one band: a dashboard, not a figure. The second card belongs
% in \stmeaningbox.
\documentclass{standalone}
\usepackage[en]{supertensor}
\stdim{T}{4}
\begin{document}\begin{tikzpicture}
\strow{R1}{T}
\stface{A}{}{T}{T}
\strowend
\stcallout{N1}{3cm}{R1}{first}{one aside per band}
\stcallout{N2}{3cm}{R1}{second}{this one has nowhere to go}
\sttopformula{F}{$A$}
\end{tikzpicture}\end{document}
+9
View File
@@ -0,0 +1,9 @@
\documentclass{standalone}
\usepackage[en]{supertensor}
\stdim{d}{3}
\begin{document}\begin{tikzpicture}
\sttopformula{F}{$A$}
\strow{row}{d}
\stface{A}{}{d}{d}
\strowend
\end{tikzpicture}\end{document}
+12
View File
@@ -0,0 +1,12 @@
% An unclosed \stgroup swallows the rest of the band into its fit list; TeX
% only reports the resulting empty row, which does not point at the cause.
\documentclass{standalone}
\usepackage[en]{supertensor}
\stdim{T}{4}
\begin{document}\begin{tikzpicture}
\strow{R1}{T}
\stgroup{G}
\stface{A}{}{T}{T}
\strowend
\sttopformula{F}{$A$}
\end{tikzpicture}\end{document}
+18
View File
@@ -0,0 +1,18 @@
\documentclass{standalone}
\usepackage[en]{supertensor}
\stsetrole{a}{stTeal}
\stsetrole{b}{stOrange}
\stsetrole{c}{stCoral}
\stsetrole{d}{stViolet}
\stsetrole{e}{stInk}
\stdim{x}{2}
\begin{document}\begin{tikzpicture}
\strow{row}{x}
\stface[role=a]{A}{}{x}{x}
\stface[role=b]{B}{}{x}{x}
\stface[role=c]{C}{}{x}{x}
\stface[role=d]{D}{}{x}{x}
\stface[role=e]{E}{}{x}{x}
\strowend
\sttopformula{F}{$A+B+C+D+E$}
\end{tikzpicture}\end{document}
+6
View File
@@ -0,0 +1,6 @@
\documentclass{standalone}
\usepackage[en]{supertensor}
\begin{document}\begin{tikzpicture}
\fill (0,0) rectangle (2,2);
\sttopformula{F}{$A$}
\end{tikzpicture}\end{document}