我必须在下图中垂直对齐“箭头框”?所以我有两个问题:
- 如何读取“inner sep”寄存器值和边界以及应用样式的连接线厚度寄存器值?
- 有没有什么方法可以全局调整“箭头框”中箭头尖端与尖线边缘的距离?
梅威瑟:
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\usetikzlibrary{plotmarks}
\usetikzlibrary{arrows.meta,bending}
\usetikzlibrary{shapes}
\usetikzlibrary{positioning}
\usetikzlibrary{backgrounds} %| for arangement objects on layers
\pgfdeclarelayer{myback} %|
\pgfsetlayers{background,myback,main} %|
\begin{document}
\def\mtw{3.0} % box width
\def\pal{2.5} % perturbation arrow length
\def\ptw{4.0} % side box width
\begin{tikzpicture}[
line join=round,
every node/.style={font=\footnotesize,align=center},
process/.style={text width=\mtw cm,fill=white,draw},
perturbation/.style={draw,right=1pt,arrow box,arrow box arrows={west:\pal cm},thin,text width=\ptw cm},
node distance=8ex,
flux/.style={very thick,-{Stealth[flex=1.2]}}
]
\node (n1) at (0,0) [anchor=south,process] {initial conditions};
\node (n2) [below=of n1,process] {first stage of the process};
\pgfmathparse{(\pal cm-0.5*\mtw cm)} % shorter arrow length
%\pgfmathparse{(\pal cm-0.5*\mtw cm-0.3333em)} % shorter arrow length; 0.3333em is "inner sep" value
%\pgfmathparse{(\pal cm-0.5*\mtw cm-\mydist cm)} % shorter arrow length; how to put into \mydist "inner sep" and line widths?
\edef\pas{\pgfmathresult pt}
\begin{pgfonlayer}{myback}
\node [perturbation,right=1pt of n1.east,arrow box arrows={west:\pas}]
{perturbations of initial conditions};
\draw [flux] (n1) -- (n2)
node [midway,perturbation] {perturbations of external conditions};
\end{pgfonlayer}
\end{tikzpicture}
\end{document}