latex: fix detection of nested boxes
latex: fix detection of nested boxes

We actually need to maintain a stack here, consider a theorem with
sub boxes:

Box             | Old nesting detection
---------------------------------------
Theorem         | None
|               | "theorem"
+- Proof        | "theorem"
|               | "proof"
+- Question     | None
                  !NESTING NOT DETECTED!

-> stack fixes the issue.

Lodifice/mfnf-pdf-export,Lodifice/mfnf-pdf-export,Lodifice/mfnf-pdf-export