3
Software for Physical Gamebooks
(sh.itjust.works)
The community for interactive fiction and text games on Lemmy.
It's a very powerful typesetting system. It can track cross-reference very easily (it was meant for professional scientific publications but it is extremely versatile). There is a gamebook package, but I can't say whether it matches your needs. You can pretty much do anything with it, but there is a steep learning curve if you want to do something fancy. The TeX stackexchange is a very good place to look for help.
This is very interesting, I've only ever used latex for math equations