7

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, ...}}

1 Answer 1

7

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:

screenshot

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

screenshot-2

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
2
  • 2
    I edited your answer with some low-level details. Feel free to roll back. Commented Mar 6, 2019 at 20:42
  • @HenriMenke Thank you for adding these details. :-)
    – AndréC
    Commented Mar 6, 2019 at 20:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .