3

In this minimal working example,

\documentclass{article}
\usepackage{tikz}
\begin{document}

\begin{equation} \lambda =  \begin{tikzpicture}
\draw(1cm,0) -- (2cm,0);
\draw(2cm,0) -- (3cm,0);
\draw(1cm,0)[fill=white]circle(.06cm);
\draw(2cm,0)[fill=white]circle(.06cm);
\draw(3cm,0)[fill=white]circle(.06cm);
\node[below]at(2cm,0){\scriptsize $\alpha_2$};
\end{tikzpicture} \end{equation}

\end{document}

how can I align horizontally lambda and the lines in the tikzpicure? (equation (1) in the picture.)

If I remove the line

\node[below]at(2cm,0){\scriptsize $\alpha_2$};

or put [above] in place of [below], then everything is aligned as I want (equations (2) and (3) in the picture), but I want to keep the node below. Also, I would not want to put lambda inside the tikzpicture.

aling horizontally equation (1)

Thank you.

  • The problem is that in the theory I am writing about, \node[above] has different meaning than \node[below]. – Rafael Mrđen Jul 12 '15 at 14:52
5

You can use the half of the height of the node content (roughly) to adjust the baseline

\documentclass{article}
\usepackage{tikz}
\begin{document}

\begin{equation} 
\lambda =  \begin{tikzpicture}[baseline={(0,{-0.5*height("$\alpha_2$")*1pt})}]
\draw(1,0) -- (3,0) node[below,midway]{$\scriptstyle\alpha_2$};
\draw[fill=white]foreach\x in{1,2,3}{(\x cm,0)circle(.06cm)};
\end{tikzpicture} 
\end{equation}

\end{document}

enter image description here

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.