# 【LaTeX应用】tikz画图中如何控制线条

\begin{tikzpicture}[auto,
box/.style = {draw, minimum height=8cm, minimum width=3cm, align=left, outer sep=0pt},
lbl/.style = {anchor=north west, outer sep=0mm},
arrow1/.style = {
draw = black, thick, -{Latex[length = 2mm, width = 1.5mm]},
},
arrow2/.style = {
draw = black, dashed, line width=2pt, {Latex[length = 2mm, width = 2.5mm]}-{Latex[length = 2mm, width = 2.5mm]},
},
arrow3/.style = {
draw = black, line width=2pt, {Latex[length = 2mm, width = 2.5mm]}-{Latex[length = 2mm, width = 2.5mm]},
},
arrow4/.style = {
draw = black, dashed, line width=1pt, -{Latex[length = 2mm, width = 2.5mm]},
} ]

\node (n1)  [box,
label={[lbl] north west:Challenger ~~ $\mathcal{C}$}
]	{\begin{aligned}\\ (vk,sk) \overset{R}{\leftarrow} G() \end{aligned}	};

\node (n3)  [box,
label={[lbl]north west:Adversary~~ $\mathcal{A}$},
right=20mm of n1
]
{	};

\node (n5) [draw,below=-8mm of n1]{$V(vk)$};
\node (n4) [below=5mm of n1]{true or false};

\path[arrow1] ([yshift=2ex]  n1.east) -- node{$vk$} ([yshift=2ex] n3.west);
\path[arrow2] ([yshift=-2ex]  n1.east) -- ([yshift=-2ex] n3.west);
\path[arrow4] ([yshift=-10ex]  n1.east) -- ([yshift=-10ex] n3.west);
\path[arrow1] ([yshift=-6ex] n3.west) --  ([yshift=-6ex] n1.east);
\path[arrow3] ([yshift=-14ex] n3.west) -- ([yshift=-14ex] n1.east);
\path[arrow1] (n5) -- (n4);
\end{tikzpicture}

在导言区添加几行代码

\usepackage{tikz}
\RequirePackage{amsmath,mathrsfs,amsfonts,amssymb}


• 线条粗细控制

• 线条颜色，透明度

• 线条样式

• 线条两端控制

• 折线控制

12-30

01-13 2万+
04-12 3834
06-03 3万+
03-21 4024
01-28
03-29 5403
12-29 1058
01-15 2213
03-24 1万+
06-01 8918
08-28 11万+
08-15 3万+
04-29 2万+
02-06 452