表格和等宽列下方的下支撑

表格和等宽列下方的下支撑

我想要一个 3×8 的表格,其列宽相等,其下方有两列undebrace(第 3 列和第 4-5 列)文字“符号规则”和“我们必须研究 g 的符号”

\documentclass{article}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{float}
\begin{document}
\begin{table}[H]
\newcommand{\mytab}{\begin{tabular}[c]{@{}c@{}}$+\infty$\\or\\ $-\infty$\end{tabular}}
\centering
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
$0$ &\mytab & \mytab &\mytab & $l\neq 0$& $l$& $l$& $\displaystyle\lim_{x\rightarrow a}f(x)$\\
\hline
$0$ &\mytab & $l^{'}\neq 0$& $0$& $0$& \mytab & $l^{'}\neq 0$&                                            $\displaystyle\lim_{x\rightarrow a} g(x)$\\
\hline
\textcolor{red}{I F}& \textcolor{red}{I F} & \textcolor{red}{\mytab}&\textcolor{red}{\mytab}&\textcolor{red}{\mytab}&\textcolor{red}{$0$}&\textcolor{red}{$\dfrac{l}{l^{'}}$}&$\displaystyle\lim_{x\rightarrow a}\dfrac{f(x)}{g(x)}$\\ 
\hline
\multicolumn{2}{c}{}&\multicolumn{1}{|c|}{signs rules}&\multicolumn{2}{c|}{we must study the 
sign  of $g$} & \multicolumn{3}{c}{}\\
\cline{3-5}
\end{tabular}
\caption{limit of quotion \label{tab2} }
\end{table}
\end{document}        

结果

在此处输入图片描述

有没有什么建议可以做到这一点?

答案1

\documentclass{article}
\usepackage{xcolor}
\usepackage{amsmath,array}
\usepackage{float}
\begin{document}
\begin{table}[H]


\newcommand{\mytab}{\begin{tabular}[c]{@{}c@{}}$+\infty$\\or\\ $-\infty$\end{tabular}}
\centering
\setlength\tabcolsep{2pt}
\hspace*{-1cm}%
\begin{tabular}{@{}|*8{>{\centering\arraybackslash}p{1.4cm}|}@{}}
\hline
$0$ &\mytab & \mytab &\mytab & $l\neq 0$& $l$& $l$& $\displaystyle\lim_{x\rightarrow a}f(x)$\\
\hline
$0$ &\mytab & $l^{'}\neq 0$& $0$& $0$& \mytab & $l^{'}\neq 0$&                                            $\displaystyle\lim_{x\rightarrow a} g(x)$\\
\hline
\textcolor{red}{I F}& \textcolor{red}{I F} & \textcolor{red}{\mytab}&\textcolor{red}{\mytab}&\textcolor{red}{\mytab}&\textcolor{red}{$0$}&\textcolor{red}{$\dfrac{l}{l^{'}}$}&$\displaystyle\lim_{x\rightarrow a}\dfrac{f(x)}{g(x)}$\\ 
\hline
\multicolumn{2}{c}{}&
\multicolumn{1}{c}{\upbracefill}&
\multicolumn{2}{c}{\upbracefill}&
\multicolumn{3}{c}{}\\
\multicolumn{2}{c}{}&
\multicolumn{1}{p{\dimexpr1.4cm+\tabcolsep}}{\centering signs rules}&
\multicolumn{2}{p{\dimexpr2.8cm+2\tabcolsep}}{\centering we must study the sign  of $g$} &
\multicolumn{3}{c}{}\\
\end{tabular}%
\hspace*{-1cm}%

\caption{limit of quotion \label{tab2} }
\end{table}
\end{document} 

答案2

我提出了另外两种解决方案,基于和\underbrace\underbracket来自mathtools)命令定义宏,在我看来,这更令人赏心悦目:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{mathtools}
\usepackage{array, float}

\newcommand{\mytab}{\begin{tabular}[c]{@{}c@{}}$+∞$\\or\\ $-∞$\end{tabular}}
\newcommand\underbracetext[1]{\raisebox{1ex}{\ensuremath{\underbrace{\hphantom{\text{#1}}}_{\text{\normalsize #1}}}}}

\newcommand\underbrackettext[2][0.6pt]{\raisebox{1ex}{\ensuremath{\underbracket[#1]{\hphantom{\text{#2}}}_{\text{\normalsize #2}}}}}

\begin{document}

\begin{table}[H]
\centering
$ \begin{array}{|*{8}{c|}}
\hline
0 &\mytab & \mytab &\mytab & l ≠ 0& l & l & \displaystyle\lim_{x → a}f(x) \\
\hline
 0 &\mytab & l^{'} ≠ 0 & 0 & 0 & \mytab & l^{'} ≠ 0 & \displaystyle\lim_{x → a} g(x) \\
\hline
\text{\color{red}I F}& \text{\color{red}I F} & \textcolor{red}{\mytab}&\textcolor{red}{\mytab}&\textcolor{red}{\mytab}&\textcolor{red}{ 0 }&\textcolor{red}{ \dfrac{l}{l^{'}} }& \displaystyle\lim_{x → a}\dfrac{f(x)}{g(x)} \\
\hline
\multicolumn{2}{c}{}&\multicolumn{1}{c}{\underbracetext{signs rules}}&\multicolumn{2}{c}{\underbracetext{we must study the sign of $g$}}
 \\
\end{array} $
\caption{limit of quotion \label{tab2} }
\end{table}

\begin{table}[H]
\centering
$ \begin{array}{|*{8}{c|}}
\hline
0 &\mytab & \mytab &\mytab & l ≠ 0& l & l & \displaystyle\lim_{x → a}f(x) \\
\hline
 0 &\mytab & l^{'} ≠ 0 & 0 & 0 & \mytab & l^{'} ≠ 0 & \displaystyle\lim_{x → a} g(x) \\
\hline
\text{\color{red}I F}& \text{\color{red}I F} & \textcolor{red}{\mytab}&\textcolor{red}{\mytab}&\textcolor{red}{\mytab}&\textcolor{red}{ 0 }&\textcolor{red}{ \dfrac{l}{l^{'}} }& \displaystyle\lim_{x → a}\dfrac{f(x)}{g(x)} \\
\hline
\multicolumn{2}{c}{}&\multicolumn{1}{c}{\underbrackettext{signs rules}}&\multicolumn{2}{c}{\underbrackettext{we must study the sign of $g$}}
 \\
\end{array} $
\caption{limit of quotion \label{tab2} }
\end{table}

\end{document} 

在此处输入图片描述

相关内容