Is there a better way of setting this tree?
Schemata is a package designed to draw, well, schemata basically. It defines a series of macros to facilitate the drawing and adjustment of this type of diagram.
The easiest way to use it is to follow the manual. Create a basic schemata first using only \schema
and \schemabox
. Then adjust as required from right to left, adding a \smallskip
or so between right-hand leaves. Then change \schema
to \Schema
as appropriate, always working from right to left to avoid needing to redo your adjustments. The manual explains this process much better than I can do here.
Here's a rough first-pass version of the finished result, based on your MWE.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amssymb}
\usepackage{schemata}
\begin{document}
\Schema{4.5ex}{19ex}{%
}{%
\Schema{-16.75ex}{9.25ex}{%
\schemabox{Doctrina de\\los elementos}
}{%
\schemabox{%
Estética\\trascendental
}%
\Schema{-8ex}{9ex}{%
\schemabox{Lógica\\trascendental}
}{%
\schema{%
\schemabox{Analítica\\ trascendental}
}{%
\schemabox{%
Analítica de\\los conceptos
}\smallskip
\schemabox{%
Analítica de\\los principios
}
}\smallskip
\Schema{-5.5ex}{7.5ex}{% change this \schema to \Schema first
\schemabox{%
Dialéctica\\
trascendental
}%
}{%
\schemabox{%
Conceptos de\\
la razón pura
}\smallskip
\schema{%
\schemabox{%
Inferencias\\
dialécticas de\\
la razón pura\\
}%
}{%
\schemabox{%
\schemabox{%
Paralogismos\\
de la razón\\
pura
}\smallskip\\
\schemabox{%
Antinomia\\
de la razón\\
Ideal de la\\
razón pura
}%
}%
}
}%
}%
}\smallskip
\schema{%
\schemabox{Doctrina\\del método}
}{%
\schemabox{%
Disciplina\\
Canon\\
Arquitectónica\\
Historia de la razón pura
}
}
}
\end{document}
I can offer no flexible solution, but two different ones. The first creates something similar to your original MWE, but with better spacing. I placed everything in minipages to stay uniform, you might want to change that:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath}
\begin{document}
\tiny
\hyphenpenalty10000%
\[
\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Doctrina de\\ los elementos}\end{minipage}
\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Estética\\ trascendental}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Lógica\\ trascendental}\end{minipage}
\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Analítica\\ trascendental}\end{minipage}
\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Analítica de\\ los conceptos}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Analítica de\\ los principos}\end{minipage}
\end{aligned}
\right.
\\
&\begin{minipage}{1.5cm}\raggedright{Dialéctica\\ trascendental}\end{minipage}
\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Conceptos de\\ la razón pura}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Inferencias\\ dialécticas de\\ la razón pura}\end{minipage}
\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Paralogismos\\ de la razón\\ pura}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Antinomia de la razón}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Ideal de la razón pura}\end{minipage}
\end{aligned}
\right.
\end{aligned}
\right.
\end{aligned}
\right.
\end{aligned}
\right.
\\
&\begin{minipage}{1.5cm}\raggedright{Doctrina\\ del método}\end{minipage}
\smash[b]{\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Disciplina}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Canon}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Arquitectónica}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Historia de la\\ razón pura}\end{minipage}
\end{aligned}
\right.}
\end{aligned}
\right.
\]
The second one is more to my personal taste, but it comes with its own problems. It works for this example, but problems will arise when opposing branches overlap, so this is not a generalizable thing:
\[
\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Doctrina de\\ los elementos}\end{minipage}
\smash[t]{\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Estética\\ trascendental}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Lógica\\ trascendental}\end{minipage}
\smash[b]{\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Analítica\\ trascendental}\end{minipage}
\smash[t]{\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Analítica de\\ los conceptos}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Analítica de\\ los principos}\end{minipage}
\end{aligned}
\right.}
\\
&\begin{minipage}{1.5cm}\raggedright{Dialéctica\\ trascendental}\end{minipage}
\smash[b]{\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Conceptos de\\ la razón pura}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Inferencias\\ dialécticas de\\ la razón pura}\end{minipage}
\smash[b]{\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Paralogismos\\ de la razón\\ pura}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Antinomia de la razón}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Ideal de la razón pura}\end{minipage}
\end{aligned}
\right.}
\end{aligned}
\right.}
\end{aligned}
\right.}
\end{aligned}
\right.}
\\
&\begin{minipage}{1.5cm}\raggedright{Doctrina\\ del método}\end{minipage}
\smash[b]{\left\{
\begin{aligned}
&\begin{minipage}{1.5cm}\raggedright{Disciplina}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Canon}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Arquitectónica}\end{minipage}
\\
&\begin{minipage}{1.5cm}\raggedright{Historia de la\\ razón pura}\end{minipage}
\end{aligned}
\right.}
\end{aligned}
\right.
\]
\end{document}
As I suggested in my comment, the use of my answer here, Multiple brackets or parentheses with a text inside, can eliminate the squeezed groups noticed by the OP. Plus, it allows item markers as well as variable column width definitions, so that manual line breaking is not necessary (though here, all columns are fixed at 0.6in).
EDITED to improve that answer in two ways:
I have loaded
amsmath
to correct scaled-brace width issues. RE-EDITED because even withamsmath
, the issue arose that the width of a\left\{
varied with the height of the associated element, causing misalignment. I have introduced\def\fudgeheight{3}
which is used by a revised\skipcol
to set the height of the phantom\left\{
. Hopefully, it can be left alone at that value.Since the item marks in any given column should be the same to achieve proper spacing, I have allowed the definition of item marks for a whole column at a time, rather than requiring their specification for each
\BL
item. The default can still be overridden with an optional argument.
Here is the MWE.
\documentclass{article}
\usepackage{amsmath}% FIXES WIDTH OF \left\{
\newcounter{levelcount}
\def\levelwidth {.6in}%NOT USED HERE, WITHOUT LEADING TEXT
\def\levelwidthi {.6in}
\def\levelwidthii {.6in}
\def\levelwidthiii{.6in}
\def\levelwidthiv {.6in}
\def\levelwidthv {.6in}
\def\levelmarki {$\dag$}
\def\levelmarkii {$-$}
\def\levelmarkiii{$+$}
\def\levelmarkiv {$\bullet$}
\def\levelmarkv {*}
\def\fudgeheight{3}
\newcommand\BL[2][\csname levelmark\romannumeral\thelevelcount\endcsname]{#1\,\parbox[t]{%
\csname levelwidth\romannumeral\thelevelcount\endcsname}{\raggedright#2}}
\def\level#1{\stepcounter{levelcount}%
\unskip$\left\{\vcenter{\hbox{\shortstack{#1}}}\right.$%
\addtocounter{levelcount}{-1}\ignorespaces}
\newcommand\skipcol[2][\relax]{%
\ifx\relax#1\skipcolhelp{\csname levelmark\romannumeral#2\endcsname}%
\else\skipcolhelp{#1}\fi}
\newcommand\skipcolhelp[1]{%
\smash{\phantom{\level{\BL[#1]{\rule{1pt}{\fudgeheight\baselineskip}}}}}}
\begin{document}
\scriptsize
\level{
\BL{Doctrina de los elementos}
\level{
\BL{Estetica trascendental}\skipcol{3}\skipcol{4}\skipcol{5}\cr
\BL{Logica trascendental}
\level{
\BL{Analitica trascendental}
\level{
\BL{Analitica de los conceptos}\cr
\BL{Analitica de los principios}\cr
}\skipcol{5}\cr
\BL{Dialectica trascendental}
\level{\cr
\BL{Conceptos de la razon pura}\skipcol{5}\cr
\BL{Inferencias dialecticas de la rason pura}
\level{
\BL{Paralogismos de la razon pura}\cr
\BL{Antinomia de la razon}\cr
\BL{Ideal de la razon pura}
}
}
}
}
\cr
\BL{Doctrina del metodo}
\level{
\BL{Disciplina}\cr
\BL{Architecture}\cr
\BL{History de la razon pura}
}\skipcol{3}\skipcol{4}\skipcol{5}
}
\end{document}
The OP prefers the answer without item markers. That is easily accomplished by setting
\def\levelmarki {}
\def\levelmarkii {}
\def\levelmarkiii{}
\def\levelmarkiv {}
\def\levelmarkv {}
in the preamble. But without the visual cue provided by the markers, one may want some additional vertical separation between items. That can be done by using a extra one or two \cr
s added beteen \BL
items, as shown in this MWE below.
\documentclass{article}
\usepackage{amsmath}% FIXES WIDTH OF \left\{
\newcounter{levelcount}
\def\levelwidth {.6in}%NOT USED HERE, WITHOUT LEADING TEXT
\def\levelwidthi {.6in}
\def\levelwidthii {.6in}
\def\levelwidthiii{.6in}
\def\levelwidthiv {.6in}
\def\levelwidthv {.6in}
\def\levelmarki {}
\def\levelmarkii {}
\def\levelmarkiii{}
\def\levelmarkiv {}
\def\levelmarkv {}
\def\fudgeheight{3}
\newcommand\BL[2][\csname levelmark\romannumeral\thelevelcount\endcsname]{#1\,\parbox[t]{%
\csname levelwidth\romannumeral\thelevelcount\endcsname}{\raggedright#2}}
\def\level#1{\stepcounter{levelcount}%
\unskip$\left\{\vcenter{\hbox{\shortstack{#1}}}\right.$%
\addtocounter{levelcount}{-1}\ignorespaces}
\newcommand\skipcol[2][\relax]{%
\ifx\relax#1\skipcolhelp{\csname levelmark\romannumeral#2\endcsname}%
\else\skipcolhelp{#1}\fi}
\newcommand\skipcolhelp[1]{%
\smash{\phantom{\level{\BL[#1]{\rule{1pt}{\fudgeheight\baselineskip}}}}}}
\begin{document}
\scriptsize
\level{
\BL{Doctrina de los elementos}
\level{
\BL{Estetica trascendental}\skipcol{3}\skipcol{4}\skipcol{5}\cr
\BL{Logica trascendental}
\level{
\BL{Analitica trascendental}
\level{
\BL{Analitica de los conceptos}\cr\cr
\BL{Analitica de los principios}\cr\cr
}\skipcol{5}\cr
\BL{Dialectica trascendental}
\level{\cr
\BL{Conceptos de la razon pura}\skipcol{5}\cr
\BL{Inferencias dialecticas de la rason pura}
\level{
\BL{Paralogismos de la razon pura}\cr\cr
\BL{Antinomia de la razon}\cr\cr
\BL{Ideal de la razon pura}
}
}
}
}
\cr
\BL{Doctrina del metodo}
\level{
\BL{Disciplina}\cr\cr\cr
\BL{Architecture}\cr\cr\cr
\BL{History de la razon pura}
}\skipcol{3}\skipcol{4}\skipcol{5}
}
\end{document}