1

I know in order to add the row height in a tabular, there are two quite different ways to do so:

  1. By setting \arraystretch. For example, \renewcommand{\arraystretch}{1.1}. Now, the row height of each row is satisfactory. However, this has the problem that in some critical situation, the lines are crowded.

    \renewcommand{\arraystretch}{1.1}
    \begin{tabular}{|lll|}\hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\\hline
        $c$ & $d$ & $\left\langle\dfrac{1^n}{7}\right\rangle$ \\\hline
    \end{tabular}
    

enter image description here

The third column is crowded. As you may think, why don't I set the \arraystretch bigger? If so:

\renewcommand{\arraystretch}{1.4}
\begin{tabular}{|lll|}\hline
$a$&$b$&$c$\\
$e$&$f$&$g$\\\hline
$i$&$j$&\color{red}{$\left\langle\dfrac{1}{7n}\right\rangle$} \\
$k$&$l$&\color{red}{$\left\langle\dfrac{1^n}{7}\right\rangle$} \\\hline
\end{tabular}

enter image description here

Now the red parts have good line spacing, but the other parts, like the spacing between letter a and e, has exaggerating spacing, too wide.

  1. The second way is by setting \extrarowheight, but it may cause the same problem.

My question: So, can I set something like the \lineskip in paragraph? That is, only when the bottom of the characters in the former line is too closed to the top of some characters in the next line(like my example), it will produce proper extra spacing among these. If such circumstance doesn't occur, the line spacing holds regular.

1 Answer 1

1

In essence, no: any glue between the lines of the tabular will spoil the vertical rules. I’m afraid you need to give individual attention to exceptional lines, by making careful use of the optional argument of the \\ command. Note that this argument specifies the minimum distance between the baselines, so it will become effective only from a certain value up.

Example:

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.

\usepackage{amsmath}



\begin{document}

\begin{center}
    \begin{tabular}{|lll|}
        \hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\[5pt]
        % \hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\[6pt]
        % \hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\[7pt]
        % \hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\[8pt]
        % \hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\[9pt]
        % \hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\
        \hline
    \end{tabular}
\end{center}

\end{document}

Output:

output of the first code sample

Compare this with what you get when you insert some vertical glue between the lines, as in

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.

\usepackage{amsmath}



\begin{document}

\begin{center}
    \begin{tabular}{|lll|}
        \hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\[5pt]
        \noalign{\vskip 2pt}
        % \hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\[6pt]
        % \hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\[7pt]
        % \hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\[8pt]
        % \hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\[9pt]
        % \hline
        $a$ & $b$ & $\left\langle\dfrac{1}{7n}\right\rangle$ \\
        \hline
    \end{tabular}
\end{center}

\end{document}

Here it is:

Output of the second code sample

1
  • Thanks! I see. By the way, does my need make sense, or is such consideration not "correct" in typography? I think manually calculate the line height whenever tall thing occurs is inconvenient. But if there's no other way to do so, as you mentioned, then I will do so. :) Maybe one day there will be a package solves this problem?
    – Eric
    Commented Jun 14, 2017 at 3:06

You must log in to answer this question.

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