I'm having trouble with the \ifthenelse command in the package ifthen.sty. The
following code illustrates the problem.
I'm conditioning on a defined variable \a being equal to another variable, either \b or something else. If \b is defined equal to a math command, e.g., \beta, the statement works, but if if \b is defined equal to either a letter (e.g., i) or a subscripted variable, \beta_i, then I get an error. Any advice as to how to get around this would be most appreciated. I want somehow to be able to condition on \b=\epsilon_i^j.
Code: Select all
\documentclass[11pt,reqno]{amsart}%
\usepackage{ifthen}
%If \b is defined as \beta, then \d is properly defined
%If \b is defined as i, then there is an error when \d is processed
%If \b is defined as \beta_i, then there is an error when \d is processed
\def\b{\beta}
\def\b{i}
\def\b{\beta_\rho}
\def\c{\gamma}
\def\d{
\ifthenelse{\a=\b}{1}{0}}
\begin{document}
\def\a{\c}
$\d$
\def\a{\b}
$\d$
\end{document}