1

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}
\addtolength{\trimedge}{-\paperwidth}
\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:

single spacing, plain break single spacing, fancy break

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:

one-half spacing, plain break one-half spacing, fancy break

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
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.