6

How can I improve brakets in this equation please?

\begin{equation}\label{E}
E_0^{(1)} = \expval{\frac{e'^2}{|\vec{r_1}-\vec{r_2}|}}{\Phi}
\end{equation}

enter image description here

EDIT: And please, what is wrong here? I think that in the end should be {\Phi }\, but it is mistake by compilation.

\documentclass{article}
\usepackage{physics}
\begin{document}
\begin{equation}\label{E}
E_0^{(1)} = 4 \pi e'^2 \expval**{\frac{1}{|\vec{r}_2|} \sum\limits_{l=0}^{\infty} \sum\limits_{m=-l}^l \left(\frac{|\vec{x}^{(1)}|}{|\vec{x}^{(2)}|} \right)^l \Phi }\\
\end{equation}
\end{document}
  • 3
    \left...\right? P.S. I usually write \vec{r}_1 because of space. – manooooh Nov 9 '18 at 19:36
  • 4
    Please provide a compilable example. Where does the \expval command come from? – Phelype Oleinik Nov 9 '18 at 19:37
  • 1
    Off-topic: One should probably write \vec{r}_1 instead of \vec{r_1}, and \vec{r}_2 instead of \vec{r_2}. – Mico Nov 9 '18 at 20:04
  • 1
    Instead of editing an existing query to pose what's essentially a new question, you should post a new query. – Mico Nov 9 '18 at 20:07
8

If you're using the physics package, then it looks like you have to pass two * arguments to \expval to allow it to auto-resize the brackets.

As for your second equation, it is missing an argument. You had \expval**{stuff \Phi}, but you need to provide another argument: \expval**{stuff}{\Phi}.

\documentclass{article}
\usepackage{physics}
\begin{document}
\begin{equation}\label{E}
E_0^{(1)} = \expval**{\frac{e'^2}{|\vec{r}_1-\vec{r}_2|}}{\Phi}
\end{equation}
\begin{equation}\label{E2}
E_0^{(1)} = 4 \pi e'^2 \expval**{\frac{1}{|\vec{r}_2|} \sum_{l=0}^\infty \sum_{m=-l}^l \left(\frac{|\vec{x}^{(1)}|}{|\vec{x}^{(2)}|} \right)^l}{\Phi}
\end{equation}
\end{document}

enter image description here

  • Please, can I have one more question - I editted my origin question. – Elisabeth Nov 9 '18 at 20:08
  • 1
    @Elisabeth The solution was simple, so I also updated my answer. If you happen to have more problems it's advisable, as Mico said, to ask a new question instead of editing an old question. – Phelype Oleinik Nov 9 '18 at 20:10
  • You should definitely remove the double-backslash stuff at the end of the equation environments. Also, the \limits directives are redundant; all they do is create code clutter. – Mico Nov 9 '18 at 20:12
  • 1
    @Mico Oops, I forgot those there. Thanks for pointing it out :-) – Phelype Oleinik Nov 9 '18 at 20:15
9

I do not know where \expval comes from but with braket you could do

\documentclass{article}
\usepackage{amsmath}
\usepackage{braket}
\begin{document}
\begin{equation}\label{E}
E_0^{(1)} = \Braket{\Phi | \frac{e'^2}{\left|\vec r_1 - \vec r_2\right|} | \Phi}
\end{equation}
\end{document}

enter image description here

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.