3

i am constructing a hierarchical diagram for my thesis document having large number of child and parent nodes but they exceed the size of paper due to which i am unable to see half of the content of my diagram. The code i used is as follows:

\documentclass[12pt,oneside]{mitthesis}
\usepackage{geometry}
\usepackage{forest}
\begin{document}

\noindent\begin{forest}
for tree={
parent anchor=south,
child anchor=north,
align=left,
edge path={
    \noexpand\path [\forestoption{edge}] (!u.parent anchor) -- +(0,-5pt) -|      (.child anchor)\forestoption{edge label};
},
}
[Text Summarization
[Extractive\\Summarization
[Similarity
[Topic 
[Explicit]
[Implicit]]
[Cluster, tier=other
[Gold Method]
[test]]
]
[Lexical Chain
[LexGraph]
[LexRank]
]
[Classification, tier=other
[Supervised]
[Unsupervised]
]
[Feature\\Selection
[Graph Based]
[Swarm Based]
[Document Categorization]
]
[Feature\\Extraction
[Sentence\\Segmentation]
[Fuzzy Logic]
[Sentence Ranking]
]
]
[Abstractive\\Summarization]
]
\end{forest}
\end{document}

i want to display all the content on a single page but with mitthesis page format any help would be appreciated.

1 Answers1

6

You could rotate the tree, using the paper in landscape mode. However, you would still need to do a lot of work to fit the tree to the paper. You could make it smaller and less readable, or you could adjust the levels of the nodes, making the hierarchical relationships less obvious.

Instead, I recommend adopting a different kind of tree structure. For example, you might set the tree out as what I think of as a 'directory tree' or 'process tree':

\documentclass[12pt,oneside,a4paper]{book}
\usepackage{geometry}
\usepackage{forest}
\forestset{
  dir tree/.style={
    for tree={
      parent anchor=south west,
      child anchor=west,
      anchor=mid west,
      inner ysep=1pt,
      grow'=0,
      align=left,
      edge path={
        \noexpand\path [draw, \forestoption{edge}] (!u.parent anchor) ++(1em,0) |- (.child anchor)\forestoption{edge label};
      },
      font=\sffamily,
      if n children=0{}{
        delay={
          prepend={[,phantom, calign with current]}
        }
      },
      fit=band,
      before computing xy={
        l=2em
      }
    },
  }
}
\begin{document}

\noindent
\begin{forest}
  dir tree
  [Text Summarization
    [Extractive Summarization
      [Similarity
        [Topic
          [Explicit]
          [Implicit]
        ]
        [Cluster
          [Gold Method]
          [test]
        ]
      ]
      [Lexical Chain
        [LexGraph]
        [LexRank]
      ]
      [Classification
        [Supervised]
        [Unsupervised]
      ]
      [Feature Selection
        [Graph Based]
        [Swarm Based]
        [Document Categorization]
      ]
      [Feature Extraction
        [Sentence Segmentation]
        [Fuzzy Logic]
        [Sentence Ranking]
      ]
    ]
    [Abstractive Summarization]
  ]
\end{forest}

\end{document}

restructured tree

This approach easily fits the tree on A4, keeps standard font sizes and represents the hierarchical relationships clearly.

cfr
  • 198,882