I use tkiz
to draw a picture in LaTeX. It works with me with \documentclass[border=5pt,tikz]{standalone}
. However, when I try to use the same code in my original LaTeX file \documentclass[english]{IEEEtran}
, it does not fit in the paper. How can I edit the following code to use it in my LaTeX file?
\documentclass[border=5pt,tikz]{standalone}
\usetikzlibrary{arrows,positioning}
\newcommand{\parallelsum}{\mathbin{\|}}
\newcommand{\point}{\textbullet\hspace{1em}}
\everymath{\displaystyle}
\begin{document}
\begin{tikzpicture}[every node/.style={inner sep=6pt,draw,anchor=east},>=triangle 60]
\node[xshift=1cm] (a) {\textcolor{red}{$V_1$ generate a temporary key pairs} $[Pk^{1}_{v_{1}}, Pr^{1}_{v_{1}}]$};
\draw[->,cyan] ([yshift=.3cm,xshift=2cm]a.east) --+ (5,0) node[black,midway,above=.1cm] {$Pk^{1}_{v_{1}}$};
\draw[<-,cyan] ([yshift=-.3cm,xshift=2cm]a.east) --+ (5,0) node[black,midway,below=.1cm] {$\mathcal{T}_{1}= {M_{1} || Sh_{R_{1}}}$};
\node[right=9.5 of a,yellow!70!black,fill=yellow] (b) {\Huge\textcolor{white}{$R_1$}};
\node[right=1 of b] {
\begin{tabular}{l}
\point Generate: $M_1 = \{Pk^{1}_{v_{1}}, \textcolor{red}{\mathrm{tag}_{\mathrm{he}_1,R_1}}\}$ \\
\point Calculate: $\mathrm{S}_{R_1}(M_1)$
\end{tabular}
};
\begin{scope}[yshift=-3cm]
\node (a) {
\begin{tabular}{p{7cm}}
\textcolor{blue}{\point Run the PoW algorithm to get $S_{\mathcal{T}_{1}}$} \\
\point $L_{R_{1}}=({\mathcal{T}_{1}||S_{\mathcal{T}_{1}}|| Pk^{2}_{v_{1}} ) || \sigma_{Pr^{1}_{v_{1}}}(\mathcal{T}_{1}||S_{\mathcal{T}_{1}}|| Pk^{2}_{v_{1}}}) $
\end{tabular}
};
\draw[->,cyan] ([yshift=.3cm,xshift=1cm]a.east) --+ (5,0) node[black,midway,above=.1cm] { $\mathrm{L}_{R_1}$};
\draw[<-,cyan] ([yshift=-.1cm,xshift=1cm]a.east) --+ (5.8,0) node[text width=5.8cm,black,midway,below=.1cm] { $\mathcal{T}_{2}= \{\mathcal{T}_{1} ||Sh_{R_{2}}(M_{1}) || M_{2} || Sh_{R_{2}}(M_{2} )\} $};
\node[right=8.5 of a,yellow!70!black,fill=yellow] (b) {\Huge\textcolor{white}{$R_2$}};
\node[right=1 of b] (c) {
\begin{tabular}{l}
\point Verify $\mathrm{L}_{R_1}$ and Shares. \\
\point Checks if: $(t_r-t_1)<\mathrm{Certain\ target\ value}$ \\
\point $M_{2}=\{Pk^{2}_{v_{1}} || (t_{1}, Tag_{R_{1}}) || (t_{2}, Tag_{R_{2}})\}$ \\
\point Calculate: $Sh_{R_{3}}(M_{2})$ \\
\point Calculate: $Sh_{R_{3}}(M_{3})$\\
\end{tabular}
};
\end{scope}
\draw[o-o,dashed] ([yshift=1.5cm]a.west) -- ([yshift=1.5cm]c.east);
\end{tikzpicture}
\end{document}