1

Consider the following MWE:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}


\begin{center}
\begin{tikzpicture}[every node/.style={fill=red!20,draw,double,rounded corners}]

    \node (PRR) at (0,0) {PRR};
    \node (MRR) at (2,0) {MRR};
    \node (MLL) at (2,2) {MLL};
    \node (PLL) at (0,2) {PLL};
    \node (PLR) at (4,0) {PLR};
    \node (MLR) at (6,0) {MLR};
    \node (MRL) at (6,2) {MRL};
    \node(PRL) at  (4,2) {PRL};
    \draw [latex'-latex',double] (PRR) --   [latex'-latex',double] (MRR) -- [latex'-latex',double] (MLL) -- [latex'-latex',double] (PLL) -- [latex'-latex',double] (PRR);

\end{tikzpicture}
\end{center}

\end{document}

I get the error:

Package tikz Error: Cannot parse this coordinate. \draw [latex' -latex',double] (PRR) -- [

What is my mistake here?

4

You should make a new path for every double sided arrow, as Tikz only places arrows at the start and end of a path.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}


\begin{center}
\begin{tikzpicture}[every node/.style={fill=red!20,draw,double,rounded corners}]

    \node (PRR) at (0,0) {PRR};
    \node (MRR) at (2,0) {MRR};
    \node (MLL) at (2,2) {MLL};
    \node (PLL) at (0,2) {PLL};
    \node (PLR) at (4,0) {PLR};
    \node (MLR) at (6,0) {MLR};
    \node (MRL) at (6,2) {MRL};
    \node(PRL) at  (4,2) {PRL};
    \begin{scope}[every path/.style={latex'-latex',double}]
        \draw (PRR) -- (MRR);
        \draw (MRR) -- (MLL);
        \draw (MLL) -- (PLL);
        \draw (PLL) -- (PRR);
    \end{scope}

\end{tikzpicture}
\end{center}

\end{document}

enter image description here

1

Use like this

\begin{tikzpicture}[every node/.style={fill=red!20,draw,double,rounded corners}]

    \node (PRR) at (0,0) {PRR};
    \node (MRR) at (2,0) {MRR};
    \node (MLL) at (2,2) {MLL};
    \node (PLL) at (0,2) {PLL};
    \node (PLR) at (4,0) {PLR};
    \node (MLR) at (6,0) {MLR};
    \node (MRL) at (6,2) {MRL};
    \node(PRL) at  (4,2) {PRL};
    \draw [latex'-latex',double] (PRR);
    \draw [latex'-latex',double] (MRR);
    \draw [latex'-latex',double] (MLL);
    \draw [latex'-latex',double] (PLL);  
     \draw [latex'-latex',double] (PRR);

\end{tikzpicture} 
  • This doesn't draw any line? – Subho Jul 12 '18 at 5:28

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.