Thursday, March 29, 2012

LaTeX: Creating Doubled Quine Corners

Quine corners are the symbols to enclose Church numerals. In LaTeX, one can create a macro to achieve it.

\documentclass{article}
\usepackage{amsmath}
\def \quine #1{
 \mbox{$\ulcorner$\hspace{-4pt}$\ulcorner$}
 #1
 \mbox{$\urcorner$\hspace{-4pt}$\urcorner$}
}
\begin{document}
$\quine i$
\end{document}

An equivalent way follows

%church number of lambda terms
\def \ch #1{
  \ulcorner #1 \urcorner
}

%quine corners for numerals
\def \quine #1{
   \ch  {\mbox{\hspace{-4pt}} \ch{ #1} \mbox{\hspace{-4pt}}}
}
The result is like $$\ulcorner \hspace{-4pt} \ulcorner n \urcorner \hspace{-4pt} \urcorner$$

No comments:

Post a Comment