1

I've written some simple text in latex but it keeps getting deformated like in the picture, any idea why? I also keep getting the warning on the same line. I am using a custom latex template but it works fine everywhere except on this line

the error messages displayed

The way latex compiles

    Upon statistical analysis through the methods described above, a very significant difference was verified between the contact angles of OH and \ce{CH3} samples. Whereas OH samples presented a contact angle of 32.29\degree \pm 3.02\degree , \ce{CH3} samples presented a contact angle of 108.41\degree \pm 0.23\degree. Generally, the experiment was precise as the maximum SD presented small values (3.02\degree). However, the precision on the \ce{CH3} test proved to be considerably higher, having a SD of only 0.23\degree.

Thanks in advance!

6
  • Welcome! Please add a full compilable example. Most likely you used math mode where you should not have done so.
    – user121799
    Dec 9, 2017 at 17:07
  • You see an error which tells you why: You missed to insert a closing $ sign.
    – TeXnician
    Dec 9, 2017 at 17:08
  • the first line of your image shows a tex error, after an error you should not even look at the generated pdf. If you choose to scroll past the error tex only recovers enough to syntax-check the rest of the document, it makes no attempt to make sensible typeset output. Dec 9, 2017 at 17:10
  • Try: Upon statistical analysis through the methods described above, a very significant difference was verified between the contact angles of OH and \ce{CH3} samples. Whereas OH samples presented a contact angle of $32.29\degree \pm 3.02\degree$, \ce{CH3} samples presented a contact angle of $108.41\degree \pm 0.23\degree$. Generally, the experiment was precise as the maximum SD presented small values ($3.02\degree$). However, the precision on the \ce{CH3} test proved to be considerably higher, having a SD of only $0.23\degree$.
    – user121799
    Dec 9, 2017 at 17:11
  • We've had this before: You're missing the use of math mode; TeX identifies a symbol that requires math mode, so it inserts $ in order to correct for this. However, there's no way to know where to end math mode, so everything following it is set in that mode. Specifically, you need $32.29\degree \pm 3.02\degree$, as well as $...$ for the others.
    – Werner
    Dec 9, 2017 at 17:12

1 Answer 1

3

You are failing to drop into math mode when you should and the compiler is doing it for you but doesn't know when to get out of it.

to fix this, tell the compiler what should be in math and what shouldn't, in your case the \pm and \degree expressions:

Upon statistical analysis through the methods described above, a very
significant difference was verified between the contact angles of \ce{OH}
and \ce{CH3} samples. Whereas \ce{OH} samples presented a contact angle of
\(32.29\degree \pm 3.02\degree\), \ce{CH3} samples presented a contact angle
of \(108.41\degree \pm 0.23\degree\). Generally, the experiment was precise
as the maximum SD presented small values (\(3.02\degree\)). However, the
precision on the \ce{CH3} test proved to be considerably higher, having a SD
of only \(0.23\degree\).

note that could also use siunitx for formatting numbers consistently. Also I would encapsulate OH in \ce{} the same way you do for CH4. (corrected in the snippet above.

You must log in to answer this question.

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