slatex / sTeX

A semantic Extension of TeX/LaTeX
50 stars 9 forks source link

referencing \vardef and \varseq outside "their statement". #302

Open kohlhase opened 2 years ago

kohlhase commented 2 years ago

In theory, variable and sequence declarations should be local to their statement. But in practice we often have the following situation (e.g. in MiKoMH/AI/source/game-play/mod/linear-evaluation.en.tex):

Screenshot 2022-05-08 at 12 16 19

i.e. the weights $w_i$ and features $f_i$ are referenced outside the definition, namely in the sparagraph directly afterwards, and the problem could be solved by lifting the declarations ouf of the definition. But that would make the definition non-self-contained (which feels strange).

Here, the reference is relatively local. But we can have long-range referneces like the weights w_i from definition \sref{foo}. or even the m in the Einstain's famous $E=mcˆ2$.

Another situation with long-range reference is continuing (running) examples, as the one in MiKoMH/AI/source/ml/mod/attributes.en.tex, where we pick up the sequence variable \varX later in the section.

We need a good, semantic way of dealing with this.