如何减小表格字体大小

如何减小表格字体大小

我正在努力创建两列、全页表。目前我编写了以下代码:

\documentclass{article}
\usepackage{booktabs}
\usepackage[margin=13mm,paper=a4paper]{geometry}
\usepackage{graphics}
\begin{document}

\begin{table}
  \centering
  \small
  \resizebox{\columnwidth}{!}{%
    \begin{tabular}{l c}
        \toprule
            y & y' \\
            \midrule
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
        \bottomrule
    \end{tabular}
  }
\end{table}
\end{document}

但不知为何,它的字体太大了,我需要大约 20 行小数学表达式。我是 Latex 新手,所以可能缺少一些简单的东西。

这是输出: 在此处输入图片描述

答案1

这里有几种可能的解决方案(在评论中讨论)。

第一个是

\documentclass{article}
\usepackage{booktabs}
\usepackage[margin=13mm,paper=a4paper]{geometry}
\usepackage{graphics}

\begin{document}
\begin{table}
  \centering
  \small
    \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}l c}
        \toprule
            y & y' \\
            \midrule
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
        \bottomrule
    \end{tabular*}
\end{table}
\end{document}

结果是

在此处输入图片描述

第二个是

\documentclass{article}
\usepackage{booktabs}
\usepackage[margin=13mm,paper=a4paper]{geometry}
\usepackage{graphics}

\begin{document}
\begin{table}
  \centering
  \small
    \begin{tabular}{l c}
        \toprule
            y & y' \\
            \midrule
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
        \bottomrule
    \end{tabular}
\end{table}
\end{document}

结果是

在此处输入图片描述

第三个是

\documentclass{article}
\usepackage{booktabs}
\usepackage[margin=13mm,paper=a4paper]{geometry}
\usepackage{graphics}

\begin{document}
\begin{table}
  \centering
  \small
  \resizebox{!}{391pt}{
    \begin{tabular}{l c}
        \toprule
            y & y' \\
            \midrule
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
        \bottomrule
    \end{tabular}}
\end{table}
\end{document}

结果是

在此处输入图片描述

(从图片上很难看出来,但它填满了整个页面并且没有溢出。)

第四个是

\documentclass{article}
\usepackage{booktabs}
\usepackage[margin=13mm,paper=a4paper]{geometry}
\usepackage{graphics}
\usepackage{tabularx}
% ...

\begin{document}
\begin{table}
  \centering
  \small
    \begin{tabularx}{\textwidth}{ XXXXXXX }
            \toprule
            y & y' \\
            \midrule
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
            as & well \\
            using & the \\
        \bottomrule
    \end{tabularx}
\end{table}

\end{document}

这使

在此处输入图片描述

我可能错误地安排了tabularx选项的间距,但即便如此,我个人认为第三个选项是最好的选择。

感谢所有评论者(Fran、David Carlisle、Johannes_B 和 Heiko Oberdiek)的建议。

最后,根据你的评论,我正在努力为你真正想要创造的东西找到解决方案。到目前为止,我已经

\documentclass{article}
\usepackage{booktabs}
\usepackage[margin=13mm,paper=a4paper]{geometry}
\usepackage{graphics}
% ...

\begin{document}


