Incompatibility between siunitx and gb4e
The cause of the problem
The redefinition of ^
and _
that gb4e
does has nothing to do with this problem, because (as @cfr notes) it isn't solved by \noautomath
. The problem is some code in the package that checks for the presence of a very old LaTeX kernel.
Changes to the current LaTeX kernel that happened a few years ago have caused this code to do the opposite of what was intended. I thought this bug had been fixed, but apparently it hasn't. I'll re-notify Alexis Dimitriadis, the maintainer of gb4e
.
Workaround
Before you load the gb4e
package, add the following code:
\makeatletter
\def\new@fontshape{}
\makeatother
It's also a good idea to load gb4e
after siunitx
. If you don't you will need to add \noautomath
immediately after loading gb4e
.
Here's a complete example:
\documentclass[11pt]{article}
\makeatletter
\def\new@fontshape{}
\makeatother
\usepackage{siunitx}
\usepackage{gb4e}
\begin{document}
\SI{30}{\degreeCelsius}
\end{document}
Package gb4e
redefines ^
, so you need to use \textsuperscript
instead of ^
for degrees. The way to make siunitx
to do this is to select text mode for the units. Also, in this case you do not need to redefine \fg
unless you want to do it for other purposes.
This works:
\documentclass[11pt]{article}
\usepackage[mode=text]{siunitx}
\usepackage{gb4e}
\begin{document}
yo
\SI{30}{\degreeCelsius}
\end{document}