有多种解决方案可以隐藏(而不是折叠)表格中的列,但不折叠。然而,在长表中,它们不起作用。有没有其他方法可以让表格整齐地跨越多页,并且有一个简单的解决方案来真正折叠列,例如,通过像往常一样使用“H”对齐选项?
\documentclass[11pt,a4paper,english]{article}
\pdfinclusionerrorlevel = 1
\pdfminorversion = 7
\usepackage[
per-mode=symbol,
round-mode=places,
table-format = 1.2,
table-number-alignment=right,
% round-integer-to-decimal,
output-decimal-marker={.}
%scientific-notation=engineering
]{siunitx}
\usepackage{makecell}
\usepackage{booktabs}
\usepackage{longtable}
\newcolumntype{H}{>{\setbox0=\hbox\bgroup}c<{\egroup}@{}}
\begin{document}
\begin{longtable}{lHl} % does not work
\multicolumn{3}{l}{Fixations} \\
\cmidrule(lr){1-3}
\multicolumn{1}{l}{A} &
\multicolumn{1}{l}{B} &
\multicolumn{1}{l}{Units} \\
\cmidrule(lr){1-1}
\cmidrule(lr){2-2}
\cmidrule(lr){3-3}
\endfirsthead\caption{Fixations (Continued)}\\
\multicolumn{3}{l}{F} \\
\cmidrule(lr){1-3}
\multicolumn{1}{l}{A} &
\multicolumn{1}{l}{B} &
\multicolumn{1}{l}{Units} \\
\cmidrule(lr){1-1}
\cmidrule(lr){2-2}
\cmidrule(lr){3-3}
\endhead
\multicolumn{3}{c}{ Continued}
\endfoot
\endlastfoot
$F_x$ & 6389 & \unit{\newton}\\
$F_y$ & 0 & \unit{\newton}\\
\end{longtable}
\end{document}