# Memoir class \pfbreak spacing inconsistency

I am using XeLaTeX and the Memoir class, and the xeCJK package for typesetting Chinese. The space taken up by \pfbreak is two lines by default, and it's the same for both the "plain" break in the middle of the page and the "fancy" version at the top or bottom. But this doesn't seem to be working correctly, especially when line spacing is changed. This is demonstrated in the following MWE. The Chinese font I'm using is SimSun, which is available from MS Windows.

% !TEX TS-program = xelatex
% !TEX encoding = UTF-8 Unicode

\documentclass[11pt]{memoir}
\usepackage{xeCJK}
\usepackage{layouts} %To check page layout
\usepackage{indentfirst} %Indent the first paragraph of a section

%%% Book Layout %%%
\setstocksize{5.5in}{4.5in}
\settrimmedsize{5.5in}{4.5in}{*}
\setlength{\trimtop}{0pt}
\setlength{\trimedge}{\stockwidth}
\settypeblocksize{4in}{3in}{*}
\setulmargins{0.7in}{*}{*}
\setlrmargins{0.75in}{*}{*}
\setmarginnotes{0pt}{0pt}{0pt}
\checkandfixthelayout

%%% xeCJK Options %%%
\setCJKmainfont{SimSun}
\xeCJKsetup{PunctStyle=kaiming}
\xeCJKsetup{CheckSingle=true}
\xeCJKsetup{CJKecglue={\hskip 0.15em plus 0.05em minus 0.05em}}

%%% Other Settings %%%
%\OnehalfSpacing
%\DoubleSpacing
\raggedbottom
\setlength{\parindent}{2em}
\widowpenalty=10
\clubpenalty=10

%%% Document Proper %%%
\begin{document}

\pfbreak

\pfbreak

\end{document}


Here's the output:

As you can see, the plain break seems to be working properly, but the fancy break is taking up more than two lines.

Here's the output for one-half spacing:

Now the fancy break is almost correct, but seems to be off by just a little bit, and the plain break is now too short. Double spacing has similar problems.

I don't know if this is intended or a bug. I looked at the code in memoir.cls, but it involves output routines and is completely over my head. I know you can adjust the space by setting \pfbreakskip, but I would like the plain and fancy breaks take up exactly the same amount of space.

Any help would be greatly appreciated.

• After looking at the code again and some simple test, I found part of the problem. Apparently \pfbreakskip is not properly updated. By inserting \setlength{\pfbreakskip}{2\baselineskip} into the \@pfbreakgap (and \@spfbreakgap) command, the plain break now works correctly. The fancy break still takes up more space than it should though. – zzjing Sep 26 '17 at 18:26
• In order for the fancy break to work properly at the top of the page, the height of the \vbox in this part of the code: \def\pfbre@kdispl@y{\vbox to 1\pfbreakskip{\vss \hb@xt@ \columnwidth{\hss \pfbreakdisplay \hss}% \vss}} should be \topskip+\baselineskip. I'm not sure how this length and \pfbreakskip should be defined so that they will be properly updated with changes in font and linespacing. – zzjing Sep 27 '17 at 5:32
• Another problem is that, if there is space for 3 lines left in the page at such a break, it will insert a fancy break and then start a new page even if \clubpenalty is set to 0 (unless the next paragraph is a single line, of course). And I haven't figured out how to change that. – zzjing Sep 27 '17 at 5:32
• Of course, the \@afterheading in \@pfbreakgap inserts a local \clubpenalty of 10000. This is probably considered intended, but at least I can hack it now if I want to change it. – zzjing Sep 27 '17 at 20:41

I know this is a very late answer, and I saw the question not long after it was posted, but at the time I had this issue and couldn't resolve it. I couldn't make fancybreaks at the top and bottom of the page line through with unbroken text.

Now, I've gone back to my book to define a template and worked out how to fix it.

In the end, I stopped using the \pfbreak shortcut and instead defined a comand that performed this:

\plainfancybreak{3\baselineskip}{1}{*\quad*\quad*}


This made the middle of page breaks one line high (the 1 in the middle parameter) and only put in the asterisks (the final parameter) if there were three lines height (the first parameter). I do not use raggedbottom or flushbottom as a setting, and my paragraph skipping and separation are zero, as below (I write novels, so the separation between them must be the same as lines in the same paragraph).

\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}


I don't set

\pfbreakskip


because the plainfancybreak command ignores this. I've never added penalties as I don't understand what they do.

I hope this goes some way towards fixing your issue!

• You do neither use \raggedbottom nor \flushbottom? What do you do then? – TeXnician Jun 2 '18 at 9:17
• Because the fancybreaks have a consistent height (and I've se the spacing after chapter headers) it all seems to settle on the grid fine. I may try those options to see if it affects anything as I now get an underfull vbox warning but see no visual problem. – Rexx Magnus Jun 2 '18 at 13:16
• As far as I know one of these options is always set… – TeXnician Jun 2 '18 at 13:35
• This may be the cause of my underfull error. I'll try them to see what happens. – Rexx Magnus Jun 2 '18 at 14:03
• @TeXnician - I have added raggedbottom (but kept options of parskip and parsep 0), which seems to have fixed the issue. The only problem I was left with was using {verse}, which had inconsistent spacing above and below. Rather than use lots of workarounds, I just defined my own environment with margins and spacing to match my layout, and everything's fine! – Rexx Magnus Jun 3 '18 at 5:38