0

I'm using the TikZ package to make a flowchart. I'm getting the following error: Package PGF Math Error: Unknown operator c' orc@' (in '1c'). \node (in1) [input] {node};

I don't understand what the error is referring to. This is my code:

\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}


\tikzstyle{question} = [rectangle, minimum width=3cm, minimum height=1cm,text centered, draw=black]
\tikzstyle{diagnosis} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, draw=black]
\tikzstyle{input} = [diamond, minimum width=3cm, minimum height=1c, text centered, draw=black]
\tikzstyle{arrow} = [thick,->,>=stealth]

\begin{tikzpicture}[node distance=2cm]

\node (in1) [input] {node};
\node (q1) [question, below of=in1] {Matches distractor node?};
\draw [arrow] (in1) -- (q1);

\end{tikzpicture}
  • 2
    minimum height=1c should be minimum height=1cm, methinks... – Rmano Jun 28 '18 at 15:36
  • Welcome to TeX.SX! It would be great to see when we see compilable code, starting with \documentclass and ending with \end{document}. – Bobyandbob Jun 28 '18 at 15:40
  • 2
    off-topic but you may want to switch to the \tikzset syntax instead of \tikzstyle, e.g. \tikzset{arrow/.style = {thick,->,>=stealth}}. – user121799 Jun 28 '18 at 15:40
1

You have a typo in the input style. You have minimum height=1c. I think you mean minimum height=1cm:

\tikzstyle{input} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black]

Also, as Mr. marmot said, the \tikzstyle syntax is somewhat discouraged and should be replaced by \tikzset:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}

\tikzset{%
  question/.style={rectangle, minimum width=3cm, minimum height=1cm,text centered, draw=black},
% \tikzstyle{question} = [rectangle, minimum width=3cm, minimum height=1cm,text centered, draw=black]
  diagnosis/.style={rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, draw=black},
% \tikzstyle{diagnosis} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, draw=black]
  input/.style={diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black},
% \tikzstyle{input} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black]
  arrow/.style={thick,->,>=stealth}
% \tikzstyle{arrow} = [thick,->,>=stealth]
  }

\begin{document}
\begin{tikzpicture}[node distance=2cm]

\node (in1) [input] {node};
\node (q1) [question, below of=in1] {Matches distractor node?};
\draw [arrow] (in1) -- (q1);

\end{tikzpicture}
\end{document}

I kept the previous syntax for comparison.

  • You are right. I feel very stupid now. – Renate Jun 28 '18 at 15:38
  • @Renate No worries, this happens for everyone :) – Phelype Oleinik Jun 28 '18 at 16: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.