0

When I type:

Now divide both sides by 154 so we have 1 on the right side of the equal side, and you get:

into LaTeX, and then look at it in PDF view it combines that whole line into one long word with no spaces, so it looks like:

Nowdividebothsidesby154sowehave1ontherightsideoftheequalside,andyouget:

This is the MWE

\documentclass{article} 
\usepackage[utf8]{inputenc} % not essential, but I'll leave it (GuM)

\begin{document}

To start you have to complete the square for 2x^2 - 12x + y^2 + 6y + 26 = 0. \\\\ 
Start by subtracting 26 from both sides to get: 2x^2 - 12x + y^2

\end{document}
11
  • 1
    Welcome to TeX.SE! Please add the compilable code resulting in your error to your question! Did you use pdflatex to compile?
    – Mensch
    Nov 15, 2017 at 2:37
  • These are the packages I'm using: \documentclass{article} \usepackage{graphicx,subfigure} \usepackage{here} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{amssymb,amsmath,amsthm}, and this is the section that is doing this:To start you have to complete the square for 2x^2 - 12x + y^2 + 6y + 26 = 0. \\\\ Start by subtracting 26 from both sides to get: 2x^2 - 12x + y^2
    – John
    Nov 15, 2017 at 2:42
  • The superscript operator only works in math mode. Input ... square for $2x^2 - 12x + y^2 + 6y + 26 = 0$. Start by subtracting 26 from both sides to get: $2x^2 - 12x + y^2$ ... Nov 15, 2017 at 3:11
  • 6
    You have to read an introduction to LaTeX before going any further! tex.stackexchange.com/questions/11/… Nov 15, 2017 at 3:12
  • 1
    In all probability things go like this: first you get an error message that says Missing $ inserted, triggered by the first superscript symbol (^) used outside of math mode, then at least another (but possibly many other) error messages, and finally, when you look at the output, you see what you say in your question. I agree with @HenriMenke that you must study at least the very basics about LaTeX usage before even trying to go on authoring your work.
    – GuM
    Nov 15, 2017 at 3:38

1 Answer 1

2

From your comments, I gather your MWE looks something like this:

\documentclass{article}
\usepackage{graphicx,subfigure}
\usepackage{here}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amssymb,amsmath,amsthm}

\begin{document}

To start you have to complete the square for 2x^2 - 12x + y^2 + 6y + 26 = 0.
\\\\
Start by subtracting 26 from both sides to get: 2x^2 - 12x + y^2

\end{document}

The problem you are having is that in LaTeX there are basically three modes (to keep things simple), paragraph mode, math mode and left-to-right mode (LR mode). Don't worry about it too much, the point is that we must distinguish between math mode and text mode (paragraph mode and LR mode are the two text modes). Maths must go in math mode, text needs to be in text mode.

Now, there are two types of math mode, inline math and display math. Display math is for when we want to highlight a formula or an equation or something, setting it off from the main body and displaying it to the reader. Inline math mode is for maths that appears as part of a sentence which is what you have here. For inline math, you need to put all of your maths inside $ ... $ or \( ... \) like so:

To start you have to complete the square for $2x^2 - 12x + y^2 + 6y + 26 = 0.$

Start by subtracting 26 from both sides to get: $2x^2 - 12x + y^2$

Now one thing is that some commands, such as ^ only work in math mode. Your problem was that you have ^ in text mode, you hadn't entered math mode at all. This would have caused a couple of

! Missing $ inserted.

errors. What's happened is LaTeX's got as far as your ^, and it's had a problem, because it needs to be in math mode and it's not. So it inserts the missing $ to put itself in math mode. Which is fine. Problem solved. Only, it doesn't know where the math mode should end. So what happens is LaTeX keeps going until it finds a closing $ to make the pair. In your MWE there isn't one, so LaTeX gets all the way to the end, finds there is no $ and inserts one. As a result, everything gets put in math mode, including the sentence that follows. And in math mode, letters like abc are treated as variables being multiplied (this is math mode after all), not as letters of a word. Spaces are ignored in math mode because LaTeX handles it all for us, giving us beautiful typographical results, with a lot of the spacing taken care of for us, without us having to do anything. But that does mean that text in math mode does not look good.

So there's your explanation. Also \\\\ is very very bad, do not do this, paragraphs should be ended by a blank line, much as you would be used to in a word processor in fact.

Not the answer you're looking for? Browse other questions tagged or ask your own question.