[Tex/LaTex] TIKZ-PGF: Align two text-nodes to the left

tikz-pgf

I want to draw two text nodes in tikz-figure where the text is aligned left and not centered:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{figure}
  \begin{tikzpicture}
    \node at (1.0, 2.0) {veeeeeeeeeeery long text node};
    \node at (1.0, 1.0) {short text node};
  \end{tikzpicture}
\end{figure}

\end{document}

Here, the positions define the center of the text.
What I want to do is to specify the left position of text. Who to do this?

Best Answer

If I understand correctly, you want the text in the nodes to appear left-aligned. You can use the anchor option that tells TikZ which one of the node's anchors to place at the specified coordinates:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node [anchor=west] at (1.0, 2.0) {veeeeeeeeeeery long text node};
\node [anchor=west] at (1.0, 1.0) {short text node};
\end{tikzpicture}
\end{document}

enter image description here