Problem:
Trying to activate math mode inside underbrace text but I receive errors telling me that I am not allowed. I have managed to solve this with \[
and \]
but the equation shifts to the center of the page despite using \noindent
.
Minimal Working Example (MWE):
\documentclass[a4paper,11pt]{book}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\noindent $(a \pm b)^2 = (a \pm b)(a \pm b) = a \cdot a \pm a \cdot b \pm \underbrace{b \cdot a}_\text{a \cdot b} + b \cdot b = a^2 \pm 2ab + b^2$
\end{document}
Desired output:
Get math mode to work inside underbrace text while keeping the overall text aligned to the left.
\[ \]
is display mode, and you can instead use\( \)
for inline.