-1

Sometimes chaining \draw commands comes in handy for me, e.g., in the following example:

\begin{tikzpicture}[
    box/.style={draw, minimum width=1.5cm, minimum height=1cm}
]
\draw 
node[box] (ui) {+}
+(0,-1.5) node[box] {+}
++(3,0) node[box, scale=1.5] (helyOS) {+}
+(0, -1.5) node[box] {+};
\end{tikzpicture}

Example

I understand the boxes have center anchoring. But how could I jump to another anchor before moving on with the +(x,y) or ++(x,y) provided without defining node names manually or assuming heights/widths?

This would be helpful, e.g., to draw lines between (ui.east) and (helyOS.west).

Probably something like \draw node[box] {+} ++(goto node.south) ++(0,-1);?

F1iX
  • 358

1 Answers1

1

Hm, if I understand you correctly, you like to have something this:

\documentclass[border=3mm]{standalone}
\usepackage{tikz}

\begin{document} \begin{tikzpicture}[ box/.style={draw, minimum width=1.5cm, minimum height=1cm} ] \draw node[box] (ui) {+} +(0,-1.5) node[box] {+} ++(3,0) node[box, scale=1.5,anchor=south] (helyOS) {+} % <--- added anchor +(0, -1.5) node[box] {+}; \end{tikzpicture} \end{document}

enter image description here

Note, default anchor is center of node, but you can change it by anchor=..., for example to anchor=north or anchor=south west, etc.

Zarko
  • 296,517
  • Thx for your answer. Actually I wanted to keep the center anchor for positioning of node (helyOS) but jump to its south anchor before applying +(0,-1.5) – F1iX Aug 12 '21 at 08:09
  • 1
    @F1iX, than ask package author for new version of TikZ, which will comply with your wish. – Zarko Aug 12 '21 at 08:21