From the package feynmf i get stringvalues like 'v1' and 'v2'.... 'vN' which represent points in a feynmangraph. I know how to implement \DrawLeftBentLine... my problem is to convert a string into an integernumber.
i want to draw lines by
Code: Select all
\newcommand{\bentline}[2]{
\ifthenelse{\BehindSubString{v}{#1}<\BehindSubString{v}{#2}}{
\DrawLeftBentLine
}{
\DrawRightBentLine
}
}
Code: Select all
\bentline{v1}{v2} ... .draws the leftbentline
\bentline{v2}{v1} ... draws the rightbentline
Can anybody help?
A minimum example:
Code: Select all
\documentclass{article}
\usepackage{substr,ifthen}
\begin{document}
First: \BehindSubString{v}{v1} %First: 1
Second: \BehindSubString{v}{v2} \\ %Second: 2
Test: \ifthenelse{ 1<2}
{Even permutation}
{Odd permutation} %Test: Even permutation
%Next line produces error:
Result: \ifthenelse{ \BehindSubString{v}{v1}<\BehindSubString{v}{v2}}
{Even permutation}
{Odd permutation}
\end{document}
Code: Select all
! Illegal parameter number in definition of \@gtempa.
<to be read again>
2
l.10 ...dSubString{v}{v1}<\BehindSubString{v}{v2}}
P.S.: \BehindSubString is part of the substr package and gets the part behind substring (so the calls above return 1 and 2 respectively but as text not as number)