Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 10 down vote accepted

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

share|improve this answer
    
Thank you! That is exactly what I was looking for :-) –  eider Mar 1 at 18:29

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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