1

Can you see label "prodotti"?

\documentclass{article}
\usepackage{float}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}
 
% Sum shape
\node[] (enter) at (0,0){alimentazione};
 
\node [draw,
    fill=SeaGreen!50,
    minimum width=3cm,
    minimum height=1.6cm,
    rounded corners=0.5mm,
    right=1cm of enter,
]  (system) {unità di separazione};

\draw[-stealth] (enter.east) -- ++(1,0);
\node[above=1em of system.east] (a) {};
\draw[-stealth] (a.center) -- ++(1,0) node (b) {};
\node[below=1em of system.east] (c) {};
\draw[-stealth] (c.center) -- ++(1,0) node (d) {};
\node[below=2em of system.south] (separator_agent) {agente separante};
\draw[-stealth] (separator_agent.north) -- (system.south) {};
\node[] (e) at (b.east) {prodotti}; % <--- this
\end{tikzpicture}
\end{figure}
\end{document}

enter image description here

Is there a way to anchor the label directly to the end of the arrow, without having to "manually" calculate the position via xshift?

3
  • 1
    Sure! Try with \node[anchor=west] (e) at (b.east) {prodotti};. But you have to manually add the anchor…
    – NBur
    May 25 at 13:52
  • Thank you very much! P.S. I mean "manually" something like xshift=1em May 25 at 13:53
  • 1
    Note that anchor=west is the same as right.
    – SebGlav
    May 25 at 13:58

1 Answer 1

2

You need to specify the anchor of the node.

\documentclass{article}
\usepackage{float}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
  \begin{figure}[H]
    \centering
    \begin{tikzpicture}
    
    % Sum shape
    \node (enter) at (0,0) {alimentazione};
    
    \node [draw,
      fill=SeaGreen!50,
      minimum width=3cm,
      minimum height=1.6cm,
      rounded corners=0.5mm,
      right=1cm of enter,
    ]  (system) {unità di separazione};
    
    \draw[-stealth] (enter.east) -- ++(1,0);
    \node[above=1em of system.east] (a) {};
    \draw[-stealth] (a.center) -- ++(1,0) node (b) {};
    \node[below=1em of system.east] (c) {};
    \draw[-stealth] (c.center) -- ++(1,0) node (d) {};
    \node[below=2em of system.south] (separator_agent) {agente separante};
    \draw[-stealth] (separator_agent.north) -- (system.south) {};
    \node[anchor=west] (e) at (b.east) {prodotti}; % <--- this
    \end{tikzpicture}
  \end{figure}
\end{document}

enter image description here

As pointed out by @SebGlav, you can code right instead of anchor=west in the node's optional argument.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.