0

I have the following table I'm trying to recreate: enter image description here

I'm translating the text to English and trying to obtain a similar form, but I'm having a terrible time managing the wild world of LaTeX tables! Here's what I have, or at least the closest I've gotten, which isn't much.

\usepackage{multicol,multirow,tabularx,pbox,makecell}
\usepackage{titling}
\usepackage{lettrine}
\usepackage{soul}

\begin{document}

\noindent
\begin{tabularx}{\textwidth}{||>{\centering\arraybackslash}X|>{\centering\arraybackslash}X|>{\centering\arraybackslash}X|>{\centering\arraybackslash}X||}
    \hhline{|t:====:t|}
    \multirow{2}{2cm}{\centering\arraybackslash\textsc{RATIO} \newline \footnotesize of the \newline \textsc{\footnotesize radii}.} & 
            \multicolumn{2}{>{\hsize=\dimexpr2\hsize+2\tabcolsep+\arrayrulewidth\relax\centering\arraybackslash}X|}{\textsc{\footnotesize ratio of the thickness of the electric layer on the two spheres,}} & 
                \multirow{2}{2.5cm}{\centering\arraybackslash\textsc{DIFFERENCE \footnotesize between calculation} \footnotesize and \textsc{\footnotesize observation.}} \\
        \hhline{||~~~~||}
         & \footnotesize according to calculation. & \footnotesize according to experiment. & \\
        \hhline{||----||}
        a & b & c & d \\
        a & b & c & d \\
        a & b & c & d \\
    \hhline{|b:====:b|}
\end{tabularx}
\end{document}

enter image description here

Well evidently it's not going so well. I need a thicker border line, better vertical spacing of the headers, and the flourish I'm not too concerned about, but it would be a nice addition. So what packages can provide a relatively easy path towards this format? And how can I get closer to the goal, with vertical spacing and all?

1

A place to start from with a NiceTabular nested inside of a tcolorbox:

enter image description here

\documentclass{article}
\usepackage{pbox}
\usepackage{tcolorbox}
\newtcolorbox{mybox}{colback=white,
                    colframe=black,
                    boxrule=1.5pt,
                    sharp corners,
                    top=0pt,
                    bottom=0pt,
                    right=0pt,
                    left=0pt
                    }
                    
\usepackage{nicematrix}

\newlength{\tablewidth}
\setlength{\tablewidth}{\dimexpr\textwidth-8.7pt-5\arrayrulewidth}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}

\begin{document}

\noindent
\begin{mybox}
\centering
\begin{NiceTabular}{*{4}{C{0.25\tablewidth-2\tabcolsep}}}[hvlines,cell-space-limits=3pt]
     \scshape\footnotesize\Block{2-1}{RATIO \\ \textnormal{of the}\\ radii.} 
    & \scshape\footnotesize\Block{1-2}{ratio of the thickness of the\\ electric layer on the two spheres,} 
    && \scshape\footnotesize\Block{2-1}{DIFFERENCE \\ between \\ calculation  \textnormal{and} \\ observation.} \\
         & \footnotesize according to calculation. & \footnotesize according to experiment. & \\
        a & b & c & d \\
        a & b & c & d \\
        a & b & c & d \\
\end{NiceTabular}
\end{mybox}
\end{document}
1
  • This is much better, thanks. Unfortunately, the MWE isn't compiling on my system, because apparently there's a problem with my nicematrix package. I get several errors such as: "LaTeX error: "xparse/unknown-argument-type" Unknown argument type '!' for the command '\environment NiceMatrix'. For immediate help type H <return>." And then "Environment NiceTabular undefined. \begin{NiceTabular}". I know it's outside the question, but any idea what's going on? My nicematrix is freshly updated as of today, not sure what could be the issue. Apr 6 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.