1

I am having trouble to make a box with this long equation and at the same time put a number in it. All I want is to remove that blank space below the equation short before the line of text. The equation is this

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{tensor}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage{lipsum}

\usepackage{scalerel}%scale things
\geometry{
    paper=a4paper, % Change to letterpaper for US letter
    inner=2.5cm, % Inner margin
    outer=3.7cm, % Outer margin
    bindingoffset=.5cm, % Binding offset
    top=1.5cm, % Top margin
    bottom=1.5cm, % Bottom margin
%   showframe, % Uncomment to show how the type block is set on the page
}

\usepackage{empheq}%Boxes in Align
\newcommand*\widefbox[1]{\fbox{\hspace{2em}#1\hspace{2em}}}
\newcommand{\T}[2]{\tensor{#1}{#2}}%fortensors
\newcommand{\Te}[3]{\tensor*{#1}{^{\scaleto{(#2)}{6pt}}#3}}
\newcommand{\h}[2]{\tensor*{h}{^{\scaleto{(#1)}{6pt}}#2}}

\begin{document}
\begin{empheq}[box=\fbox]{align}
\Te{G\left[\h{1}{_a_b}\right]}{2}{_a_b}&=\frac{1}{2}\left\lbrace\h{1}{^c^d}\left[\tensor{\tilde{\nabla}}{_a}\tensor{\tilde{\nabla}}{_b}\h{1}{_c_d}+\tensor{\tilde{\nabla}}{_c}\tensor{\tilde{\nabla}}{_d}\h{1}{_a_b}-2\tensor{\tilde{\nabla}}{_c}\tensor{\tilde{\nabla}}{_(_a}\h{1}{_b_)_d}\right]\right.\\
&\qquad+\left[\frac{1}{2}\tensor{\tilde{\nabla}}{_a}\h{1}{^c^d}\tensor{\tilde{\nabla}}{_b}\h{1}{_c_d}\right.+\left(\frac{1}{2}\tensor{\tilde{\nabla}}{^c}\h{1}{}-\tensor{\tilde{\nabla}}{_d}\h{1}{^c^d}\right)\left(2\tensor{\tilde{\nabla}}{_(_a}\h{1}{_b_)_c}-\tensor{\tilde{\nabla}}{_c}\h{1}{_a_b}\right)\notag\\
&\qquad\left.\left.+\tensor{\tilde{\nabla}}{_c}\h{1}{_b_d}\left(\tensor{\tilde{\nabla}}{^c}\h{1}{_a^d}-\tensor{\tilde{\nabla}}{^d}\h{1}{_a^c}\right)
\right]\right\rbrace\notag\\
&\quad -\frac{1}{4}\T{\tilde{g}}{_a_b}\left\lbrace\T{\tilde{\nabla}}{^c}\h{1}{_c_d}\T{\tilde{\nabla}}{^d}\h{1}{}-\T{\tilde{\nabla}}{_c}\h{1}{_d_f}\T{\tilde{\nabla}}{^f}\h{1}{^c^d}+\frac{3}{2}\T{\tilde{\nabla}}{^c}\h{1}{^d^f}\T{\tilde{\nabla}}{_c}\h{1}{_d_f}-\frac{1}{2}\T{\tilde{\nabla}}{^c}\h{1}{}\T{\tilde{\nabla}}{_c}\h{1}{}\right.\notag\\
& \qquad\qquad\left.-2\T{\tilde{\nabla}}{_c}\h{1}{^c^d}\T{\tilde{\nabla}}{^f}\h{1}{_d_f}+\h{1}{^c^d}\left[\T{\tilde{\nabla}}{^f}\T{\tilde{\nabla}}{_f}\h{1}{_c_d}+\T{\tilde{\nabla}}{_c}\T{\tilde{\nabla}}{_d}\h{1}{}-2\T{\tilde{\nabla}}{_c}\T{\tilde{\nabla}}{^f}\h{1}{_f_d}\right]\right\rbrace.\notag
\end{empheq}
\lipsum

\end{document}

the command \T{}{} stands for \tensor{}{}. Too much white space

10
  • 1
    Please -- as usual here -- make your code snippet compilable, then we do not have to guess what you are doing ...
    – Mensch
    Jul 4 '19 at 3:53
  • 2
    For starters, do tell us which document class you employ and which packages you load.
    – Mico
    Jul 4 '19 at 3:59
  • 4
    And how is \Te defined? Do please make your document compilable. It's absolutely discouraging to be asked to debug a multi-line equation that won't even compile.
    – Mico
    Jul 4 '19 at 4:26
  • 1
    Even if one \usepackage{scalerel} to the preamble of your document such that it runs through your screen shot does not get reproduced. Why can't you (a) upload an MWE that you have tested before and (b) attach the screen shot of that MWE (rather than something else)? There are now at least 4 users that are stumbling over this.
    – user121799
    Jul 4 '19 at 5:33
  • 5
    Your updated code still doesn't compile. E.g., how is \scaleto defined? Just in case this isn't clear: This site is not some kind of debugging service. If you hope to get usable answers, it is therefore very much in your own interest to provide usable input.
    – Mico
    Jul 4 '19 at 5:51
2

I would reorganize equations such, that each line become a little bit shorter. In this I would use macro \MoveEqLeft from the package mathtools:

\documentclass{article}

\usepackage{tensor}
\usepackage{mathtools}
\usepackage{geometry}
\usepackage{lipsum}

\usepackage{scalerel}%scale things
\geometry{
    paper=a4paper, % Change to letterpaper for US letter
    inner=2.5cm, % Inner margin
    outer=3.7cm, % Outer margin
    bindingoffset=.5cm, % Binding offset
    top=1.5cm, % Top margin
    bottom=1.5cm, % Bottom margin
   showframe, % Uncomment to show how the type block is set on the page
}

\usepackage{empheq}%Boxes in Align
\newcommand*\widefbox[1]{\fbox{\hspace{2em}#1\hspace{2em}}}
\newcommand{\T}[2]{\tensor{#1}{#2}}%fortensors
\newcommand{\Te}[3]{\tensor*{#1}{^{\scaleto{(#2)}{6pt}}#3}}
\newcommand{\h}[2]{\tensor*{h}{^{\scaleto{(#1)}{6pt}}#2}}

\begin{document}
\begin{empheq}[box=\fbox]{align}
    \MoveEqLeft
\Te{G\Bigl[\h{1}{_a_b}\Bigr]}{2}{_a_b} = 
    \frac{1}{2}\Bigl\lbrace\h{1}{^c^d}
    \Bigl[\tensor{\tilde{\nabla}}{_a}
          \tensor{\tilde{\nabla}}{_b}\h{1}{_c_d} + 
          \tensor{\tilde{\nabla}}{_c}
          \tensor{\tilde{\nabla}}{_d}\h{1}{_a_b} - 2\tensor{\tilde{\nabla}}{_c}
          \tensor{\tilde{\nabla}}{_(_a}\h{1}{_b_)_d}\Bigr]  \notag  \\
& + \Bigl[\frac{1}{2}
          \tensor{\tilde{\nabla}}{_a}\h{1}{^c^d}
          \tensor{\tilde{\nabla}}{_b}\h{1}{_c_d} + 
          \Bigl(\frac{1}{2}\tensor{\tilde{\nabla}}{^c}\h{1}{} - 
          \tensor{\tilde{\nabla}}{_d}\h{1}{^c^d}\Bigr)
          \Bigl(2\tensor{\tilde{\nabla}}{_(_a}\h{1}{_b_)_c} -
          \tensor{\tilde{\nabla}}{_c}\h{1}{_a_b}\Bigr)     \notag  \\
& + \tensor{\tilde{\nabla}}{_c}\h{1}{_b_d}
          \Bigl(\tensor{\tilde{\nabla}}{^c}\h{1}{_a^d} -
          \tensor{\tilde{\nabla}}{^d}\h{1}{_a^c}\Bigr)\Bigr]\Bigr\rbrace    \\
& - \frac{1}{4}\T{\tilde{g}}{_a_b}
    \Bigl\lbrace\T{\tilde{\nabla}}{^c}\h{1}{_c_d}\T{\tilde{\nabla}}{^d}\h{1}{}-
    \T{\tilde{\nabla}}{_c}\h{1}{_d_f}\T{\tilde{\nabla}}{^f}\h{1}{^c^d}+
    \frac{3}{2}\T{\tilde{\nabla}}{^c}\h{1}{^d^f}\T{\tilde{\nabla}}{_c}\h{1}{_d_f}- 
    \frac{1}{2}\T{\tilde{\nabla}}{^c}\h{1}{}\T{\tilde{\nabla}}{_c}\h{1}{} \notag  \\
& - 2\T{\tilde{\nabla}}{_c}\h{1}{^c^d}\T{\tilde{\nabla}}{^f}\h{1}{_d_f} +    
    \h{1}{^c^d}
    \Bigl[\T{\tilde{\nabla}}{^f}\T{\tilde{\nabla}}{_f}\h{1}{_c_d} +
    \T{\tilde{\nabla}}{_c}\T{\tilde{\nabla}}{_d}\h{1}{} -
    2\T{\tilde{\nabla}}{_c}\T{\tilde{\nabla}}{^f}\h{1}{_f_d}\Bigr]\Bigr\rbrace. \notag
    \end{empheq}
\lipsum[11]

\end{document}

enter image description here

0
0

Something like this:

\begin{empheq}[box=\fbox]{align*}%use an asterix after align
...
\end{empheq}
\begin{equation}%used to create a tag below the box
\end{equation}
\lipsum

The other way to solve this problem is to somehow decrease the width of your formula so your formula and it's tag could fit into \textwidth.

-1

As @egreg has pointed out in the comments the problem is due to the equation number that needs to be added. To fix this just use align* instead of align in the line \begin{empheq}[box=\fbox]{align} as suggested by @NuncTorUs. This was not explicit in the answer, hence I wrote this one.

1
  • 1
    Sory, but my answer has numbered of equations! Your claims are false.
    – Zarko
    Aug 17 at 17:25

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.