![如何在 acmsmall 模板中生成旋转表格](https://linux22.com/image/446539/%E5%A6%82%E4%BD%95%E5%9C%A8%20acmsmall%20%E6%A8%A1%E6%9D%BF%E4%B8%AD%E7%94%9F%E6%88%90%E6%97%8B%E8%BD%AC%E8%A1%A8%E6%A0%BC.png)
我使用了\usepackage{rotating}
,但是它不起作用。
代码:
\usepackage{rotating}
\begin{sidewaystable}
\caption{Performance After Post Filtering} % title name of the table
\centering % centering table
\begin{tabular}{l c c rrrrrrr} % creating 10 columns
\hline\hline % inserting double-line
Audio &Audibility & Decision &\multicolumn{7}{c}{Sum of Extracted Bits}
\\ [0.5ex]
\hline % inserts single-line
% Entering 1st row
& &soft &1 & $-1$ & 1 & 1 & $-1$ & $-1$ & 1 \\[-1ex]
\raisebox{1.5ex}{Police} & \raisebox{1.5ex}{5}&hard
& 2 & $-4$ & 4 & 4 & $-2$ & $-4$ & 4 \\[1ex]
% Entering 2nd row
& &soft & 1 & $-1$ & 1 & 1 & $-1$ & $-1$ & 1 \\[-1ex]
\raisebox{1.5ex}{Beethoven} & \raisebox{1.5ex}{5}& hard
&8 & $-8$ & 2 & 8 & $-8$ & $-8$ & 6 \\[1ex]
% Entering 3rd row
& &soft & 1 & $-1$ & 1 & 1 & $-1$ & $-1$ & 1 \\[-1ex]
\raisebox{1.5ex}{Metallica} & \raisebox{1.5ex}{5}& hard
&4 & $-8$ & 8 & 4 & $-8$ & $-8$ & 8 \\[1ex]
% [1ex] adds vertical space
\hline % inserts single-line
\end{tabular}
\label{tab:LPer}
\end{sidewaystable}
答案1
使用 acmart.cls 2022/02/05 v1.82 Typesetting articles for the Association for Computing Machinery
最新版本的主要文章模板 - LaTeX
在包含的文件中,它之前sample-acmsmall.tex
被添加 ,并且此代码位于部分中\usepackage{rotating}
\begin{document}
表格要模拟一张大桌子,你必须转动它。
\setlength\rotFPtop{0pt plus 1fil}
将使表格横向居中。
\setlength\rotFPtop{0pt plus 1fil} % added <<<<<<<<<<<<
\begin{sidewaystable}
\centering
\caption{Frequency of Special Characters}
\label{tab:freq}
\begin{tabular}{*{14}{c}}
\toprule
A &B &C& D &E &F &G &H &I &J &K &L &M \\
\midrule
0.4 & 2.447 & 2.177 & 2.304 & 4.921 & 4.298 & 2.121 & 3.928 & 3.478 & 3.462 & 1.751 & 0.875 & 0.525 \\
0.8 & 4.894 & 4.354 & 4.609 & 9.843 & 8.597 & 4.241 & 7.857 & 6.957 & 6.924 & 3.502 & 1.750 & 1.049 \\
1.2 & 7.341 & 6.530 & 6.913 & 14.764 & 12.895 & 6.362 & 11.785 & 10.435 & 10.386 & 5.252 & 2.625 & 1.574 \\
1.6 & 9.789 & 8.707 & 9.218 & 19.686 & 17.194 & 8.482 & 15.713 & 13.914 & 13.848 & 7.003 & 3.500 & 2.099 \\
2 & 12.236 & 10.884 & 11.522 & 24.607 & 21.492 & 10.603 & 19.642 & 17.392 & 17.310 & 8.754 & 4.375 & 2.624 \\
2.4 & 14.683 & 13.061 & 13.827 & 29.529 & 25.791 & 12.723 & 23.570 & 20.871 & 20.772 & 10.505 & 5.250 & 3.148 \\
2.8 & 17.130 & 15.237 & 16.131 & 34.450 & 30.089 & 14.844 & 27.498 & 24.349 & 24.234 & 12.256 & 6.125 & 3.673 \\
3.2 & 19.577 & 17.414 & 18.435 & 39.372 & 34.388 & 16.965 & 31.427 & 27.828 & 27.697 & 14.006 & 7.000 & 4.198 \\
3.6 & 22.024 & 19.591 & 20.740 & 44.293 & 38.686 & 19.085 & 35.355 & 31.306 & 31.159 & 15.757 & 7.875 & 4.723 \\
4 & 24.471 & 21.768 & 23.044 & 49.215 & 42.984 & 21.206 & 39.283 & 34.784 & 34.621 & 17.508 & 8.750 & 5.247 \\
4.4 & 26.919 & 23.945 & 25.349 & 54.136 & 47.283 & 23.326 & 43.212 & 38.263 & 38.083 & 19.259 & 9.625 & 5.772 \\
4.8 & 29.366 & 26.121 & 27.653 & 59.058 & 51.581 & 25.447 & 47.140 & 41.741 & 41.545 & 21.009 & 10.500 & 6.297 \\
5.2 & 31.813 & 28.298 & 29.957 & 63.979 & 55.880 & 27.567 & 51.068 & 45.220 & 45.007 & 22.760 & 11.375 & 6.821 \\
5.6 & 34.260 & 30.475 & 32.262 & 68.900 & 60.178 & 29.688 & 54.996 & 48.698 & 48.469 & 24.511 & 12.250 & 7.346 \\
6 & 36.707 & 32.652 & 34.566 & 73.822 & 64.477 & 31.809 & 58.925 & 52.177 & 51.931 & 26.262 & 13.125 & 7.871 \\
\bottomrule
\end{tabular}
\end{sidewaystable}
不相关的:acmart 文档类包含 booktabs 包,用于准备高质量的表格。建议使用\toprule
、\midrule
和\bottomrule
代替\hline
。
答案2
有点晚了,而且也大多偏离主题,但无论如何......
- 在您的表中我将使用包
S
中定义的列类型siunitx
, - 在 ine
sidewaystable
环境中,如果有足够的空间,您可以插入两个表格
\documentclass{acmart}
\usepackage{rotating}
\usepackage{siunitx}
\begin{document}
\begin{sidewaystable}
\centering
\caption{Frequency of Special Characters}
\label{tab:freq}
\begin{tabular}{*{14}{c}}
\toprule
A &B &C& D &E &F &G &H &I &J &K &L &M \\
\midrule
0.4 & 2.447 & 2.177 & 2.304 & 4.921 & 4.298 & 2.121 & 3.928 & 3.478 & 3.462 & 1.751 & 0.875 & 0.525 \\
0.8 & 4.894 & 4.354 & 4.609 & 9.843 & 8.597 & 4.241 & 7.857 & 6.957 & 6.924 & 3.502 & 1.750 & 1.049 \\
1.2 & 7.341 & 6.530 & 6.913 & 14.764 & 12.895 & 6.362 & 11.785 & 10.435 & 10.386 & 5.252 & 2.625 & 1.574 \\
1.6 & 9.789 & 8.707 & 9.218 & 19.686 & 17.194 & 8.482 & 15.713 & 13.914 & 13.848 & 7.003 & 3.500 & 2.099 \\
2 & 12.236 & 10.884 & 11.522 & 24.607 & 21.492 & 10.603 & 19.642 & 17.392 & 17.310 & 8.754 & 4.375 & 2.624 \\
2.4 & 14.683 & 13.061 & 13.827 & 29.529 & 25.791 & 12.723 & 23.570 & 20.871 & 20.772 & 10.505 & 5.250 & 3.148 \\
2.8 & 17.130 & 15.237 & 16.131 & 34.450 & 30.089 & 14.844 & 27.498 & 24.349 & 24.234 & 12.256 & 6.125 & 3.673 \\
3.2 & 19.577 & 17.414 & 18.435 & 39.372 & 34.388 & 16.965 & 31.427 & 27.828 & 27.697 & 14.006 & 7.000 & 4.198 \\
3.6 & 22.024 & 19.591 & 20.740 & 44.293 & 38.686 & 19.085 & 35.355 & 31.306 & 31.159 & 15.757 & 7.875 & 4.723 \\
4 & 24.471 & 21.768 & 23.044 & 49.215 & 42.984 & 21.206 & 39.283 & 34.784 & 34.621 & 17.508 & 8.750 & 5.247 \\
4.4 & 26.919 & 23.945 & 25.349 & 54.136 & 47.283 & 23.326 & 43.212 & 38.263 & 38.083 & 19.259 & 9.625 & 5.772 \\
4.8 & 29.366 & 26.121 & 27.653 & 59.058 & 51.581 & 25.447 & 47.140 & 41.741 & 41.545 & 21.009 & 10.500 & 6.297 \\
5.2 & 31.813 & 28.298 & 29.957 & 63.979 & 55.880 & 27.567 & 51.068 & 45.220 & 45.007 & 22.760 & 11.375 & 6.821 \\
5.6 & 34.260 & 30.475 & 32.262 & 68.900 & 60.178 & 29.688 & 54.996 & 48.698 & 48.469 & 24.511 & 12.250 & 7.346 \\
6 & 36.707 & 32.652 & 34.566 & 73.822 & 64.477 & 31.809 & 58.925 & 52.177 & 51.931 & 26.262 & 13.125 & 7.871 \\
\bottomrule
\end{tabular}
\end{sidewaystable}
\end{document}