You ask how to temporarily turn off a global option.
In general you have to look at the code (in the class or package) that sets the global option, create a macro that negates that code and also a macro that reinstates the option code. Something along the lines:
\documentclass[opta]{...}
\newcommand{\killopta}{...}
\newcommand{\enableopta}{...}
%
\begin{document}
bla bla bla
\killopta % disable option opta
more blas
\enableopta % reenable option opta
yet more blas
\end{document}
ADDITION
In a comment the OP asked how to deal the the nomath
option in the fontspec
package.
I have never used fontspec
but looking at the fonspec
code as given in fontspec-luatex.sty
there is the following code:
\DeclareOption {math} {\bool_gset_true:N \g__fontspec_math_bool }
\DeclareOption {no-math} { \bool_gset_false:N \g__fontspec_math_bool }
I would guess that creating two new commands, say \mathon
and \mathoff
whose definitions are the same as for the math
and no-math
options would enable you to switch between them in the document.
\ensuremath
is wrong.ensuremath
. What is the correct use of it?$...$
then removed the$
. See also tex.stackexchange.com/a/35877