1

I have small table where I enter equation (already written in a file). To make the high of the table smaller, I'd like to squeeze the white space above the equation in the table cells more. But all my attempts fail. Here is screen shot

enter image description here

Here is the code

\documentclass[12pt]{article}
\usepackage{breqn}
\usepackage{amssymb,amsmath,amsthm,enumitem}
%\usepackage{array}

\setlength\belowdisplayshortskip{\belowdisplayskip}

%\setlength{\abovedisplayskip}{-3pt} %\setlength{\belowdisplayskip}{-3pt}

\begin{document}

\begin{tabular}{|p{.6in}|p{5in}|}\hline ODE&\begin{gather} \boxed{y^{\prime}-1-2 x=0} \end{gather} With initial conditions $ \begin{aligned} [y \left(0\right) = 3] \end{aligned} $\ \hline program solution& \begin{dmath} y \left(x \right) = x^{2}+x +3 \end{dmath} Verified OK. \ \hline Maple solution&\begin{dmath} y \left(x \right) = x^{2}+x +3
\end{dmath
}\ \hline \end{tabular}

\end{document}

I use lualatex to compile.

How to push these equation up more in order to reduce the overall high of the table? So it shows up something like this (using manual editing)

enter image description here

This way the table is shorter and I can fit more of these on one page. Note that I can't edit the equations themselves as these are already generated externally. I could only edit the table itself and what is around the equations, but not the equations themselves.

Nasser
  • 20,220

1 Answers1

1

There will likely be better answers. But for an easy, inelegant solution I used negative \vspace.

\begin{tabular}{|p{.6in}|p{5in}|}\hline
    ODE& \vspace{-2em}
    \begin{gather*}
        \boxed{y^{\prime}-1-2 x=0}
    \end{gather*}
    With initial conditions
    $
    \begin{aligned}
        [y \left(0\right) = 3]
    \end{aligned}
    $\\ \hline
    program solution&
    \vspace{-1.25em}
    \begin{dmath*}
        y \left(x \right) = x^{2}+x +3
    \end{dmath*}
    Verified OK. \\ \hline
    Maple solution&
    \vspace{-1.25em}
    \begin{dmath*}
        y \left(x \right) = x^{2}+x +3                        
    \end{dmath*}\\ \hline
\end{tabular}

enter image description here

B Hos
  • 305