[comp.text.tex] \parindent rides again

dorai@titan.rice.edu (Dorai Sitaram) (05/06/91)

I'd like for my paragraphs to undergo \parindentation only when they
have leading spaces -- or tabs -- in the source.  (While I'm in broad
agreement with LaTeX's indentation policy -- I do want indented
paragraphs most of the time --, the constant use of \noindent to
suppress \parindentation at several crucial points drives me up the
wall -- in addition to probably being against Hosek's Never Do
Procedurally What You Can Do Structurally commandment.)

  Thus, this paragraph is indented.

This isn't.

I've tried using \everypar to \futurelet the following character
(after making spaces temporarily active) and check for spaceness, but
it appears LaTeX's \sectioning commands -- and probably a host of
others -- mess with \everypar too, occasioning too much crossfire.
I'd be grateful for any ideas.

--d

eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) (05/07/91)

dorai@titan.rice.edu (Dorai Sitaram) writes:

>I'd like for my paragraphs to undergo \parindentation only when they
>have leading spaces -- or tabs -- in the source.  (While I'm in broad
>agreement with LaTeX's indentation policy -- I do want indented
>paragraphs most of the time --, the constant use of \noindent to
>suppress \parindentation at several crucial points drives me up the
>wall -- in addition to probably being against Hosek's Never Do
>Procedurally What You Can Do Structurally commandment.)

1/ Read my article in TUGboat about indentation for
a quite general way of doing things.

2/ Don't you think you're abusing TeX here? It is way
easier to step outside TeX and use a simply editor
command 1,$s/^  */\\indent / or something like that
to do what you want to.

>I've tried using \everypar to \futurelet the following character
>(after making spaces temporarily active) and check for spaceness, but
>it appears LaTeX's \sectioning commands -- and probably a host of
>others -- mess with \everypar too, occasioning too much crossfire.
>I'd be grateful for any ideas.

Oh you're using LaTeX? That has mechanisms for automating
indentation, and you're supposed to use these. Otherwise
you might just as well write your own macro package.
LaTeX has in its \@startsection command (and \@list et cetera)
all of the tools to prevent indentation *structurally*
at all the places where you want it.

Victor.

jpl1@Isis.MsState.Edu (Gamma-Ray Burst) (05/07/91)

dorai@titan.rice.edu (Dorai Sitaram) writes:

>I'd like for my paragraphs to undergo \parindentation only when they
>have leading spaces -- or tabs -- in the source.  (While I'm in broad
>agreement with LaTeX's indentation policy -- I do want indented
>paragraphs most of the time --, the constant use of \noindent to
>suppress \parindentation at several crucial points drives me up the
>wall -- in addition to probably being against Hosek's Never Do
>Procedurally What You Can Do Structurally commandment.)

WHy not simply turn off indent with \parindent=0pt and then define your
own indent to use when you want?


--
John Patrick Lestrade, PhD
Department of Physics and Astronomy
Mississippi State University, MS 39762
Voice: (601) 325-2806  Fax: (601) 325-8898

dhosek@euler.claremont.edu (Don Hosek) (05/07/91)

In article <1991May6.151933.9484@rice.edu>, dorai@titan.rice.edu (Dorai Sitaram) writes:
> I'd like for my paragraphs to undergo \parindentation only when they
> have leading spaces -- or tabs -- in the source.  (While I'm in broad
> agreement with LaTeX's indentation policy -- I do want indented
> paragraphs most of the time --, the constant use of \noindent to
> suppress \parindentation at several crucial points drives me up the
> wall -- in addition to probably being against Hosek's Never Do
> Procedurally What You Can Do Structurally commandment.)

TeX guru: someone who has principals named after him? ;-)
 
>   Thus, this paragraph is indented.
 
> This isn't.
 
> I've tried using \everypar to \futurelet the following character
> (after making spaces temporarily active) and check for spaceness, but
> it appears LaTeX's \sectioning commands -- and probably a host of
> others -- mess with \everypar too, occasioning too much crossfire.
> I'd be grateful for any ideas.

Aside from the input, you're still being visual. Where and why
are you placing \noindent commands? My money is after displayed
text (equations, quotations, lists). If I'm right, your problem
can be solved by leaving out the blank line after the
\end{equation}, \end{itemize}, \], etc. commands. e.g.,

Einstein's formula
\[
E=mc^{2}
\]
is a simplification of the general form

rather than

Einstein's formula
\[
E=mc^{2}
\]

\noindent is a simplification of the general form


-dh

-- 
Don Hosek                  | To retrieve files from ymir via the mailserver,
dhosek@ymir.claremont.edu  | send a message to mailserv@ymir.claremont.edu 
Quixote Digital Typography | with a line saying send [DIRECTORY]FILENAME
714-625-0147               | where DIRECTORY is the FTP directory (sans 
---------------------------+ "anonymous") and FILENAME is the filename, e.g. 
"send [tex]00readme.txt". There is a list of files in each directory under the 
name 00files.txt. Binary files are not available by this technique.