如何减小整个LaTeX表的大小?

时间:2011-01-26 20:09:33

标签: latex latex-environment

我有一张桌子,我希望看起来更小,以节省一些空间。我可以用什么环境来缩小整个表格?

4 个答案:

答案 0 :(得分:15)

使用\resizebox

\resizebox{3cm}{!}{
  \begin{something}
    something
  \end{something}
  }

!告诉LaTeX保持纵横比。您还可以通过在那里给出值来不同地缩放y方向。

答案 1 :(得分:0)

\begin{table}[tch]
\caption{foo}
\begin{tabular}{lll}
\hline 
\footnotesize{
foo&foo&foo\\
foo&doo&fofo\\
}\\\hline
\end{tabular}
\label{foo}
\end{table}

答案 2 :(得分:0)

缩放包含文本的元素确实不是一个好主意(有关更多信息,请参见https://tex.stackexchange.com/questions/425453/why-not-scale-elements-that-contain-text),因此,这里有另外两种方法来减小表的大小:

  • 使用\addtolength{\tabcolsep}{-1pt}缩小列间距
  • 手动选择较小的字体,例如使用\small之类的字体命令或进行更精细的控制\fontsize{9.5pt}{10.25pt}\selectfont

\documentclass{article}

\usepackage{lipsum}

\begin{document}

Reducing the inter column spacing a bit:
\begin{table}[htbp]
\addtolength{\tabcolsep}{-1pt}
\begin{tabular}{lll}
\hline
some text some text & some text some text & some text some text some text\\
\hline
\end{tabular}
\end{table}

\lipsum[2]

Smaller font size:
\begin{table}[htbp]
\small
\begin{tabular}{lll}
\hline
some text some som text & some text some text & some text some text some text\\
\hline
\end{tabular}
\end{table}


\end{document}

答案 3 :(得分:-1)

``ddd

```This is an example:
```ddd
```\begin{table}[h!] 
```\resizebox{6cm}{!} 
```{ 
```% here is the table content.
```}
```%\caption{Versiones a comparar.} 
```\end{table}