While laying out a bunch of nodes with a TikZ matrix, I noticed slight vertical mis-alignment of nodes.
It seems that words with “tall” letters (p, b, l) shift the box vertically up or down. This does not happen if the node contains only a word without those letters. E.g. test will appear shifted when placed beside a node with uiae as text.
Here's a minimum example:
\usetikzlibrary{matrix}
\begin{tikzpicture}
\matrix[
matrix of nodes,
column sep=1ex, row sep=1ex,
nodes={
draw,
minimum height=2em,
text width=30mm,
},
] (matrix-optimization) {
Encodings &
Problems &
Algorithms \\
%
Selection &
uiae &
pppp \\
};
\end{tikzpicture}
The nodes Problems and pppp will appear shifted. How can I fix that? I'd like all nodes to have the same height (text vertically centered) and to be perfectly aligned.



text height=1em, text depth=1ex}. Not sure about the implications though – knittl Jul 20 '12 at 12:20