1

I am trying to create a table, but inside has some mathematical fractions which is too wide for the table.

Originally I used arraystretch 1.4, the vertical space is too tight. So I wanted to stretch wider.

enter image description here

When I used 2.4, the problem is that it is not vertically aligned anymore.

enter image description here

The problem might not seem apparent in this, so when I increase further to 4, it is even less vertically aligned.

enter image description here

Can someone help me understand and find the correct solution? Thanks in advance.

PS: Incidentally, I use LuaLaTeX as the default compiler.

\documentclass[twoside,14pt]{extarticle}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}m{#1}}

\usepackage{amsmath}

\begin{document}

    \renewcommand{\arraystretch}{2.4}
    \setlength\tabcolsep{1.5\tabcolsep}
    \setlength\arrayrulewidth{1.5pt}
    \begin{center}
        \begin{tabular}{!{\vrule width 1.5pt} L{75mm} !{\vrule width 1.5pt} L{75mm} !{\vrule width 1.5pt}}
            \hline
            As $\displaystyle f\left(x\right) \rightarrow +\infty$, & $\displaystyle \dfrac{1}{f\left(x\right)} \rightarrow$
            \\ \hline
        \end{tabular}
    \end{center}    

\end{document}
2

The cellspace ensures a minimal vertical padding of cells in columns with specifier prefixed with the letter S (or C if you load siunitx). This works better with the pcolumn type, for some reason:

\documentclass[twoside,14pt]{extarticle}

\usepackage{array}
\usepackage{cellspace}
\setlength{\cellspacetoplimit}{8pt}
\setlength{\cellspacebottomlimit}{8pt}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}S{p{#1}}}

\usepackage{amsmath}

\begin{document}

    \setlength\tabcolsep{1.5\tabcolsep}
    \setlength\arrayrulewidth{1.5pt}
    \begin{center}
        \begin{tabular}{!{\vrule width 1.5pt} L{75mm} !{\vrule width 1.5pt} L{75mm} !{\vrule width 1.5pt}}
            \hline
            As $\displaystyle f\left(x\right) \rightarrow +\infty$, & then $\displaystyle \dfrac{1}{f\left(x\right)} \rightarrow$
            \\ \hline
        \end{tabular}
    \end{center}

\end{document}

enter image description here

  • @James If this answer helps you, consider accepting it by clicking the checkmark on the left of the answer. If you have already done so, flag this comment as no longer needed. – user156344 Apr 20 '19 at 7:53
2

with macro \makegapedcells from the makecell pacakege. after removing all unnecessary code from your mwe the code of mwe is:

\documentclass[twoside,14pt]{extarticle}
\usepackage{array,
            makecell}   % new
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}

\usepackage{amsmath}

\begin{document}
    \begin{center}
\setlength\tabcolsep{1.5\tabcolsep}
\setlength\arrayrulewidth{1.5pt}
\setcellgapes{5pt}
\makegapedcells
    \begin{tabular}{| L{75mm} |  L{75mm} |}
        \hline
        As $f(x) \rightarrow +\infty$, & then $\dfrac{1}{f(x)} \rightarrow$ \\
        \hline
    \end{tabular}
    \end{center}
\end{document}

enter image description here

note: this solution doesn't works with m columns type!

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.