2

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}

1 Answer 1

2

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

2
  • Thanks a lot! Your code is partially matched the picture I provided. pancarde, banere etc. had to be additional information. They were put there because I didn't know how to display additional info below. The code you provided [+ durativ [{some extra \\information},no edge ] ] showed me how to do this, and I thank you. Instead of pancarde should be Chanel (as in picture left side) but moved 1 level up. How can I move 1 level up? Can you please help me by updating the code?
    – Mafsi
    Nov 1, 2021 at 20:10
  • @Mafsi I've made some updates to the code which answers your question, but also makes the tree more like the one in your image. My previous suggestion of using no edge nodes for the additional information below a node is probably unnecessary.
    – Alan Munn
    Nov 2, 2021 at 18:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .