\newcommand{\eca}[3]{%
  \def\automate@temp{#2}%
  {\small
    \ensuremath{%
      \frac{%
        \textit{#1}%
        \ifx\automate@temp\@empty%
        \else%
          \textrm{ \color{blue} if #2}%
        \fi%
      }{%
        \textrm{#3}%
      }%
    }%
  }%
}
