如何在默认边距内缩小大表格?

如何在默认边距内缩小大表格?

我有这张大桌子,想将其挤压以适合默认边距,有解决办法吗?

\documentclass[12pt, a4paper]{report}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage{bm}
\usepackage{nccmath}
\usepackage{amsfonts, graphicx, verbatim, mathtools,amssymb, amsthm, mathrsfs}
\usepackage{array}
    \usepackage{enumitem}
\usepackage{lipsum}
\usepackage{floatrow}

\begin{document}

\[
\setlength\arraycolsep{3pt} % default:5pt
\renewcommand\arraystretch{1.2}
\begin{array}{@{} c | *{8}{c} @{}}
        & (0,(0,0)) & (0,(0,1)) & (0,(1,0)) & (0,(1,1)) & (1,(0,0)) & (1,(0,1)) & (1,(1,0)) & (1,(1,1))\\
 \hline
 (0,(0,0)) & (0,(0,0)) & (0,(0,1)) & (0,(1,0)) & (0,(1,1)) & (1,(0,0)) & (1,(0,1)) & (1,(1,0)) & (1,(1,1))\\
 (0,(0,1)) & (0,(0,1)) & (0,(0,0)) & (0,(1,1)) & (0,(1,0)) & (1,(0,1)) & (1,(0,0)) & (1,(1,1)) & (1,(1,0))\\
 (0,(1,0)) & (0,(1,0)) & (0,(1,1)) & (0,(0,0)) & (0,(0,1)) & (1,(1,0)) & (1,(1,1)) & (1,(0,0)) & (1,(0,1))\\
 (0,(1,1)) & (0,(1,1)) & (0,(1,0)) & (0,(0,1)) & (0,(0,0)) & (1,(1,1)) & (1,(1,0)) & (1,(0,1)) & (1,(0,0))\\
 (1,(0,0)) & (1,(0,0)) & (1,(1,0)) & (1,(0,1)) & (1,(1,1)) & (0,(0,0)) & (0,(1,0)) & (0,(0,1)) & (0,(1,1))\\
 (1,(0,1)) & (1,(0,1)) & (1,(1,1)) & (1,(0,0)) & (1,(1,0)) & (0,(0,1)) & (0,(1,1)) & (0,(0,0)) & (0,(1,0))\\
 (1,(1,0)) & (1,(1,0)) & (1,(0,0)) & (1,(1,1)) & (1,(0,1)) & (0,(1,0)) & (0,(0,0)) & (0,(1,1)) & (0,(0,1))\\
 (1,(1,1)) & (1,(1,1)) & (1,(0,1)) & (1,(1,0)) & (1,(0,0)) & (0,(1,1)) & (0,(0,1)) & (0,(1,0)) & (0,(0,0))\\
\end{array}
\]

\[ % no need for an 'align*' env.
\setlength\arraycolsep{3pt} % default:5pt
\renewcommand\arraystretch{1.2}
\begin{array}{@{} c | *{8}{c} @{}}
    & (0,(0,0)) & (0,(0,1)) & (0,(1,0)) & (0,(1,1)) & (1,(0,0)) & (1,(0,1)) & (1,(1,0)) & (1,(1,1))\\
\hline
\chi_{(0,(0,0))} &1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 \\
\chi_{(0,(0,1))} &1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & -1 & -1 & -1 & -1\\
\chi_{(0,(1,0))} &1 & \phantom{-}1 & -1 & -1 & \phantom{-}1 & \phantom{-}1 & -1 & -1\\
\chi_{(0,(1,1))} &1 & \phantom{-}1 & -1 & -1 & -1 & -1 & \phantom{-}1 & \phantom{-}1 \\
\chi_{(1,(0,0))} &1 &-1 & \phantom{-}1 &-1 & \phantom{-}1 &-1 & \phantom{-}1 &-1\\
\chi_{(1,(0,1))} &1 &-1 & \phantom{-}1 &-1 & -1 & \phantom{-}1 &-1 & \phantom{-}1 \\
\chi_{(1,(1,0))} &1 &-1 & -1 & \phantom{-}1 & \phantom{-}1 & -1 & -1 & \phantom{-}1 \\
\chi_{(1,(1,1))} &1 &-1 & -1 & \phantom{-}1 &-1 & \phantom{-}1 & \phantom{-}1 & -1\\
\end{array}
\]

\end{document}

