2

Say that for example I have the following set of equations for which I want to use overset to clarify what equations are used:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
V &\overset{def}{=}           & R(\delta) \\
  &\overset{ \{ 1.2.3 \} }{=} & \sum_{a} \delta(a) R(a)
\end{align*}

\end{document} 

Of course, in the real document I'd use a reference instead of hardcoding the equation number. I know that I can use \hphantom to overset an equals-sign with whitespace, but that does not work here as the first equals-sign is already overset with 'def'.

Am I better off creating a separate column for the equals-signs, or is there a way to force column width in align environment that I'm unfamiliar with?

1 Answer 1

2

There's a considerable difference in the widths of the terms \overset{def}{=} and \overset{ \{ 1.2.3 \} }{=}. (Aside: Is the second term for real?!) A straightforward way to achieve decent alignment of the elements is to use an array environment. Incidentally, I would also suggest that you create dedicated macros for the terms above.

enter image description here

\documentclass{article}
\usepackage{amsmath}  % for "align" environment
\newcommand\defeq{\mathrel{\overset{\textnormal{def}}{=}}}
\newcommand\numeq{\mathrel{\overset{ \{ 1.2.3 \} }{=}}}
\setlength\textwidth{2.5in} %% just for this example
\begin{document}
Before:
\begin{align*}
   V &\defeq R(\delta) \\
     &\numeq \delta(a) R(a)
\end{align*}

New:
\[ \renewcommand\arraystretch{1.5} % mimic wider spacing of align environment
\begin{array}{@{} r@{}c@{}l @{}}
   V & \defeq     & R(\delta) \\
     & {}\numeq{} & \delta(a) R(a)
\end{array}
\]
\end{document}
1
  • I suspected align would not be the best environment to solve this problem. Thanks (and you're right, they should be macro's). It's a mock example, the terms are made up. Oct 25, 2014 at 14:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .