Problem with custom width of nodes in TikZ

\tikz is a short version of the tikzpicture environment, for pictures with just one or two commands, you shouldn't put the former within the latter. Remove \tikz from your code, and it works.

In the manual (for version 2.10, dated October 25, 2010), the \tikz command is introduced in section 12.2.2 Creating a Picture Using a Command, on page 118.

I removed all the libraries in the below code, as none of them are necessary for this example.

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}

\draw (0,3) node[draw,rounded corners,align=left,text width=30mm]{\textbf{Title}\\ Text text text text text text text text text text text text text text text text text text text text text};

\end{tikzpicture}

\end{document}

enter image description here

You could remove the tikzpicture environment instead, which will produce the same output.

\documentclass{article}
\usepackage{tikz}

\begin{document}
\tikz\draw (0,3) node[draw,rounded corners,align=left,text width=30mm]{\textbf{Title}\\ Text text text text text text text text text text text text text text text text text text text text text};
\end{document}

The code

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
 \draw (0,3) node[draw,rounded corners,align=left,text width=6cm]{\textbf{Title}\\
Text text text text text text 
Text text text text text text
Text text text text text text
Text text text text text text
Text text text text text text
Text text text text text text
Text text text text text text
Text text text text text text};
\end{tikzpicture}

\begin{tikzpicture}
 \draw (0,3) node[draw,rounded corners,align=left,text width=3cm]{\textbf{Title}\\
Text text text text text text 
Text text text text text text
Text text text text text text
Text text text text text text
Text text text text text text
Text text text text text text
Text text text text text text
Text text text text text text};
\end{tikzpicture}

\end{document}

works in my computer and you can adjust the width. Does that help?

Tags:

Nodes

Tikz Pgf