knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
```{tikz, echo=FALSE, fig.cap = "SWIG template", fig.ext='png'} \usetikzlibrary{arrows,shapes.arrows,shapes.geometric,shapes.multipart, decorations.pathmorphing,positioning,shapes.swigs,}
%\resizebox{100mm}{100mm}{
\begin{tikzpicture} \tikzset{line width=0.5pt, outer sep=0pt, ell/.style={draw,fill=white, inner sep=2pt, line width=0.5pt}, swig hsplit={gap=2pt, line color lower=red}}; % inner line width right=0.5pt
\node[name=li1, ell, shape=ellipse]{$L_{i1}$}; \node[below=2mm of li1] (dummyi1) {}; \node[below=7mm of li1] (dummyi2) {}; \node[name=ai1, right=5mm of dummyi2, shape=swig hsplit]{ \nodepart{upper}{$A_{i1}$} \nodepart{lower}{$a_{i1}$} }; \node[name=atildei1, right=30mm of dummyi1, ell, draw=red, shape=ellipse]{$\tilde{a}{i1}$}; \node[name=yi1, right=25mm of ai1, ell, shape=ellipse]{$Y{i1}(a_{i1}, \tilde{a}_{i1})$};
\node[name=lj1, below=20mm of li1, ell, shape=ellipse]{$L_{j1}$}; \node[below=2mm of lj1] (dummyj1) {}; \node[below=7mm of lj1] (dummyj2) {}; \node[name=aj1, right=5mm of dummyj2, shape=swig hsplit]{ \nodepart{upper}{$A_{j1}$} \nodepart{lower}{$a_{j1}$} }; \node[name=atildej1, right=30mm of dummyj1, draw=red, ell, shape=ellipse]{$\tilde{a}{j1}$}; \node[name=yj1, right=25mm of aj1, ell, shape=ellipse]{$Y{j1}(a_{j1}, \tilde{a}_{j1})$};
\node[name=lk1, below=20mm of lj1, ell, shape=ellipse]{$L_{k1}$}; \node[below=2mm of lk1] (dummyk1) {}; \node[below=7mm of lk1] (dummyk2) {}; \node[name=ak1, right=5mm of dummyk2, shape=swig hsplit]{ \nodepart{upper}{$A_{k1}$} \nodepart{lower}{$a_{k1}$} }; \node[name=atildek1, right=30mm of dummyk1, draw=red, ell, shape=ellipse]{$\tilde{a}{k1}$}; \node[name=yk1, right=25mm of ak1, ell, shape=ellipse]{$Y{k1}(a_{k1}, \tilde{a}_{k1})$};
\draw[->,line width=0.5pt,>=stealth] (li1) edge (ai1) (li1) edge[out=0,in=150] (yi1) (lj1) edge (aj1) (lj1) edge[out=0,in=150] (yj1) (lk1) edge (ak1) (lk1) edge[out=0,in=150] (yk1)
(ai1) edge[out=340,in=180] (yi1) (atildei1) edge (yi1) (aj1) edge[out=340,in=180] (yj1) (atildej1) edge (yj1) (ak1) edge[out=340,in=180] (yk1) (atildek1) edge (yk1) (ai1) edge[out=330,in=160] (atildej1) (ai1) edge[out=330,in=160] (atildek1) (aj1) edge[out=330,in=210] (atildei1) (aj1) edge[out=330,in=210] (atildek1) (ak1) edge[out=330,in=185] (atildei1) (ak1) edge[out=330,in=185] (atildej1)
; \end{tikzpicture}
%}
```
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.