I don't get the excepted result with the following code

\input tikz
  \node[draw,align=center] {Hello \hfil\break World};

There is no break after Hello. I don't want to use text width and specify the width manually.

  • 1
    It is too long to include it here hence I would suggest that you consult the manual pages 179-181 – percusse Feb 2 '12 at 20:24
  • 1
    @Rupert: yeah, those text related things don't work too well with plain unfortunately. You can change the \hfil\break into `\\` and you will get the break, but the first line will have a veeeery persistent parindent! – morbusg Feb 2 '12 at 20:36

PGF/TikZ has some troubles (at least at the time of this writing; version 2.10) when used with the plain-format, unfortunately.

Your example works as \tikz[draw,align=center] {Hello\\ World};, but there are situations where surprising things will happen with plain-format:

\tikz\node[draw,align=center,text width=1cm] {Hello World};

The above will introduce an interesting (and annoyingly persistent) \parindent. A \noindent at the start of the node will do nothing. Same with \parindent0pt. Same with a style with execute at begin node for both of the previous. The \parindent0pt needs to be set before the \node command for it to work.

Another surprising thing one can run into with plain-format:

\tikz\node[draw,align=right,text width=1cm] {Hello World};

where PGF/TikZ will try to execute \raggedleft, a command which does not exist in plain.

Now, I think I remember reading somewhere that PGF/TikZ issues with plain are being fixed (or have already been fixed?), so the current CVS version might not exhibit these issues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.