1

Errors:
Package pgf Error: No shape named `c' is known. }
Package pgf Error: No shape named `e' is known. }
Package pgf Error: No shape named `' is known. }

\documentclass[a4paper,12pt]{report}

\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgfkeys}

\usetikzlibrary{fit,arrows,tikzmark,shadows,decorations.pathreplacing,calc,automata}

\begin{document}

\tikzstyle{line} = [-stealth, very thick, draw]

\tikzset{label/.style={draw=gray, thick, rounded corners=.25ex, fill=gray!20,text width=4cm, text badly centered,  inner sep=2ex, anchor=east, minimum height=4em}}

\begin{figure}[!htb]
    \centering
    \resizebox{\textwidth}{!}{
        \begin{tikzpicture}[node distance=6cm,auto]
            \node [label] (b) {DTMF Decoder Module};
            \node [label] (a) at ([yshift=-3cm]$(c)!1.0!(e)$) {Mobile Phone} ();
            \node [label, right of=b] (c) {Microcontroller};
            \node [label] (d) at ([yshift=3cm]$(b)!1.4!(c)$) {LCD Display};
            \node [label, right of=c] (e) {Relay Module};
            \node [label] (f) at ([yshift=-3cm]$(c)!1.4!(e)$) {Solenoid Actuator};
            \path [line] (a) -- (b);
            \path [line] (b) -- (c);
            \path [line] (c) -- (d);
            \path [line] (c) -- (e);
            \path [line] (e) -- (f);
        \end{tikzpicture} 
    }
    \caption{Block Diagram 1}
    \label{fig:bd1}
\end{figure}
\end{document}
4
  • 2
    Your using c in the definition for a. At that time c is not known, you define it later.
    – daleif
    Commented Jan 25, 2021 at 10:27
  • 1
    Welcome to TeX.SE. Commented Jan 25, 2021 at 10:27
  • @daleif you were correct and the error was gone but I further wanted to simplify the code you know it kind of looked too complicated so I done some more research and finally have come up up a simple version of the above code and I have posted it as answer... Commented Jan 26, 2021 at 7:33
  • And thanks @PeterGrill for the welcome note.. Commented Jan 26, 2021 at 7:34

2 Answers 2

1

Just as @daleif said editing the question and this also solved my problem

\documentclass[a4paper,12pt]{report}

\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgfkeys}

\usetikzlibrary{fit,arrows,tikzmark,shadows,decorations.pathreplacing,calc,automata}

\begin{document}

\tikzstyle{line} = [-stealth, very thick, draw]

\tikzset{label/.style={draw=gray, thick, rounded corners=.25ex, fill=gray!20,text width=4cm, text badly centered,  inner sep=2ex, anchor=east, minimum height=4em}}

\begin{figure}[!htb]
    \centering
    \resizebox{\textwidth}{!}{
        \begin{tikzpicture}[node distance=6cm,auto]
            \node [label] (b) {DTMF Decoder Module};
            \node [label, right of=b] (c) {Microcontroller};
            \node [label] (d) at ([yshift=3cm]$(b)!1.4!(c)$) {LCD Display};
            \node [label, right of=c] (e) {Relay Module};
            \node [label] (a) at ([yshift=-3cm]$(c)!1.0!(e)$) {Mobile Phone} ();
            \node [label] (f) at ([yshift=-3cm]$(c)!1.4!(e)$) {Solenoid Actuator};
            \path [line] (a) -- (b);
            \path [line] (b) -- (c);
            \path [line] (c) -- (d);
            \path [line] (c) -- (e);
            \path [line] (e) -- (f);
        \end{tikzpicture} 
    }
    \caption{Block Diagram 1}
    \label{fig:bd1}
\end{figure}
\end{document}
0

I just removed the error by replacing the code like this: (The output is same no difference)

\documentclass[a4paper,12pt]{report}

\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgfkeys}

\usetikzlibrary{fit,arrows,tikzmark,shadows,decorations.pathreplacing,calc,automata}

\begin{document}

\tikzstyle{line} = [-stealth, very thick, draw]
\tikzstyle{block} = [draw=gray, thick, rounded corners=.25ex, fill=gray!20,text width=4cm, text badly centered,  inner sep=2ex, anchor=east, minimum height=4em]

\begin{figure}[!htb]
    \centering
    \resizebox{\textwidth}{!}{
        \begin{tikzpicture}[node distance=6cm,auto]
            \node [block] (b) {DTMF Decoder Module};
            \node [block, below of=b, yshift=8.0em] (a) {Mobile Phone};
            \node [block, right of=b] (c) {$Microcontroller$} ;
            \node [block, above of=c, yshift=-8.0em] (d) {LCD Display};
            \node [block, right of=c] (e) {Relay Module};
            \node [block, below of=e, yshift=8.0em] (f) {Solenoid Actuator};
            \path [line] (a) -- (b);
            \path [line] (b) -- (c);
            \path [line] (c) -- (d);
            \path [line] (c) -- (e);
            \path [line] (e) -- (f);
        \end{tikzpicture} 
    }
    \caption{Block Diagram 1}
    \label{fig:bd1}
\end{figure}

\end{document}

You must log in to answer this question.

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