我想知道是否可以增加箭头的尺寸。打印时不可见。
% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{matrix,shapes,arrows,positioning,chains}
\begin{document}
\begin{figure}
\centering
% Define block styles
\tikzset{
decision/.style={
diamond,
draw,
text width=4em,
text badly centered,
inner sep=0pt
},
block/.style={
rectangle,
draw,
text width=10em,
text centered,
rounded corners
},
cloud/.style={
draw,
ellipse,
minimum height=2em
},
descr/.style={
fill=white,
inner sep=2.5pt
},
connector/.style={
-latex,
font=\scriptsize
},
rectangle connector/.style={
connector,
to path={(\tikztostart) -- ++(#1,0pt) \tikztonodes |- (\tikztotarget) },
pos=0.5
},
rectangle connector/.default=-2cm,
straight connector/.style={
connector,
to path=--(\tikztotarget) \tikztonodes
}
}
\begin{tikzpicture}
\matrix (m)[matrix of nodes, column sep=2cm,row sep=8mm, align=center, nodes={rectangle,draw, anchor=center} ]{
|[cloud]| {phase scheduler} & \\
|[decision]| {detect circularity} & \\
|[block]| {non-circular phase scheduler} & |[block]| {circular phase scheduler} \\
|[block]| {find component containing single chunk of half-left for this phase} & |[block]| {find component containing both half-left and half-right for this phase}\\
|[block]| {schedule half-left for this phase} & |[block]| {schedule half-left from this component} \\
|[block]| {find next inner component ready to schedule} & |[block]| {find next chunk ready to schedule from this component} \\
|[block]| {schedule next available chunk in this in this inner component} & |[block]| {schedule chunk} \\
|[block]| {find component containing a single chunk of half-right for this phase} & |[block]| {schedule half-right from this component} \\
|[block]| {schedule half-right for this phase} & \\
};
\path [>=latex,->] (m-1-1) edge (m-2-1);
\path [>=latex,->, dashed] (m-2-1) edge (m-3-1);
\path [>=latex,->] (m-3-1) edge (m-4-1);
\path [>=latex,->] (m-4-1) edge (m-5-1);
\path [>=latex,->] (m-5-1) edge (m-6-1);
\path [>=latex,->] (m-6-1) edge (m-7-1);
\path [>=latex,->] (m-7-1) edge (m-8-1);
\path [>=latex,->] (m-8-1) edge (m-9-1);
\draw [rectangle connector=2.5cm, dashed] (m-2-1) to node[descr] {\emph{circular phase}} (m-3-2);
\path [>=latex,->] (m-3-2) edge (m-4-2);
\path [>=latex,->] (m-4-2) edge (m-5-2);
\path [>=latex,->] (m-5-2) edge (m-6-2);
\path [>=latex,->] (m-6-2) edge (m-7-2);
\path [>=latex,->] (m-7-2) edge (m-8-2);
\draw [rectangle connector=2.75cm] (m-7-1) to node[descr] {\emph{loop}} (m-6-1);
\draw [rectangle connector=2.75cm] (m-7-2) to node[descr] {\emph{loop}} (m-6-2);
\draw [rectangle connector=-3.5cm] (m-9-1) to node[descr] {\emph{loop}} (m-1-1);
\draw [rectangle connector=-2.55cm] (m-8-2) to node[descr] {\emph{loop}} (m-1-1);
\end{tikzpicture}
\caption{Flow chart describing different pieces of SCC chunk scheduling}
\end{figure}
\end{document}
答案1
您可以使用arrows.meta
库来轻松更改箭头的大小。我建议您删除所有实例>=latex
并仅定义一次箭头样式。此外,在样式定义中替换-latex
为,以便在任何地方都获得相同的箭头:->
rectangle connector
% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{matrix,shapes,arrows.meta,positioning,chains}
\begin{document}
\begin{figure}
\centering
% Define block styles
\tikzset{
>={Latex[width=5pt]},
decision/.style={
diamond,
draw,
text width=4em,
text badly centered,
inner sep=0pt
},
block/.style={
rectangle,
draw,
text width=10em,
text centered,
rounded corners
},
cloud/.style={
draw,
ellipse,
minimum height=2em
},
descr/.style={
fill=white,
inner sep=2.5pt
},
connector/.style={
->,
font=\scriptsize
},
rectangle connector/.style={
connector,
to path={(\tikztostart) -- ++(#1,0pt) \tikztonodes |- (\tikztotarget) },
pos=0.5
},
rectangle connector/.default=-2cm,
straight connector/.style={
connector,
to path=--(\tikztotarget) \tikztonodes
}
}
\begin{tikzpicture}
\matrix (m)[matrix of nodes, column sep=2cm,row sep=8mm, align=center, nodes={rectangle,draw, anchor=center} ]{
|[cloud]| {phase scheduler} & \\
|[decision]| {detect circularity} & \\
|[block]| {non-circular phase scheduler} & |[block]| {circular phase scheduler} \\
|[block]| {find component containing single chunk of half-left for this phase} & |[block]| {find component containing both half-left and half-right for this phase}\\
|[block]| {schedule half-left for this phase} & |[block]| {schedule half-left from this component} \\
|[block]| {find next inner component ready to schedule} & |[block]| {find next chunk ready to schedule from this component} \\
|[block]| {schedule next available chunk in this in this inner component} & |[block]| {schedule chunk} \\
|[block]| {find component containing a single chunk of half-right for this phase} & |[block]| {schedule half-right from this component} \\
|[block]| {schedule half-right for this phase} & \\
};
\path [->] (m-1-1) edge (m-2-1);
\path [->, dashed] (m-2-1) edge (m-3-1);
\path [->] (m-3-1) edge (m-4-1);
\path [->] (m-4-1) edge (m-5-1);
\path [->] (m-5-1) edge (m-6-1);
\path [->] (m-6-1) edge (m-7-1);
\path [->] (m-7-1) edge (m-8-1);
\path [->] (m-8-1) edge (m-9-1);
\draw [rectangle connector=2.5cm, dashed] (m-2-1) to node[descr] {\emph{circular phase}} (m-3-2);
\path [->] (m-3-2) edge (m-4-2);
\path [->] (m-4-2) edge (m-5-2);
\path [->] (m-5-2) edge (m-6-2);
\path [->] (m-6-2) edge (m-7-2);
\path [->] (m-7-2) edge (m-8-2);
\draw [rectangle connector=2.75cm] (m-7-1) to node[descr] {\emph{loop}} (m-6-1);
\draw [rectangle connector=2.75cm] (m-7-2) to node[descr] {\emph{loop}} (m-6-2);
\draw [rectangle connector=-3.5cm] (m-9-1) to node[descr] {\emph{loop}} (m-1-1);
\draw [rectangle connector=-2.55cm] (m-8-2) to node[descr] {\emph{loop}} (m-1-1);
\end{tikzpicture}
\caption{Flow chart describing different pieces of SCC chunk scheduling}
\end{figure}
\end{document}