\textsubscript undefined in Beamer? [duplicate]

This question already has an answer here:

Beamer tells me \textsubscript is undefined. Isn't it a core LaTeX command? How can I use the command in Beamer?

This example throws "undefined control sequence" errors and does not subscript the numbers.

\documentclass{beamer}
\newcommand{\octave}[1]{\textsubscript{#1}}

\begin{document}
\begin{frame}
Musical octaves are designated with subscript numbers:
A\octave{1}, A\octave{2}, A\octave{3}, and so on.
\end{frame}
\end{document}


The package fixltx2e provides a \textsubscript command.
The memoir document class (and probably others) loads fixltx2e by default; beamer does not. If you want to write a package that you can use in both classes, adding \RequirePackage{fixltx2e} can cause problems with any class that already loads that package.
But if \textsubscript is the only reason for loading fixltx2e, then it is better to use the subscript package instead.
• You need fixltx2e for \textsubscript. – egreg Feb 5 '15 at 15:18
• @egreg Thanks. Up till now I have been using this with memoir class, which must load fixltx2e automatically, so I didn't realize. – musarithmia Feb 5 '15 at 19:05