4

Just wondering if there's a particular way to do the following in LaTeX:

enter image description here

where I've equated a particular part of the main equation to a little equation, given by T and U.

Thanks in advance!

9
  • 1
    Welcome! amsmath provides \underbrace, with usage \underbrace{a^2+b^2+c^2}_{=T}.
    – 1010011010
    May 8, 2015 at 13:03
  • 2
    Related: vertical equal sign May 8, 2015 at 13:05
  • Schrödinger's equation ;-) .. The ^ above the potential operator is out of alignment. It should be over U only
    – user31729
    May 8, 2015 at 13:06
  • @1010011010, thank you, that is exactly what I was looking for! You should post that as an answer. May 8, 2015 at 13:13
  • 1
    @HarrySmith: For the typesetting of the kets you might have a look on the braket package
    – user31729
    May 8, 2015 at 13:15

3 Answers 3

1

This should get you going. I've introduced a few commands to make it easier to typeset some parts of the equations in a more automated way, or if you wish to change something all over the document at once. *They're not strictly necessary for the obtained result.

http://i.imgur.com/70hSYbF.png?1

\documentclass{article}
\usepackage{amsmath,mathtools}
\newcommand\partt[1][]{%
  \ifmmode
    \frac{\partial#1\mathstrut}{\partial t}%
  \fi
}
\newcommand\ChristianHupfer[1]{%
  \ifmmode
    \lvert
      #1%
    \rangle
  \fi
}
\newcommand\rotateequal[1]{%
  \ifmmode
    \underset{#1}{\rotatebox{90}{$=$}}%
  \fi
}
\newcommand\myvector[1]{%
  \ifmmode
    \mathbf#1%
  \fi
}
\newcommand\largemathstrut{%
  \ifmmode
    \frac{\mathstrut}{\mathstrut}
  \fi
}
\begin{document}
\[
i\hbar\partt\ChristianHupfer{\psi(\myvector{r},t)} 
= 
\underbrace{\frac{-\hbar^{2}}{2m}\nabla^2\largemathstrut}_{\rotateequal{T}}\ChristianHupfer{\psi(\myvector{r},t)}
+
\underbrace{\hat{U(\myvector{r})}\largemathstrut}_{\rotateequal{U}}\ChristianHupfer{\psi(\myvector{r},t)}
\]
\end{document}
4
  • \waveleft? ;-) That's a ket state vector
    – user31729
    May 8, 2015 at 13:26
  • @ChristianHupfer Fixed. :-)
    – 1010011010
    May 8, 2015 at 13:31
  • This is a very nice solution. It's a shame the standard \underbrace curly brace symbol is so ugly! May 8, 2015 at 13:45
  • 1
    What's the purpose of \ifmmode in all those definitions? If you use those commands in a wrong place you'll get nothing, instead of a clear error message (Missing $ inserted)
    – egreg
    May 8, 2015 at 15:11
3

Here, I provide \undereq{} to be used in the \underbrace subscript.

\documentclass{article}
\usepackage{amsmath,stackengine,graphicx}
\stackMath
\newcommand\undereq[1]{%
  \stackunder[2pt]{\mkern1mu\rotatebox{90}%
                  {$\scriptstyle=\mkern-3mu$}}{\scriptstyle \mathstrut#1}%
}
\begin{document}
\[
  = \underbrace{\frac{-\hbar^2}{2m}\nabla^2}_{\undereq{T}}\lvert \psi(\mathbf{r},t)...
\]\end{document}

enter image description here

6
  • Although this provides the right formatting for equations, the main body text now overlaps my headers. Is there a way to fix this? May 8, 2015 at 13:29
  • @HarrySmith I'm not sure I understand. When you say "headers," do you mean the stuff at the top of the page? If so, I don't see how this particular implementation could produce that effect. May 8, 2015 at 13:30
  • I am writing using the book class, with the fancyhdr package. It results in this: 1drv.ms/1GToe1a. May 8, 2015 at 13:34
  • @HarrySmith That web site is blocked to me, so I cannot see it. However, using book class, fancyhdr package, with a \pagestyle{fancy} and a \fancyhead{This is a test} does not produce any interference with the header using my MWE. May 8, 2015 at 13:40
  • Hosting shared files on OneDrive is less-than-ideal, haha. This one may work: 1drv.ms/1H3EwqP. However, I tried this solution in a regular document and it worked very nicely -- and the curly brace looks nice, too. I may use this in future documents. Thank you! May 8, 2015 at 13:48
1

A possible better way to set your equation:

\documentclass{article}
\usepackage{amsmath,mathtools}
\usepackage{braket,graphicx}

\newcommand\pder[2][]{%
  \frac{\partial#1\mathstrut}{\partial #2}%
}

\newcommand\roteq{\mathpalette\doroteq\relax}
\newcommand\doroteq[2]{%
  \rotatebox[origin=c]{90}{$#1=$}%
}

\renewcommand\vec[1]{\mathbf{#1}}

\begin{document}

\[
\newcommand{\BF}{\vphantom{\frac{-\hbar^{2}}{2m}\nabla^2}} % just for this equation
i\hbar\pder{t}\ket{\psi(\vec{r},t)} 
= 
\underbrace{\frac{-\hbar^{2}}{2m}\nabla^2}_{\substack{\roteq\\T}}\ket{\psi(\vec{r},t)}
+
\underbrace{\BF\widehat{U(\vec{r})}}_{\substack{\roteq\\U}}\ket{\psi(\vec{r},t)}
\]

\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.