# [texhax] Avoid paragraph indentation on new page?

Edsko de Vries edsko at edsko.net
Sat Nov 24 16:34:07 CET 2007

Hi,

A final follow-up question in light of all the strong recommendations
not to do this. Suppose I wanted to avoid indenting the first paragraph
on a page only if it is a very small paragraph, such as

Consider the following example:

--- indented example ---

Continuation..

Consider the following example:

-- indented example ---

Continuation..

This is mainly why I wanted to avoid the indendation, because I think it
doesn't look right that the 'Consider..' is indented as much as the
example; it's ok when the paragraph is longer:

Consider the blah blah blah blah blah blah
blah blah blah following example:

-- indented example --

Continuation..

because now the example clearly stands out again. Can I in some way
manually call your 'checkandfixparindent' macro before the 'Consider the
following example' paragraph? (I tried calling it directly just before
the paragraph but that either has no effect or gives the following
error:

! You can't use \lastbox' in vertical mode.

Using '\leavevmode\checkandfixparindent' doesn't work either (although
it gets rid of the error) -- I suspect that this is because the macro is
now somehow removing the wrong box or something like that, but I don't
know how to fix it. I also tried

\newcommand*\noindentatnewpage{%
\stepcounter{par-position}%
\message{\zposy{par-\number\value{par-position}}}%
\ifnum\zposy{par-\number\value{par-position}} > 43500000\relax
% the value depends on your layout - check with the messages written
\noindent%
\fi
\zsavepos{par-\number\value{par-position}}%
}

where I modified your macro to use a \noindent if the condition it true
but that doesn't quite work either (it does something; it sometimes
removes the parindent, but not always..) but I have to admit that I
don't really understand what the rest of the macro does.

`