[comp.text.tex] Every paragraph must be indented

palkovic@linac.fnal.gov (John A. Palkovic) (12/16/90)

No doubt this has been asked before. Flamers please ignore. I have RTFM.

I am writing a document with the report style in \LaTeX. How can I get
every paragraph indented? The default is to not indent paragraphs at
the beginning of chapters and sections. I know about \indent, I'm
looking for something with a global effect I can put in my preamble.

Thanks.

-- 
John Palkovic (708) 840-3527	| palkovic@linac.fnal.gov
"A Superconductor generates electricity without resistance when cooled." 
- Chicago Tribune, Oct. 21, 1990, A-18 

eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) (12/17/90)

palkovic@linac.fnal.gov (John A. Palkovic) writes:

>No doubt this has been asked before. Flamers please ignore. I have RTFM.

Yes. This is in a manual that Lamport should have written,
but hasn't.

There is no simple command to put in your preamble.
You have to dig into the .sty file. (May I ask if you have thought
this decision over, to indent every paragraph? It goes against
all typografic practice. What's you reason for discarding 5 centuries
of tradition, common sense, and experience? Never mind. Just know
what and why you are doing.)

In the .sty files you will find that all sectioning commands
(well, most) are implemented in terms of \@startsection, of which
here follows the explanation from latex.tex:
% \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}
%            optional * [ALTHEADING]{HEADING}
%    Generic command to start a section.
%    NAME       : e.g., 'subsection'
%    LEVEL      : a number, denoting depth of section -- e.g., chapter=1,
%                 section = 2, etc.
%    INDENT     : Indentation of heading from left margin
%    BEFORESKIP : Absolute value = skip to leave above the heading.
%                 If negative, then paragraph indent of text following
%                 heading is suppressed.
%    AFTERSKIP  : if positive, then skip to leave below heading, else
%                 negative of skip to leave to right of run-in heading.
%    STYLE      : commands to set style

You see that by inverting the beforeskip you can get indentation.

Victor.

palkovic@linac.fnal.gov (John A. Palkovic) (12/21/90)

It has been suggested (via email) that I post a followup. I know this
is not considered good style by some. I also know of grad schools and
journals that require it, so someone may find it helpful. The problem
was to make *every* paragraph of a LaTeX report style doc. be
indented.

The best solution came from David Carlisle:

-----------snip snip-----------
Put the following code in a file indentfirst.sty

then put
\documentstyle[indentfirst]{report}
or whatever. This should work with report article or book styles.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%                  indentfirst.sty
%                  %%%%%%%%%%%%%%%
%
% Make the first line of all sections etc be indented by the usual
% paragraph indentation.
%  
%                   David Carlisle
%                   carlisle@uk.ac.man.cs
%                   31/10/90
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\let\@st@rtsection\@startsection

\def\@startsection#1#2#3#4{\skip@=#4\relax
\ifdim \skip@ < \z@ \skip@=-\skip@\fi
\@st@rtsection{#1}{#2}{#3}{\skip@}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

-----------snip snip-----------

--
John Palkovic (708) 840-3527	| palkovic@linac.fnal.gov
"A Superconductor generates electricity without resistance when cooled." 
- Chicago Tribune, Oct. 21, 1990, A-18 

eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) (12/22/90)

palkovic@linac.fnal.gov (John A. Palkovic) writes:

>The best solution came from David Carlisle:
I'd want to argue about that 'best', but for the moment...

>or whatever. This should work with report article or book styles.

Nope. The \chapter command in the report and \part command
in the article styles are in implemented in terms of 
\@startsection, so they are not affected.

Victor.

carlisle@cs.man.ac.uk (David &) (01/03/91)

The following code causes the first paragraph of LaTeX sections etc. to be
indented.

As Victor Eijkhout mentioned in an earlier posting, my indentfirst.sty, as
posted by John Palkovic, does not work with the \part and \chapter commands
in the standard styles.

I have no strong feelings about whether this is "good style", but a quick
look at various journals and textbooks in my office shows that it is quite
common to indent the first paragraph of a section.

   David Carlisle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%                  indentfirst.sty
%                  %%%%%%%%%%%%%%%
%
% Make the first line of all sections etc be indented by the usual
% paragraph indentation.
%  
%                   David Carlisle
%                   carlisle@uk.ac.man.cs
%                   2/1/91
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\let\@afterindentfalse\@afterindenttrue
\@afterindenttrue

--
                           David Carlisle
                                    JANET: carlisle@uk.ac.man.cs

                                    Computer Science Deptartment
                                    Manchester University
                                    Oxford Road
                                    Manchester
                                    England
                                    M13 9PL