2

In some part of my .tex file,

\begin{align}
\ket{\psi_t}
&= exp(-\frac{i}{\hbar}\int _{t_1}^{t_2} \mathbb{H}(t')dt')\ket{\psi_0}= \{ \mathbb{I} -\frac{i}{\hbar}\int _{0}^{t} \mathbb{H}(t')dt' + \frac{1}{2!}(\frac{i}{\hbar})^2 \int _{0}^{t}dt' \int_{0}^{t} dt_1 \mathbb{H}(t_1)\mathbb{H}(t')- \nonumber \\
& \frac{1}{3!}(\frac{i}{\hbar})^3\int _{0}^{t}dt' \int_{0}^{t} dt_1 \int_{0}^{t} dt_2 \mathbb{H}(t_2) \mathbb{H}(t_1)\mathbb{H}(t') + . . .  \ \} \ket{\psi_0} \nonumber \\
& \ket{\psi_t} - \ket{\psi_0} = \{-\frac{i}{\hbar}\int _{0}^{t} \mathbb{H}(t')dt' + (\frac{i}{\hbar})^2 \int _{0}^{t}dt' \int_{0}^{t'} dt_1 \mathbb{H}(t_1)\mathbb{H}(t')-   (\frac{i}{\hbar})^3\int _{0}^{t}dt' \int_{0}^{t'} dt_1 \int_{0}^{t_1} dt_2 \mathbb{H}(t_2) \mathbb{H}(t_1)\mathbb{H}(t') \nonumber \\ 
& + . . .  \ \} \ket{\psi_0}
\end{align}

gives necessary Alignment, but in just other part:

\begin{align}
\frac{d}{dt}\ket{\psi_t}= -\frac{i}{\hbar}\mathbb{H}(t) 
\{ \mathbb{I} -\frac{i}{\hbar}\int _{0}^{t} \mathbb{H}(t')dt' + \frac{1}{2!}(\frac{i}{\hbar})^2 \int _{0}^{t}dt' \int_{0}^{t} dt_1 \mathbb{H}(t_1)\mathbb{H}(t')- ... \ \} \ket{\psi_0} \nonumber \\
&= -\frac{i}{\hbar}\mathbb{H}(t) \mathcal{O}_{\mathbb{H}}\ket{\psi_0}
\end{align}

ALSO

\begin{align}
h(\textbf{R}_t) \ket{\psi_n (\textbf{R}_t)}= E_n(\textbf{R}_t) \ket{\psi_n (\textbf{R}_t)} \nonumber \\ 
&\implies \braket{\psi_n (\textbf{R}_t)| \psi_m (\textbf{R}_t)}
\end{align}

DOESN'T Align the text, rather shifts towards the right-most part.

I am very new to this Latex, and am finding this slightly troublesome, can somebody please note me what exactly am I missing here? Thank you!

EDIT:

Simply when using &:

Even take this example, it shifts the `abcd` to the right side

\begin{align}
h(\textbf{R}_t) \ket{\psi_n (\textbf{R}_t)}= E_n(\textbf{R}_t) \ket{\psi_n (\textbf{R}_t)} \nonumber \\ 
& abcd
\end{align}

enter image description here

How do I resolve this?

6
  • 2
    The equations align at ampersands (&). You are missing ampersands in the examples that do not align properly. Jul 25 at 10:36
  • Not, but I have used & when I wished to align, but even that doesn't align! That was my question. Jul 25 at 10:42
  • Even take this example, it shifts the abcd to the right side ` \begin{align} h(\textbf{R}_t) \ket{\psi_n (\textbf{R}_t)}= E_n(\textbf{R}_t) \ket{\psi_n (\textbf{R}_t)} \nonumber \\ & abcd \end{align} ` Jul 25 at 10:43
  • I have edited and explicitly added the problem, kindly check please! Jul 25 at 10:47
  • 1
    The correct markup is \mathbf{R} and not \textbf{R}. They seem to produce the same, but try $\textbf{R}$ in the statement of a theorem.
    – egreg
    Jul 25 at 12:30
6

How about this?

\documentclass{book}
\usepackage{amsmath}
\usepackage{physics}
\begin{document}
\begin{align}
     h(\mathbf{R}_t) \ket{\psi_n (\mathbf{R}_t)}
  &= E_n(\mathbf{R}_t) \ket{\psi_n (\mathbf{R}_t)} \nonumber\\
  &= abcd
\end{align}
\begin{align}
  & h(\mathbf{R}_t) \ket{\psi_n (\mathbf{R}_t)}
    = E_n(\mathbf{R}_t) \ket{\psi_n (\mathbf{R}_t)} \nonumber\\
  & abcd
\end{align}
\end{document}

enter image description here

6
  • Thanks for the answer! But can I not start this from the leftmost side again? Jul 25 at 11:03
  • 1
    @prikarsartam If you want to align the lines at the left end of the line, place the ampersands at the beginning of each line. Jul 25 at 11:14
  • 1
    @prikarsartam, yes you can. As pointed out by N. F. Taussig above, you just move the ampersand of the first line to the place that you want the second line to align to. I just changed my answer to show both cases.
    – citsahcots
    Jul 25 at 11:24
  • 2
    \mathbf, not \textbf. Don't confuse them.
    – egreg
    Jul 25 at 12:29
  • 1
    @egreg, you are absolutely right. I have made the correction.
    – citsahcots
    Jul 25 at 12:33
3

I have used braket package instead of physics package. Here I add an alternative with a few small differences.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{braket}
\begin{document}
\[
\begin{aligned}
     h(\mathbf{R}_t) \ket{\psi_n (\mathbf{R}_t)}
  &= E_n(\mathbf{R}_t) \ket{\psi_n (\mathbf{R}_t)}\\
  &= abcd\\[1cm]
  h(\mathbf{R}_t) \ket{\psi_n (\mathbf{R}_t)}
    & = E_n(\mathbf{R}_t) \ket{\psi_n (\mathbf{R}_t)}\\
  abcd &
\end{aligned}
\]
\end{document}

The snapshot is:

enter image description here

2
  • 1
    thank you very much @Sebastiano for the answer, but I used \begin{split} \end{split} and it worked fine! Jul 26 at 9:15
  • 1
    @prikarsartam Don't worry absolutely. I have given to you an alternative :-). Regards.
    – Sebastiano
    Jul 26 at 10:53

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.