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 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.

share|improve this question
    
...trying to adapt an example from here: tex.stackexchange.com/questions/17331/…. ...when I use variable height letters, it causes the above problems. –  badroit Nov 24 '11 at 18:35

1 Answer 1

up vote 8 down vote accepted

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

share|improve this answer
3  
pgfmanual 2.10 cvs 52.6 Shapes with Multiple Text Parts page 497 ! –  Alain Matthes Nov 24 '11 at 19:44

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.