I have some arrays in math mode, such as the one below. I would like a diagonal line in a cell, something like diagbox
(diagobx package) or diaghead
(makecell package). But it seems that diagbox
and diaghead
only work in a tabular
environment. Of course a way to go consists in using tabular
instead of array
but this requires to put some $
's in each cell. I'm looking for a less tedious solution.
\documentclass{article}
\usepackage{diagbox}
\begin{document}
$$
\begin{array}{r|cccc}
%\diagbox{x}{y}
& (0,0) & (0,1) & (1,0) & (1,1) \\
\hline
(0,0) & \phi^{-1} & \frac{f_n}{f_{n-1}} - \phi^{-1} & 0 & \frac{f_{n+1}}{f_{n-1}} \\
(0,1) & f_{n}/f_{n-1} & 0 & f_{n+1}/f_{n-1} & 0 \\
(1,0) & \phi^{-1} & \phi^{-2} & 0 & 0 \\
(1,1) & 1 & 0 & 0 & 0 \\
\end{array}
$$
\end{document}