# How to add new line character in the node

I wish to add the new line character in the node, however, I tried several ways, all cannot work.

``````\node[draw, minimum width = 2em, minimum height=1em] (a) {get \\ flight(gf)};
``````
-
Add `align=center` to the node's options. –  Qrrbrbirlbel Feb 15 '13 at 2:14
Or specify `text width=<length>` –  Harish Kumar Feb 15 '13 at 2:17
i think there's a duplicate round here somewhere... –  cmhughes Feb 15 '13 at 3:46

You use `\\` inside your node to mark the end of lines and then request TikZ to arrange these lines in some manner. This will only be done, however, if the align option has been given.
You can request that TikZ does an automatic line-breaking for you inside the node by specifying a fixed text width for the node. In this case, you can still use `\\` to enforce a line-break. Note that when you specify a text width, the node will have this width, independently of whether the text actually “reaches the end” of the node.