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}
GuM
  • 21,558
John
  • 1
  • 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 '17 at 02: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 '17 at 02: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$ ... – Henri Menke Nov 15 '17 at 03:11
  • 6
    You have to read an introduction to LaTeX before going any further! https://tex.stackexchange.com/questions/11/what-are-good-learning-resources-for-a-latex-beginner – Henri Menke Nov 15 '17 at 03:12
  • Spaces are ignored in math mode. You need to keep the math separate from the text either by using \text{...} inside an equation or (probably for what you are doing) embedding the math inside regular text by using $...$ or \( ... \). – Alan Munn Nov 15 '17 at 03: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 '17 at 03:38
  • @gum Or the entire text is inside a math environment. This is why I don't think the MWE should have been added. – Alan Munn Nov 15 '17 at 03:57
  • @AlanMunn: IMHO, this question cannot be viewed as a duplicate of What is the “correct” way of embedding text into math mode?: it concerns, rather, the very basics of how to write math in LaTeX. Apparently, the guidelines in the help center do not forbid to ask “absolutely trivial” question, so triviality cannot be regarde as a legitimate reason for closing a question… – GuM Nov 15 '17 at 04:00
  • @gum It only concerns the very basics of how to write math if you assume the MWE you added. If you assume that all the text is inside an equation environment then it's a duplicate. So it's up to the OP to provide the MWE. For example, you are assuming that the OP's code generates an error but they report no error. – Alan Munn Nov 15 '17 at 04:04
  • @AlanMunn: I think that the OP has provided a MWE that indeed exhibit the actual issue (s)he is facing. That’s why I approved the edit (after deleting irrelevant packages). Edit: Yes, I have to assume that the OP gets an error even if (s)he doesn’t report it, but recall that many novice user compile through front-ends that set the \nonstopmode switch. – GuM Nov 15 '17 at 04:06
  • About the debate on whether this question should be closed, may I suggest having a look to About “trivial” questions on Meta? – GuM Nov 15 '17 at 04:37

1 Answers1

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.

Au101
  • 10,278