I'm working on a memoir class document which happens to use interparagraph spacing rather than indented first lines, yet I'm trying to create an environment that showcases sample text - I'm calling it hangingsample - where:

  • the text is indented (like in a quote or quotation environment),
  • the text is set in typewriter font (I use \texttt for this),
  • the text is set \raggedright,
  • each paragraph uses hanging indentation (like in APA referencing), and
  • the interparagraph spacing is zero.

To illustrate:

sample effect

The only way I have managed to create this effect thus far is to do everything manually, combining the figure, minipage, and hangparas environment, the \raggedright command, and enveloping each separate paragraph in \texttt{x} and following up each paragraph with \vspace{-\parskip}:

Preceding text ...

\texttt{Technic is ... LEGO.}\vspace{-\parskip}

\texttt{Technic sets are ... electric motors.}\vspace{-\parskip}

\texttt{The style of ... technic bricks.}\vspace{-\parskip}

\texttt{Lego Technic. ... wiki/Lego\_Technic}

Following text...

surely this cannot be the most economical way of doing it... I'm looking for a simple new (or renewed) environment that does all of these things.

So far, I have created the following environment:

\everypar{\hangafter=1 \setlength{\hangindent}{5mm}}\ttfamily\raggedright}

Which achieves most points except the full indentation of the paragraphs.

Anyone any idea what I could do to solve this?

Most kind regards,



2 Answers 2


Define your own environment:


    \setlength{\parsep}{0pt plus 1pt}%







enter image description here


Hope this helps. It's an adaptation of Herbert's answer to Within a single paragraph, hang a wrapped line, but do not hang new lines. Being based in a minipage, this environment won't break between pages.








enter image description here

  • I have a feeling @egreg's solution will work even better for me, but I will give both a try. Thanks!
    – Krottsy
    Commented Sep 29, 2016 at 4:44
  • @Krottsy No doubt! Any egreg's solution will work better than mine. He knows what he's doing. ;-)
    – Ignasi
    Commented Sep 29, 2016 at 7:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .