Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

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

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

share|improve this question
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

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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