如何拆分表格并使文本居中

如何拆分表格并使文本居中

你能帮我一下吗?我需要把这个表格放到我的文件中,但它不能被破坏,而且会导致公式触及单元格的边缘。我希望公式在单元格中居中(公式在左侧),并且我希望单元格的尺寸相等。非常感谢。

\documentclass{book}  
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath, mathtools, amsthm, amssymb}

\begin{document}
    \begin{tabular}{|l|l|}
        \hline 
        $y = \text{ costante }$& $y' = 0$\\
        \hline
         $y=x$   &  $ y' = 1$\\
        \hline
        $y=x^{m} $     &  $y' = mx ^{m-1} $\\
        \hline
        $ y= \displaystyle\frac{1}{x^{n} }  $ & $y'=- \displaystyle\frac{n}{x^{n+1} } $\\
        \hline   
        $ y = \displaystyle \frac{1}{x}  $ & $ y' = \displaystyle\frac{1}{x^2 }  $\\
        \hline 
        $ y = \sqrt{n}{x} $ & $ y' = \displaystyle\frac{1}{n \sqrt{n}{x ^{n-1} }}  $\\
        \hline 
        $ y = \sqrt{}{x} $ & $ y' = \displaystyle\frac{1}{2 \sqrt{}{x}}  $\\
        \hline 
        $ y = \displaystyle\frac{1}{\sqrt{}{x}} $ & $ - \displaystyle\frac{1}{2x \sqrt{}{x}}  $\\
        \hline 
        $ y = \sqrt{n}{x ^{m} } $ & $ \displaystyle\frac{m}{n \sqrt{n}{x ^{n-m} }} $ \\
        \hline 
        $ y= \displaystyle\frac{1}{\sqrt{n}{x ^{m} }} $ & $ - \displaystyle\frac{m}{nx \sqrt{n}{x ^{m} }} $\\ 
        \hline 
        $ y = \sin_{}^{} (x) $ & $ y' = \cos_{}^{} (x)  $ \\
        \hline 
        $ y = \cos_{}^{} (x) $ & $y' = - \sin_{}^{} (x)  $ \\
        \hline 
        $ y = \tan_{}^{} (x) $ & $ y' = \displaystyle\frac{1}{\cos_{}^{2} (x) }= 1 + \tan_{}^{2} (x)  $ \\
        \hline 
        $ y = \cot_{}^{} (x) $ & $ y'= \displaystyle\frac{1}{\sin_{}^{2} (x) } = 1 - \cot_{}^{2} (x) $\\
        \hline 
        $ y = \sinh_{}^{} (x) $ & $ y'= \cosh_{}^{} (x) $ \\
        \hline 
        $ y = \cosh_{}^{} (x) $ & $ y' =  \sinh_{}^{} (x) $ \\
        \hline 
        $ y = \tanh_{}^{} (x) $ & $ y'= \displaystyle\frac{1}{\cosh_{}^{2} (x) } = 1- \tanh_{ }^{2} (x) $ \\
        \hline 
        $ y = \coth_{}^{} (x) $ & $ y' = \displaystyle\frac{1}{\sinh_{}^{2} (x) }= 1- \coth_{}^{2} (x)  $\\
        \hline 
        $ y =  \mbox{arccosh}_{}^{} (x)  $ & $ y' = \displaystyle\frac{1}{\sqrt{}{x ^2  -1}}  $\\
        \hline 
        $ y = \mbox{arcsinh}_{}^{} (x)  $ & $ y' = \displaystyle\frac{1}{\sqrt{}{x ^2  + 1}} $\\
        \hline 
            $y =  \mbox{arctanh}_{}^{} (x)$&$y'= \displaystyle\frac{1}{1- x ^2 }$\\
        \hline 
            $y = \log_{a}^{} (x)$&$y' = \displaystyle\frac{1}{x} \log_{a}^{} (e) = \displaystyle\frac{1}{x \ln^{} (a) }  $\\
        \hline 
            $y = \ln^{} (x) $&$y'= \displaystyle\frac{1}{x} $\\
        \hline
            $y = a ^{x} $&$y'= a ^{x} \log_{}^{} (a)$\\
        \hline 
            $y = e^{x} $&$y' = e^{x}$ \\
        \hline
            $y = e^{-x}$&$ y' = - e^{-x} $\\
        \hline
            $y = \arcsin_{}^{} (x)$& $y'= \frac{1}{\sqrt{}{a- x ^2 }}$\\
        \hline 
            $y = \arccos_{}^{} (x) $&$- \displaystyle\frac{1}{\sqrt{}{1- x ^2 }}$\\
        \hline
            $y = \arctan_{}^{} (x) $&$ y'= \displaystyle\frac{1}{1 + x^2 }$\\
        \hline
            $ y =   \mbox{arccot}_{}^{} (x) $     & $- \displaystyle\frac{1}{1 + x ^2 }   $\\
        \hline   