编辑:

这是一个类似的表格,它与默认边距完全匹配,这正是我想要的表格:

\begin{align*}
\setlength\arraycolsep{3pt} % default:5pt
\renewcommand\arraystretch{1.2}
\begin{array}{@{} c | *{8}{c} @{}}
  +  & $(0,0,0)$ & $(0,0,1)$ & $(0,1,0)$ & $(0,1,1)$ & $(1,0,0)$ & $(1,0,1)$ & $(1,1,0)$ & $(1,1,1)$\\
    \cline{1-9}
   $(0,0,0)$ & $(0,0,0)$ & $(0,0,1)$ & $(0,1,0)$ & $(0,1,1)$ & $(1,0,0)$ & $(1,0,1)$ & $(1,1,0)$ & $(1,1,1)$\\
    $(0,0,1)$ & $(0,0,1)$ & $(0,0,0)$ & $(0,1,1)$ & $(0,1,0)$ & $(1,0,1)$ & $(1,0,0)$ & $(1,1,1)$ & $(1,1,0)$\\
    $(0,1,0)$ & $(0,1,0)$ & $(0,1,1)$ & $(0,0,0)$ & $(0,0,1)$ & $(1,1,0)$ & $(1,1,1)$ & $(1,0,0)$ & $(1,0,1)$\\
    $(0,1,1)$ & $(0,1,1)$ & $(0,1,0)$ & $(0,0,1)$ & $(0,0,0)$ & $(1,1,1)$ & $(1,1,0)$ & $(1,0,1)$ & $(1,0,0)$\\
    $(1,0,0)$ & $(1,0,0)$ & $(1,0,1)$ & $(1,1,0)$ & $(1,1,1)$ & $(0,0,0)$ & $(0,0,1)$ & $(0,1,0)$ & $(0,1,1)$\\
    $(1,0,1)$ & $(1,0,1)$ & $(1,0,0)$ & $(1,1,1)$ & $(1,1,0)$ & $(0,0,1)$ & $(0,0,0)$ & $(0,1,1)$ & $(0,1,0)$\\
    $(1,1,0)$ & $(1,1,0)$ & $(1,1,1)$ & $(1,0,0)$ & $(1,0,1)$ & $(0,1,0)$ & $(0,1,1)$ & $(0,0,0)$ & $(0,0,1)$\\
    $(1,1,1)$ & $(1,1,1)$ & $(1,1,0)$ & $(1,0,1)$ & $(1,0,0)$ & $(0,1,1)$ & $(0,1,0)$ & $(0,0,1)$ & $(0,0,0)$\\
\end{array}
\end{align*}

The character table:

\[ 
\setlength\arraycolsep{3pt} % default:5pt
\renewcommand\arraystretch{1.2}
\begin{array}{@{} c | *{8}{c} @{}}
  +  & (0,0,0) & (0,0,1) & (0,1,0) & (0,1,1) & (1,0,0) & (1,0,1) & (1,1,0) & (1,1,1)\\
\hline
\chi_{(0,0,0)} &1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 \\
\chi_{(0,0,1)} &1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & -1 & -1 & -1 & -1\\
\chi_{(0,1,0)} &1 & \phantom{-}1 & -1 & -1 & \phantom{-}1 & \phantom{-}1 & -1 & -1\\
\chi_{(0,1,1)} &1 & \phantom{-}1 & -1 & -1 & -1 & -1 & \phantom{-}1 & \phantom{-}1 \\
\chi_{(1,0,0)} &1 &-1 & \phantom{-}1 &-1 & \phantom{-}1 &-1 & \phantom{-}1 &-1\\
\chi_{(1,0,1)} &1 &-1 & \phantom{-}1 &-1 & -1 & \phantom{-}1 &-1 & \phantom{-}1 \\
\chi_{(1,1,0)} &1 &-1 & -1 & \phantom{-}1 & \phantom{-}1 & -1 & -1 & \phantom{-}1 \\
\chi_{(1,1,1)} &1 &-1 & -1 & \phantom{-}1 &-1 & \phantom{-}1 & \phantom{-}1 & -1\\
\end{array}
\]

答案1

由于午餐时间,我推迟了回答:-)

我会尝试以下操作:

\documentclass[12pt, a4paper]{report}
\usepackage{bm}
\usepackage{mathrsfs}
\usepackage{amssymb, amsthm,
            mathtools,
            nccmath}
