@ {\ hskip} ve \ multicolumns
Sep 26 2020
Aşağıdaki tabloyu düşünün
\begin{tabular}{cccccc}
\toprule
N & \multicolumn3c{L-family} & \multicolumn2c{H-family} \\
n & large & Large & LARGE & huge & Huge \\
\bottomrule
\end{tabular}
Sütunların gruplandırılmasını vurgulamak istiyorum, dolayısıyla @ -construction
\def\htc#1{ {\hskip#1\tabcolsep} }
\begin{tabular}{c @\htc4 ccc @\htc4 cc}
\toprule
N & \multicolumn3c{L-family} & \multicolumn2c{H-family} \\
n & large & Large & LARGE & huge & Huge \\
\bottomrule
\end{tabular}
Şimdi yatay boşluk kapalı olduğu için çok sütunlu ince ayar yapmam gerekiyor
\begin{tabular}{c @\htc4 ccc @\htc4 cc}
\toprule
N & \multicolumn3{@\htc{-3}c}{L-family} & \multicolumn2{@\htc0c}{H-family}
\\
n & large & Large & LARGE & huge & Huge
\\
\bottomrule
\end{tabular}
Neden kirli sabitler? Daha otomatik bir şekilde yapılabilir mi?
MWE
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\parskip1em
Consider the following table
\begin{tabular}{cccccc}
\toprule
N & \multicolumn3c{L-family} & \multicolumn2c{H-family} \\
n & large & Large & LARGE & huge & Huge \\
\bottomrule
\end{tabular}
~
I want to emphasis the grouping of columns, hence the @-construction
\def\htc#1{ {\hskip#1\tabcolsep} }
\begin{tabular}{c @\htc4 ccc @\htc4 cc}
\toprule
N & \multicolumn3c{L-family} & \multicolumn2c{H-family} \\
n & large & Large & LARGE & huge & Huge \\
\bottomrule
\end{tabular}
~
Now I have to fine-tune the multicolumn
\begin{tabular}{c @\htc4 ccc @\htc4 cc}
\toprule
N & \multicolumn3{@\htc{-3}c}{L-family} & \multicolumn2{@\htc0c}{H-family}
\\
n & large & Large & LARGE & huge & Huge
\\
\bottomrule
\end{tabular}
Why the dirty constantss?
\end{document}
Not: Bu soruda: Çok sütunlu ve @ {\ hskip} kullanırken hizalamayla ilgili sorun mu yaşıyorsunuz? Cevap, \tabcolsepboş kullanarak bastırmayı öneriyor @{}. Bunun her zaman size istenen sonucu vermediği görülebilir.
Yanıtlar
1 DavidCarlisle Sep 26 2020 at 05:06
@Kullanırken ifadeler ilgili sütunun sağ kenarında bir parçası, bu nedenle \multicolumnonun sağ olmak üzere yayılma için tekrar edin tam bileşeni @ifade:
\documentclass{article}
\usepackage{booktabs}
\def\htc#1{ {\hskip#1\tabcolsep} }
\begin{document}
\parskip1em
I want to emphasis the grouping of columns, hence the @-construction
\begin{tabular}{c @{\htc4} ccc @{\htc4} cc}
\toprule
N & \multicolumn{3}{c@{\htc4}}{L-family} & \multicolumn{2}{c}{H-family} \\
n & large & Large & LARGE & huge & Huge \\
\bottomrule
\end{tabular}
\end{document}
Gene Simmons, KISS Çizgi Romanlarının Potansiyel Olarak "İnsanlığı Yeniden Yaratabileceğini" Söyledi
Tom Girardi Dolandırıcılık Suçlamalarından Yargılanma Yetkisinin Belirlenmesi İçin Duruşmaya Katıldı
Kevin Jonas'ın Kızı Alena, Doğum Günü Fotoğrafında Büyümüş Görünüyor: '9 Yaşında Gerçek Hissetmiyor'