[Tex/LaTex] How to align text in TikZ nodes by baseline

nodestikz-pgf

I need to draw a graph where some nodes have the same y-coordinate. I want the text within the nodes on the same y-coordinate to be baseline-aligned. However, the text seems to be aligned by the bottom lines, not the baseline.

Here's what I tried to do:

\documentclass[final,t]{beamer}
\mode<presentation>
\usepackage{tikz}
\usepackage{pgfplots}
\tikzstyle{gate2} = [circle,fill=white,draw=black,minimum size=1cm]
\begin{document}
    \begin{tikzpicture}
        \node[gate2] (mu_0) at (0, 0) {$\mu_0$};
        \node[gate2, baseline = (mu_0.base)] (Lambda_0) at (2,  0) {$\Lambda_0  $};
    \end{tikzpicture}
\end{document}

What I see is that the shapes are at the same y-coordinate (as expected), but mu is higher than Lambda. How do I specify that mu and Lambda should be on the baseline?

Best Answer

I would just add a \strut to both characters

\documentclass[final,t]{beamer}
\mode<presentation>
\usepackage{tikz}
\usepackage{pgfplots}
\tikzstyle{gate2} = [circle,fill=white,draw=black,minimum size=1cm]
\begin{document}
    \begin{tikzpicture}
        \node[gate2] (mu_0) at (0, 0) {$\strut\mu_0$};
        \node[gate2, baseline = (mu_0.base)] (Lambda_0) at (2,  0) {$\strut\Lambda_0$};
    \end{tikzpicture}
\end{document}

enter image description here