# Possible to add multicolumn functionality to LaTeX mark down?

I am not sure how LaTeX packages are loaded into StackExchanges like Stats, but I'm curious whether the multicolumn functionality can be added for arrays? I know some of the amsmath symbols are loaded since characters like $$\nabla$$ and $$\mathbb{F}$$ and $$\mathcal{S}$$ are loaded by default.

As an example, I was trying to implement this table as would appea

$$\begin{array}{c|cccc} & \multicolumn{2}{c}{W=0} & \multicolumn{2}{c}{W=1}& \\ & X & \bar{X} & X & \bar{X} \\ \hline Y & a & b & r & s \\ \bar{Y} & c & d & u & v \\ \end{array}$$


So that it was clear we depicted an X-Y relation stratified by groups according to W=0 and W=1, like this:

• tex.stackexchange.com/q/313635/23242 Oct 21, 2022 at 17:24
• @Scortchi-ReinstateMonica interesting and creative examples. Maybe I misunderstand they look like they span a whole row, or at least from a particular column until the end. I need two text displays to hover over two columns specifically. I gave my "want" example as would be rendered as desired in my standard tex compiler. Oct 21, 2022 at 18:20
• Sorry, I didn't bother to compile & see how it's supposed to look. But you'll need some workaround, as \multicolumn isn't supported by MathJax: docs.mathjax.org/en/latest/input/tex/macros/index.html. (MathJax is an external service which converts a subset of LaTeX into MathML, so S.E. can't add functionality without writing & hosting its own extensions.) Oct 22, 2022 at 9:14
• Unrelatedly, I don't think you need the 's when you start & end the mathjax w/ \begin{} ... \end{}. Oct 22, 2022 at 12:16
• In light of @Scortchi-ReinstateMonica's comment, it might be worth trying to figure out if it can be done purely via MathML. Oct 22, 2022 at 12:16
• @gung-ReinstateMonica: Even if it can, you'll still have to persuade S.E. to enable MathML markup in posts. Oct 22, 2022 at 20:20