using an up-to-date MiKTeX installation I'm trying to plot a graph in TikZ, where the \draw command with the coordinates is input from an external file. The \draw command is not closed by a semicolon inside the file though, because its options like [-latex] should be assignable within the main file.
When I insert the file contents directly into the main file, everything works fine, but when I use \input{myfilename} to insert the file contents, I get the error
Package tikz Error: Giving up on this path. Did you forget a semicolon?. \input{myfilename}
Here are the MWEs:
This works fine:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{scope}
\draw plot[smooth] coordinates { %
( 1, 0) %
( 0.5, -0.5) %
( 0, 0) %
}%
[-latex];
\end{scope}
\end{tikzpicture}
\end{document}
But this produces the error:
\begin{filecontents}{genplot}
\draw plot[smooth] coordinates { %
( 1, 0) %
( 0.5, -0.5) %
( 0, 0) %
}
\end{filecontents}
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{scope}
\input{genplot}%
[-latex];
\end{scope}
\end{tikzpicture}
\end{document}
Strangely this was working fine until at least a year ago (when I last compiled the document). So something in the behaviour of using \input inside a TikZ picture must have changed since then.
Can someone enlighten me or does anyone have a solution where I don't need to edit the content of the external file?
