5
$\begingroup$

I'm trying to draw a checkerboard (chessboard) pattern, but there is a problem.

Is it possible to draw it, such that there is no space at all, between rows and columns?

Failed attempt one: (rows and columns are spaced)

$$ \begin{array}{} \color{black}{\Rule{5mm}{5mm}{0mm}}&\color{magenta}{\Rule{5mm}{5mm}{0mm}}&\color{black}{\Rule{5mm}{5mm}{0mm}}\\ \color{magenta}{\Rule{5mm}{5mm}{0mm}}&\color{black}{\Rule{5mm}{5mm}{0mm}}&\color{magenta}{\Rule{5mm}{5mm}{0mm}}\\ \color{black}{\Rule{5mm}{5mm}{0mm}}&\color{magenta}{\Rule{5mm}{5mm}{0mm}}&\color{black}{\Rule{5mm}{5mm}{0mm}} \end{array} $$

Failed attempt two: (rows are spaced)

$$\begin{aligned}{} \color{black}{\Rule{5mm}{5mm}{0mm}}\color{magenta}{\Rule{5mm}{5mm}{0mm}}\color{black}{\Rule{5mm}{5mm}{0mm}}\\[-5mm] \color{magenta}{\Rule{5mm}{5mm}{0mm}}\color{black}{\Rule{5mm}{5mm}{0mm}}\color{magenta}{\Rule{5mm}{5mm}{0mm}}\\[-5mm] \color{black}{\Rule{5mm}{5mm}{0mm}}\color{magenta}{\Rule{5mm}{5mm}{0mm}}\color{black}{\Rule{5mm}{5mm}{0mm}} \end{aligned}$$

How to remove space between rows?

| |
$\endgroup$
  • $\begingroup$ What's the end goal of this exercise? $\endgroup$ – Asaf Karagila May 27 at 9:48
  • $\begingroup$ @AsafKaragila Visualizing a specific family of matrices, where instead of integers, we use colors. (I know I can simply include a image of the visualization, but I'm wondering if it is possible to do it directly in MathJax for small matrices.) $\endgroup$ – Vepir May 27 at 9:56
  • 1
    $\begingroup$ MathJax is meant to render and communicate mathematical content in a meaningful way---unlike TeX, it is not a typesetting program, and is not meant to be used for page layout functionality. I think that you are probably better off using an image. $\endgroup$ – Xander Henderson May 27 at 12:51
6
$\begingroup$

Not perfect, but hopefully close to what you want:

$$\begin{aligned}{} \color{black}{\Rule{10mm}{10mm}{1mm}} \color{magenta}{\Rule{10mm}{10mm}{1mm}} \color{black}{\Rule{10mm}{10mm}{1mm}}\\[-1em] \color{magenta}{\Rule{10mm}{10mm}{1mm}} \color{black}{\Rule{10mm}{10mm}{1mm}} \color{magenta}{\Rule{10mm}{10mm}{1mm}}\\[-1em] \color{black}{\Rule{10mm}{10mm}{0mm}} \color{magenta}{\Rule{10mm}{10mm}{0mm}} \color{black}{\Rule{10mm}{10mm}{0mm}} \end{aligned} $$

$$\begin{aligned}{} \color{black}{\Rule{10mm}{10mm}{1mm}} \color{magenta}{\Rule{10mm}{10mm}{1mm}} \color{black}{\Rule{10mm}{10mm}{1mm}} \color{magenta}{\Rule{10mm}{10mm}{1mm}}\\[-1em] \color{magenta}{\Rule{10mm}{10mm}{1mm}} \color{black}{\Rule{10mm}{10mm}{1mm}} \color{magenta}{\Rule{10mm}{10mm}{1mm}} \color{black}{\Rule{10mm}{10mm}{1mm}}\\[-1em] \color{black}{\Rule{10mm}{10mm}{1mm}} \color{magenta}{\Rule{10mm}{10mm}{1mm}} \color{black}{\Rule{10mm}{10mm}{1mm}} \color{magenta}{\Rule{10mm}{10mm}{1mm}}\\[-1em] \color{magenta}{\Rule{10mm}{10mm}{0mm}} \color{black}{\Rule{10mm}{10mm}{0mm}} \color{magenta}{\Rule{10mm}{10mm}{0mm}} \color{black}{\Rule{10mm}{10mm}{0mm}} \end{aligned} $$

$$\begin{aligned}{} 
\color{black}{\Rule{10mm}{10mm}{1mm}}
\color{magenta}{\Rule{10mm}{10mm}{1mm}}
\color{black}{\Rule{10mm}{10mm}{1mm}}\\[-1em] 
\color{magenta}{\Rule{10mm}{10mm}{1mm}}
\color{black}{\Rule{10mm}{10mm}{1mm}}
\color{magenta}{\Rule{10mm}{10mm}{1mm}}\\[-1em]
\color{black}{\Rule{10mm}{10mm}{0mm}}
\color{magenta}{\Rule{10mm}{10mm}{0mm}}
\color{black}{\Rule{10mm}{10mm}{0mm}}
\end{aligned}
$$

$$\begin{aligned}{} 
\color{black}{\Rule{10mm}{10mm}{1mm}}
\color{magenta}{\Rule{10mm}{10mm}{1mm}}
\color{black}{\Rule{10mm}{10mm}{1mm}}
\color{magenta}{\Rule{10mm}{10mm}{1mm}}\\[-1em] 
\color{magenta}{\Rule{10mm}{10mm}{1mm}}
\color{black}{\Rule{10mm}{10mm}{1mm}}
\color{magenta}{\Rule{10mm}{10mm}{1mm}}
\color{black}{\Rule{10mm}{10mm}{1mm}}\\[-1em]
\color{black}{\Rule{10mm}{10mm}{1mm}}
\color{magenta}{\Rule{10mm}{10mm}{1mm}}
\color{black}{\Rule{10mm}{10mm}{1mm}}
\color{magenta}{\Rule{10mm}{10mm}{1mm}}\\[-1em] 
\color{magenta}{\Rule{10mm}{10mm}{0mm}}
\color{black}{\Rule{10mm}{10mm}{0mm}}
\color{magenta}{\Rule{10mm}{10mm}{0mm}}
\color{black}{\Rule{10mm}{10mm}{0mm}}
\end{aligned}
$$
| |
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .