
大きな表を作成中で、いくつかのツールを使用して既定の幅のテキストに表を合わせています。ただし、列の 1 つが表の寸法に収まりません。どうすればよいでしょうか?
\documentclass[
% -- opções da classe memoir --
article, % indica que é um artigo acadêmico
11pt, % tamanho da fonte
oneside, % para impressão apenas no verso. Oposto a twoside
a4paper, % tamanho do papel.
% -- opções da classe abntex2 --
%chapter=TITLE, % títulos de capítulos convertidos em letras maiúsculas
%section=TITLE, % títulos de seções convertidos em letras maiúsculas
%subsection=TITLE, % títulos de subseções convertidos em letras maiúsculas
%subsubsection=TITLE % títulos de subsubseções convertidos em letras maiúsculas
% -- opções do pacote babel --
english, % idioma adicional para hifenização
brazil, % o último idioma é o principal do documento
sumario=tradicional
]{abntex2}
\usepackage{tabularx}
\usepackage{adjustbox}
\begin{document}
\begin{table}[!htbp]
\scriptsize
\centering
\begin{center}
\caption{Resultados das regressões utilizando Mínimos Quadrados Ordinários}
%\scalebox{1}{
\begin{tabularx}{\textwidth}{cccccccccccccc} \hline %{bss}
& $R^2 (\%)$ & Int. & \multicolumn{1}{l}{$R_{t}$} & \multicolumn{1}{l}{$R_{t-1}$} & \multicolumn{1}
{l}{$R_{t-2}$} & \multicolumn{1}{l}{$R_{t-3}$} & \multicolumn{1}{l}{$R_{t+1}$ } & \multicolumn{1}{l}
{$R_{t+2}$} & \multicolumn{1}{l}{$|R_{t}|$} & \multicolumn{1}{l}{$R^2_t$ } & \multicolumn{1}{l}{$\%
\Delta OVX_{t-1}$} & \multicolumn{1}{l}{$\% \Delta OVX_{t-2}$} & \multicolumn{1}{l}{$\% \Delta
OVX_{t-3}$} \\ \hline
M1 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M2 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M3 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M4 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M5 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\ \hline
\end{tabularx}
%}
\label{tab:Tabela 1}
\end{center}
\end{table}
\end{document}
答え1
テーブルをテキスト幅に収まるほど狭くする方法をいくつか示します。
tabularx
最初の例では、を に置き換えました。この特定のケースでは、より適切な をと組み合わせてtabular*
使用することで、列間の距離を短縮し、表がテキスト幅にちょうど収まるようにしています。この例では、フォント サイズも維持していますが、冗長なコマンドと環境は削除しています。\setlength{\tabcolsep}{0pt}
@{\extracolsep{\fill}}
\scriptsize
\entering
center
2 番目の例では、テキストと水平線が重ならないように、
\hline
コマンドをパッケージの水平線に置き換えました。booktabs
\small
3 番目の例では、重複する情報を共有ヘッダーに移動して列ヘッダーを短くしてみました。このアプローチでは、表をテキスト幅に合わせながらフォント サイズを大きくすることができます。最後の例では、表全体を転置しました。
(赤い線は余白を示します。)
\documentclass[
% -- opções da classe memoir --
article, % indica que é um artigo acadêmico
11pt, % tamanho da fonte
oneside, % para impressão apenas no verso. Oposto a twoside
a4paper, % tamanho do papel.
% -- opções da classe abntex2 --
%chapter=TITLE, % títulos de capítulos convertidos em letras maiúsculas
%section=TITLE, % títulos de seções convertidos em letras maiúsculas
%subsection=TITLE, % títulos de subseções convertidos em letras maiúsculas
%subsubsection=TITLE % títulos de subsubseções convertidos em letras maiúsculas
% -- opções do pacote babel --
english, % idioma adicional para hifenização
brazil, % o último idioma é o principal do documento
sumario=tradicional
]{abntex2}
\usepackage{booktabs}
\usepackage{showframe}\renewcommand*\ShowFrameColor{\color{red}}
\begin{document}
\begin{table}[!htbp]
\scriptsize
\setlength{\tabcolsep}{0pt}
\caption{Resultados das regressões utilizando Mínimos Quadrados Ordinários}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}cccccccccccccc} \hline %{bss}
& $R^2 (\%)$ & Int. & \multicolumn{1}{l}{$R_{t}$} & \multicolumn{1}{l}{$R_{t-1}$} & \multicolumn{1}
{l}{$R_{t-2}$} & \multicolumn{1}{l}{$R_{t-3}$} & \multicolumn{1}{l}{$R_{t+1}$ } & \multicolumn{1}{l}
{$R_{t+2}$} & \multicolumn{1}{l}{$|R_{t}|$} & \multicolumn{1}{l}{$R^2_t$ } & \multicolumn{1}{l}{$\%
\Delta OVX_{t-1}$} & \multicolumn{1}{l}{$\% \Delta OVX_{t-2}$} & \multicolumn{1}{l}{$\% \Delta
OVX_{t-3}$} \\ \hline
M1 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M2 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M3 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M4 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M5 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\ \hline
\end{tabular*}
\label{tab:Tabela 1}
\end{table}
\begin{table}[!htbp]
\scriptsize
\setlength{\tabcolsep}{0pt}
\caption{Resultados das regressões utilizando Mínimos Quadrados Ordinários}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}cccccccccccccc}
\toprule %{bss}
& $R^2 (\%)$ & Int. & $R_{t}$ & $R_{t-1}$ & $R_{t-2}$ & $R_{t-3}$ & $R_{t+1}$ &
$R_{t+2}$ & $|R_{t}|$ & $R^2_t$ & $\%\Delta OVX_{t-1}$ & $\% \Delta OVX_{t-2}$ & $\% \Delta OVX_{t-3}$ \\ \midrule
M1 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M2 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M3 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M4 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M5 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\ \bottomrule
\end{tabular*}
\label{tab:Tabela 1}
\end{table}
\begin{table}[!htbp]
\small
\setlength{\tabcolsep}{0pt}
\caption{Resultados das regressões utilizando Mínimos Quadrados Ordinários}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}cccccccccccccc}
\toprule
& & &&&&&&&&& \multicolumn{3}{c}{$\% \Delta OV$}\\
\cmidrule{12-14}
& $R^2 (\%)$ & Int. & $R_{t}$ & $R_{t-1}$ & $R_{t-2}$ & $R_{t-3}$ & $R_{t+1}$ &
$R_{t+2}$ & $|R_{t}|$ & $R^2_t$ & $X_{t-1}$ & $X_{t-2}$ & $X_{t-3}$ \\ \midrule
M1 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M2 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M3 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M4 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\
M5 & 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00 & 0.00
& 0.00 & 0.00 & 0.00
& 0.00 & 0.00 \\ \bottomrule
\end{tabular*}
\label{tab:Tabela 1}
\end{table}
\begin{table}[!htbp]
\centering
\caption{Resultados das regressões utilizando Mínimos Quadrados Ordinários}
\begin{tabular}{lccccc} \hline %{bss}
& M1 & M2 & M3 & M4 & M5\\
\midrule
$R^2 (\%)$ & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
Int. & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
$R_{t}$ & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
$R_{t-1}$ & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
$R_{t-2}$ & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
$R_{t-3}$ & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
$R_{t+1}$ & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
$R_{t+2}$ & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
$|R_{t}|$ & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
$R^2_t$ & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
$\%\Delta OVX_{t-1}$ & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
$\% \Delta OVX_{t-2}$ & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
$\% \Delta OVX_{t-3}$ & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
\bottomrule
\end{tabular}
\label{tab:Tabela 1}
\end{table}
\end{document}