9

I have been attempting to draw this language family tree into LaTeX: I have tried using the tikz package as well as the forest package, but to no avail. I do not need the colours in the tree, nor do I need the lines to be formatted in the same way, but just for the lines to go to the correct language(s).

This is the code I have now (I have not included the "Baltic" branch, as it is not absolutely neccesary):

\documentclass[a4paper, 11pt]{book}
\usepackage{lipsum} %This package just generates Lorem Ipsum filler text. 
\usepackage{fullpage} % changes the margin
\usepackage{forest}
\usepackage{showframe} % just to show the margin lines; comment this package     out for the final version

\begin{document}

\section*{Language tree}

\begin{forest}
for tree={
    edge path={
        \noexpand\path [thick, \forestoption{edge}] (!u.parent anchor) --   +(0,-7pt) -| (.child anchor)\forestoption{edge label};
}, % this option together with setting the parent and child anchors to south and north, respectively, gives you the right-angle style for your branches
parent anchor=south,
child anchor=north,
align=center, % allows you to put line breaks within nodes
}
 [Indo-European
[Balto-Slavic
    [Slavic
        [West
            [Old West Slavic
                [Minovian
                    [Old Minovian
                        [Minovian]
                [Lechitic
                    [Old Polish
                        [Polish]
                        [Silesian]
                    [Polabian
                    [Pomeranian
                        [Kashubian]
                [Czech-Slovak
                    [Czech]
                    [Slovak]
                [Knaanic
                [Sorbian
        [South
            [Western
                    [Slovene]
                [Serbo-Croatian
                    [Bosnian]
                    [Croatian]
                    [Serbian]
            [Eastern
                [Old Church Slavonic
                        [Bulgarian]
                        [Church Slavonic]
                        [Macedonian]
        [East
                        [Old Novgorod]
                [Old East Slavic
                        [Old Ruthenian]
                        [Belarusian]
                        [Russian]
                        [Rusyn]
                        [Ukranian]
                    ]
                ]
            ]
        ]
    ]
]  
]
\end{forest}

\end{document}

These are the errors I receive:

Is it possible to do this in LaTeX?

(I am using XeLaTeX compiler)

Thank you for any help in advance.


As requested by the OP, I paste a version that compiles. I have starting shuffling closing brackets ] but not finished it. -marmot

\documentclass[a4paper, 11pt]{book}
\usepackage{lipsum} %This package just generates Lorem Ipsum filler text. 
\usepackage{fullpage} % changes the margin
\usepackage{forest}
\usepackage{showframe} % just to show the margin lines; comment this package     out for the final version

\begin{document}

\section*{Language tree}

\begin{forest}
for tree={
    edge path={
        \noexpand\path [thick, \forestoption{edge}] (!u.parent anchor) --   +(0,-7pt) -| (.child anchor)\forestoption{edge label};
}, % this option together with setting the parent and child anchors to south and north, respectively, gives you the right-angle style for your branches
parent anchor=south,
child anchor=north,
align=center, % allows you to put line breaks within nodes
%grow'=south
}
[Indo-European
[Balto-Slavic
    [Slavic
        [West
            [Old West Slavic
                [Minovian
                    [Old Minovian
                        [Minovian]
                    ]
                ]                           
                [Lechitic
                    [Old Polish
                        [Polish
                        [Silesian]
                        ]
                        [Polabian
                        [Pomeranian
                        [Kashubian]
                        ]
                        ]   
                    ]       
                [Czech-Slovak
                    [Czech]
                    [Slovak]
                    ]
                [Knaanic]
                [Sorbian]
        [South
            [Western
                    [Slovene]
                [Serbo-Croatian
                    [Bosnian]
                    [Croatian]
                    [Serbian]
            [Eastern
                [Old Church Slavonic
                        [Bulgarian]
                        [Church Slavonic]
                        [Macedonian]
        [East
                        [Old Novgorod]
                [Old East Slavic
                        [Old Ruthenian]
                        [Belarusian]
                        [Russian]
                        [Rusyn]
                        [Ukranian]
                    ]
                ]
            ]
        ]
    ]
]  
]]]]]]]
\end{forest}
\end{document}
6
  • 1
    This is really not that difficult to do in forest, (although arbitrary branching paths are not completely trivial) so perhaps you should edit your question with a document showing a small part of the tree that you've tried with forest and explain what you're having trouble with. – Alan Munn Aug 5 '18 at 17:41
  • 1
    You have an excess of 13 (!) opening [ over closing ]. – user121799 Aug 5 '18 at 17:58
  • Where should I place the additional ]? – Tomsk Aug 5 '18 at 18:00
  • At the very end of the code? – Tomsk Aug 5 '18 at 18:03
  • When I add 13 extra ], it still won't compile. Have you succesfully compiled it? If so, would you mind just copy-paste the code, thank you very much. – Tomsk Aug 5 '18 at 18:07
9

Here's another version:

\documentclass[landscape]{article}
\usepackage[margin=1in]{geometry}
\usepackage{textcase}
\usepackage[edges]{forest}
\forestset{list/.style=
               {l sep=2pt,l=0,
                for descendants={no edge,l sep=2pt,l=0}},
    lfamily/.style={content=\MakeTextUppercase{##1}},
    dead/.style={fill={red!50}},
    living/.style={fill={green!50}}
}
\begin{document}
\begin{forest}forked edges,for tree={draw,align=center,minimum width=.8in,inner sep=1pt,font=\sffamily}
[Indo-European,lfamily
[Balto-Slavic,lfamily
    [Baltic,lfamily
        [West,lfamily
            [Galindan,list,for tree=dead
            [Prussian
            [Sudovian]]]
        ]
        [East,lfamily
            [Latvian,list,living
            [Lithuanian,living
            [Selonian,for tree=dead
            [Semigallian]]]]
        ]
    ]
    [Slavic,lfamily,l=1.5in
        [West,lfamily,
            [Old West Slavic,dead
                    [Minovian,lfamily
                    [Old Minovian,dead
                        [Minovian,living ]
                    ]
                ]
                [Czech-Slovak,dead
                [Knaanic,list,dead
                [Sorbian,living ]]
                [Czech,list,for tree=living
                [Slovak ]]]
                [Lechitic,lfamily
                    [Old Polish,dead
                        [Polish,list,for tree=living
                        [Silesian]]
                        [Polabian,list,for tree=dead
                        [Pomeranian]]]
                    ]
                ]
            ]
        [South,lfamily
            [Western,lfamily
                [Slovene,living]
                [Serbo-Croatian,for tree=living
                    [Bosnian,list
                    [Croatian
                    [Serbian]]]
                ]
            ]
            [Eastern,lfamily
                [Old Church Slavonic,list,dead
                    [Bulgarian,for tree=living
                    [Church Slavonic
                    [Macedonian ]]]
                ]
            ]   
        ]
        [East,lfamily
            [Old Novgorod,dead]
            [Old East Slavic,dead
                [Old Ruthenian,dead]
                [Belarusian,list,for tree=living
                [Russian
                [Rusyn
                [Ukranian]]]]]
            ]
        ]
    ]
]
]
\end{forest}
\end{document}

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.