When I try to compile the MWE below with xelatex, I get the following:
*geometry* detected driver: pdftex
)
*
The * seems to be a prompt: pressing ENTER gives
*
(Please type a command or say `\end')
*
(Please type a command or say `\end')
*
(Please type a command or say `\end')
*
The .log file isn't useful. Leaving aside whatever the actual error in my document is, I don't understand what's happening: why is LaTeX pausing in this fashion without emitting any error?
MWE:
\documentclass[a4paper,10pt]{article}
\usepackage[landscape,hmargin={1.2cm,1cm},vmargin=1cm,footskip=7mm]{geometry}
\usepackage[no-math]{fontspec}
\usepackage[T1]{fontenc}
\makeatletter
\begingroup
\lccode`\~`\\
\lowercase{\endgroup
\def\vb{%
\par
\parindent\z@
\parskip1\baselineskip plus 2pt\relax
\let\do\@makeother\dospecials%
\let\@xobeysp\space
\catcode`\ \active
\catcode`\\\active
\let~\scanendvb
}}
\def\scanendvb#1#2#3#4#5#6#7{%
\def\x{#1#2#3#4#5#6#7}%
\ifx\x\endvbstr
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
{\end{vb}}{\char`\\#1#2#3#4#5#6#7}}
\edef\endvbstr{end\string{vb\string}}
\makeatother
\def\endvb{\par}
\newenvironment{almsinp}{\begin{minipage}[t]{0.5\textwidth}\begin{vb}}{\end{vb}\end{minipage}}
\begin{document}
\begin{almsinp}
Definition 2.1.2.
A _metric space_ M = (A, d) consists of a non-empty set A together with a map d : A\times A -> \bfR such that:
(M1a) d(x, y)\geq 0 for all x, y in A.
(M1b) d(x, y) = 0 <=> x = y for all x, y in A.
(M2) d(x, y) = d(y, x) for all x, y in A.
(M3) d(x, y)+d(y, z)\geq d(x, z) for all x, y, z in A.
The elements of A are called the _points_ of the metric space M, and d is called a _metric_ on A. We sometimes also call d the _metric_ of M.
\end{almsinp}
\end{document}
vbenvironment as argument to other commands. It's a limitation holding for all "verbatim-type" environments. – egreg Dec 8 '12 at 15:20