[Tex/LaTex] TikZ multipart nodes: How to set text attributes (opacity) for some/all parts


I am using TikZ with the rectangle split multipart node (detailed on pp 450ff in the PGF 2.1 documentation). I need to influence the text opacity of all parts, but whatever I try seems to work only on the text (=first) part of the multipart node:


    \node[rectangle split, rectangle split parts=2, draw, text opacity=0.5]{%
      transparent :-)
      not transparent :-(

results in:

enter image description here

I have also tried \nodepart[text opacity=0.5]{two} and even Heiko Oberdiek's transparent package to set the text transparency manually, which, however does not seem to play together with PGF. There also seem to be no every ... styles for the additional parts of the rectangle split node.

I must be overlooking something.

Best Answer

I submitted a bug report at the Sourceforge page.

A temporary workaround would be to put the following into your preamble:

  % Now start new box:
   \expandafter\setbox\csname pgfnodepart\tikz@nodepart@name box\endcsname=\hbox%
        \tikzset{every \tikz@nodepart@name\space node part/.try}%
        % ---- begin added lines
        % ---- end added lines

Everything except for the marked code is copied from tikz.code.tex (the marked code is also from that file, but taken from the definition of \tikz@do@fig).

With this your code produces
correct result