slatex / sTeX

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

\sref: allow variables in \sref (mostly in archive=) #387

Open kohlhase opened 1 year ago

kohlhase commented 1 year ago

[writing this up so that I understand it]

When I base a new course on an older one, then I usually make a new MiKoMH/* archive. E.g. LBS based on ComSem. Then I copy over (the relevant of) the ComSem/source/*/sec/*.tex structure and adapt that for the new course. I try to keep this copying as shallow as possible (and that works quite nicely) except for the \sref[file=...]{foo} references (usually in the still-referenced-not-copied ComSem/source/ */snip/bar.tex, but also in the slides/*.tex). And I do not want to copy these, since they are identical except for the (implied) \sref[archive=...].

I think the best way to solve this is to just have a general macro \thisarchive which is set in the preambles. For the still-referenced-not-copied files I would just use \sref[archive=\thisarchive] and be done with it.

Is there a better way to do this?

Jazzpirate commented 1 year ago

Yes; the better way is to nut use archive= at all (if I understand the problem correctly) - you only need to provide the archive=-option if the file you're referring to is actually in a different archive. If archive is empty, it is assumed to be the current archive anyway