LoginSignup
2
1

More than 3 years have passed since last update.

【LaTeX】表を限界まで横幅を埋めて表示する方法

Last updated at Posted at 2021-02-19

重回帰分析の結果をstargazerで6つならべて表示しようとしたら、はみ出てしまった。
stargazerで「no.space = TRUE」オプションをオンにして空白を削っても収まらなかった。

どうすれば紙面からはみ出ないかを考えてみた。

結果として、textwidthを超えた幅のテーブルを中央に表示することができます。

手法

以下のアイデアで、中央に表を置くことができました。
- 表の部分だけ余白を減らして、センタリングできる範囲が広くなるようにする1
- tabulrをセンタリングする
- 表の大きさを調整する

LaTeXのソース

ライブラリを読み込んで、

\usepackage{chngpage}

tabularの前に

\begin{adjustwidth}{-1in}{-1in} \begin{center} \resizebox{1.2\textwidth}{!}{ %サイズ調整開始

tabularの後に

} \end{center} \end{adjustwidth} %サイズ調整終わり

と入れます。

\usepackage{chngpage}

....

\begin{table}[!htbp] \centering 
    \caption{Specifiacations} 
    \label{hyob_3} 
    \begin{adjustwidth}{-1in}{-1in} \begin{center} \resizebox{1.2\textwidth}{!}{ %サイズ調整開始
        \begin{tabular}{@{\extracolsep{5pt}}lcccccc} 
            \\[-1.8ex]\hline 
            \hline \\[-1.8ex] 
            & \multicolumn{6}{c}{\textit{Dependent variable:}} \\ 
           \cline{2-7} 
           \\[-1.8ex] & \multicolumn{6}{c}{log(price)} \\ 
           \\[-1.8ex] & (1) & (2) & (3) & (4) & (5) & (6)\\ 
           \hline \\[-1.8ex] 
           \hline 
           \hline \\[-1.8ex] 
           \textit{Note:}  & \multicolumn{6}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ 
           \end{tabular}
  } \end{center} \end{adjustwidth} %サイズ調整終わり
\end{table} 

変化

before

image.png

after

image.png

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1