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.

Please consider MWE below:

\documentclass{standalone}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,shadows,arrows}
\usepackage{lipsum}
\begin{document}
\tikzstyle{abstract} =  [draw=gray, 
                        inner sep = 0.2cm,
                        rounded corners, 
                        rectangle split, 
                        rectangle split parts=3, 
                        % shade=rectangle, 
                        % left color=blue!10!white,
                        % rectangle split part fill={blue!30!white,blue!20!white,blue!10!white}, %This will fill them, but not shade! Moreover, I prefer not to do it this way
                        every text node part/.style={fill=blue!20!white}, %This is not working
                        every two node part/.style={text width=6cm},
                        every three node part/.style={text=blue}]
\tikz
        \node (Item)[abstract]  
        {
            \textbf{Foo}
            \nodepart{two}\lipsum[1]
            \nodepart{three}\textsl{Bar}
        };
\end{document}

This creates tikz node with three parts but no filling (Fig. Left). Somehow the line below is doing nothing:

every text node part/.style={fill=blue!20!white}

Next line fills the rectangles (Fig. Center) but I prefer to do it with every command:

rectangle split part fill={blue!30!white,blue!20!white,blue!10!white}

What I eventually want, is to have different gradient shadings for each part, preferably using every XXX node part/.style (e.g. Fig. Right).

enter image description here

share|improve this question
    
Have you tried the tcolorbox package? It looks it is designed very well for this sort of shading tasks. –  Malipivo Apr 10 at 12:30
    
@Malipivo, I know about that package. What I want to do however, is out of the boundaries of tcolorbox. What you see above is just the tip of the iceberg ;) –  Pouya Apr 10 at 12:31
    
I see, I would start putting individual nodes on each other if your requirements are this high. –  Malipivo Apr 10 at 12:33
add comment

1 Answer 1

To my best knowledge TikZ is not offering such feature, yet. This is an example where I used several independent nodes to get that effect.

%! *latex mal-nodepart.tex
\documentclass{article}
\pagestyle{empty}
\usepackage{tikz}
\usepackage[nopar]{kantlipsum}
\begin{document}
\begin{tikzpicture}
[m/.style={text width=5cm, anchor=north, draw},
  every node/.style={m},
  first/.style={shade, left color=white, right color=blue, align=center, font=\bfseries},
  second/.style={shade, right color=green, font=\small, text=yellow},
  third/.style={shade, left color=red, align=center, font=\bfseries},
  ]
\node[first] (first) {My heading};
\node[second] (second) at (first.south) {\kant[1]};
\node[third] (third) at (second.south) {My footing};
\end{tikzpicture}
\end{document}

mwe

share|improve this answer
    
Thank you. But I'm afraid using multiple stacked nodes is my failsafe. This is what I'm doing right now but I need to do it more systematically. I will wait for some other answers if you don't mind. –  Pouya Apr 11 at 8:09
    
Of course, please have no worries! –  Malipivo Apr 11 at 8:16
add comment

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.