slatex / sTeX

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

\module@id does not survive \importmodule (master) #282

Closed kohlhase closed 3 years ago

kohlhase commented 3 years ago

I have started looking into hyperrefs induced by term references, ... and they are quite off. The main culprit seems to be the one in the title: here is an example. If we have a file FOO.tex:

\begin{module}[id=FOO]
  foo loaded
\end{module}

and a file test.tex

\documentclass{omdoc}
\usepackage{statements}
\begin{document}
\begin{module}[id=foo]
  \importmodule[load=FOO]{FOO}
\makeatletter  \message{module@ID: \module@id}\makeatother
\end{module}
\end{document}

then this reports the module@ID: FOO in the log file. But \module@id is used in the references and the change causes havoc.

I do not remember what I had done to prevent this in the past, I suspect that I put the code in the \input called in the \importmodule into a {} group, since we only need it for the global side-effects. But when I look at \@importmodule, there seems to be a group, ... so I do not quite understand.

kohlhase commented 3 years ago

Ah, I think I know what I must do. in metakeys, I had used gdefs for the keys, but the global is too aggressive. But before I commit something as drastic as this, I will have to test more.

kohlhase commented 3 years ago

seems I fixed it.