1

So i am trying to make a flowchart with tikz. Everything was working fine and as expected. But then I tried to specify starting and endpoints of edges between some rectangles and out of nowhere tikz seems to add an additional arrowhead to the start of my edge.

See the MWE:

\documentclass[border=0.2cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
    \begin{tikzpicture}[font=\small,thick]
        \node[draw,
        minimum width=2.5cm,
        minimum height=1cm
        ] (test1) {test1};
        \node[draw,
        left=of test1,
        minimum width=2.5cm,
        minimum height=1cm
        ] (test2) {test2};
        \draw[-latex] (test1.180) edge [bend left=45] (test2.-90);
        \draw[-latex] (test1) edge [bend right=45] (test2);
    \end{tikzpicture}
\end{document}

For some reason the first edge has an additional arrowhead at the start of the edge (at node test1). How do I get rid of the unwanted arrowhead?

Also, is there a way for an edge starting at a rectangle node to properly fill out the empty space near the border?

enter image description here

1 Answer 1

2

Like this?

enter image description here

I would define edge as shown in MWE below:

\documentclass[border=0.2cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}
    \begin{tikzpicture}[
box/.style = {draw, thick, 
              minimum width=2.5cm, minimum height=1cm},
every edge/.style = {draw, -latex, thick} % <---
                        ]
\node[box] (test1) {test 1};
\node[box, left=of test1] (test2) {test 2};
%
\draw   (test1.180) edge [bend left=45] (test2.-90) 
        (test1)     edge [bend right=45] (test2);
    \end{tikzpicture}
\end{document}
2
  • Thank you! This works... even though I don't quite see the difference between the code.
    – Max_M
    Jan 29, 2022 at 14:04
  • @Max_M, difference is that command \draw doesn't use options for edge style. Their style is defined in tikzpicture` preamble, code line is marked by % <--- .
    – Zarko
    Jan 29, 2022 at 14:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .