![我应该怎样在 Latex 中编写这个表格?](https://linux22.com/image/452270/%E6%88%91%E5%BA%94%E8%AF%A5%E6%80%8E%E6%A0%B7%E5%9C%A8%20Latex%20%E4%B8%AD%E7%BC%96%E5%86%99%E8%BF%99%E4%B8%AA%E8%A1%A8%E6%A0%BC%EF%BC%9F.png)
答案1
与。{NiceTabular}
nicematrix
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\renewcommand{\arraystretch}{1.6}
\begin{NiceTabular}{ccccccc}[hvlines]
\CodeBefore
\rowcolor[gray]{0.9}{1,2}
\columncolor[gray]{0.9}{1,2}
\Body
\Block{2-2}{\diagbox{$\xi_\omega$}{$\Delta\xi_\omega$}} && \Block{1-*}{error signal} \\
&& NL & NS & ZE & PS & PL \\
\Block{4-1}<\rotate>{Change in Speed} & NL & NL & NL & NM & NS & ZE \\
& NL & NL & NL & NM & NS & ZE \\
& NL & NL & NL & NM & NS & ZE \\
& NL & NL & NL & NM & NS & ZE \\
\end{NiceTabular}
\end{document}
您需要多次编译(因为nicematrix
在后台使用 PGF/Tikz 节点)。
答案2
\documentclass{standalone}
\usepackage{tabularray,graphicx,xcolor}
\UseTblrLibrary{diagbox}
\begin{document}
\begin{tblr}{
cells = {c},
row{1,2} = {gray8},
column{1,2} = {gray8},
cell{1}{1} = {r=2,c=2}{mode=math},
cell{1}{3} = {c=5}{},
cell{3}{1} = {r=4}{},
hlines, vlines,
vspan=even, hspan=even,
belowsep=0pt,
}
\diagbox{\xi_\omega}{\Delta\xi_\omega} && error signal &&&& \\
&& NL & NS & ZE & PS & PL \\
\rotatebox{90}{Change in Speed} & NL & NL & NL & NM & NS & ZE \\
& NL & NL & NL & NM & NS & ZE \\
& NL & NL & NL & NM & NS & ZE \\
& NL & NL & NL & NM & NS & ZE \\
\end{tblr}
\end{document}