[Tex/LaTex] How to make column bold in array

arraysboldboldmathmath-mode

\begin{align*}
    \begin{array}{cc|>{\boldsymbol}cclccl}
        X&Y&\neg&X&\rightarrow(&Y&\rightarrow&X))\\
        \hline
        0&0&0&0&1&0&1&0\\
        0&1&0&0&1&1&0&0\\
        1&0&0&1&1&0&1&1\\
        1&1&0&1&1&1&1&1
    \end{array}
\end{align*}

I just need the first column right to the vertical line to be bold. I couldn't figure out how to make this work; I hope someone can help.

Best Answer

collcell seems to help here, passing the cell contents to a \user macro (with one argument) via the array-like column specification

. . . >{\collectcell\usermacro}c<{\endcollectcell} . . .

enter image description here

\documentclass{article}

\usepackage{amsmath,collcell}

\begin{document}

\[
  \begin{array}{ c c | >{\collectcell\boldsymbol}c<{\endcollectcell} c l c c l }
    X & Y & \neg & X & \rightarrow( & Y & \rightarrow & X)) \\
    \hline
    0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 \\
    0 & 1 & 0 & 0 & 1 & 1 & 0 & 0 \\
    1 & 0 & 0 & 1 & 1 & 0 & 1 & 1 \\
    1 & 1 & 0 & 1 & 1 & 1 & 1 & 1
  \end{array}
\]

\end{document}
Related Question