I am trying to typeset a sparse matrix:
\documentclass{article}
\usepackage{amsmath}
\newcommand{\z}{0} % Zero entry
\begin{document}
$$
\begin{pmatrix}
\dot{\mathit{vx}} & \dot{\mathit{vy}} & \dot{x} & \dot{y} & F \\
\hline \\
\z & \z & -1 & \z & \\
\z & \z & \z & -1 & \z \\
1 & \z & \z & \z & -x \\
\z & 1 & \z & \z & -gy \\
\z & \z & \z & \z & \z
\end{pmatrix}
$$
\end{document}
In order to enhance readability, I can set \z to use a light grey. But I'd also like to test different options (or reuse the code in slides etc.) like setting every non-zero cell in boldface.
Except from defining a nonzero command (which would be somewhat tedious), is there a simple way to set every entry in boldface but \z?


$$...$$-- use\[...\]– Jul 08 '16 at 15:36\[…\]preferable to$$? – Werner Jul 08 '16 at 15:49