# I can't Find My Latex Error

1. Sep 1, 2009

### John Creighto

Code (Text):
\left(\frac{\partial \mathcal L(a_1,…a_n, …;\dot a_1,..,\dot a_n, …;t)}{\partial a_i}\right) - \left(\frac{d}{dy} \frac{\partial \mathcal L(a_1,…a_n, …;\dot a_1,..,\dot a_n, …;t)}{\partial \dot a_i}\right) = 0 \quad \text{for } i = 1, \dots, n, i \neq j
The above equation works on this form but won't work on my wordpress blog (see Lagrangian Mechanics and The Heat Equation), and it won't work on http://www.climateaudit.org/phpBB3/viewtopic.php?f=4&t=766&p=14997#p14997 [Broken]. Is there any useful tools for debugging latex equations? If anyone is curious the above equation is the Eular Lagrange Equation.

Last edited by a moderator: May 4, 2017
2. Sep 1, 2009

### Dragonfall

\mathcal is usually succeeded by {blah}. Could that be the problem?

You can use TeXnic for debugging information.

3. Sep 1, 2009

### John Creighto

I gave it a try. No such luck though. Thanks though. I'm going to give TeXnic a try. Hopefully it will save me a lot of trouble in the future.

4. Sep 1, 2009

### cristo

Staff Emeritus
Try changing \text to \textrm (or something).

5. Sep 1, 2009

"\mathcal is usually succeeded by {blah}. Could that be the problem?"

No - if the argument to mathcal is longer than a single character then {} would be needed, but without them it is applied only to the next character, the L.

I copied your code and tried it in Latexit on my Macbook pro - no problem - it compiled it without a hitch, and displayed it just as you see it above. If this is indeed what it should look like, perhaps there is a code structure used here that your other software doesn't support? Or perhaps it's something so glaringly simple that we all miss it at first shot.

$$\left(\frac{\partial \mathcal L(a_1,…a_n, …;\dot a_1,..,\dot a_n, …;t)}{\partial a_i}\right) - \left(\frac{d}{dy} \frac{\partial \mathcal L(a_1,…a_n, …;\dot a_1,..,\dot a_n, …;t)}{\partial \dot a_i}\right) = 0 \quad \text{for } i = 1, \dots, n, i \neq j$$

and no, \text is designed specifically to be used inside displays like this, so we no longer have to work with those annoying little boxes to get the formatting correct. textrm would probably work too, but I don't think this is where the problem might be.

6. Sep 1, 2009

### cristo

Staff Emeritus
Well, I just ran the input in a boring tex file (i.e. something that looked like \documentclass{article}\begin{document}$$math$$\end{document}), and I got an "undefined control sequence" error for \text, which this went away with \textrm.

By the way, to the OP, you should replace "..." with "\ldots".

7. Sep 1, 2009