[comp.text.tex] Sometimes want no \parindent

jg@prg.ox.ac.uk (Jeremy Gibbons) (05/07/91)

Don Hosek writes:

> 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. 

Better still, you can get \end to do it for you:



\def\noparindent{\everypar{{\setbox0=\lastbox}\everypar{}}}

\newif\if@noparindent \@noparindentfalse

\def\end#1{\csname end#1\endcsname
        \if@noparindent
           \global\let\@gtempa\noparindent
        \else
           \if@endpe
              \global\let\@gtempa\@doendpe
           \else
              \global\let\@gtempa\relax
           \fi
        \fi
     \endgroup % end the group opened by \begin{...}
     \@checkend{#1}%
     \@gtempa
     \if@ignore 
        \global\@ignorefalse \ignorespaces
     \fi}

\def\display{\equation}
\def\enddisplay{\@noparindenttrue\endequation}


% We redefine \end{...} so it looks for the flag \if@noparindent.
% This gets set by displayed-material environments to indicate
% that paragraph indentation of the following paragraph should
% be switched off.
% 
% I can say
% 
%    waffle waffle.
%
%    \begin{display}
%       x &=& y
%    \end{display}
%
%    Waffle waffle...
% 
% and get
%
%    waffle waffle.
%
%                      x  =  y
%
%    Waffle waffle...
%
% (without any paragraph indentation).
%
% Should you *want* paragraph indentation, you need to give a definition
% like the following
%
%    \def\noparindent{} % clobbers the no-paragraph-indentation facility
%




Jeremy

*-----------------------------------------------------------------------*
|  Jeremy Gibbons (jg@prg.oxford.ac.uk)   Funky Monkey Multimedia Corp  |
*-----------------------------------------------------------------------*