Allright, hi guys. Inside my EPS i got quite some texts that are quite similar. Only their index shall change from each one. So i'm trying to get those done in an own command.
They are used inside an \begin{figure}...\end{figure}
- block, right after \centering
. after them the eps gets included.
My code looks like this:
\newcommand{\qfrag}[1]{\psfrag{q#1}[c][c]{$q_#1$}} %this works as \qfrag{0}\qfrag{1}...
\newcounter{ctr}
\newcommand{\qrfrag}[1]{\forloop{ctr}{0}{\value{ctr} < #1}{\qfrag{\arabic{ctr}}}} %but not like this.
My \qfrag
replaces all q#1
to q_#1
. works fine on its own. Also behind each other like this works fine:
\qfrag{0}\qfrag{1}\qfrag{2}\qfrag{3}
But once i try to get them together inside a forloop they kinda mess up and make all indices of my q
's to the number inserted to \qrfrag{}
\qrfrag{3} causes to be all q0,q1,q2 to become formatted q_3 but not q3.
Any clues on your sides there? I'm kinda new to latex.