1

I am new user with LaTeX. Can anyone share related material in implementing following figure in LaTeX?

enter image description here

Sebastiano
  • 54,118

2 Answers2

1

You can do it with:

1) tcolorbox package for the first box

2) tikz package for the general solution and shapes --need tikzlibraryshapes.arrows too for the fat arrows (code from here: https://tex.stackexchange.com/a/247875/120578 by @Andrew)

3) amsmath package for arrays

4) possibly will need caption package to include figures or other environments with caption that can not be included in a minipage.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.arrows}%for the blue arrows
\usepackage{amsmath}%For array
\usepackage{caption}%For including figures or other not accepted environments in minipage
\usepackage{tcolorbox}%For the colorbox
\usepackage{lipsum}%for pseudo-random text


\begin{document}
\lipsum[1]
\vspace{\baselineskip}

\noindent\begin{tikzpicture}
    %Arrow style from here : https://tex.stackexchange.com/a/247875/120578
    \tikzset{>=stealth,->,shorten >=2pt,looseness=.5,auto,shape border rotate=180,
    fat arrow/.style={single arrow,
                          thick,draw=blue!70,fill=blue!30,
                          minimum height=13mm,minimum width=11mm}}
  \coordinate(TopLeft);
  \node[anchor=west,inner sep=0](First) at(TopLeft)
       {\begin{tcolorbox}
           [width=0.4\textwidth,title={Example for a box}]
           \begin{align*}a_t&=S(x)+f(3\cdot t)-5\\
             b_t&=(x-1)\cdot\frac{5}{t-4}
           \end{align*}\end{tcolorbox}};
       \coordinate (mbot)at (First.south);
       \coordinate (mtop)at (First.north);
       \coordinate (mleft)at (First.west);
       \coordinate (mright) at(First.east);
       \draw[thick,blue,->] (mbot)|-([yshift=-0.2cm]mbot)-|([xshift=-0.6cm]mleft)|-([yshift=0.5cm]mtop)-|(mtop);
       \node (J)at ([xshift=1cm,yshift=0.6cm]mright)[fat arrow]{};
       \node at ([xshift=1.2cm]J){$f_1(j)$};
       \node (K)at ([xshift=1cm,yshift=-0.6cm]mright)[fat arrow]{};
       \node at ([xshift=1.2cm]K){$\frac{m-1}{3}$};
       \node[anchor=west] at ([yshift=-3cm]TopLeft) {\begin{minipage}{0.4\textwidth}\[\left[\begin{array}{ccc}3 &4 &f(x-2)\\
               9 &-6& j+5\\
               45 &-f_3(H+\alpha)
             \end{array}\right.\]\end{minipage}};
      \node[anchor=west,inner sep=0] at ([yshift=-5cm]TopLeft) {\begin{minipage}{0.8\textwidth}\begin{equation}\left[\begin{array}{ccc}3 &4 &f(x-2)\\
               9 &-6& j+5\\
               45 &-f_3(H+\alpha)
              \end{array}\right]\end{equation}\end{minipage}};
      \node[anchor=west] at ([yshift=-8.5cm]TopLeft) {\begin{minipage}{\textwidth}\begin{center}\captionof{figure}{My figure here}\includegraphics[width=3cm]{example-image-a}\end{center}\end{minipage}};
                  \node[anchor=west] at ([yshift=-10cm]TopLeft) {\begin{minipage}{0.3\textwidth}\[F(z)=0\;\;\text{(continue math)}\]\end{minipage}};
\end{tikzpicture}

\end{document}

Output:

enter image description here

koleygr
  • 20,105
  • Other useful stuff for anyone need similar things are here: http://www.texample.net/tikz/examples/tag/text-and-math/. Also, if you need normal "page mode" without changes of the original content but just to include some arrows and shapes without changing the content layout, then use tikzmark and overlay option in your tikzpicture (a search can help) – koleygr Mar 03 '18 at 11:49
1

well, i done this exceptionally (you not show any your effort, what you try so far), mostly for fun and exercise :-).

by use of mathtools for math and pure tikz for others:

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta,
                positioning,
                shapes.arrows,
                shapes.multipart}
\usepackage{mathtools}

\begin{document}

    \begin{tikzpicture}[
    node distance = 4mm and 3mm,
                > = Straight Barb,
       arr/.style = {single arrow, draw=blue!60, thick, %fill=blue!30,
                     single arrow head extend=1.5mm, shape border rotate=180,
                     minimum height=7mm, minimum width=8mm,
                     node contents={}},
        NN/.style = {rectangle split, rectangle split parts=2,
                     draw=blue!60, thick,
                     rectangle split part fill={blue!40, white},
                     rectangle split part align={center,left}
                     },
       prm/.style = {rectangle, draw=blue!60, minimum size=8mm},
                        ]
\node (n1)  [NN, below] {\nodepart{one} \bfseries\textcolor{SHA-1 Operation}
                         \nodepart{two} $\begin{aligned}
                         a_t & = \mathsf{ROTL}^5(a_{t-1}) + \\
                             &  \qquad   f_t(_{t-1},c_{t-1}) + e_t + W_t + K_t\\
                         b_t & = a_{t-1}    \\
                         c_t & = \mathsf{ROTL}^{30}(B_{t-1})\\
                         d_t & = c_{t-1}\\
                         e_t & = d_{t-1}
                                         \end{aligned}$
                         };
\coordinate[above=of n1] (aux1);
\coordinate[left =of n1] (aux2);
\coordinate[below=of n1] (aux3);
\path[draw=blue!70,->, semithick] (n1) -- (aux3) -| (aux2) node[left] {80}
                           |- (aux1) -- (n1);
% right perimeter
\node (n2) [arr,above right=of n1.two east];
\node (n3) [prm,right=of n2] {$W^t$};
\node (n4) [arr,below right=of n1.two east];
\node (n5) [prm,right=of n4] {$K^t$};
% equations below
\node[align=left, below = of aux3]   {$\begin{aligned}
    W_t & = \begin{cases*}  xxxx    & if $80>t\geq 16$ \\
                            yyyy    & if $0 <t<    16$
            \end{cases*}    \\
    K_t & = \begin{cases*}  xxxx    & if $80>t\geq 16$ \\
                            yyyy    & if $0 <t<    16$ \\
                            zzzz    & if $0 <t<    16$ \\
                            wwww    & if $0 <t<    16$
            \end{cases*}    \\
f_t(b,c,d)
    & = \begin{cases*}  xxxx    & if $80>t\geq 16$ \\
                            yyyy    & if $0 <t<    16$ \\
                            zzzz    & if $0 <t<    16$ \\
                            wwww    & if $0 <t<    16$
            \end{cases*}
                                    \end{aligned}$
                    };
    \end{tikzpicture}
\end{document}

equation are symbolic. right variables you should write yourself.

enter image description here

Zarko
  • 296,517