Long equation doesn’t go to a new line

equationsmath-modespacing

I'm trying to write an equation and make it a little bigger but it's too long and it doesn't go to a new line. I also get some errors on the last line like "Missing $ inserted. \end{equation}} "Bad math environment delimeter. \end{equation}}" "You can't use \eqno in restricted horizontalmode. \end{equation}}"

\scalebox{1.0}{%
\begin{equation}

        \bm{f(x, y, z, w)} = (x+y+z+\overline{w}) \cdot (x+y+\overline{z}+\overline{w}) \cdot (x+\overline{y}+z+w) \cdot (x+\overline{y}+\overline{z}+\overline{w}) \cdot (\overline{x}+y+z+w)
        \cdot (\overline{x}+y+\overline{z}+w) \cdot (\overline{x}+\overline{y}+\overline{z}+w) \cdot (\overline{x}+\overline{y}+\overline{z}+\overline{w})
        

\end{equation}}

Best Answer

equation is a display construct that adds vertical space so can not be used in \scalebox (you should anyway avoid scaling text) also equation will give an error if a blank line appears in the source.

You should never ignore error messages, TeX can sometimes recover if you scroll past an error but only to allow further debugging, the pdf output is never usable after an error.

Here you could use a multi-line math display, several possibilities depending on how you want it to look but... enter image description here

\documentclass{article}
\usepackage{bm,amsmath}
\begin{document}

\begin{multline}
  \bm{f(x, y, z, w)} = \\
  (x+y+z+\overline{w}) \cdot (x+y+\overline{z}+\overline{w}) \cdot (x+\overline{y}+z+w) \cdot
  (x+\overline{y}+\overline{z}+\overline{w}) \\
   \cdot  (\overline{x}+y+z+w)
  \cdot (\overline{x}+y+\overline{z}+w) \cdot (\overline{x}+\overline{y}+\overline{z}+w) \cdot 
  (\overline{x}+\overline{y}+\overline{z}+\overline{w})
\end{multline}
\end{document}