# How to Create an Image for Cantor's *Diagonal Argument* with a Diagonal Oval

I would like to produce an illustration for Cantor's diagonal argument, something like a centered enumeration of $4$ or $5$ decimal expansions $x_{i} = .d_{i1}d_{i2}d_{i3} \ldots$, and then insert a diagonal oval circumscribing $d_{11}, d_{22}, d_{33}, \ldots$.

What is a good way to do this?

I have come up with the following, but I'm not sure it will allow me to insert the diagonal oval? (which I don't know how to do.)

I don't know if the latex documentation will format properly as this is my first question post on this site.

Thank you.

\documentclass{book} \usepackage{amsthm,latexsym,amssymb,amsmath,verbatim}

\pagestyle{empty}

\begin{document}

[ x_{1} = .d_{11}d_{12}d_{13}d_{14}d_{15} \ldots ] [ x_{2} = .d_{21}d_{22}d_{23}d_{24}d_{25} \ldots ] [ x_{3} = .d_{31}d_{32}d_{33}d_{34}d_{35} \ldots ] [ x_{4} = .d_{41}d_{42}d_{43}d_{44}d_{45} \ldots ] [ x_{5} = .d_{51}d_{52}d_{53}d_{54}d_{55} \ldots ] [ \hskip -100pt \vdots ]

\end{document}

• MathJax isn't enabled on this site, so math expressions aren't rendered as math. To highlight code properly, select it and hit Ctrl + K (or click the button marked {} above the input field). – Torbjørn T. Jul 27 at 18:35
• Thank you, I did not know that. (And thank you for your edit.) – mlchristians Jul 27 at 18:36

I propose this code, based on alignat and pstricks:

\documentclass[11pt, svgnames]{book}

\usepackage{amsthm,latexsym,amssymb,amsmath, verbatim}
\usepackage{makebox}
\usepackage{pst-node, auto-pst-pdf}
\pagestyle{empty}

\begin{document}

\begin{postscript}
\everypsbox{\scriptstyle}
\begin{alignat*}{7}
x_{1} & = . &\: & d_{\rnode{d1}{1}1} & & d_{12} & & d_{13} & & d_{14} & & d_{15} & \; & \ldots \\
x_{2} & = . & & d_{21} & \enspace & d_{\rnode{d2}{2}2} & & d_{23} & & d_{24} & & d_{25} & & \ldots \\
x_{3} & = . & & d_{31} & & d_{32} & \enspace & d_{ \rnode{d3}{3}3} & & d_{34} & & d_{35} & & \ldots \\
x_{4} & = . & & d_{41} & & d_{42} & & d_{43} & \enspace & d_{\rnode{d4}{4}4} & & d_{45} & & \ldots \\
x_{5} & = . & & d_{51} & & d_{52} & & d_{53} & & d_{54} & \enspace & d_{\rnode{d5}{5}5} & & \ldots\\[-1.33ex]
\makebox*{$x_{5}$}{$\vdots$} & & & & & & & \makebox*{$d_{53}$}{$\vdots$} & & & & & \enspace & \Rnode{dd}{\ddots}
\end{alignat*}
\ncbox[boxsize=0.22, linearc=0.22, linecolor=FireBrick, nodesep=1.5ex, fillstyle=solid, fillcolor=FireBrick!20, opacity=0.3]{d1}{dd}
\end{postscript}

\end{document}


• This is much nicer than I had hoped for! Thank you. – mlchristians Jul 27 at 21:33