TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to have an environment that encloses all its content into the typewriter font as \texttt{} does. However, I do not want to use \texttt{} but an own environment, e.g. \begin{allintypewriter} because my text contains multiple paragraphs.

So instead of

My multiparagraph text

I'd like to write

My multiparagraph text

Sorry, it's a newbe question, but how do I define a \newenvironment for this? (I do not want to use something like \verbatim because the text to be set as typewriter should contain other latex commands; only the font should be changed to typewriter for this environment)

share|improve this question
up vote 10 down vote accepted

The more general version of you question is dealt with here:

How do I use a particular font for a small section of text in my document?

But since you only need to change the font family and not the font itself, your particular instance of it is much simpler:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.