\usepackage{siunitx}

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}

\begin{document}

\begin{center}
    \footnotesize%\small
    \setlength\tabcolsep{0pt} % default:5pt
    \renewcommand\arraystretch{1.2}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}
                             >{$}l<{$} @{\;} | *{8}{c} @{}}
        & (0,(0,0)) & (0,(0,1)) & (0,(1,0)) & (0,(1,1))
        & (1,(0,0)) & (1,(0,1)) & (1,(1,0)) & (1,(1,1)) \\
 \hline
 (0,(0,0)) & (0,(0,0)) & (0,(0,1)) & (0,(1,0)) & (0,(1,1)) & (1,(0,0)) & (1,(0,1)) & (1,(1,0)) & (1,(1,1))\\
 (0,(0,1)) & (0,(0,1)) & (0,(0,0)) & (0,(1,1)) & (0,(1,0)) & (1,(0,1)) & (1,(0,0)) & (1,(1,1)) & (1,(1,0))\\
 (0,(1,0)) & (0,(1,0)) & (0,(1,1)) & (0,(0,0)) & (0,(0,1)) & (1,(1,0)) & (1,(1,1)) & (1,(0,0)) & (1,(0,1))\\
 (0,(1,1)) & (0,(1,1)) & (0,(1,0)) & (0,(0,1)) & (0,(0,0)) & (1,(1,1)) & (1,(1,0)) & (1,(0,1)) & (1,(0,0))\\
 (1,(0,0)) & (1,(0,0)) & (1,(1,0)) & (1,(0,1)) & (1,(1,1)) & (0,(0,0)) & (0,(1,0)) & (0,(0,1)) & (0,(1,1))\\
 (1,(0,1)) & (1,(0,1)) & (1,(1,1)) & (1,(0,0)) & (1,(1,0)) & (0,(0,1)) & (0,(1,1)) & (0,(0,0)) & (0,(1,0))\\
 (1,(1,0)) & (1,(1,0)) & (1,(0,0)) & (1,(1,1)) & (1,(0,1)) & (0,(1,0)) & (0,(0,0)) & (0,(1,1)) & (0,(0,1))\\
 (1,(1,1)) & (1,(1,1)) & (1,(0,1)) & (1,(1,0)) & (1,(0,0)) & (0,(1,1)) & (0,(0,1)) & (0,(1,0)) & (0,(0,0))\\
\end{tabular*}
\end{center}

\begin{center}
    \footnotesize%\small
    \setlength\tabcolsep{0pt} % default:5pt
    \renewcommand\arraystretch{1.2}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} 
                             >{$}l<{$} @{\;}| *{8}{S[table-format=-1.0]}}
        & {(0,(0,0))} & {(0,(0,1))} & {(0,(1,0))} & {(0,(1,1))}
        & {(1,(0,0))} & {(1,(0,1))} & {(1,(1,0))} & {(1,(1,1))} \\
\hline
\chi_{(0,(0,0))}    & 1 &  1 &  1 &  1 &  1 &  1 &  1 &  1  \\
\chi_{(0,(0,1))}    & 1 &  1 &  1 &  1 & -1 & -1 & -1 & -1  \\
\chi_{(0,(1,0))}    & 1 &  1 & -1 & -1 &  1 &  1 & -1 & -1  \\
\chi_{(0,(1,1))}    & 1 &  1 & -1 & -1 & -1 & -1 &  1 &  1  \\
\chi_{(1,(0,0))}    & 1 & -1 &  1 & -1 &  1 & -1 &  1 & -1  \\
\chi_{(1,(0,1))}    & 1 & -1 &  1 & -1 & -1 &  1 & -1 &  1  \\
\chi_{(1,(1,0))}    & 1 & -1 & -1 &  1 &  1 & -1 & -1 &  1  \\
\chi_{(1,(1,1))}    & 1 & -1 & -1 &  1 & -1 &  1 &  1 & -1  \\
\end{tabular*}
\end{center}

\end{document}

\small如果您使用字体大小它也会起作用。

答案2

由于footnotesize列与列之间的空间较小,因此表格可以放在边距内:

\documentclass[12pt, a4paper]{report}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage{bm}
\usepackage{nccmath}
\usepackage{amsfonts, graphicx, verbatim, mathtools,amssymb, amsthm, mathrsfs}
\usepackage{array}
\usepackage{enumitem}
\usepackage{lipsum}
\usepackage{floatrow}

