[Tex/LaTex] problem with footnote in xepersian : ” Undefined control sequence \small By me\footnote”

errorsfootnotesxepersian

I have problem in using xepersian package. When I use footnote, it come with the error Undefined control sequence \end
but without xepersian it works properly.

I use MiKTeX 2.9


here is the code

    \documentclass[]{article}
    \usepackage{graphicx}
    \usepackage{xepersian}
    \begin{document}
    \begin{center}

    \includegraphics{../Pictures/tehran}

    \huge This is My First work!

    \small By me\footnote{dfgdtjk}
    \end{center}
    \end{document}

and here is the error

    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \small By me\footnote{dfgdtjk}
    Undefined control sequence \end{document}
    Overfull \hbox (0.99916pt too wide) in paragraph
    Overfull \hbox (172.67282pt too wide) in paragraph

Best Answer

The example seems to work when I add \let\Umathcode\XeTeXmathcode \let\Umathchardef\XeTeXmathchardef. Perhaps the package should make a suitable test to avoid to break with older engines.