Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 at 14:44

1 Answer 1

It ain't pretty:-)

enter image description here

\documentclass{article}

\begin{document}

\noindent X\dotfill X

\noindent X\dotfill X


\begin{sloppypar}
\setlength\parindent{-1cm}%
\setlength\leftskip{1cm}
\def\par{%
\ifnum\lastpenalty=-10000 \endgraf\else
\leavevmode\unskip\linebreak
\fi}
\obeylines

1   blah blah blah blah ..
    blah blah blah blah..
    :::

2   blah blah blah blah blah blah..
    blah blah ..
    :::
\end{sloppypar}

\end{document}
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 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 at 14:46

Your Answer

 
discard

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.