8

I can't seem to vertically align text in different nodeparts of the same node.

This MWE

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

\begin{tikzpicture}
\tikzstyle{bplus}=[rectangle split, rectangle split horizontal, rectangle split ignore empty parts,draw]
\tikzstyle{every node}=[bplus]
\node {\huge{I} \nodepart {two} \huge{h} \nodepart {three} \huge{g} \nodepart {four} \huge{x} } ;
\end{tikzpicture}

\end{document}

gives:

enter image description here

I'd like to have the text aligned on some baseline, preferably centred as if a complete word.

I tried

\begin{tikzpicture}[every node/.style = {anchor = base}] ...

amongst other things, but it didn't work.

1

1 Answer 1

8

Add the option rectangle split part align=base:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}
\tikzstyle{bplus}=[rectangle split, rectangle split horizontal,
    rectangle split ignore empty parts, rectangle split part align=base,draw]
\tikzstyle{every node}=[bplus]
\node {\huge{I} \nodepart {two} \huge{h} \nodepart {three}
    \huge{g} \nodepart {four} \huge{x} } ;
\end{tikzpicture}
\end{document}

node parts with base alignment

2
  • 3
    pgfmanual 2.10 cvs 52.6 Shapes with Multiple Text Parts page 497 ! Commented Nov 24, 2011 at 19:44
  • @JasperHabicht Maybe the issue is this one? Commented Mar 3 at 2:31

You must log in to answer this question.

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