I have a set of really easy formulas/equations and need to present them in the right way. And, as always, I have some trouble with the different possibilities from Latex.

My first attempt was:

 p(x) &=& C \cdot x ^ {- \alpha} \nonumber \\
 ln(p(x)) &=& ln(C \cdot x ^ {- \alpha}) \nonumber \\ 
 &=& ln(C)+ln(x ^ {- \alpha}) \nonumber \\
 ln(p(x)) &=& ln(C) + ln(x) \cdot {- \alpha}

It has only one number for the equation on the bottom, but the equations have to much space to the equal-sign and they are right-aligned after the equal-sign. The output as an image: 1]

Thus, I googled my problem and found a new solution with the \equation function and I know, that this is not the best way:

 p(x) &=& C \cdot x ^ {- \alpha} \\
 ln(p(x)) &=& ln(C \cdot x ^ {- \alpha})  \\ 
 &=& ln(C)+ln(x ^ {- \alpha}) \\
 ln(p(x)) &=& ln(C) + ln(x) \cdot {- \alpha}

The result looks much better, but I want the counting-number on the bottom. [2]

I asked this question first in Stack Overflow, but don't get an answer (probably I'm too impatient), anyway, I think this is the right place to ask it. Any ideas how to solve this problem? Thanks a lot.

  • Welcome to TEX.SE. First suggestion: isn't $ln$ but $\ln$. – Sebastiano May 29 '18 at 8:47
  • 3
    Just replace &=& (the old eqnarray syntax) by &=. And to ahve the numbering at the bottom use \begin{aligned}[b] instead of split. – campa May 29 '18 at 8:48
  • 5
    the syntax is &= not &=& – David Carlisle May 29 '18 at 8:48
  • Add \usepackage[fleqn,tbtags]{amsmath} into your preamble. – M S May 29 '18 at 8:56

In addition to fixing the syntax error by changing the four instances of &=& to &=, you may also wish to (a) switch from an align environment to a nested pair of equation and aligned environments -- to get rid of the need for all those \nonumber directives -- and (b) write \ln rather than just ln and also use fewer parentheses to declutter the "look" of the equations.

enter image description here

\documentclass{article} % choose a suitable document class
\begin{equation} \label{eq_convert}
\begin{aligned}[b] % "[b]" for bottom alignment of eqn. number
     p(x) &= C x ^ {- \alpha} \\
 \ln p(x) &= \ln(C x ^ {- \alpha}) \\
          &= \ln C +\ln(x ^ {- \alpha})  \\
          &= \ln C - \alpha\ln x 
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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