I would ascribe that to these communities evolving differently. There is no reason to assume that the popularity of LaTeX tracks the popularity of programming languages. It's a type setting system. And that doesn't even take into account communities that exist parallel to SO/SE. Surely there exist communities today for LaTeX that have been around since before SO began its life.