![Tikz 文本无法根据箭头进行调整](https://linux22.com/image/254415/Tikz%20%E6%96%87%E6%9C%AC%E6%97%A0%E6%B3%95%E6%A0%B9%E6%8D%AE%E7%AE%AD%E5%A4%B4%E8%BF%9B%E8%A1%8C%E8%B0%83%E6%95%B4.png)
我有以下代码可以生成图像(遗憾的是,由于此处没有图像文件,因此代码无法工作)。由于某种原因,“完成”文本被放置在箭头下方。我该如何修复?
\begin{flushleft}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto, node distance=8.5cm ,semithick]
\node [draw=none, initial, initial text=\textbf{Initial Query},initial where=above](part1){\includegraphics[width=7.5cm,height=6cm,keepaspectratio=true]{byhalfpart1.jpg}};
\node [draw=none](part2)[right of=part1] {\includegraphics[width=7.5cm,height=6cm,keepaspectratio=true]{byhalfpart2.jpg}
};
\path (part1) edge[] node{} (part2);
\coordinate[below of=part2] (d1);
\path (part2) edge[shorten >=5cm] node{Done} (d1);
% \draw [shorten >=5cm] (part2) to[] node[auto] {\textbf{Done}} (d1);
\end{tikzpicture}\\
\end{flushleft}
答案1
如果没有充分米动物西工作埃例如,很难找出可以做什么。我认为你可以right=2cm of node.anchor
像这个小例子一样使用这个概念:
\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning}
\begin{document}
\begin{tikzpicture}[textnode/.style={align=left}, -latex]
\node (iq) {initial query};
\node[textnode,below=1cm of iq.south] (part1) {part1 part1\\ part1 part1\\ part1 part1\\ part1 part1};
\node[textnode,right=1cm of part1.east] (part2) {part2 part2\\ part2 part2\\ part2 part2\\ part2 part2\\ part2 part2};
\node[below=1cm of part2.south] (d1) {Done};
\draw (iq) -- (part1);
\draw (part1) -- (part2);
\draw (part2) -- (d1);
\end{tikzpicture}
\end{document}