1

I want to specify the width of my column, each column with a different width. However, if I do specify like {\tabularx = X{1cm}||Y|Y|Y| etc. } the columns are combining in the same cell.
Most ideally I want the column width as wide as the word in the top row. For the first column this is the word Composition (Sheet resistance may be split into two lines).

Another problem I am facing has to do with the \checkmark symbol. It is not shown properly, but as a unfilled square (indicating that the code \checkmark is not recognized). I know that with greek letters, the problem is simply solved by putting the symbol into a math environment ($\rho$). However, this is not working for the \checkmark symbol. If somebody knows how to fix this, I would be very thankful.

Below I attached the code and the used packages.

    \documentclass{report}

    \usepackage{changes}
    \usepackage{amssymb}
    \usepackage{mathtools}
    \usepackage{amsmath}
    \usepackage[version=4]{mhchem}  %allows chemical formulae
    \usepackage{siunitx} %allow SI units
    \usepackage{cleveref} %smart referencing, automatic sorting etc.
    \usepackage{nomencl}
    \usepackage{pdfpages}
    \makenomenclature 

    \usepackage[usenames,dvipsnames]{xcolor}
    \usepackage{tcolorbox}
    \usepackage{tabularx}
    \usepackage{array}
    \usepackage{colortbl}
    \tcbuselibrary{skins}

    \newcolumntype{Y}{>{\raggedleft\arraybackslash}X}

    \tcbset{tab2/.style={enhanced,fonttitle=\bfseries,fontupper=\normalsize\sffamily,
    colback=yellow!10!white,colframe=tudelft-sky-blue,colbacktitle=Salmon!40!white,
    coltitle=black,center title}}

\begin{document}     

        \begin{tcolorbox}[tab2,tabularx={X||Y|Y|Y|Y|Y|Y|Y|Y}]
            \textbf{Property}   & \textbf{ECV}                  & \textbf{QSSPC}                & \textbf{Sherescan}            & \textbf{PL}                       & \textbf{Ellipsometry}         & \textbf{SEM}                  & \textbf{FTIR}                 & \textbf{XRD}      \\\hline\hline
            Passivation         & \checkmark    &            &            &            &            &            &           &           \\
            Doping profile      &               & \checkmark &            &            &            &            &           &           \\
            Sheet resistance    &               & \checkmark & \checkmark &            &            &            &           &           \\
            Thickness           & \checkmark    &            &            &            & \checkmark &\checkmark  &           &           \\
            Crystallinity       &               &            &            &            &            &\checkmark  &           &\checkmark \\
            Composition         &               &            &            & \checkmark &            &\checkmark  &\checkmark &           \\
            Absorption          &               &            &            &            & \checkmark &            &           &           \\
            \end{tcolorbox}

    \end{document}
1

With the default margins of your MWE there is simply not enough room to make each column as wide as the header. If your document provides enough room for your table, then you don't need to specify the widths manually, but just let latex do it's job.

(I had to move the xcolor package, otherwise your document did not compile because of an option clash)

\documentclass{report}

\usepackage{geometry}

\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{changes}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage[version=4]{mhchem}  %allows chemical formulae
\usepackage{siunitx} %allow SI units
\usepackage{cleveref} %smart referencing, automatic sorting etc.
\usepackage{nomencl}
\usepackage{pdfpages}
\makenomenclature 


\usepackage{tcolorbox}
\usepackage{tabularx}
\usepackage{array}
\usepackage{colortbl}
\tcbuselibrary{skins}

\newcolumntype{Y}{>{\raggedleft\arraybackslash}c}

\tcbset{tab2/.style={enhanced,fonttitle=\bfseries,fontupper=\normalsize\sffamily,
colback=yellow!10!white,colframe=blue,colbacktitle=Salmon!40!white,
coltitle=black,center title}}

\begin{document}     

    \begin{tcolorbox}[tab2,tabularx={X||Y|Y|Y|Y|Y|Y|Y|Y}]
        \textbf{Property}   & \textbf{ECV}                  & \textbf{QSSPC}                & \textbf{Sherescan}            & \textbf{PL}                       & \textbf{Ellipsometry}         & \textbf{SEM}                  & \textbf{FTIR}                 & \textbf{XRD}      \\\hline\hline
        Passivation         & \checkmark    &            &            &            &            &            &           &           \\
        Doping profile      &               & \checkmark &            &            &            &            &           &           \\
        Sheet resistance    &               & \checkmark & \checkmark &            &            &            &           &           \\
        Thickness           & \checkmark    &            &            &            & \checkmark &\checkmark  &           &           \\
        Crystallinity       &               &            &            &            &            &\checkmark  &           &\checkmark \\
        Composition         &               &            &            & \checkmark &            &\checkmark  &\checkmark &           \\
        Absorption          &               &            &            &            & \checkmark &            &           &           \\
        \end{tcolorbox}

\end{document}

enter image description here

  • @mhchem Thanks for your edit! Can you also comment or edit on the original question to make the OP aware of this problem? – user36296 Mar 30 '18 at 18:51

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.