I ran into an issue today, while rendering a simple diagram with Tikz. The horizontal line in the following picture is ever so slightly lower on the right hand side than on its left.
Adding a subscript to the \mathbb B
on the left didn't change this behavior – neither did omitting the label h_j
on the top.
Here is a minimal working code for this diagram:
\documentclass{article}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{center}
\begin{tikzpicture}
\matrix (m)
[matrix of math nodes,row sep=4em,column sep=4em,minimum width=2em]
{
\mathbb B & \mathbb B_{j} \\
& \mathbb B_{i} \\
};
\path[-stealth]
(m-1-1) edge node [above] {$h_{j}$} (m-1-2)
edge node [below] {$h_{i}$} (m-2-2)
(m-1-2) edge node [right] {$h_{\mathbb B_{i}, \mathbb B_{j}}$} (m-2-2);
\end{tikzpicture}
\end{center}
\end{document}
Is this a known issue and does anyone know how to fix it?
Best Answer
The
\mathbb{B}_j
on the right is deeper than the\mathbb{B}
on the left, that is why the line is lower on the right. You can just add a\vphantom{_j}
to the node on the left to compensate for this.Also with node
positioning
instead of\matrix
can look nicer: