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 have a document (a lease) which I have painstakingly typed as a text file from a hard-copy and would now like to format with justified paragraphs but retaining the current line endings (to facilitate checking for typos and any missing sections etc and to preserve the original pages).

So I was wondering what the simplest approach would be. If necessary I'd be content to surround each text line with its own TeX annotation, although this would be very repetitive and would increase the TeX document length and reduce its readability.

So I wondered if there was a simpler approach that could deal with entire paragraphs or more with a single annotation.

Also, whatever approach I adopt, from the kind suggestions of experts on here must support overhanging indents, e.g.

1   blah blah ..
    blah blah ..
share|improve this question
Welcome to TeX.SX! – Adam Liter Apr 2 '14 at 14:44

It ain't pretty:-)

enter image description here



\noindent X\dotfill X

\noindent X\dotfill X

\ifnum\lastpenalty=-10000 \endgraf\else

1   blah blah blah blah ..
    blah blah blah blah..

2   blah blah blah blah blah blah..
    blah blah ..

share|improve this answer
Wow that's almost perfect, not too cumbersome as it applies to a whole paragraph, and such a fast reply - Very many thanks. My only slight niggle is that the first word after the section number should line up with subsequent indented lines, rather than the number and the word all being lumped in together for the purpose of justifying the line. – John R Ramsden Apr 2 '14 at 14:37
@JohnRRamsden it will do that if you replace 1 blah with \makebox[1cm][l]{1}blah to stop that first space stretching – David Carlisle Apr 2 '14 at 14:46

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.