\begin{document}

{
\footnotesize
\[
\setlength\arraycolsep{2pt} % default:5pt
\renewcommand\arraystretch{1.2}
\begin{array}{@{} c | *{8}{c} @{}}
        & (0,(0,0)) & (0,(0,1)) & (0,(1,0)) & (0,(1,1)) & (1,(0,0)) & (1,(0,1)) & (1,(1,0)) & (1,(1,1))\\
 \hline
 (0,(0,0)) & (0,(0,0)) & (0,(0,1)) & (0,(1,0)) & (0,(1,1)) & (1,(0,0)) & (1,(0,1)) & (1,(1,0)) & (1,(1,1))\\
 (0,(0,1)) & (0,(0,1)) & (0,(0,0)) & (0,(1,1)) & (0,(1,0)) & (1,(0,1)) & (1,(0,0)) & (1,(1,1)) & (1,(1,0))\\
 (0,(1,0)) & (0,(1,0)) & (0,(1,1)) & (0,(0,0)) & (0,(0,1)) & (1,(1,0)) & (1,(1,1)) & (1,(0,0)) & (1,(0,1))\\
 (0,(1,1)) & (0,(1,1)) & (0,(1,0)) & (0,(0,1)) & (0,(0,0)) & (1,(1,1)) & (1,(1,0)) & (1,(0,1)) & (1,(0,0))\\
 (1,(0,0)) & (1,(0,0)) & (1,(1,0)) & (1,(0,1)) & (1,(1,1)) & (0,(0,0)) & (0,(1,0)) & (0,(0,1)) & (0,(1,1))\\
 (1,(0,1)) & (1,(0,1)) & (1,(1,1)) & (1,(0,0)) & (1,(1,0)) & (0,(0,1)) & (0,(1,1)) & (0,(0,0)) & (0,(1,0))\\
 (1,(1,0)) & (1,(1,0)) & (1,(0,0)) & (1,(1,1)) & (1,(0,1)) & (0,(1,0)) & (0,(0,0)) & (0,(1,1)) & (0,(0,1))\\
 (1,(1,1)) & (1,(1,1)) & (1,(0,1)) & (1,(1,0)) & (1,(0,0)) & (0,(1,1)) & (0,(0,1)) & (0,(1,0)) & (0,(0,0))\\
\end{array}
\]
}

{
\footnotesize
\[ % no need for an 'align*' env.
\setlength\arraycolsep{2pt} % default:5pt
\renewcommand\arraystretch{1.2}
\begin{array}{@{} c | *{8}{c} @{}}
    & (0,(0,0)) & (0,(0,1)) & (0,(1,0)) & (0,(1,1)) & (1,(0,0)) & (1,(0,1)) & (1,(1,0)) & (1,(1,1))\\
\hline
\chi_{(0,(0,0))} &1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 \\
\chi_{(0,(0,1))} &1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & -1 & -1 & -1 & -1\\
\chi_{(0,(1,0))} &1 & \phantom{-}1 & -1 & -1 & \phantom{-}1 & \phantom{-}1 & -1 & -1\\
\chi_{(0,(1,1))} &1 & \phantom{-}1 & -1 & -1 & -1 & -1 & \phantom{-}1 & \phantom{-}1 \\
\chi_{(1,(0,0))} &1 &-1 & \phantom{-}1 &-1 & \phantom{-}1 &-1 & \phantom{-}1 &-1\\
\chi_{(1,(0,1))} &1 &-1 & \phantom{-}1 &-1 & -1 & \phantom{-}1 &-1 & \phantom{-}1 \\
\chi_{(1,(1,0))} &1 &-1 & -1 & \phantom{-}1 & \phantom{-}1 & -1 & -1 & \phantom{-}1 \\
\chi_{(1,(1,1))} &1 &-1 & -1 & \phantom{-}1 &-1 & \phantom{-}1 & \phantom{-}1 & -1\\
\end{array}
\]
}

\end{document}

答案3

这个链接可能对你有帮助:如何正确地调整数组大小?

另外,我尝试按照链接修改您的代码,得到的结果如下:

\documentclass[12pt, a4paper]{report}
\def\A{A}
\def\B{B}
\def\false{\ne}
\def\true{=}
\usepackage{graphicx,amsmath}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage{bm}
\usepackage{nccmath}
\usepackage{amsfonts, graphicx, verbatim, mathtools,amssymb, amsthm, mathrsfs}
\usepackage{array}
    \usepackage{enumitem}
