4

In the following code, how do I align the n's?

Here is the MWE:

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
n \propto exp(-U/kT) \notag \\
\Rightarrow \quad n  = A.exp(-U/kT) \notag
\end{align}
\end{document}

7

Something like this. Put & right after n's.

Update: commented by barbara beeton. Thanks.

enter image description here

Code

\documentclass[12pt]{article}
\usepackage[paper size={10cm,3cm}]{geometry}
\usepackage{amsmath}
\begin{document}
\begin{align}
n& \propto \exp(-U/kT) \notag \\
\Rightarrow \quad n&  = A \exp(-U/kT) \notag  
\end{align}
\end{document}
|improve this answer|||||
  • I would change \Rightarrow to \implies. – Manuel Jul 19 '14 at 10:27
  • @Manuel -- Thanks for the suggestion, mcuh appreciated. A link tex.stackexchange.com/q/47063/34618 for the OP to make his/her decision. – Jesse Jul 19 '14 at 10:51
  • 1
    the exp should really be roman. \exp is already provided by amsmath as an operator name, which should do the right thing. – barbara beeton Jul 19 '14 at 13:24
  • @barbarabeeton -- Much appreciated. Corrected accordingly. – Jesse Jul 19 '14 at 13:28
4
\documentclass[preview,border=12pt,12pt]{standalone} % please change it back to your article class below
%\documentclass[12pt]{article}
\usepackage{amsmath}


\begin{document}
\abovedisplayskip=0pt\relax% don't use this line in your production
\begin{align*}
n                   & \propto \exp(-U/kT)  \\
\Rightarrow \quad n &= A \exp(-U/kT)   
\end{align*}
\end{document}

enter image description here

|improve this answer|||||
  • 1
    What is the difference between this and Jesse's answer? – Manuel Jul 19 '14 at 10:27
  • @Manuel This answer makes the alignment at the proportional and equals signs, rather than at the ns, which is standard practice: if the relations didn't have the same RHSs, the difference would be more noticeable. – ChrisS Jul 19 '14 at 10:48
  • @Manuel: \exp and exp is one of the differences. – kiss my armpit Jul 19 '14 at 10:56
  • @ChrisS And so does Jesse's. Pleasedon'ttouch true, I missed that one ;) – Manuel Jul 19 '14 at 10:56

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.