\end{tabular}
\end{document}

答案1

  • 你的表格很长,所以应该是长表类型,可以跨越两页
  • 由于表格很窄,您可以考虑将其分成两个平行的部分,以便放在一页上。
  • 对于等高单元格,我建议使用tabularray包,它可以简单地定义行高
  • 我将从列中删除y =y' =插入列标题。

如果使用长表,结果可能是:

在此处输入图片描述

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{amssymb}

\usepackage{tabularray}
\UseTblrLibrary{amsmath}
\DeclareMathOperator{\arccosh}{arccosh}
\DeclareMathOperator{\arcsinh}{arcsinh}
\DeclareMathOperator{\arctanh}{arctanh}

\begin{document}
    \begin{longtblr}[
    label=none,
    entry=none,    
                    ]{hlines, vlines,
                     colspec={Q[c, mode=dmath] Q[c, mode=dmath]},
                     rowsep=3pt,
                     row{2-Z} = {ht=2\baselineskip},
                     rowhead=1
                     }
y                       &   y'                      \\
\text{ costante }   &   0                           \\
y=x                     &   1                       \\
y=x^{m}                 &   mx^{m-1}                \\
\frac{1}{x^{n} }    &   y'c = - \frac{n}{x^{n+1}}   \\
 \frac{1}{x}        &   \frac{1}{x^2 }              \\
\sqrt{n}{x}         &   \frac{1}{n \sqrt{n}{x^{n-1} }}  \\
\sqrt{}{x}          &   \frac{1}{2 \sqrt{}{x}}      \\
\frac{1}{\sqrt{x}}  &   -\frac{1}{2x \sqrt{x}}      \\
\sqrt{n}{x ^{m} }   &  \frac{m}{n \sqrt{n}{x ^{n-m} }}  \\
\frac{1}{\sqrt{n}{x^{m} }}  
                    &  - \frac{m}{nx \sqrt{n}{x ^{m} }} \\
\sin (x)            &   \cos(x)                     \\
\cos (x)            &   -\sin(x)                    \\
\tan (x)            &   \frac{1}{\cos^{2}(x) } = 1 + \tan^{2}(x)    \\
\cot (x)            &   \frac{1}{\sin^{2}(x) } = 1 - \cot^{2}(x)    \\
\sinh (x)           &   \cosh(x)                    \\
\cosh (x)           &   \sinh(x)                    \\
\tanh (x)           &   \frac{1}{\cosh^{2}(x) } = 1- \tanh^{2} (x)  \\
\coth (x)           &   \frac{1}{\sinh^{2}(x) }= 1- \coth^{2} (x)   \\
\arccosh(x)         &   \frac{1}{\sqrt{}{x^2 - 1}}  \\
\arcsinh(x)         &   \frac{1}{\sqrt{}{x^2 + 1}}  \\
\arctanh(x)         &   \frac{1}{1 - x^2}           \\
\log_{a}(x)         &   \frac{1}{x} \log_{a}(e) = \frac{1}{x \ln(a) }  \\
\ln(x)              &   y'= \frac{1}{x}             \\
a ^{x}              &   a^{x} \log (a)              \\
e^{x}               &   e^{x}                       \\
e^{-x}              &   -e^{-x}                     \\
\arcsin(x)          &   \frac{1}{\sqrt{}{a- x^2}}   \\
\arccos(x)          &   -\frac{1}{\sqrt{}{1- x^2}}  \\
\arctan(x)          &   \frac{1}{1 + x^2}           \\
\mbox{arccot} (x)   &   -\frac{1}{1 + x^2}          \\
    
