Dear community members,

I want to draw a 3D fancy box by coupling the first box (wich has a simple rectangle) and the second one. Have you any ideas?

enter image description here These are the Latex codes for the first and the second boxes, respectively.

First code (written outside the \begin{document} environment):

\xdefinecolor{mycolor}{HTML}{1475bb} % Neutral Blue

    \node [draw, line width=0.5mm, inner sep=1.5ex,text width=#2]% good 
options: minimum height, minimum width  , fill={mycolor!30}
    (BOXCONTENT) \bgroup\rule{0pt}{3ex}\ignorespaces
\node [right,inner xsep=1em,fill=bancolor!50,outer sep=0pt,text 
height=2ex,text depth=.5ex, text =black, font=\bf] (BOXNAME) 
at ([shift={(-1em,0pt)}]BOXCONTENT.north west) {\myboxname};
\fill[bancolor] (BOXNAME.north east) -- +(-1em,1em) -- +(-1em,0) -- cycle;
\fill[bancolor] (BOXNAME.south west) -- +(1em,-1em) -- +(1em,0) -- cycle;

I call it inside the \begin{document} environment as follows:

    Hello World!

Second code (written within the \begin{document} environment):

    uniform color list=gray!60!black for 2 items,
    back arrow disabled=true,
\smartdiagram[flow diagram:horizontal]{PGF}

Regards. Widad


Here is an implementation with tcolorbox and TikZ.






  decorationwidth/.store in=\kv@decoration@width,
  decorationcolor/.colorlet =tcbcol@decorationcolor,
\newtcolorbox[auto counter]{myboxother}[2][]{%
  enhanced, sharp corners,
  drop shadow,
  attach boxed title to top left={xshift=-\kv@decoration@width,yshift=-\tcboxedtitleheight/2,yshifttext=-\tcboxedtitleheight/2},
  boxed title style={toprule=0pt,bottomrule=0pt,leftrule=0pt,frame hidden,enhanced,colback=tcbcol@boxedtitle,sharp corners},
  underlay boxed title={ 
    \coordinate (refpointsouth) at ($(title.south west)+(0pt,0mm)$);
    \filldraw[line width=0pt,tcbcol@decorationcolor] 
    (refpointsouth)  -- ($(refpointsouth) + (\kv@decoration@width,0)$) -- +(0pt, -\kv@decoration@width) -- cycle;
    \coordinate (refpointnorth) at ($(title.north east)-(\kvtcb@left@rule-0.25pt,0pt)$);
    \filldraw[line width=0pt,tcbcol@decorationcolor]
    (refpointnorth)  -- ($(refpointnorth) + (-\kv@decoration@width,0pt)$) -- ($(refpointnorth) +(0pt, \kv@decoration@width)$) -- cycle;


\begin{myboxother}[decorationwidth=15pt]{My title}
  Hello World


\begin{tcolorbox}[enhanced,interior style={top color=white,bottom color=white!60!black}, drop shadow]
  Hello World

or a small box

\tcbox[enhanced,interior style={top color=white,bottom color=white!60!black}, drop shadow south]{Hello World}


enter image description here

| improve this answer | |

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.