# What does 'text badly centered' mean, and what is its modern PGF/TikZ equivalent

I have inherited an old LaTeX document that uses old \tikzstyle way of defining styles. Among other definitions there is one that reads

\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width=4.5em, text badly centered, node distance=2cm, inner sep=0pt]


What does "text badly centered" mean, and what is its modern equivalent using

\tikzset{decision/.style={diamond, draw, fill=blue!20, ...}}


You will find the explanations in manual 1.18 of TikZ which is available for download here (until when?) on page 122. Here is a screenshot of the explanation:

And its copy:

text badly centered centers the text, without balancing the lines.

The low-level code which is executed for the alignment is similar to

\parfillskip=0pt
\rightskip=0pt plus 1fil
\leftskip=0pt plus 1fil


### The modern equivalent is align=flush center

align=flush center Works like flush left or flush right, only for center alignment. Because of all the trouble that results from the center option in conjunction with narrow lines, I suggest picking this option rather than center unless you have longer text, in which case center will give the typographically better results.

The low-level code which is executed for the alignment is similar to

\parfillskip=0pt
\rightskip=0pt plus 2em
\leftskip=0pt plus 2em
\spaceskip=.3333em
\xspaceskip=.5em

• I edited your answer with some low-level details. Feel free to roll back. – Henri Menke Mar 6 at 20:42
• @HenriMenke Thank you for adding these details. :-) – AndréC Mar 6 at 20:54