Matrix with only $a_{i1} \neq 0$ in first column
Here's a way, but I doubt it can work with MathJax.
\documentclass{article}
\usepackage{amsmath}
\newsavebox{\firstcolbox}
\begin{document}
\[
\sbox\firstcolbox{$\displaystyle
\begin{matrix}0\\\vdots\\0\\a_{i1}\\0\\\vdots\\0\end{matrix}$}
\begin{bmatrix}
\usebox\firstcolbox &
\!\!\!
\fbox{\rule[-.9\dp\firstcolbox]{0pt}{.9\dimexpr\ht\firstcolbox+\dp\firstcolbox}%
\hspace{6\wd\firstcolbox}}
\,\,\,
\end{bmatrix}
\]
\end{document}
Ok, I tested this on the math overflow site (note the backticks):
`$\begin{bmatrix}\begin{matrix} 0\\ \vdots\\ 0 \\ a_{i1} \\ 0 \\ \vdots \\ 0\end{matrix} &
\bbox[84px, border: 2px solid black]{}\end{bmatrix}$`
Here is the output:
I have found this site to test mathjax input. Here is the output of the same code (in the meantime I have learned about the \enclose
command in mathJax which could be useful (as \phantom
works)):
Sorry for the superfluous backticks in the image above. I could not get the \enclose
to work as this is a mathjax
extension which is not automatically loaded. But the following code works (sorry there is one extra row of zeros):
\begin{bmatrix}\begin{matrix} 0\\ \vdots\\ 0 \\ a_{i1} \\ 0 \\ \vdots \\ 0\end{matrix} & \bbox[border:1px solid black]{\phantom{\begin{matrix}
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\\end{matrix}}}\end{bmatrix}
Output:
Actually I just see on this official mathjax site that \fbox
works with MathJax v2.1
. I tried it works, and in fact even the amsmath
\boxed
is available:
\begin{bmatrix}\begin{matrix} 0\\ \vdots\\ 0 \\ a_{i1} \\ 0 \\ \vdots \\ 0\end{matrix} & \boxed{\phantom{\begin{matrix}
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0\\\end{matrix}}}\end{bmatrix}
Oh, I left some \mathstrut
inside. Anyway, I think this is enough.