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$$

Wednesday, March 28, 2012

pdflatex: Combining Multiple .pdf Files

A real example.

\title{The Essential C Notes}
\author{
\url{http://www.acm.uiuc.edu/webmonkeys/book/c_guide/}
}
\date{\today}
\documentclass{article}
\usepackage{grffile} %to treat the spaces in the file name%
\usepackage{pdfpages} %the package to do the combination job%
\usepackage{hyperref} %for the hyperlink%
\begin{document}
\maketitle
\includepdf[pages=-]{C Guide--1.pdf} %pages=- means all the pages%
\includepdf[pages=-]{C Guide--1.3 function.pdf}
\includepdf[pages=-]{C Guide--1.4 pointer.pdf}
\includepdf[pages=-]{C Guide--1.5 operators.pdf}
\includepdf[pages=-]{C Guide--1.6 statements.pdf}
\includepdf[pages=-]{C Guide--1.7 preprocessing.pdf}
\includepdf[pages=-]{C Guide--2.12 stdio.pdf}
\includepdf[pages=-]{C Guide--2.13 stdlib.pdf}
\includepdf[pages=-]{C Guide--2.14 string.pdf}
\includepdf[pages=-]{C Guide--2.15 time.pdf}
\includepdf[pages=-]{C Guide--2.7 math.pdf}
\includepdf[pages=-]{C Guide--Appendix A ASCII Chart.pdf}
\end{document}