
Ich arbeite an einer großen Tabelle und verwende einige Tools, um sie an die Textbreite der Standardgröße anzupassen. Eine der Spalten passt jedoch nicht in die Maße der Tabelle. Wie kann ich das tun?
\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}
Antwort1
Hier sind einige Optionen, wie Sie Ihre Tabelle schmal genug machen können, damit sie in die Textbreite passt:
Im ersten Beispiel habe ich
tabularx
durch ersetzt, in diesem konkreten Fall besser geeignet,tabular*
und\setlength{\tabcolsep}{0pt}
in Kombination mit verwendet@{\extracolsep{\fill}}
, um den Abstand zwischen den Spalten zu verringern, damit die Tabelle gerade in die Textbreite passt. In diesem Beispiel habe ich auch die\scriptsize
Schriftgröße beibehalten, aber den redundanten\entering
Befehl undcenter
die Umgebung entfernt.Im zweiten Beispiel habe ich die
\hline
Befehle zusätzlich durch horizontale Linien aus dembooktabs
Paket ersetzt, um Überlappungen zwischen Text und horizontalen Linien zu vermeiden.Im dritten Beispiel habe ich versucht, die Spaltenüberschriften zu verkürzen, indem ich wiederholte Informationen in eine gemeinsame Überschrift verschoben habe. Mit diesem Ansatz kann man die Schriftgröße vergrößern und
\small
trotzdem die Tabelle in die Textbreite einpassen.Im letzten Beispiel habe ich die komplette Tabelle transponiert.
(Rote Linien zeigen Ränder an.)
\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}