\usepackage{lipsum}
\usepackage{floatrow}


\begin{document}


\setlength\arraycolsep{3pt} % default:5pt
\renewcommand\arraystretch{1.2}
\begin{itemize}
\item \resizebox{\textwidth}{!}{$\displaystyle

\begin{array}{@{} c | *{8}{c} @{}}
        & (0,(0,0)) & (0,(0,1)) & (0,(1,0)) & (0,(1,1)) & (1,(0,0)) & (1,(0,1)) & (1,(1,0)) & (1,(1,1))\\
 \hline
 (0,(0,0)) & (0,(0,0)) & (0,(0,1)) & (0,(1,0)) & (0,(1,1)) & (1,(0,0)) & (1,(0,1)) & (1,(1,0)) & (1,(1,1))\\
 (0,(0,1)) & (0,(0,1)) & (0,(0,0)) & (0,(1,1)) & (0,(1,0)) & (1,(0,1)) & (1,(0,0)) & (1,(1,1)) & (1,(1,0))\\
 (0,(1,0)) & (0,(1,0)) & (0,(1,1)) & (0,(0,0)) & (0,(0,1)) & (1,(1,0)) & (1,(1,1)) & (1,(0,0)) & (1,(0,1))\\
 (0,(1,1)) & (0,(1,1)) & (0,(1,0)) & (0,(0,1)) & (0,(0,0)) & (1,(1,1)) & (1,(1,0)) & (1,(0,1)) & (1,(0,0))\\
 (1,(0,0)) & (1,(0,0)) & (1,(1,0)) & (1,(0,1)) & (1,(1,1)) & (0,(0,0)) & (0,(1,0)) & (0,(0,1)) & (0,(1,1))\\
 (1,(0,1)) & (1,(0,1)) & (1,(1,1)) & (1,(0,0)) & (1,(1,0)) & (0,(0,1)) & (0,(1,1)) & (0,(0,0)) & (0,(1,0))\\
 (1,(1,0)) & (1,(1,0)) & (1,(0,0)) & (1,(1,1)) & (1,(0,1)) & (0,(1,0)) & (0,(0,0)) & (0,(1,1)) & (0,(0,1))\\
 (1,(1,1)) & (1,(1,1)) & (1,(0,1)) & (1,(1,0)) & (1,(0,0)) & (0,(1,1)) & (0,(0,1)) & (0,(1,0)) & (0,(0,0))\\
\end{array}$

 }
    \end{itemize}




\setlength\arraycolsep{3pt} % default:5pt
\renewcommand\arraystretch{1.2}
\begin{itemize}
\item \resizebox{\textwidth}{!}{$\displaystyle
\begin{array}{@{} c | *{8}{c} @{}}
    & (0,(0,0)) & (0,(0,1)) & (0,(1,0)) & (0,(1,1)) & (1,(0,0)) & (1,(0,1)) & (1,(1,0)) & (1,(1,1))\\
\hline
\chi_{(0,(0,0))} &1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 \\
\chi_{(0,(0,1))} &1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & -1 & -1 & -1 & -1\\
\chi_{(0,(1,0))} &1 & \phantom{-}1 & -1 & -1 & \phantom{-}1 & \phantom{-}1 & -1 & -1\\
\chi_{(0,(1,1))} &1 & \phantom{-}1 & -1 & -1 & -1 & -1 & \phantom{-}1 & \phantom{-}1 \\
\chi_{(1,(0,0))} &1 &-1 & \phantom{-}1 &-1 & \phantom{-}1 &-1 & \phantom{-}1 &-1\\
\chi_{(1,(0,1))} &1 &-1 & \phantom{-}1 &-1 & -1 & \phantom{-}1 &-1 & \phantom{-}1 \\
\chi_{(1,(1,0))} &1 &-1 & -1 & \phantom{-}1 & \phantom{-}1 & -1 & -1 & \phantom{-}1 \\
\chi_{(1,(1,1))} &1 &-1 & -1 & \phantom{-}1 &-1 & \phantom{-}1 & \phantom{-}1 & -1\\
\end{array}$
 }
    \end{itemize}

\end{document}

尝试一下!我不确定这是否会让您满意。

问候,

相关内容