Style math according to surrounding context (heading, list etc.).
Might not always be accurate, but seems to work well enough since we re-render whole lines.