code: def _propagate_packages(self):
          
  
          for item in self.data:
              if isinstance(item, LatexObject):
                  if isinstance(item, Container):
                      item._propagate_packages()
                  for p in item.packages:
                      self.packages.add(p)
docs: Make sure packages get propagated.