! Paket tikz Fehler: fehlendes Semikolon

! Paket tikz Fehler: fehlendes Semikolon

Ich habe dieses Codebeispiel hier gefunden:Blockdiagrammgenerierung in LaTeX. Anfangs hatte ich einige Probleme beim Kompilieren des Codes und ich habe sie gelöst, weil einige Zeichen durch die Copy-Paste-Funktion verändert wurden. Obwohl mir der Code korrekt erscheint, erhalte ich immer wieder diesen Fehler:

! Package tikz Error: Giving up on this path. Did you forget a semicolon?.

 See the tikz package documentation for explanation.
 Type  H <return>  for immediate help.
 ...                                              

 l.20 \draw [->] (controller)
                                �� node[name=u] {$u(k)$} (system);
 ? 

Da ich neu beim Tikz-Paket bin, kann ich den Fehler nicht sehen. Alle Teile des Knotens scheinen die Halbsäule zu haben. Was übersehe ich hier?

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,automata}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}

\begin{document}

\tikzstyle{block} = [draw, rectangle, minimum height=2em, minimum width=4em]
%fill=blue!20
\tikzstyle{sum} = [draw, fill=blue!20, circle, node distance=1cm]
\tikzstyle{input} = [coordinate] \tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thin,black}]

\begin{tikzpicture}[auto, node distance=2cm,>=latex']
\node [input, name=input] {};
\node [sum, right of=input] (sum) {};
\node [block, right of=sum, node distance=3.5cm] (controller) {$C(z^{-1})$};
\node [block, right of=controller, pin={[pinstyle]above:$d(k)$}, node distance=4cm] (system) {$P(z^{-1})$};
\draw [->] (controller) – node [name=u] {$u(k)$} (system);
\node [output, right of=system] (output) {};
\node [block, below of=u] (measurements) {$F(z^{-1})$};
\draw [draw,->] (input) – node {$r(k)$} (sum);
\draw [->] (sum) – node {$e(k)$} (controller);
\draw [->] (system) – node [name=y] {$y(k)$}(output);
\draw [->] (y) |- (measurements);
\draw [->] (measurements) -| node[pos=0.99] {$-$} node [near end] {$y_m(k)$} (sum);
\end{tikzpicture}

\end{document}

Antwort1

Du hast absolut Recht, @Johannes_B, etwas so Kleines kann so viele Probleme verursachen, wenn jemand noch nie Tikz verwendet hat. Vielen Dank an alle für eure Zeit und Mühe. Ich werde auch die aktualisierte Version posten, nur für den Fall, dass bei jemandem der gleiche Fehler auftritt wie bei mir.

 \documentclass{article}
 \usepackage{tikz}
 \usetikzlibrary{shapes,arrows,automata}
 \usepackage{pgfplots}
 \pgfplotsset{compat=1.8}

\begin{document}

\tikzstyle{block} = [draw, rectangle, minimum height=2em, minimum width=4em] %fill=blue!20
\tikzstyle{sum} = [draw, fill=blue!20, circle, node distance=1cm]
\tikzstyle{input} = [coordinate] \tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thin,black}]

\begin{tikzpicture}[auto, node distance=2cm,>=latex']
\node [input, name=input] {};
\node [sum, right of=input] (sum) {};
\node [block, right of=sum, node distance=3.5cm] (controller) {$C(z^{-1})$};
\node [block, right of=controller, pin={[pinstyle]above:$d(k)$}, node distance=4cm] (system) {$P(z^{-1})$};
\draw [->] (controller) -- node [name=u] {$u(k)$} (system);
\node [output, right of=system] (output) {};
\node [block, below of=u] (measurements) {$F(z^{-1})$};
\draw [draw,->] (input) -- node {$r(k)$} (sum);
\draw [->] (sum) -- node {$e(k)$} (controller);
\draw [->] (system) -- node [name=y] {$y(k)$}(output);
\draw [->] (y) |- (measurements);
\draw [->] (measurements) -| node[pos=0.99] {$-$} node [near end] {$y_m(k)$} (sum);
\end{tikzpicture}

\end{document}

verwandte Informationen