1. 程式人生 > 其它 >【LaTeX應用】繪圖,流程圖,折線

【LaTeX應用】繪圖,流程圖,折線

技術標籤:LaTeXlatex流程圖折線畫圖

繪製圖形的時候,可能需要有折線,這個簡單的應用就可以滿足這點,程式碼邏輯非常簡單

\begin{tikzpicture}[
	nodex/.style = {draw, minimum width=20mm, minimum height=8mm},
	nodey/.style = {draw, minimum width=10mm, minimum height=8mm},
	]
	
	\node[nodex] (n1)  {msg};
	\node[nodex, right = (0mm of n1)] (n2)  {01};
	\node[nodex, right = (0mm of n2)] (n3)  {$ 0\cdots 0 $};
	\node[nodex, right = (10mm of n3)] (n4)  {rand};
	\node[nodey, below of=n3, node distance=15mm] (n5)  {H};
	\node[minimum width=10mm, minimum height=8mm, below of=n2, node distance=15mm] (n6)  {+};
	\node[nodey, below of=n5, node distance=15mm] (n7)  {G};
	\node[minimum width=10mm, minimum height=8mm, right =(20mm of n7), node distance=10mm] (n8)  {+};
	\node[nodex, below of=n8, node distance=15mm] (n9)  {with RSA};
	\node[nodex, minimum width=60mm, left =(10mm of n9)] (n10) {plaintext to encrypt};
	
	\draw[->] (n2) -- (n6);
	\draw[->] (n4) |- (n5);
	\draw[->] (n4) -- (n8);
	\draw[->] (n5) -- (n6);
	\draw[->] (n6) -- (n10);
	\draw[->] (n6) |- (n7);
	\draw[->] (n7) -- (n8);
	\draw[->] (n8) -- (n9);
	\end{tikzpicture}	

還可以參考前面一篇部落格,也是繪製流程圖,可能在除錯的時候有些幫助