[Tex/LaTex] Put an arrow and text at the end node of a tikz graph

tikz-arrowstikz-pgf

I am novice guy in LaTeX. Tikz is completely new to me.

I have gone through the post How to zoom a portion of TiKZ picture?

  1. Let's say I want to write $a=(b,c)$ at the beginning of the arrow which enters S. How to do that?(according to the above question)

As per my picture, I am having a problem to put an arrow before the block A.

My try: I did the following modification to the code:

    initial text= $a=(b,c)$

It was working until I put the '=' sign between a and (b,c).

  1. Next, I want to put an arrow and text over it after the end node (D according to my picture). How to do it?

My Target is to create a picture like below-

enter image description here

Best Answer

In the absence of a minimal working example, it is hard to be terribly helpful. (Where is S? Where did you try that code?) This is, of course, especially frustrating when it is obvious from your question that you do, in fact, have code and have simply chosen not to share it so that people have to start from scratch. This is less likely to be helpful, of course, since we can only guess what the problem might be.

That said, the image you posted can be easily drawn using the chains library and a simple loop, with a couple of tweaks to accommodate the start and end of the chain. The quotes library is used for the labelling. scopes is not really needed here but it is useful when using chains so I've included it in case your diagram grows in complexity.

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{chains,scopes,quotes,arrows.meta}
\begin{document}
\begin{tikzpicture}
  [
    start chain=main going right,
    every on chain/.append style={minimum width=25mm, minimum height=10mm, draw=green!50!yellow!60, thick, text centered},
    every join/.append style={-{Triangle[]}, draw=blue!50!cyan, thick},
    node distance=20mm
  ]
  \node (in) [shape=coordinate] {};
  {
    \chainin (in);
    \foreach \i/\j in {A/{$a=(b,c)$},B/{$x$},C/{$y$},D/{$z$}}
    \node (\i) [on chain, join=by {"\j"}] {\i};
    \node (out) [every on chain/.append style={draw=none, minimum width=0pt, minimum height=0pt}, on chain, join=by {"a"} ] {};
  }
\end{tikzpicture}
\end{document}

chained nodes

Related Question