3

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}}
13
  • 2
    Welcome! You have a lot of (basic) errors here. Why don't you look at learnlatex.org/en/lesson-10 ? It's well-spent time, believe me.
    – Rmano
    Commented Jan 11 at 16:41
  • 2
    Basically: 1) always post complete, compilable examples, with a minimal preamble etc. 2) never scale things that way 3) you can't put paragraphs (blank lines) in equations.
    – Rmano
    Commented Jan 11 at 16:43
  • Ok thanks this is my first time using latex and posting questions on stackexchange. I'll look your link thanks
    – pepper
    Commented Jan 11 at 16:47
  • You're welcome. Try to follow this guide:tex.meta.stackexchange.com/questions/228/… when posting a question, and you'll help us to help you!
    – Rmano
    Commented Jan 11 at 16:49
  • 1
    Never ignore errors, any pdf produced after an error is just a debugging aid, not intended to be usable. Commented Jan 11 at 17:05

2 Answers 2

7

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}
3
  • Thank you, I solved the new line problem using \begin{align*} but I can't find a better solution for the scaling problem. Now I have used \large in front of the equation and it works but other than that and \scalebox I don't know other alternatives. Of course I wasn't ignoring error messages, I wrote them because I thougth that it could be usefull. Thank you again for the solution, I'll keep it in mind, it could be usefull later
    – pepper
    Commented Jan 11 at 18:04
  • @pepper yes align* and multline* the same here just as I commented in the answer, different layout it's always better to use a fixed size like \large to get a consistent foint but you can have any font size \fontsize{3cm}[4cm}\selectfont for example (with eg \usepackage{lmodern} to allow any size) Commented Jan 11 at 19:24
  • ok thank you I will use this in the future
    – pepper
    Commented Jan 11 at 20:50
0
\documentclass[12pt]{article}
\usepackage{amsmath}


\begin{document}

\begin{align}
\boldsymbol{f(x, y, z, w)} &= (x+y+z+\overline{w}) \cdot (x+y+\overline{z}+\overline{w}) \cdot (x+\overline{y}+z+w) \cdot{} \nonumber \\
&\quad (x+\overline{y}+\overline{z}+\overline{w}) \cdot (\overline{x}+y+z+w) \cdot (\overline{x}+y+\overline{z}+w) \cdot{} \nonumber \\
&\quad (\overline{x}+\overline{y}+\overline{z}+w) \cdot{(\overline{x}+\overline{y}+\overline{z}+\overline{w})}
\end{align}

\end{document}

enter image description here

6
  • 2
    use \cdot{} at the end so you get the right space for the final . Commented Jan 21 at 12:21
  • @DavidCarlisle Thank you very much. Is it correct?
    – Sebastiano
    Commented Jan 21 at 12:29
  • 1
    no that's worse! look at your output, you have no space around the final . I meant literally use \cdot{} for (just) the last two cdot on the line so that the cdot has something after it and stays as a binary operator. You have put some subterm inside braces??? Commented Jan 21 at 12:32
  • @DavidCarlisle I hope that you have patience with me. Before I must understood. Can you edit my code to understand it? Please
    – Sebastiano
    Commented Jan 21 at 12:34
  • just look at your image it should look like ) ⋅ but your last dot on lines 1 and 2 looks like )⋅ Commented Jan 21 at 12:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .