[texhax] Conditional control of paragraph spacing.

Ben Whale ben.whale at anu.edu.au
Fri Sep 22 01:34:28 CEST 2006


Thank you so much for the advice.  Your suggestion didn't work, it put a
\smallskip after every section heading and no where else.  I did, however,
try this out

 \newenvironment{Para}
   {\if at nobreak \else \smallskip \fi
   \noindent\ignorespaces}
   {\ignorespacesafterend}

which work perfectly.  Again, thank you.  Do you know where I can find a
list of latex switches (eg @nobreak or @afterindent)?

Ben

FWI these are the packages I'm using:
\input xy
\xyoption{all}
\usepackage{amsfonts}
\usepackage{eufrak}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{mathrsfs}
\usepackage{graphicx}
\usepackage{psfrag}
\usepackage{amssymb}
\usepackage{fancyhdr}
\usepackage{ifthen}

> -----Original Message-----
> From: Uwe Lueck [mailto:uwe.lueck at web.de]
> Sent: Friday, 22 September 2006 6:03 a.m.
> To: Ben Whale; texhax at tug.org
> Subject: Re: [texhax] Conditional control of paragraph spacing.
>
>
>
> "Ben Whale" <ben.whale at anu.edu.au> schrieb am 19.09.2006 15:18:30:
> >
> > I want to produce an environment so that when it follows anything but a
> > chapter( or section, subsection, etc...) command it inserts a
> \smallskip.  I
> > have been unable to do this.  Help please!
> >
> > Here is a small example of code that I have tried, but that doesn't work
> >
> > \newboolean{indent}
> > \setboolean{indent}{false}
> >
> > \newcommand{\bensection}[1]{\setboolean{indent}{false}\section{#1}}
> >
> > \newenvironment{Para}
> > {\ifthenelse{\boolean{indent}}{\smallskip}{\setboolean{indent}{true}}
> > \noindent\ignorespaces}
> > {\ignorespacesafterend}
>
> This seems to do the \smallskip before every Para occurence in a section
> except the first one. Instead you need a Para that can find out whether
> it is the first paragraph in the section. LaTeX uses \everypar for such
> purposes; unfortunately in a way that doesn't allow the user to use
> \everypar for her/his own purposes additionally. Quickly I can only
> suggest the following hack using LaTeX's internal switch \if at nobreak:
>
> \newenvironment{Para}
>   {\if at nobreak \smallskip \fi
>   \noindent\ignorespaces}
>   {\ignorespacesafterend}
>
> It is quite probable that this fails with certain packages or classes
> (like memoir!?) that give the user more flexibility than Standard LaTeX
> does. Such a package or class may, on the other hand, provide a more
> legal and stable alternative to that \if at nobreak.
>
> Hope this helps,
>
> Uwe Lueck.
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.405 / Virus Database: 268.12.6/453 - Release Date: 20/09/2006
>
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.7/454 - Release Date: 21/09/2006



More information about the texhax mailing list