0

I write some introductory system administration notes for my students.

Some text and some lines of verbatim Unix commands, repeatedly.

I disabled indentation of text paragraphs following

How to disable automatic indentation on new paragraphs?

and set an indentation for the verbatim parts following

How can I indent verbatim blocks?

using verbatim package and redefining \verbatim@processline .

This was a quick hack that worked, now the explaining text starts to the left of verbatim commands.

However, on the long run, it would be nice to have indentation for longer paragraphs. Is there a way to do this? Longer as in at least two lines long.

Gergely
  • 1,065
  • 1
  • 8
  • 17
  • 2
    Best to have indentation and then use \noindent where you don't want that, changing the setting automatically for short paragraphs is tricky unless you change the markup so that each paragraph text is the argument to some command, so that you can test setting on one line, and if it doesn't fit, re-typeset as a paragraph. (This is exactly what the standard \caption does) But evaluating the text twice has other problems, you need to be careful with counters and cross references, to ensure that things don't get incremented twice. – David Carlisle Sep 21 '15 at 13:54

1 Answers1

1

For commands and such take a peek at the packages for typesetting program listings, e.g. listings (my personal favorite), but there are alternatives like minted that use the extremely flexible Pygments Python library. This one is said to require more installation effort, but might be easier to coax into handling other "non-program-listing" texts.

vonbrand
  • 5,473