@ {\ _ hskip} और \ multicolumns

Sep 26 2020

निम्न तालिका पर विचार करें

\begin{tabular}{cccccc}
    \toprule
    N   &       \multicolumn3c{L-family}    &   \multicolumn2c{H-family}    \\
    n   &   large   &   Large   &   LARGE   &       huge    &   Huge        \\
    \bottomrule
\end{tabular}

मैं स्तंभों के समूहन पर जोर देना चाहता हूं, इसलिए @ -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}

अब मुझे मल्टीकोल्यूमेंट को फाइन-ट्यून करना होगा क्योंकि क्षैतिज स्थान बंद है

\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}

गंदे कब्जे क्यों? क्या इसे अधिक स्वचालित तरीके से किया जा सकता है?

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}

PS इस प्रश्न में: मल्टी-कॉलम और @ {\ hskip} का उपयोग करते समय संरेखण के साथ समस्या? , उत्तर \tabcolsepएक खाली का उपयोग कर दबाने का सुझाव देता है @{}। कोई देख सकता है कि यह हमेशा आपको वांछित परिणाम नहीं देता है।

जवाब

1 DavidCarlisle Sep 26 2020 at 05:06

@का उपयोग करते समय भाव प्रासंगिक स्तंभ के दाहिने हाथ की बढ़त का हिस्सा हैं, तो \multicolumnअपने दाहिने हाथ सहित अवधि के लिए बार-बार पूर्ण घटक @अभिव्यक्ति:

\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}