help me figure out why my latex isn't working?!
August 16, 2008 3:56 PM   Subscribe

I'm learning latex by trying to write a paper in it... and it's going all awry. I'm getting a bunch of bizarre error messages when I try and add formulas ... help?!

I'm following the instructions on this page to enter mathematics mode and enter equations. So a sample few sentences of text looks something like this:

Let the one-round payoff for a cooperating trader be \rho, and let the one-round payoff for defection be \psi. For obvious reasons, $ \psi > \rho $, and let $ \phi = \psi - \rho $. We will assume a community member gets \kappa from a trade in which the trader cooperates, \lambda ($ \lambda < \kappa $) from a trade in which the trader defects. Should the community member refuse to trade with a given trader, I will assume that the community member can randomly draw another trading partner from the community at a cost of \xi.\footnote{That is, \xi represents the loss that a community member must suffer from trading with a different member of the community. Intuitively, this cost can be understood either as a loss of time, or as imperfect substitution between trading partners.} Intuitively, each payoff variable should be constrained to be positive.

When I try to run pdftex on the file, I get error messages like this:

?
[5]
! Missing $ inserted.
< inserted text >

1.70 ...nd payoff for a cooperating trader be \rho
, and let the one-round pa...

I also get error messages like this...

?

Overfull \hbox (56.50252pt too wide) in paragraph at lines 70--81

HELP? What have I done wrong here?
posted by paultopia to Computers & Internet (12 answers total) 4 users marked this as a favorite
 
Best answer: \rho etc. are math symbols, so you need to put them between $s.

This should work:

Let the one-round payoff for a cooperating trader be $\rho$, and let the one-round payoff for defection be $\psi$. For obvious reasons, $ \psi > \rho $, and let $ \phi = \psi - \rho $. We will assume a community member gets $\kappa$ from a trade in which the trader cooperates, $\lambda$ ($ \lambda < \kappa $) from a trade in which the trader defects. Should the community member refuse to trade with a given trader, I will assume that the community member can randomly draw another trading partner from the community at a cost of $\xi$.\footnote{That is, $\xi$ represents the loss that a community member must suffer from trading with a different member of the community. Intuitively, this cost can be understood either as a loss of time, or as imperfect substitution between trading partners.} Intuitively, each payoff variable should be constrained to be positive.
posted by snownoid at 4:10 PM on August 16, 2008


Best answer: You need dollar signs around all of the greek letters, including the standalone ones that are not part of equations. LaTeX only recognizes these in math mode. I would also recommend putting your parentheses inside the dollar signs in sentence 3, though it will compile without this.
posted by shadow vector at 4:12 PM on August 16, 2008


the overfull hbox occurs when it can't wrap a line nicely. if you look at the output you'll see some text sticking out of the right side of the text somewhere. add hyphens, break up equations, or just re-jig the text until it looks ok.
posted by not sure this is a good idea at 4:16 PM on August 16, 2008


Response by poster: Thank you! That made the other errors go away too, for some random reason, and it works now!
posted by paultopia at 4:19 PM on August 16, 2008


Also note that math is sometimes the easiest way to do subscripts.

CO2 should be CO$_2$.

But then again, I think CO2 should be "carbon dioxide."

I was always told: "Write for the busy reader."
posted by GarageWine at 4:26 PM on August 16, 2008


Best answer: That made the other errors go away too, for some random reason
because it is no longer turning your text into one long equation.
posted by not sure this is a good idea at 4:28 PM on August 16, 2008


Response by poster: because it is no longer turning your text into one long equation.

Ooooooooooooooh.
posted by paultopia at 4:42 PM on August 16, 2008


add hyphens, break up equations, or just re-jig the text until it looks ok.

This is the correct way to deal with this problem. The easy way to deal with it is to use \sloppy at the beginning of your document. This produces output that might not look as attractive as a document hyphenated and manually adjusted, but it will be far more attractive than a document with overfull hboxes. You can always turn it off when you're done writing the document and adjust things manually when you have time (ha!).
posted by grouse at 6:13 PM on August 16, 2008


I highly recommend LyX for those just starting out with LATEX.
posted by alby at 2:58 AM on August 17, 2008


Best answer: A tip when writing any LaTeX or TeX: always try to solve the first error you get and ignore the remainder. Once something causes a problem, this often causes a whole string of further errors because something else is now screwed up. In your case, the "over-full hbox" was caused by the processor inserting a math mode symbol and not knowing where to turn it off. Since it doesn't know how to hyphenate in math mode, the line got too long: "over-full hbox". Solve the original problem and you'll find that many of the other "errors" go away too.
posted by bonehead at 6:21 AM on August 17, 2008


This newsgroup would be more than useful for you as you learn LaTeX.
posted by zouhair at 8:52 AM on August 17, 2008


Just found this one : paresse A means of typing greek letters with an active character §, e.g. §a is equivalent to \ensuremath{\alpha}
posted by zouhair at 9:40 AM on August 17, 2008


« Older Should I pop this fine French red?   |   Mongol Nazis?! Newer »
This thread is closed to new comments.