This invention discloses a method and
system for managing and automatically formatting slide content based on a
tree structure. By abstracting different types of materials such as text, images, tables, code snippets, and mathematical formulas into tree nodes with parent-child hierarchical relationships, users can freely add, delete, move, or mark nodes in a
visual interface to achieve rapid merging or splitting of multi-level documents. The
system then maps several nodes into multiple slides based on the node merging or splitting markers; and automatically formats the pages during the output stage, including overflow detection and
font scaling, adaptive image proportioning, line wrapping for tables or code snippets, and format conversion of mathematical formulas. This approach significantly reduces the burden of manually adjusting text and images, maintains consistency and aesthetics in slide
layout across different resolutions, and is suitable for multi-level, text-rich, and large-scale presentation document scenarios.