2

Reading Brace diagram in TikZ

I liked the solution of @fran using schemata package

\usepackage{schemata}
\newcommand\AB[2]{\schema{\schemabox{#1}}{\schemabox{#2}}}

Now I'd like to use another similar command that h-align braces at the same level, as you can see in the image. How to do that?

enter image description here

\documentclass[10pt,a4paper]{article}
\usepackage{schemata}
\newcommand\AB[2]{\schema{\schemabox{#1}}{\schemabox{#2}}}

\begin{document}

\AB{TEXT}
{
\AB{Some text 1}
{
$\bullet$ text 1.1 \\
$\bullet$ text 1.2 \\
$\bullet$ text 1.3
}\\
Some text 2 \\
Some text 3 \\
\AB{Some large text 4}
{
text 4.1 \\
text 4.2 \\
text 4.3
}\\
\AB{short 5}
{
$\bullet$ shorty 5.1\\
$\bullet$ shorty 5.2\\
$\bullet$ shorty 5.3
}
}

\end{document}

I think an appropiate way may be similar to this one in the documentation, enter image description here

but I'd like to make the new one with a simple command as AB defined, passing the largest text as a parameter, similar to documentation snapshot.

Mika Ike
  • 3,751
  • 2
    Please post a minimal, but compilable example of what you try as MWE included in the post (no image please). – TeXnician Sep 17 '17 at 09:46
  • Why not \AB{<your code between \begin{document} and \end{document}>}{<your code between \begin{document} and \end{document}>} ? Or do i misunderstand your question? – Bobyandbob Nov 11 '17 at 11:07

1 Answers1

1

What about using a \parbox?

\documentclass[10pt,a4paper]{article}
\usepackage{schemata}
\newcommand\AB[2]{\schema{\schemabox{#1}}{\schemabox{#2}}}
\newcommand\ABC[2]{\schema{\schemabox{\parbox{8em}{#1}}}{\schemabox{#2}}}
\begin{document}

\AB{TEXT}
{
\ABC{Some text 1}
{
$\bullet$ text 1.1 \\
$\bullet$ text 1.2 \\
$\bullet$ text 1.3
}\\
Some text 2 \\
Some text 3 \\
\ABC{Some large text 4}
{
text 4.1 \\
text 4.2 \\
text 4.3
}\\
\ABC{short 5}
{
$\bullet$ shorty 5.1\\
$\bullet$ shorty 5.2\\
$\bullet$ shorty 5.3
}
}

\end{document}

enter image description here

CarLaTeX
  • 62,716