Additional info to Forest Tree & fit tree to page

foresttrees

I'm trying to reproduce the image below.
As you can see on the left margin has some info: Channel, Code Type, Sender etc. aligned with descendants.

Also, on Repertoire of codes and channels > visual > + verbal has additional info placards, banner etc.

The same info is also on -verbal > figure > + durative
a.s.o

Tree

Here is what I tried

this is the first time I'm using forest package

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usepackage[linguistics]{forest}
\begin{document}


\begin{forest}% should be fit to page
  [Repertoriul codurilor și al canalelor
    [vizual % this is CHANEL
      [+ verbal % this is Code type
        [,phantom
          [pancarde % has to be aditional info to the tree
          [banere   % has to be aditional info to the tree
          [etc.]    % has to be aditional info to the tree
          ]
          ]
        ]
      ]
      [- verbal
        [figura  % this is the Sender
          [+ durativ] % information transmission
          [- durativ]
        ]
        [scena
          [+ durativ]
          [- durativ]
        ]
      ]
    ]
    [(olfactiv)]
    [(haptic)]
    [(gustativ)]
    [(acustic)
      [+ verbal
        [lingvistic
          [figura
            [+ durativ]
            [- durativ]
          ]
          [scena]
        ]
        [paralingvistic
          [figura
            [+ durativ]
            [- durativ]
          ]
          [scena]
        ]
      ]
      [- verbal
        [figura]
        [scena]
      ]
    ]
  ];
\end{forest}

\end{document}

Best Answer

For the information on the side, you had the right idea, but at the wrong level of the tree. You need to make a phantom branch as the leftmost branch of the tree, and then for subsequent labels specify no edge to remove the line between nodes.

For the extra information below the terminal nodes, you can just use \\ to create new lines in a node label. Since you're loading the linguistics library, nodes are already specified with the align=center key, so node labels can have \\ inside them. (In my previous version, I made these nodes with no edge because I thought they were uniformly at the bottom row of the tree, but in retrospect, I don't think this is the best way to do it.)

To more faithfully reproduce the tree in your image, I've also added an explicit tier=fig key to each of the nodes so that all of the "Sender" level nodes appear at the same level.

Unless you want to make the font smaller, there's no good way to make this tree more compact and have it fit on the page in portrait mode, with the default page margins, and it barely fits with 1cm margins on an A4 page, so I would recommend using the lscape package and its landscape environment to put the tree in landscape orientation.

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc} % not needed with recent TeX distributions
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usepackage[linguistics]{forest}
\usepackage{lscape}
\begin{document}

\begin{landscape} % use this environment to make the tree appear in landscape mode

\begin{forest}% should be fit to page
  [Repertoriul codurilor și al canalelor
    [chanel,for tree=no edge
          [code type
          [sender,tier=fig
          [information\\transmission    % has to be aditional info to the tree
          ]
          ]
        ]
    ]
    [vizual % this is CHANEL
      [+ verbal\\pancarde\\banere\\etc.% this is Code type
      ]
      [- verbal
        [figura,tier=fig  % this is the Sender
          [+ durativ] % information transmission
          [- durativ]
        ]
        [scena,tier=fig
          [+ durativ\\some extra \\information ]
          [- durativ]
        ]
      ]
    ]
    [(olfactiv)]
    [(haptic)]
    [(gustativ)]
    [(acustic)
      [+ verbal
        [lingvistic
          [figura,tier=fig
            [+ durativ]
            [- durativ]
          ]
          [scena,tier=fig]
        ]
        [paralingvistic
          [figura,tier=fig
            [+ durativ]
            [- durativ]
          ]
          [scena,tier=fig]
        ]
      ]
      [- verbal
        [figura,tier=fig]
        [scena,tier=fig]
      ]
    ]
  ];
\end{forest}
\end{landscape}
\end{document}

output of code

Related Question