Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a long expression coming from using \underbrace. It is causing the equation to look, for lack of a better adjective, strange. Here is the entire equation:

\begin{equation}
  \frac{1}{2}g^{\mu\nu}\dm\phi\dn\phi = \frac{1}{2}\left[
    \underbrace{g^{0\nu}\d_0\phi\dn\phi}_{g^{00}\d_0\phi\d_0\phi+
      \cancel{g^{01}}\d_0\phi\d_1\phi+\cancel{g^{02}}\d_0\phi\d_2\phi+
      \cancel{g^{03}}\d_0\phi\d_3\phi}+
    g^{1\nu}\d_1\phi\dn\phi+g^{2\nu}\d_2\phi\dn\phi
    + g^{3\nu}\d_3\phi\dn\phi\right]
\end{equation}

This is what it looks like: Equation

Is it possible to have an arrow come from the underbrace towards somewhere else under the equation so the main equation does not have to accommodate for the length of the expression beneath the underbrace?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You can use \mathclap (or \mathrlap) from the mathtools package:

\documentclass[11pt, letterpaper]{article}
\usepackage{mathtools}
\usepackage{cancel}

\newcommand\dn{\mathrm{d}\, n}
\newcommand\dm{\mathrm{d}\, m}
\def\d{\mathrm{d}}% Don't do this

\begin{document}

\begin{equation}
  \frac{1}{2}g^{\mu\nu}\dm\phi\dn\phi = \frac{1}{2}\bigl[\,
    \underbrace{g^{0\nu}\d_0\phi\dn\phi}_{\mathclap{g^{00}\d_0\phi\d_0\phi+
      \cancel{g^{01}}\d_0\phi\d_1\phi+\cancel{g^{02}}\d_0\phi\d_2\phi+
      \cancel{g^{03}}\d_0\phi\d_3\phi}}+
    g^{1\nu}\d_1\phi\dn\phi+g^{2\nu}\d_2\phi\dn\phi
    + g^{3\nu}\d_3\phi\dn\phi\bigr]
\end{equation}

\begin{equation}
  \frac{1}{2}g^{\mu\nu}\dm\phi\dn\phi = \frac{1}{2}\bigl[\,
    \underbrace{g^{0\nu}\d_0\phi\dn\phi}_{\mathrlap{g^{00}\d_0\phi\d_0\phi+
      \cancel{g^{01}}\d_0\phi\d_1\phi+\cancel{g^{02}}\d_0\phi\d_2\phi+
      \cancel{g^{03}}\d_0\phi\d_3\phi}}+
    g^{1\nu}\d_1\phi\dn\phi+g^{2\nu}\d_2\phi\dn\phi
    + g^{3\nu}\d_3\phi\dn\phi\bigr]
\end{equation}

\end{document}

enter image description here

I didn't had the original definitions for \dn and \dm so I provided some definitions for the example. From your code, it seems that you are also redefining \d (as I did in my example to reproduce the result); please choose a different name, since \d is an already existing command.

share|improve this answer
    
Probably he/she has \renewcommand{\d}{\partial} \newcommand{\dm}{\partial_{\mu}} \newcommand{\dn}{\partial_{\nu}} –  karlkoeller Jun 20 '13 at 19:21
    
@karlkoeller probably, yes, except for \renewcommand\d{...}; he must have \def\d{...}; otherwise, an error is triggered. –  Gonzalo Medina Jun 20 '13 at 19:22
    
I tried the above MWE with \renewcommand{\d}{\partial} and I have no errors. Why should it occur? –  karlkoeller Jun 20 '13 at 19:26
    
@karlkoeller sorry; I thought you had \newcommand\d{...}. Using \nenewcommand\d{...} doesn't produce errors, but it's not correct, since \d is a basic command to produce an accent (a little dot below the argument). –  Gonzalo Medina Jun 20 '13 at 19:29
    
I have this: \def\d{\partial} \def\dm{\partial_{\mu}} \def\dn{\partial_{\nu}} with no errors. –  dougphy Jun 20 '13 at 19:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.