3

I am trying to align node text to left but it seems below code still put the text at the center of node:

\documentclass{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[thick]
  \node[draw,rectangle,minimum width=10em,align=left] (A) {Abc};
\end{tikzpicture}

\end{document}

The output is:

output

Update: Thanks for your valuable comments, so I should update it as following:

\documentclass{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[thick]
  \node[draw,rectangle,minimum height=4em,text width=10em,align=left] (A) {Abc};
\end{tikzpicture}

\end{document}

Then it's exactly what I want:

enter image description here

Beatlej
  • 1,723
  • 1
    It's text width for the text boxes, minimum width is for the shape. – percusse Aug 19 '14 at 03:23
  • Oh, so that means I should use "text width" instead of "minimum width" or should use both? – Beatlej Aug 19 '14 at 03:29
  • 1
    When you set text width, it already increases the shape dimensions to cover that text box so you get it as a bonus, but for example you want a taller node then you can use together with minimum height=2cm. – percusse Aug 19 '14 at 03:32
  • We'd like to keep answers separate from questions, so you should write a separate answer instead of editing your answer into the question. Self-answers are perfectly admissible, and a well-written answer may earn you additional reputation. – Paul Gessler Aug 19 '14 at 03:46

0 Answers0