I'm trying to draw a flowchart with TikZ. In one of the decision "diamonds", I have both text and a bit of math between $.
\node [decision, below of=buildbid, node distance=1.8cm, aspect=8, minimum size=20mm] (evalTotImpact) {$\delta_b\left(b_{\text{cur}},b_{\text{last}}\right)\geq$max?};
Unfortunately, despite using centered in the tikzstyle definitions, the text position seems to be fixed and ends up outside of the block, as can be seen on this picture.

It does not happen for other blocks in the flowchart with math...
Here is the smallest example I could make:
\documentclass[journal]{IEEEtran}
\usepackage[cmex10]{amsmath}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}
\usetikzlibrary{calc}
\tikzstyle{decision} = [diamond, draw, fill=white, text width=4em, text centered, node distance=3cm, inner sep=0pt, font=\footnotesize]
\tikzstyle{block} = [rectangle, draw, fill=white, text width=6em, text centered, rounded corners, minimum height=6pt, font=\footnotesize]
\tikzstyle{line} = [draw, -latex', font=\footnotesize]
\begin{figure}
\centering
\begin{tikzpicture}[node distance = 1.7cm, auto]
\footnotesize
\tikzset{block/.append style={text width=10em, minimum height=2em}}
\node [decision, aspect=8, minimum size=20mm] (evalTotImpact) {$\delta_b\left(b_{\text{cur}},b_{\text{last}}\right)\geq$max?};
\end{tikzpicture}
\end{figure}
\end{document}
text widthand can't be wrapped around to a new line will protrude over the right edge, regardless ofalign=centerortext centered. Do you need alldecisionnodes in your flow chart to be the same size? If not, you could simply remove thetext widthkey from your style definition, or disable it locally usingtext width={}in the individual node. If you need to keep the node sizes identical, you could uselabel=center:<node text>to place the text in the node. – Jake Nov 15 '12 at 15:59\tikzstyle{decision}...text width=4em, if you change that value you will see that it works well. But as I said, I don't know what do you exactly want. Well, Jake wrote faster (and better) than me. – Manuel Nov 15 '12 at 16:01text width. I thought it was directly related to the font width. – KlaasDC Nov 15 '12 at 16:03text widthis used to tell TikZ to pretend that the width of the text in a node is whatever you specify, instead of actually measuring the width of the text. Together withtext heightandtext depth, this can be used to achieve fixed node sizes, unlikeminimum heightandminimum width, which merely set lower limits: In that case, the text dimensions are still measured and used to increase the node size if necessary. – Jake Nov 15 '12 at 16:08