TeXToMath[s_String] :=
 Module[{},
  StringReplace[
   s,
   {
    "\\(" -> "\!\(",
    "\\)" -> "\)",
    "{" -> "\(",
    "}" -> "\)",
    "\n" -> " ",
    "\\alpha" -> "\[Alpha]",
    "\\beta" -> "\[Beta]",
    "\\gamma" -> "\[Gamma]",
    "\\delta" -> "\[Delta]",
    "\\epsilonbar" -> "\(\[Epsilon]\&_\)",
    "\\epsilon" -> "\[Epsilon]",
    "\\zetabar" -> "\(\[Zeta]\&_\)",
    "\\zeta" -> "\[Zeta]",
    "\\eta" -> "\[Eta]",
    "\\theta" -> "\[Theta]",
    "\\iota" -> "\[Iota]",
    "\\kappa" -> "\[Kappa]",
    "\\lambda" -> "\[Lambda]",
    "\\mubar" -> "\(\[Mu]\&_\)",
    "\\mu" -> "\[Mu]",
    "\\nubar" -> "\(\[Nu]\&_\)",
    "\\nu" -> "\[Nu]",
    "\\xi" -> "\[Xi]",
    "\\pi" -> "\[Pi]",
    "\\rho" -> "\[Rho]",
    "\\sigmabar" -> "\(\[Sigma]\&_\)",
    "\\sigma" -> "\[Sigma]",
    "\\tau" -> "\[Tau]",
    "\\phi" -> "\[Phi]",
    "\\chi" -> "\[Chi]",
    "\\psi" -> "\[Psi]",
    "\\omega" -> "\[Omega]",
    "\\varphi" -> "\[CurlyPhi]",
    "\\vartheta" -> "\[CurlyTheta]",
    "\\Gamma" -> "\[CapitalGamma]",
    "\\Delta" -> "\[CapitalDelta]",
    "\\Theta" -> "\[CapitalTheta]",
    "\\Lambda" -> "\[CapitalLambda]",
    "\\Pi" -> "\[CapitalPi]",
    "\\Sigma" -> "\[CapitalSigma]",
    "\\Upsilon" -> "\[CapitalUpsilon]",
    "\\Phi" -> "\[CapitalPhi]",
    "\\Chi" -> "\[CapitalChi]",
    "\\Psi" -> "\[CapitalPsi]",
    "\\Omega" -> "\[CapitalOmega]",
    "\\rightarrow" -> "\[RightArrow]",
    "\\langle" -> "\[LeftAngleBracket]",
    "\\rangle" -> "\[RightAngleBracket]",
    "\\circ" -> "\[EmptySmallCircle]",
    "\\oplus" -> "\[CirclePlus]",
    "\\ominus" -> "\[CircleMinus]",    
    "\\otimes" -> "\[CircleTimes]",
    "_" -> "\\_",
    "^" -> "\\^",
    "\\{" -> "{",
    "\\}" -> "}",
    "\\geq" -> "\[GreaterEqual]",
    "\\leq" -> "\[LessEqual]",
    "\\pm" -> "\[PlusMinus]",
    "\\mp" -> "\[MinusPlus]",
    "\\N" -> "\[DoubleStruckCapitalN]",
    "\\Z" -> "\[DoubleStruckCapitalZ]",
    "\\Q" -> "\[DoubleStruckCapitalQ]",
    "\\R" -> "\[DoubleStruckCapitalR]",
    "\\C" -> "\[DoubleStruckCapitalC]",
    "\\Smash" -> "\[And]",
    "\\Wedge" -> "\[Or]",
    "\\setminus" -> "\[Backslash]",
    "\\bullet" -> "\[Bullet]",
    "\\cap" -> "\[Intersection]",
    "\\cup" -> "\[Union]",
    "\\emptyset" -> "\[EmptySet]",
    "\\amalg" -> "\[Coproduct]",
    "\\times" -> "\[Times]",
    "\\nabla" -> "\[Del]",
    "\\Rightarrow" -> "\[DoubleRightArrow]",
    "\\Leftarrow" -> "\[DoubleLeftArrow]",
    "\\infty" -> "\[Infinity]",
    "\\in" -> "\[Element]",
    "\\forall" -> "\[ForAll]",
    "\\exists" -> "\[Exists]"
   }
  ]
 ]

