9

I'm currently trying to include a tree, visualized using Tikz-qtree and Tikz into an equation. The problem I'm having is that the curly braces are way too large.

The code I'm using at the moment is:

\documentclass{article}

\usepackage{tikz}
\usepackage{tikz-qtree}

\begin{document}

\begin{equation}
Q = \left\lbrace     
\tikz{
\Tree[.E $\alpha$ [.E [.E [.E [.E E $\beta$ ] $\gamma_3$ ] $\gamma_2$ ] $\gamma_1$ ] ]
    } 
\right\rbrace
\end{equation}

\end{document}

Probably there is some argument that needs to be added to the \tikz command, but I've not found the solution in the Tikz documentation. How can I reduce the size of the curly braces to match the size of the tikz figure?

preview

2 Answers 2

11

You can use

baseline=(current bounding box.center)

so the center ot the picture is put on the baseline of the surrounding text.

\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-qtree}

\begin{document}

\begin{equation}
Q = \left\lbrace     
\tikz[baseline=(current bounding box.center)]{
\Tree[.E $\alpha$ [.E [.E [.E [.E E $\beta$ ] $\gamma_3$ ] $\gamma_2$ ] $\gamma_1$ ] ]
    } 
\right\rbrace
\end{equation}

\end{document}

enter image description here

0
4

enter image description here

\documentclass{article}

\usepackage{tikz}
\usepackage{tikz-qtree}

\begin{document}

\begin{equation}
Q = \left\lbrace     
\raisebox{-.5\height}[.5\height]{%
\tikz{
\Tree[.E $\alpha$ [.E [.E [.E [.E E $\beta$ ] $\gamma_3$ ] $\gamma_2$ ] $\gamma_1$ ] ]
    } }
\right\rbrace
\end{equation}

\end{document}

You must log in to answer this question.

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