![如何相对于对象+偏移量在 tikz 范围内移动?](https://linux22.com/image/275084/%E5%A6%82%E4%BD%95%E7%9B%B8%E5%AF%B9%E4%BA%8E%E5%AF%B9%E8%B1%A1%2B%E5%81%8F%E7%A7%BB%E9%87%8F%E5%9C%A8%20tikz%20%E8%8C%83%E5%9B%B4%E5%86%85%E7%A7%BB%E5%8A%A8%EF%BC%9F.png)
您如何转变(0,0)
为类似这样的情况:(MYBOX.west)++(0.1,0)
?
这是一个 MnWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning, calc}
\begin{document}
\begin{tikzpicture}
\node[rectangle, draw] at (0,0) (MYBOX) {Something};
\begin{scope}[shift={$(MYBOX.east) + (0.1,0)$}]
\draw[black] (0,0) -- ++(0, -1);
\end{scope}
\end{tikzpicture}
\end{document}
答案1
您可以为此使用语法shift={($(MYBOX.west)+(0.1,0)$)}
(需要calc
使用 加载库):\usetikzlibrary{calc}
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning, calc}
\begin{document}
\begin{tikzpicture}
\node[rectangle, draw] at (0,0) (MYBOX) {Something};
\begin{scope}[shift={($(MYBOX.east) + (0.1,0)$)}]
\draw[black] (0,0) -- ++(0, -1);
\end{scope}
\end{tikzpicture}
\end{document}