A programming tool that I use (coqdoc) generates LaTeX documentation from my source code. Parts of the manual include pretty-printed code listings and math proofs.
These listings and proofs are rather math-heavy, and thus are not wrapped in verbatim or lstlistings. When successions of dashes are found (-- or ---) in code or proofs, they are dumped literally in the LaTeX output, and thus get converted to – and — as the document is typeset by pdflatex. Code and proof listings are wrapped in a particular environment, which I can renew.
What can I add to my preamble to disable en and em dash ligatures in that specific environment?
Ideally, I would like something like the following:
\documentclass{article}
\usepackage[T1]{fontenc}
\renewenvironment{coqdoccode}{MAGIC HERE}{}
\begin{document}
This should be an an and an em dash: -- ---
\begin{coqdoccode}
This should be two and three small dashes: -- ---
This should still be ligatures: ff fi
\end{coqdoccode}
\end{document}
microtype only seems to be able to disable ligatures at the entire document level.


verbatimenvironment use\@noligsto stop--ligatures, and the tt font has no ff ligatures, is monospace acceptable for this use? – David Carlisle Apr 07 '15 at 17:57