我是 overleaf 新手,正在尝试使用 overleaf 模板“INFORMS 数据科学期刊模板”完成手稿。我正在尝试旋转一个有 15 列的表格,但以下代码不允许我将表格放入页面宽度中。我没有使用 sidewaystable 方法,因为我发现 informs 模板建议我使用 \begin{rotate} 来旋转表格。模板来自以下网址: https://www.overleaf.com/latex/templates/template-for-informs-journal-on-data-science/srqvhmybxgfn
\documentclass[ijds,nonblindrev]{informs-ijds}
\OneAndAHalfSpacedXI
\begin{document}
\RUNTITLE{Tis a Butter Place}
\TITLE{Tis a Far, Far Butter Place}
\KEYWORDS{butter, margarine, silliness} \HISTORY{This paper was
first submitted on April 12, 1922 and has been with the authors for
83 years for 65 revisions.}
\maketitle
\begin{rotate}
\begin{table}
\TABLE
{Posterior covariance of estimation $\bar{\beta}$}
{\begin{tabular}{p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} p{1.2cm} }
\hline
Variable & \centering $Intercept$ & \centering $CC1$ & \centering $CC2$ & \centering $CCCCC3$ & \centering $CCC4$ &
\centering $CC1 \times TS(STD)$ & \centering $CC2 \times TS(STD)$ & \centering $CCCC3 \times TS(STD)$ & \centering $CCC4 \times TS(STD)$ &
\centering $CC1 \times IT(STD)$ & \centering $CC2 \times IT(STD)$ & \centering $CCCC3 \times IT(STD)$ & \centering $CCC4 \times IT(STD)$ & \centering $Switching$ & \centering $Price Fee_{\log}$\\
\hline
\end{tabular}}
{}
\end{table}
\end{rotate}
\end{document}
我尝试了调整框和调整框大小的方法,但没有任何效果。请告知是否有办法让所有列都适合页面。非常感谢!
答案1
我不明白您为什么不愿意使用sidewaystable
环境。我还希望能够更灵活地查找标题单元格中的换行点。
article
由于我的系统上没有文档类,因此以下代码使用了文档类informs-ijds
。我相信您能够弄清楚如何使代码适应类的要求informs-ijds
。
\documentclass{article} %[ijds,nonblindrev]{informs-ijds}
%\OneAndAHalfSpacedXI
\usepackage{rotating} % for 'sidewaystable' env.
\usepackage{tabularx} % for 'tabularx' env. and 'X' column type
\usepackage{ragged2e} % for '\Centering' macro
% Optional -- set page parameters as needed:
\usepackage[a4paper,margin=2.5cm]{geometry}
\begin{document}
%\RUNTITLE{Tis a Butter Place}
%\TITLE{Tis a Far, Far Butter Place}
%\KEYWORDS{butter, margarine, silliness}
%\HISTORY{This paper was first submitted on
% April 12, 1922 and has been with the authors
% for 83 years for 65 revisions.}
%\maketitle
\begin{sidewaystable}
\setlength\extrarowheight{2pt} % for a more open "look"
\setlength\tabcolsep{3pt} % default: 6pt
\caption{Posterior covariance of estimation $\bar{\beta}$}
\smallskip
\begin{tabularx}{\textwidth}{ | *{16}{ >{\Centering\hspace{0pt}}X | } }
\hline
Variable & Intercept & CC1 & CC2 & CCCCC3 & CCC4
& CC1 $\times$ TS (STD) & CC2 $\times$ TS (STD)
& CCCC3 $\times$ TS (STD) & CCC4 $\times$ TS (STD)
& CC1 $\times$ IT (STD) & CC2 $\times$ IT (STD)
& CCCC3 $\times$ IT (STD) & CCC4 $\times$ IT (STD)
& Switching & Price Fee\textsubscript{log} \\
\hline
\end{tabularx}
\end{sidewaystable}
\end{document}