# Make the \ddots looks well in a transformed matrix

I want to typeset a large matrix:

\addtocounter{MaxMatrixCols}{8}
\begin{pmatrix}
1\\
&\ddots\\
&      &1\\
&      & &0& &      & &1& &      &\\
&      & & &1&      & & & &      &\\
&      & & & &\ddots& & & &      &\\
&      & & & &      &1& & &      &\\
&      & &1& &      & &0& &      &\\
&      & & & &      & & &1&      &\\
&      & & & &      & & & &\ddots&\\
&      & & & &      & & & &      &1
\end{pmatrix}


I had to change the \arraycolsep so as to fit for paper width:

\setlength\arraycolsep{3pt}


and then the \ddots in the matrix look a bit ugly:

So I changed the \arraystretch

\renewcommand\arraystretch{0.8}


the dots all are too low and has not a conspicuous improvement:

You could use commands of the graphicx package for rotating and raising the dots, such as \rotatebox and \raisebox. Define a macro for it, preferably also macros for the value. So you could easily adjust it if necessary.

\documentclass{article}
\usepackage{amsmath}
\setlength\arraycolsep{3pt}
\usepackage{graphicx}
\newcommand{\dotsangle}{-12}
\newcommand{\dotsxshift}{.2ex}
\newcommand{\dotsyshift}{1ex}
\newcommand{\rdots}{\hspace{\dotsxshift}%
\raisebox{\dotsyshift}{\rotatebox{\dotsangle}{$\ddots$}}}
\begin{document}
$\begin{pmatrix} 1\\ &\rdots\\ & &1\\ & & &0& & & &1& & &\\ & & & &1& & & & & &\\ & & & & &\rdots& & & & &\\ & & & & & &1& & & &\\ & & &1& & & &0& & &\\ & & & & & & & &1& &\\ & & & & & & & & &\rdots&\\ & & & & & & & & & &1 \end{pmatrix}$