I'm using a macro that uses \StrBetween from xstring
It seems to be working great.
However, when I try to use a value that it returns as a coordinate in a tikz picture, I get a confusing error.
Consider this snippet:
\documentclass[letterpaper,12pt]{article}
\usepackage{xstring}
\usepackage{tikz}
% http://tex.stackexchange.com/a/21566/3068
\newcommand*\GetListMember[2]{\StrBetween[#2,\number\numexpr#2+1]{,#1,},,\par}%
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}
\def\A{\GetListMember{1,2,3}{1}}
% This makes me think the value of \A is 1
\node [draw] at (1,0) {\A};
% Uncommenting the following gives an error that is very confusing to me
% \node [draw] at (\A,1) {\A};
\end{tikzpicture}
\end{document}
It works, but if I uncomment the last commented line, I get this error:
! Undefined control sequence.
<argument> \@@cls
l.18 \node [draw] at (\A,1)
{\A};
I think I need to convert the value of \A to a number, or something, but I don't know how.
p.s. This happens a lot, where an error message contains text that's not in my input file. (In this case \@@cls) Is there a way for me to see the intermediate forms? I feel like I'm debugging Lisp code with no macroexpand-1.
Thanks, as ever. (: