How would you implement the "catcode" solution here for superscripts? Thanks
EDIT
The code below reproduces the error (complied using XeLaTeX). Works if the following two lines are commented out:
\catcode`^=\active
\newcommand^[1]{\ensuremath{\sp{\scriptscriptstyle #1}}}
Full code:
\documentclass[11pt,english,no-math]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Calibri}
\usepackage{geometry}
\geometry{verbose,tmargin=0.8in,bmargin=0.8in,lmargin=0.8in,rmargin=0.8in}
\catcode`_=\active
\newcommand_[1]{\ensuremath{\sb{\scriptscriptstyle #1}}}
\catcode`^=\active
\newcommand^[1]{\ensuremath{\sp{\scriptscriptstyle #1}}}
\usepackage[dvipsnames]{xcolor}
\usepackage{titlesec}
\titleformat*{\section}{\LARGE\bfseries\color{RoyalBlue}}
\titleformat*{\subsection}{\Large\bfseries\color{RoyalBlue}}
\usepackage{xunicode}
\usepackage{polyglossia}
\setdefaultlanguage[variant=american]{english}
\begin{document}
\section{Set up}
\begin{align*}
\int_{n-1}^{n}c_{n}dt & =x\left(i,n\right)\\
\implies c_{n} & =x\left(i,n\right)
\end{align*}
\end{document}
_by^and\sbby\sp– David Carlisle Jan 30 '18 at 01:49\catcode`^=\active \newcommand^[1]{\ensuremath{\sp{\scriptscriptstyle #1}}}
– gsab Jan 30 '18 at 01:53