\begin{table}
  \centering
  \small
  \resizebox{520pt}{320pt}{%
    \begin{tabular}{l l}
      Derivatives and Integrals \\
      \\
      \toprule
      Basic Differentiation Rules \\
      \midrule
      \\
      1. $\frac {d}{dx} [cu] = cu'$ & 2. $\frac{d}{dx} [u \pm v] = u' \pm 
      v'$ \\
      3. $\frac{d}{dx} [uv] = uv' + vu'$ & 4. $\frac{d}{dx} [\frac{u}{v}] 
      = \frac{vu' - uv'}{v^2}$ \\
      5. $\frac{d}{dx} [c] = 0$ & 6. $\frac{d}{dx} [u^n] = nu^{n-1} \quad 
      u'$ \\
      7. $\frac{d}{dx} [x] = 1$ & 8. $\frac{d}{dx} [\mid u \mid] = 
      \frac{u}{\mid u \mid} (u'), \quad u \neq 0$ \\
      9. $\frac{d}{dx} [ln \quad u] = \frac{u'}{u}$ & 10. $\frac{d}{dx} 
      [e^u] = e^u \quad u'$ \\
      11. $\frac{d}{dx} [sin \quad u] = (cos \quad u) u'$ & 12. $\frac{d}
      {dx} [cos \quad u] = -(sin \quad u) u'$ \\
      13. $\frac{d}{dx} [tan \quad u] = (sec^2 \quad u)u'$ & 14. 
      $\frac{d}{dx} [cot \quad u] = -(csc^2 \quad u) u'$ \\
      15. $\frac{d}{dx} [sec \quad u] = (sec \quad u \quad tan \quad u) 
      u'$ & 16. $\frac{d}{dx} [csc \quad u] = -(csc \quad u \quad cot 
      \quad u) u'$ \\
      17. $\frac{d}{dx} [arcsin \quad u] = \frac{u'}{\sqrt{-1 - u^2}}$ & 
      18. $\frac{d}{dx} [arccos \quad u] = \frac{-u'}{\sqrt{1-u^2}}$ \\
      19. $\frac{d}{dx} [arctan \quad u] = \frac{u'}{1 + u^2}$ & 20. 
      $\frac{d}{dx} [arccot \quad u] = \frac{-u'}{1 + u^2}$ \\
      21. $\frac{d}{dx} [arcsec \quad u] = \frac{u'}{\mid u \mid 
      \sqrt{u^2 - 1}}$ & 22. $\frac{d}{dx} [arcsec \quad u] = \frac{-u'}
      {\mid u \mid \sqrt{u^2 - 1}}$ \\
      \\
      Basic Integration Formulas \\
      \\
      1. $\int k \quad f(u) \quad d u = k \int f(u) \quad du$ & 2. $\int 
      \quad [f(u) \pm g (u)] \quad du = \int f(u) \quad du \pm \int g(u) 
      \quad du$ \\
      3. $\int  d u = u + C$ & 4. $\int u^n d u = \frac{u^{n+1}}{n + 1} + 
      C, \quad n \neq -1$ \\
      5. $\int \frac{d}{u} = ln \mid u \mid + C$ & 6. $\int e^u d u = e^u 
      + C$ \\
      7. $\int sin \quad u \quad du = -cos u + C$ & 8. $\int cos \quad u 
      \quad d u = sin \quad u + C$ \\
      9. $\int tan \quad u \quad du = -ln \mid cos \quad u \mid + C$ & 
      10. $\int cot \quad u \quad du = ln \mid sin \quad u \mid + C$ \\
      11. $\int sec \quad u \quad du = ln \mid sec \quad u + tan \quad du 
      \mid + C$ & 12. $\int csc \quad u \quad du = -ln \mid csc \quad u + 
      cot \quad u \mid + C$ \\
      13. $\int sec^2 u \quad du  = tan \quad u + C$ & 14. $\int csc^2 
      \quad u \quad du = -cot \quad u + C$ \\
      15. $\int sec \quad u \quad tan \quad u \quad du = sec \quad u + C$ 
      & 16. $\int csc \quad u \quad cot \quad du = -csc \quad u + C$ \\
      17. $\int \frac{du}{\sqrt{a^2 - u^2}} = arcsin \frac{u}{a} + C$ & 
      18. $\int \frac{du}{a^2 + u^2} = \frac{1}{a} arctan \frac{u}{a} + 
      C$ \\
      19. $\int \frac{du}{u \sqrt{u^2 - a^2}} = \frac{1}{a} arcsec 
      \frac{\mid u \mid}{a} + C$ \\
      \bottomrule
  \end{tabular}}
\end{table}

\end{document}

这使

在此处输入图片描述

我正在努力实现这个目标:

在此处输入图片描述

有些线条没有居中,调整大小也不完美,但您可以调整大小。我会尝试找出如何正确居中线条。

希望这可以帮助!

相关内容