2

Here is my code, I want connect A and C without B. How can I change? Thank you so much!

\documentclass[tikz,
               border=5mm]{standalone}
\usetikzlibrary{arrows, chains, positioning, quotes, shapes.geometric}
\usepackage[utf8]{inputenc}
\usepackage{braket}
\usepackage{url}
\usepackage{chemarrow}
\newcommand{\lra}{\ensuremath{\mathrel{%
    \mkern1.5mu\textrm{\arro\symbol{71}}%
    \mkern-1.1mu\textrm{\arro\symbol{65}}%
    }}\xspace}
\usepackage{xspace}

\begin{document}
    \begin{tikzpicture}[
    node distance = 8mm and 20mm,
      start chain = going below,
     arrow/.style = {thick,-stealth},
      base/.style = {
            draw, thick, 
            minimum width=30mm, minimum height=10mm, align=center,
            inner sep=1mm, outer sep=0mm,
            on chain, join=by arrow},
  decision/.style = {diamond, base,
            aspect=1.5, inner xsep=0mm},
   process/.style = {rectangle, base},
 startstop/.style = {rectangle, rounded corners, base},
                        ]
\node (start)   [startstop] {Start};
\node (setup)   [process]   {Input a specific $n$ };

\node (test)    [decision]  {is 5?};
\node (acqir)   [process,left=of test]    {A};
\node (compute) [process]   {B};
\node (displace)[process]   {C};
\draw [arrow] (test) |- node [near start,right] {Yes} (compute);
\path   (test) to["No"] (acqir);
\node (end)     [process]   {End};

    \end{tikzpicture}
\end{document}
1

Adding \draw [arrow] (acqir.west) -| ([xshift=-10mm]compute.west) |- (displace.west); would add an arrow that connects A and C (I removed some unused options and packages):

\documentclass[tikz, border=5mm]{standalone}
\usetikzlibrary{chains, quotes, shapes.geometric}
\usepackage[utf8]{inputenc}


\begin{document}
    \begin{tikzpicture}[
    node distance = 8mm and 20mm,
      start chain = going below,
     arrow/.style = {thick,-stealth},
      base/.style = {
            draw, thick, 
            minimum width=30mm, minimum height=10mm, align=center,
            inner sep=1mm, outer sep=0mm,
            on chain, join=by arrow},
  decision/.style = {diamond, base,
            aspect=1.5, inner xsep=0mm},
   process/.style = {rectangle, base},
 startstop/.style = {rectangle, rounded corners, base},
                        ]
\node (start)   [startstop] {Start};
\node (setup)   [process]   {Input a specific $n$ };

\node (test)    [decision]  {is 5?};
\node (acqir)   [process,left=of test]    {A};
\node (compute) [process]   {B};
\node (displace)[process]   {C};
\draw [arrow] (test) |- node [near start,right] {Yes} (compute);
\path   (test) to["No"] (acqir);
\node (end)     [process]   {End};

\draw [arrow] (acqir.west) -| ([xshift=-10mm]compute.west) |- (displace.west);

    \end{tikzpicture}
\end{document}

enter image description here


Edit

If you don’t want to join A and B or B and C (see also these answers):

\documentclass[tikz, border=5mm]{standalone}
\usetikzlibrary{chains, quotes, shapes.geometric}
\usepackage[utf8]{inputenc}

\makeatletter
\tikzset{
  suppress join/.code={\def\tikz@after@path{}}
}
\makeatother
\begin{document}
    \begin{tikzpicture}[
    node distance = 8mm and 20mm,
      start chain = going below,
     arrow/.style = {thick,-stealth},
      base/.style = {
            draw, thick, 
            minimum width=30mm, minimum height=10mm, align=center,
            inner sep=1mm, outer sep=0mm,
            on chain, join=by arrow},
  decision/.style = {diamond, base,
            aspect=1.5, inner xsep=0mm},
   process/.style = {rectangle, base},
 startstop/.style = {rectangle, rounded corners, base},
                        ]
\node (start)   [startstop] {Start};
\node (setup)   [process]   {Input a specific $n$ };

\node (test)    [decision]  {is 5?};
\node (acqir)   [process,left=of test]    {A};
\node (compute) [process,suppress join]   {B};
\node (displace)[process,suppress join]   {C};
\draw [arrow] (test) |- node [near start,right] {Yes} (compute);
\path   (test) to["No"] (acqir);
\node (end)     [process]   {End};

\draw [arrow] (acqir.west) -| ([xshift=-10mm]compute.west) |- (displace.west);

    \end{tikzpicture}
\end{document}

enter image description here

  • Thank you for your kind help! My question is not clear, no connection between A and B, just A and C. – Goat May 23 '18 at 15:02
  • OK, see my edit. But would’t it be more logical if you put B just below the decision node instead of inbetween A and C? You could also change the position of A and B maybe. – Jasper Habicht May 23 '18 at 15:35
  • Thank you so much, I will change a bit! Thank you again! – Goat May 23 '18 at 15:58
  • You‘re welcome (also to accept this answer if it has helped you)! – Jasper Habicht May 28 '18 at 20:30

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.