I want to use the catchfile package to import the data of nodes from external file ver.dat as following:
\documentclass[tikz]{standalone}
\usepackage{catchfile}
\CatchFileDef{\myver}{ver.dat}{}
\begin{document}
\begin{tikzpicture}
\foreach [count=\i] \coord in {\myver}{
\node (p\i) at \coord {\i};
}
\end{tikzpicture}
\end{document}
where the file ver.dat is (1,0),(0,1).
But the above code doesn't work, what's wrong?
\myveris not expanded; you can see this by inserting\show\coordinside the\foreachloop to see what\coordlooks like. You need to remove the braces around\myverso it's properly expanded, as suggested in TikZ\foreachloop with macro-defined list. – Werner Sep 26 '14 at 05:37\foreachline should be:\foreach [count=\i] \coord in \myver {...}but when I do this\coordis still{(1,0), (0,1)}. What am I doing wrong? – Sep 26 '14 at 06:31ver.datcontains only(1,0), (0,1)(without the braces{...})? – Werner Sep 26 '14 at 13:51