[texhax] parpic causes orphaned subsections headings

Andy Farnell padawan12 at obiwannabe.co.uk
Wed Apr 9 04:03:22 CEST 2008

Sorry to have another question so soon,

This is aimed at Donald, who I belive may know the answer, but
all other suggestions are welcome.

I once posted about a problem with orphaned section and subsection
headings. Several of you kindly offered solutions, some of which had 
an effect, some of which didn't, but none completely solved the problem.

So, still stuck with this, and I want to attack it again. 

Using picins (\parpic) to create paragraphs which begin with a
wrapped figure and text flowing around it.

For example:

\subsection{Random selection}
\pargraf{images/puredata/random-select}{Random select}{fig:randomselect}{0.6}{r}{12pt}
To choose one of several events with uniform probability a combination...

which calls (defined elsewhere)

% Main side graphic, left or right
\captionsetup{font=footnotesize, labelfont=bf}
\parpic[#5]{\includegraphics[angle=0, scale=#4]{#1}}

So, what happens is this... very often the heading (usually a subsection) is
orphaned and everything starts on the next page. This happens even when
there is plenty of room on the previous page.

\clubpenalty etc have absolutely no effect.

\parpic is essential, I cannot change this as the indented text contains
other small figures and hence \wrapfig is unsuitable.

Research led me to this problem which seems relevant. In this case
the author is having trouble with enumerated lists causing a similar


where Michael Rolfe writes:

>> and a page break occurs between the paragraph header and the first
>> \item in the list. That is, the paragraph header is an orphan.

Donald Arseneau replies:

> The \paragraph command puts the title at the start of a
> paragraph, but your paragraph body is null, so the title
> is the entire paragraph. An entire paragraph is not
> considered an orphan.

Donald then goes on to provide a solution 


So, I have my figure code wrapped in a new command that embeds \parpic
and what I would like is modify this to ***FORBID*** LaTeX from breaking
a page immediately after a subsection heading (whatever the cost - if problems
arise I will have to edit the text at that point)

Unfortunately I don't understand \makeatletter, \makeatother.

Will happily provide links to source and output examples if this helps.

Thankyou all again for help solving this annoying problem and sorry to
keep pestering with it, unfortunately the previous suggestions failed, I think
this is a more subtle problem.


Use the source

More information about the texhax mailing list