I have an equation below that is wrapped in an equation and split environment. Because the equation is long, it will run over the margins, so I used resizebox. According to this SO question I need to explicitly enter math mode when in the resizebox environment. However, I still get an error. The document compiles (on Overleaf, at least), but I would like to get rid of the error so I can share the tex file.
The code:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb}
\usepackage{parskip}
\usepackage[numbers]{natbib}
\bibliographystyle{plainnat}
\usepackage{graphicx}
\begin{document}
\begin{equation}
\label{eq:word}
\resizebox{\textwidth}{!}{%
\begin{split}
$quality(w_{i}) = & \log(1 + \operatorname{similarity}(a,b)) + \log(1 + familiarity(w_{i})) \
& + \log(1+familiarity(\min{(e,3)})) +
\log(1 + expectedness(w_i|w_{i-1})) \
& - \log(1+tts\textnormal{-}experience(subject)) +
quality(w_{i-1}) + \mathcal{A}$%
\end{split}
}
\end{equation}
\end{document}
Throws the error:
Pakage amsmath Error: \begin{aligned} allowed only in math mode
Missing $ inserted
Missing { inserted
Missing } inserted
How can this error be resolved?




qualityshould be in\mathrmas the math italic font intentionally makes adjacent letters look like a product of variables not a word. scaling of equations (or text generally) should only be a last resort and even then avoided, it produces inconsistent ad potentially unreadable font sizes) – David Carlisle Sep 25 '20 at 15:49