0
我想從文件中讀取一些座標,然後使用TikZ繪製它們。 該文件是格式如下:TeX容量超過,輸入堆棧大小
timestamp 1.002132 3.2131231
timestamp 1.332132 2.9120
這是我的代碼:
\begin{tikzpicture}
\draw[step=0.5,black,thin,xshift=0cm,yshift=0cm, opacity=0.3] (0,0) grid (8,4);
\draw [->](-.5,.5) -- (8.5,.5);
\draw [->] (4, -.5) -- (4, 4.5);
% read file and draw coordinates
\newread\file
\openin\file=recording2
\loop
\read\file to\fileline
\unless\ifeof\file
% Fetch coordinates in \coordX and \coordY
\StrSplit{\fileline}{14}{\ts}{\coords}
\def\coordX{\StrBefore{\coords}{ }}
\def\coordY{\StrBehind{\coords}{ }}
\draw (1,1) node {\coordX}; %this works fine
\draw (1,1) node {\coordY}; %this works fine
\draw (\coordX+4,\coordY+0.5) circle(1pt); %this cause the error
\repeat
\closein\file
\end{tikzpicture}
我已經印雙方coordX和coordY的價值觀,他們是正確的。 你有什麼想法是什麼導致錯誤?爲了讓TikZ將數值解釋爲數值,我是否必須「投射」這些值?
我已經嘗試編輯LaTeX的內存設置沒有運氣,所以我假設錯誤是在代碼中(duh-uh)。