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 am trying to do this (do not pay attention to red line above blue node and line in the node):

enter image description here

By so far i have this:

enter image description here

With this code:

\documentclass[tikz,12pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,french,russian]{babel}
\usepackage{chemfig}
\usepackage{mathptmx}
\usepackage{esvect}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathmorphing,decorations.pathreplacing,shadows,calc,decorations.markings} 
\usetikzlibrary{shapes,shadows}
\usetikzlibrary{intersections}
\usetikzlibrary{positioning}
\definecolor{Green}{RGB}{0,220,70}
\tikzstyle{vecArrow} = [thick, decoration={markings,mark=at position
1 with {\arrow[semithick,fill=blue]{triangle 60}}}, double distance=1.8pt, shorten >= 5.5pt,
preaction = {decorate},
postaction = {draw,line width=1.4pt, white,shorten >= 4.5pt}]

\tikzstyle{vecArrowBlue} = [thick, decoration={markings, mark=at position
   1 with {\arrow[semithick, fill=blue]{triangle 60}}},
   double distance=1.4pt, shorten >= 5.5pt,
   preaction = {decorate},
   postaction = {draw, line width=1.4pt, blue, shorten >= 4.5pt}]

\begin{document}
\begin{tikzpicture}[font=\small,line width=1pt,node distance=0]
\tikzset{line width=2pt}

\node[draw,line width=2pt,rounded corners=4pt,minimum width=0.5cm, minimum height=.8cm,shade, shading=axis, top color=Green, bottom color=blue!80,shading angle=0,circular drop shadow={color=red!60!black}] (box) at (0,0) {};

\draw[vecArrowBlue] ($(box.south)+(0,3pt)$) to ($(box.north)-(0,3pt)$);
\end{tikzpicture}
\end{document}

Is there a way to make halo around node? I've tried shadow without any success.

Thank you in advance.

share|improve this question
    
    
This helped...But not exactly what I need. But I will look more after work. –  saldenisov Feb 14 at 11:04
    
Think of the image as several distinct objects in front of each other. That is, use two nodes and two arrows. –  John Kormylo Feb 16 at 15:27

1 Answer 1

up vote 2 down vote accepted

I've searched a lot and combined my code with code of examples. Finally I've got this:

\documentclass[tikz,12pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,french,russian]{babel}
\usepackage{chemfig}
\usepackage{mathptmx}
\usepackage{esvect}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathmorphing,decorations.pathreplacing,shadows,calc,decorations.markings} 
\usetikzlibrary{shapes,shadows}
\usetikzlibrary{intersections}
\usetikzlibrary{positioning}
\definecolor{Green}{RGB}{0,220,70}
\tikzstyle{vecArrow} = [thick, decoration={markings,mark=at position
1 with {\arrow[semithick,fill=blue]{triangle 60}}}, double distance=1.8pt, shorten >= 5.5pt,
preaction = {decorate},
postaction = {draw,line width=1.4pt, white,shorten >= 4.5pt}]

\tikzstyle{vecArrowBlue} = [thick, decoration={markings, mark=at position
   1 with {\arrow[semithick, fill=blue]{triangle 60}}},
   double distance=1.4pt, shorten >= 5.5pt,
   preaction = {decorate},
   postaction = {draw, line width=1.4pt, blue, shorten >= 4.5pt}]

\begin{document}
\def\shadowshift{0pt,0pt}
\def\shadowradius{35pt}

% this draws a shadow under a rectangle node
\newcommand\drawshadow[1]{
    \begin{pgfonlayer}{shadow}
        \shade[red,inner color=red,outer color=white] ($(#1.center)$)        circle (\shadowradius);

    \end{pgfonlayer}
}

% create a shadow layer, so that we don't need to worry about overdrawing other things
\pgfdeclarelayer{shadow} 
\pgfsetlayers{shadow,main}   
\begin{tikzpicture}[font=\small,line width=1pt,node distance=0]
\tikzset{line width=2pt}  
\tikzset{
 shrink inner sep/.code={
   \pgfkeysgetvalue{/pgf/inner xsep}{\currentinnerxsep}
   \pgfkeysgetvalue{/pgf/inner ysep}{\currentinnerysep}
   \pgfkeyssetvalue{/pgf/inner xsep}{\currentinnerxsep - 0.5\pgflinewidth}
   \pgfkeyssetvalue{/pgf/inner ysep}{\currentinnerysep - 0.5\pgflinewidth}
   }
}
\tikzset{horizontal shaded border/.style args={#1 and #2}{
    append after command={
       \pgfextra{%                 
          \begin{pgfinterruptpath}
                \path[rounded corners,left color=#1,right color=#2]
                ($(\tikzlastnode.south west)+(-\pgflinewidth,-\pgflinewidth)$) 
                rectangle
                ($(\tikzlastnode.north east)+(\pgflinewidth,\pgflinewidth)$);        
           \end{pgfinterruptpath}
        } 
    }
  },
  vertical shaded border/.style args={#1 and #2}{
    append after command={
       \pgfextra{%                 
          \begin{pgfinterruptpath}
                \path[rounded corners,top color=#1,bottom color=#2]
                ($(\tikzlastnode.south west)+(-\pgflinewidth,-\pgflinewidth)$) 
                rectangle
                ($(\tikzlastnode.north east)+(\pgflinewidth,\pgflinewidth)$);        
           \end{pgfinterruptpath}
        } 
    }
  }
}

\node[rectangle,
      rounded corners,thick,shrink inner sep,minimum width=0.5cm, minimum height=.8cm,shade, shading=axis, top color=Green, bottom color=blue!80!red!50,shading angle=0,vertical shaded border=Green and blue!80!red!50] (box) at (0,0) {};
\drawshadow{box}   
\draw[vecArrowBlue] ($(box.south)+(0,3pt)$) to ($(box.north)-(0,3pt)$);
\end{tikzpicture}
\end{document}

enter image description here

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.