slatex / sTeX

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

double loading #374

Closed kohlhase closed 1 year ago

kohlhase commented 1 year ago

in MathHub/MiKoMH/GenCS/source/adt/slides/substitutions.en.tex I see

(/Users/kohlhase/localmh/MathHub/smglom/sets/source/mod/injective.en.tex)
(/Users/kohlhase/localmh/MathHub/smglom/sets/source/mod/injective.en.tex)
(/Users/kohlhase/localmh/MathHub/smglom/sets/source/mod/surjective.en.tex)
(/Users/kohlhase/localmh/MathHub/smglom/sets/source/mod/surjective.en.tex)
(/Users/kohlhase/localmh/MathHub/smglom/sets/source/mod/bijective.en.tex)

this occurs regularly, but I am not sure whether all modules are loaded doubly.

If this could be avoided, this would make sTeX much faster.

Jazzpirate commented 1 year ago

Unfortunately not. sTeX needs two passes over each file with different macros active to resolve transitive dependencies without exploding the file stack size: In the first pass, all dependencies are collected (\importmodule, \begin{smodule[sig=, etc.), then the dependencies are actually loaded, then (second pass) the file itself is loaded. If a file's dependencies are already loaded, both passes will occur immediately one after the other, leading to the above output - otherwise, they lead to nestings like

(/../a)
(/../b)
(/.../c)
(/.../c)
(/../b)
(/../a)
kohlhase commented 1 year ago

is this documented in the sTeX manual?

kohlhase commented 1 year ago

I think it should be (if only that you can tell me RTFM when I notice it the next time), if this persists in the new version.

Jazzpirate commented 1 year ago

No - but it seems to me to me like a pretty unimportant implementation detail with respect to how sms mode works...? It should end up in the package documentation at some point, but I don't think it belongs in the manual