I'm trying to typeset a matrix which has entries of differing widths. However, for aesthetic reasons, I would like each of the columns of the matrix to be the same width, and I'd furthermore like them to be right-aligned.
I'm working in the tabularx environment (because of its ability to adjust column width uniformly). However, if I compile
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{array}
\usepackage{tabularx}
\begin{document}
\[
\left[
\begin{tabularx}{1in}{XXX}
x & 0 & y\\
0 & y & -x
\end{tabularx}
\right]
\]
\end{document}
then the columns don't have the desired justification. I looked through the tabularx documentation and discovered that I should define a new column type. So I tried the following:
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{array}
\usepackage{tabularx}
\begin{document}
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}
\[
\left[
\begin{tabularx}{1in}{RRR}
x & 0 & y\\
0 & y & -x
\end{tabularx}
\right]
\]
\end{document}
This produced no change in output. What am I missing?
EDIT: The following code
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{array}
\usepackage{tabularx}
\begin{document}
\newcolumntype{P}{>{\raggedleft\arraybackslash }p{.075in}}
\newcolumntype{Q}{>{\raggedleft\arraybackslash $}p{0.075in}<{$}}
$\left[\begin{array}{PPP}
x & 0 & y\\
0 & y & -x
\end{array}\right]$
\qquad
$\left[\begin{array}{QQQ}
x & 0 & y\\
0 & y & -x
\end{array}\right]$
\end{document}
produces THIS output:

