[Tex/LaTex] Vertical space in longtable

longtablespacing

I have the following table in which I have placed an extra vertical space between the lines.

That space "works" in every line but in some cases it show no effect (space between the derivative and the integral).

Also when I use \hline between the lines then in some cases the formulas intersect with the lines (the derivative with the line under it), which I think that generally shouldn't happen with or without the extra space, and in others there is a lot of vertical space between the lines and the mathematical expressions (the exponential and the line above it).

Why is that happening? How can I fix that?

enter image description here

enter image description here

\documentclass[12pt]{article}

\usepackage{fontspec}

\usepackage[english,greek]{babel}

\usepackage[fleqn]{amsmath}

\usepackage{unicode-math}

\setmainfont
[
  Ligatures=TeX,
  Extension=.otf,
  UprightFont=*,
  BoldFont=*Bold,
  ItalicFont=*It,
  BoldItalicFont=*BoldIt,
  Mapping=tex-text
]{GFSArtemisia}

\setsansfont[Mapping=tex-text]{GFSArtemisia.otf}

%Use of array as @cfr suggested
\usepackage{longtable,array}

\setlength{\extrarowheight}{0.5cm}

\setmathfont{latinmodern-math.otf}

\setmathfont[range=\varnothing]{Asana-Math.otf}

\setmathfont[range=\int]{latinmodern-math.otf}

\newcommand{\ds}{\displaystyle}

\begin{document}

\begin{longtable}[l]{l l}
Time Domain & Frequency Domain\\
$f(t)$ & $F(s)$\\
$f(t-t_{0})$ & $e^{-st_{0}}\cdot F(s)$\\
$e^{s_{0}t}\cdot f(t)$ & $F(s-s_{0})$\\
$\ds \frac{df}{dt}$ & $s\cdot F(s)-f(0)$\\
$\ds \int\limits_{-\infty}^{t}f(t)dt$ & $\ds \frac{1}{s}\cdot F(s)$\\
$f_{1}(t)\ast f_{2}(t)$ & $F_{1}(s)\cdot F_{2}(s)$
\end{longtable}

\end{document}

Best Answer

array allows you to add additional height to the rows of tabulars globally (or locally if you restrict the scope of the command, of course). This helps ensure consistency and makes it easy to adjust the layout if necessary. For example, you can say

\setlength{\extrarowheight}{5mm}

However, I think that you will get better results if you use an environment designed for mathematics rather than trying to squeeze display sized maths into an environment designed for text (with inline maths).

This example is not at all optimal but just to give the idea:

\documentclass[12pt]{article}

\usepackage{fontspec}

\usepackage[fleqn]{amsmath}

\usepackage{unicode-math}

\setmainfont
[
Ligatures=TeX,
Extension=.otf,
UprightFont=*,
BoldFont=*Bold,
ItalicFont=*It,
BoldItalicFont=*BoldIt,
Mapping=tex-text
]{GFSArtemisia}

\setsansfont[Mapping=tex-text]{GFSArtemisia.otf}

\setmathfont{latinmodern-math.otf}

\setmathfont[range=\varnothing]{Asana-Math.otf}

\setmathfont[range=\int]{latinmodern-math.otf}

\newcommand{\ds}{\displaystyle}

\begin{document}


  \begin{align*}
    &\text{Time Domain} & &\text{Frequency Domain}\\
    &f(t) & &F(s)\\
    &f(t-t_{0}) & &e^{-st_{0}}\cdot F(s)\\
    &e^{s_{0}t}\cdot f(t) & &F(s-s_{0})\\
    &\ds\frac{df}{dt} & &s\cdot F(s)-f(0)\\
    &\ds\int\limits_{-\infty}^{t}f(t)dt & &\ds\frac{1}{s}\cdot F(s)\\
    &f_{1}(t)\ast f_{2}(t) & &F_{1}(s)\cdot F_{2}(s)\\
  \end{align*}


\end{document}

maths in <code>align*</code> environment rather than tabular

Related Question