我正在使用 ACM 模板用乳胶创建表格,\documentclass[sigconf, anonymous]{acmart}
这是我的代码:
\begin{table}
\centering
\begin{tabulary}{\textwidth}{CLCL}
\toprule
\multicolumn{2}{c}{Security} &
\multicolumn{2}{c}{Data protection} \\\cmidrule(rl){1-2}\cmidrule(rl){3-4}
Level & \hfil Mode & Encryption & \hfil Authenticity\\
%\midrule
\cmidrule(rl){1-1}\cmidrule(rl){2-2}\cmidrule(rl){3-3}\cmidrule(rl){4-4}
0 & No Security & No & Not validated \\
1 & AES-CBC-MAC-32 & No & 32-bit MIC \\
2 & AES-CBC-MAC-64 & No & 64-bit MIC \\
3 & AES-CBC-MAC-128 & No & 128-bit MIC \\
4 & AES-CTR & Yes & Not validated \\
5 & AES-CCM-32 & Yes & 32-bit MIC \\
6 & AES-CCM-64 & Yes & 64-bit MIC \\
7 & AES-CCM-128 & Yes & 128-bit MIC \\
\bottomrule
\end{tabulary}
\end{table}
最初,使用 IEEE 模板我得到:
但是通过 ACM,我得到了这个:
答案1
如果你得到一个 TeX 错误,那么你甚至不应该看 PDF,看看日志,你的日志会显示
! LaTeX Error: Environment tabulary undefined.
未定义tabulary
。(您必须已加载booktabs
,否则输出将没有水平规则)。
你需要
\usepackage{tabulary}
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabulary}{\textwidth}{CLCL}
\toprule
\multicolumn{2}{c}{Security} &
\multicolumn{2}{c}{Data protection} \\\cmidrule(rl){1-2}\cmidrule(rl){3-4}
Level & \hfil Mode & Encryption & \hfil Authenticity\\
%\midrule
\cmidrule(rl){1-1}\cmidrule(rl){2-2}\cmidrule(rl){3-3}\cmidrule(rl){4-4}
0 & No Security & No & Not validated \\
1 & AES-CBC-MAC-32 & No & 32-bit MIC \\
2 & AES-CBC-MAC-64 & No & 64-bit MIC \\
3 & AES-CBC-MAC-128 & No & 128-bit MIC \\
4 & AES-CTR & Yes & Not validated \\
5 & AES-CCM-32 & Yes & 32-bit MIC \\
6 & AES-CCM-64 & Yes & 64-bit MIC \\
7 & AES-CCM-128 & Yes & 128-bit MIC \\
\bottomrule
\end{tabulary}
\end{table}
\end{document}