\end{longtblr}
\end{document}

如果使用两个并行表,结果可能是:

在此处输入图片描述

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{amssymb}

\usepackage{tabularray}
\UseTblrLibrary{amsmath}
\DeclareMathOperator{\arccosh}{arccosh}
\DeclareMathOperator{\arcsinh}{arcsinh}
\DeclareMathOperator{\arctanh}{arctanh}

\begin{document}
\noindent%
    \begin{tblr}{hlines, vline{1-Y}=solid,vline{Z}=1pt,
                colspec={Q[c, mode=dmath] Q[c, mode=dmath]},
                rowsep=3pt,
                row{2-Z} = {ht=2.4\baselineskip},
                     }
y                       &   y'                      \\
\text{ costante }   &   0                           \\
y=x                     &   1                       \\
y=x^{m}                 &   mx^{m-1}                \\
\frac{1}{x^{n} }    &   y'c = - \frac{n}{x^{n+1}}   \\
 \frac{1}{x}        &   \frac{1}{x^2 }              \\
\sqrt{n}{x}         &   \frac{1}{n \sqrt{n}{x^{n-1} }}  \\
\sqrt{}{x}          &   \frac{1}{2 \sqrt{}{x}}      \\
\frac{1}{\sqrt{x}}  &   -\frac{1}{2x \sqrt{x}}      \\
\sqrt{n}{x ^{m} }   &  \frac{m}{n \sqrt{n}{x ^{n-m} }}  \\
\frac{1}{\sqrt{n}{x^{m} }}  
                    &  - \frac{m}{nx \sqrt{n}{x ^{m} }} \\
\sin (x)            &   \cos(x)                     \\
\cos (x)            &   -\sin(x)                    \\
\tan (x)            &   \frac{1}{\cos^{2}(x) }¸= 1 + \tan^{2}(x)    \\
\cot (x)            &   \frac{1}{\sin^{2}(x) } = 1 - \cot^{2}(x)    \\
\sinh (x)           &   \cosh(x)                    \\
    \end{tblr}%
    \begin{tblr}{hlines, vline{2-Z}=solid,
                colspec={Q[c, mode=dmath] Q[c, mode=dmath]},
                rowsep=3pt,
                row{2-Z} = {ht=2.4\baselineskip},
                     }
y                       &   y'                      \\
\cosh (x)           &   \sinh(x)                    \\
\tanh (x)           &   \frac{1}{\cosh^{2}(x) } = 1- \tanh^{2} (x)  \\
\coth (x)           &   \frac{1}{\sinh^{2}(x) }= 1- \coth^{2} (x)   \\
\arccosh(x)         &   \frac{1}{\sqrt{}{x^2 - 1}}  \\
\arcsinh(x)         &   \frac{1}{\sqrt{}{x^2 + 1}}  \\
\arctanh(x)         &   \frac{1}{1 - x^2}           \\
\log_{a}(x)         &   \frac{1}{x} \log_{a}(e) = \frac{1}{x \ln(a) }  \\
\ln(x)              &   y'= \frac{1}{x}             \\
a ^{x}              &   a^{x} \log (a)              \\
e^{x}               &   e^{x}                       \\
e^{-x}              &   -e^{-x}                     \\
\arcsin(x)          &   \frac{1}{\sqrt{}{a- x^2}}   \\
\arccos(x)          &   -\frac{1}{\sqrt{}{1- x^2}}  \\
\arctan(x)          &   \frac{1}{1 + x^2}           \\
\mbox{arccot} (x)   &   -\frac{1}{1 + x^2}          \\
    \end{tblr}
\end{document}

相关内容