以下是我所理解的表格的描述。第一行是两行的组合:第一行的第一个单元格为空,第一行的第二个单元格是 5 列的组合(text=GrpNumber1),第一行列的第三个单元格是 4 列的组合(text=GrpNumber2),第一行的第 4 个单元格是 2 列的组合(text=GrpNumber3),第一行的第 5、第 6 和第 7 个单元格分别是 3 列的组合,其中 (text=GrpNumber4)、(text=GrpNumber5)、(text=GrpNumber6)。第二行的每个单元格的列数相同,只有第 4 个单元格包含文本“Task”第三行的每个单元格的列数相同,但每个单元格中的文本都是从下到上垂直排列的其余行在第一个单元格中有文本,而在其余单元格中有勾号和叉号,如此持续到 20 行。
表格示例图片上传如下:
我创建了一些文本。我可以正确编码第一行和第二行,但无法编码包含垂直方向文本的第三行。之后我无法继续。我使用“\rot”打印垂直方向的文本
我的代码是:
\documentclass[manuscript,screen]{acmart}
\usepackage{listings}
\input{solidity-highlighting.tex}
\usepackage[colorinlistoftodos]{todonotes}
\AtBeginDocument{%
\providecommand\BibTeX{{%
\normalfont B\kern-0.5em{\scshape i\kern-0.25em b}\kern-0.8em\TeX}}}
\setcopyright{acmcopyright}
\copyrightyear{2020}
\acmYear{2020}
\acmDOI{10.1145/1122445.1122456}
\begin{document}
\title{A Test of Latex}
\author{Khan}
\email{Khan@edu}
\affiliation{}
\institution{University}
\renewcommand{\shortauthors}{Trovato and Tobin, et al.}
\begin{abstract}
Testing abstract
\end{abstract}
\begin{CCSXML}
<ccs2012>
<concept>
<concept_id>10002978.10003022</concept_id>
<concept_desc> and application security</concept_desc>
<concept_significance>500</concept_significance>
</concept>
<concept>
<concept_id>10002944.10011122.10002945</concept_id>
<concept_desc>General and reference~Surveys and overviews</concept_desc>
<concept_significance>500</concept_significance>
</concept>
</ccs2012>
\end{CCSXML}
\ccsdesc[500]{Security and privacy~Software and application security}
\ccsdesc[500]{General and reference~Surveys and overviews}
\maketitle
\section{Introduction}
Hello. \citet{1}, \citet{2}, \citet{3} %\cite{8} \cite{105} \cite{112} %\cite{48} \cite{87}.
\begin{lstlisting}[language=Solidity]
contract TestList1{
}
\end{lstlisting}
\begin{table}[]
\centering
\begin{tabular}{l|ccccc|cccc|cc|ccc|ccc|ccc}
\hline
& \multicolumn{5}{c|}{\bf GrpNumber1} & \multicolumn{4}{c|}{\bf GrpNumber2} & \multicolumn{2}{c|}{\bf GrpNumber3} & \multicolumn{3}{c|}{\bf GrpNumber4} & \multicolumn{3}{c|}{\bf GrpNumber5} & \multicolumn{3}{c}{\bf GrpNumber6} \\
& \multicolumn{5}{c|}{\bf } & \multicolumn{4}{c|}{\bf } & \multicolumn{2}{c|}{\bf Task} & \multicolumn{3}{c|}{\bf } & \multicolumn{3}{c|}{\bf } & \multicolumn{3}{c}{\bf } \\
\hline
此行以下的代码无法正常工作:
& \rot{Grp1Member1} & \rot{Grp1Member2} & \rot{Grp1Member3} & \rot{Grp1Member4}
& \multicolumn{1}{c|}{\rot{Grp1Member5}}
& \rot{Grp2Member1}
& \rot{Grp2Member2}
& \rot{Grp2Member3}
& \multicolumn{1}{c|}{\rot{Grp2Member4}}
& \rot{Grp3Member1}
& \multicolumn{1}{c|}{\rot{Grp3Member2}}
& \rot{Grp4Member1}
& \rot{Grp4Member2}
& \multicolumn{1}{c|}{\rot{Grp4Member3}}
& \rot{Grp5Member1}
& \rot{Grp5Member2}
& \multicolumn{1}{c|}{\rot{Grp5Member3}}
& \rot{Grp6Member1}
& \rot{Grp6Member2}
& \multicolumn{1}{c|} {\rot{Grp6Member3}} \\
\hline
\end{tabular}
\caption{Testing Table for Classification.}
\label{tab:classification}
\vspace{-0.1in}
\end{table}
\bibliographystyle{ACM-Reference-Format}
\bibliography{sourcefile-bib}
\end{document}
\endinput
我也想知道如何打印“刻度标记”。
请向我展示整个工作代码。
祖尔菲。
答案1
在您的文档示例中
- 不是最小的,
- 据我了解,您的表格有问题,因此请删除所有与表格无关的其他内容
- 缺少编译表所必需的定义和包
- 表格的标题太宽,表格无法放在页面上;解决方案可以用一些缩写替换它们的名称,例如“GN”,如下面的 MWE 中所做的那样,并在标题中解释它的含义
- 可能的 MWE,仅关注表格:
\documentclass[manuscript,screen]{acmart}
%\usepackage{listings}
%\input{solidity-highlighting.tex}
%\usepackage[colorinlistoftodos]{todonotes}
%\AtBeginDocument{%
% \providecommand\BibTeX{{%
% \normalfont B\kern-0.5em{\scshape i\kern-0.25em b}\kern-0.8em\TeX}}}
%\setcopyright{acmcopyright}
%\copyrightyear{2020}
%\acmYear{2020}
%\acmDOI{10.1145/1122445.1122456}
%%% new packages and definitions ------------------------------%
\usepackage{rotating}
\usepackage{array, makecell}
\renewcommand\rotheadgape{}
\usepackage{xparse}
\NewExpandableDocumentCommand\mcc{O{1}m}
{\multicolumn{#1}{>{\bfseries\small}c|}{#2}}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
\usepackage{lipsum} % for dummy text
%---------------------------------------------------------------%
%\title{A Test of Latex}
%\author{Khan}
%\email{Khan@edu}
%\affiliation{}
%\institution{University}
%\renewcommand{\shortauthors}{Trovato and Tobin, et al.}
\begin{document}
% \maketitle
%\begin{abstract}
% Testing abstract
%\end{abstract}
%\begin{CCSXML}
%<ccs2012>
%<concept>
%<concept_id>10002978.10003022</concept_id>
%<concept_desc> and application security</concept_desc>
%<concept_significance>500</concept_significance>
%</concept>
%<concept>
%<concept_id>10002944.10011122.10002945</concept_id>
%<concept_desc>General and reference~Surveys and overviews</concept_desc>
%<concept_significance>500</concept_significance>
%</concept>
%</ccs2012>
%\end{CCSXML}
%\ccsdesc[500]{Security and privacy~Software and application security}
%\ccsdesc[500]{General and reference~Surveys and overviews}
%\maketitle
%\section{Introduction}
Hello. %\citet{1}, \citet{2}, \citet{3} %\cite{8} \cite{105} \cite{112} %\cite{48} \cite{87}.
%\begin{lstlisting}[language=Solidity]
%contract TestList1{
%}
%\end{lstlisting}
\lipsum[11]
\begin{table}[ht]
\settowidth\rotheadsize{Grp1Member1}
\setlength\tabcolsep{4pt}
\centering
\begin{tabular}{|l|ccccc|cccc|cc|ccc|ccc|ccc|}
\hline
& \mcc[20]{task} \\
\cline{2-21}
& \mcc[5]{GN 1}
& \mcc[4]{GN 2}
& \mcc[2]{GN 3}
& \mcc[3]{GN 4}
& \mcc[3]{GN 5}
& \mcc[3]{GN 6} \\
\hline
& \rothead{Grp1Member1} & \rothead{Grp1Member2} & \rothead{Grp1Member3}
& \rothead{Grp1Member4} & \rothead{Grp1Member5} & \rothead{Grp2Member1}
& \rothead{Grp2Member2} & \rothead{Grp2Member3} & \rothead{Grp2Member4}
& \rothead{Grp3Member1} & \rothead{Grp3Member2} & \rothead{Grp4Member1}
& \rothead{Grp4Member2} & \rothead{Grp4Member3} & \rothead{Grp5Member1}
& \rothead{Grp5Member2} & \rothead{Grp5Member3} & \rothead{Grp6Member1}
& \rothead{Grp6Member2} & \rothead{Grp6Member3} \\
\hline
\end{tabular}
\caption{Testing Table for Classification. GN stands for GrpNumber.}
\label{tab:classification}
\end{table}
\end{document}
(红线表示页面布局)
注意,MWE 是在 Overleaf 中编译的。