4

How can I enlarge the space between the horizontal line and the equation

\begin{table}[H]
\centering
\begin{center}
\begin{equation}
\begin{tabular}{|c|}
\hline
$
\begin{aligned}
\sum_n \frac{1}{a+n^2}=A(a)\\
\end{aligned}
$
\\ [0.1ex]
 \hline
\end{tabular}
\end{equation}
\end{center}
\end{table}

1 Answer 1

7

There are several things that you should remove.

  1. table is useless here;
  2. center adds unwanted vertical space;
  3. and more.

The equation environment already centers its contents and leaves some vertical space. You don't need more and \boxed is your friend here.

\documentclass{article}
\usepackage{amsmath}

\usepackage{lipsum} % for context

\begin{document}

\lipsum[1][1-3]
\begin{equation}
\boxed{
  \sum_n \frac{1}{a+n^2}=A(a)
}
\end{equation}
\lipsum[2][1-3]

\end{document}

enter image description here

You might want to make your own version of \boxed where you can specify a different padding.

\documentclass{article}
\usepackage{amsmath}

\usepackage{lipsum} % for context

\newcommand{\Boxed}[2][\fboxsep]{%
  \begingroup
  \setlength{\fboxsep}{#1}%
  \boxed{#2}%
  \endgroup
}

\begin{document}

\lipsum[1][1-3]
\begin{equation}
\Boxed{
  \sum_n \frac{1}{a+n^2}=A(a)
}
\end{equation}
\lipsum[2][1-3]
\begin{equation}
\Boxed[6pt]{
  \sum_n \frac{1}{a+n^2}=A(a)
}
\end{equation}
\lipsum[3][1-3]

\end{document}

enter image description here

You must log in to answer this question.

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