Page LayoutText block not as spec'd & now hits footer? [Memoir]

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Julian_S_Moore
Posts: 72
Joined: Sun Nov 16, 2008 1:26 pm

Text block not as spec'd & now hits footer? [Memoir]

Post by Julian_S_Moore »

EDIT: didn't notice the error - they are attached now in a ZIP]

[The MWE references one font "Bookman Old Style" - you might need to replace it. I have attached the referenced EPS graphic files]

"Simple" question(s)?

As shown I set the textblock height to be 540pt, but when it's processed it comes out at 550pt and I lose the gap that I thought I had between the bottom of the textblock and the footer. Any idea why - and why I seem to have lost the footskip?

(I guess it is \checkandfixthelayout, but I've done all the calculations in a spreadsheet and don't see why it should be changing anything. If I just use \fixthelayout the result is the same, but I don't get the readout of the layout parameters. If I do neither, the layout is completely wrong... even though the parameters I've set look perfectly sensible to me.)

Code: Select all

\documentclass[final,twoside,openright,showtrims,10pt]{memoir} % 
\usepackage{calc, wrapfig}
\usepackage{xltxtra,fontspec,xunicode}
\usepackage{lipsum}
\usepackage[calc]{picture}

\stockroyalvo
\settrimmedsize{663.3pt}{440pt}{*}
\setlength{\trimtop}{\stockheight}
\addtolength{\trimtop}{-\paperheight} % - \paperheight
\setlength{\trimedge}{\stockwidth} % \trimedge = \stockwidth
\addtolength{\trimedge}{-\paperwidth} % - \paperwidth
\settrims{0.5\trimtop}{\trimedge}
\settypeblocksize{540pt}{344pt}{*} % {344pt}{*} %{322.6pt}{*}

\setulmargins{56pt}{*}{*} % keep type block and page size fixed, spec top margin to text block only
\setlrmargins{*}{*}{1} % edge margin is 3rd (last) parameter * the spine margin

\setheadfoot{36pt}{36pt} % header height and footskip (distance from the bottom of the text block to the footer)
\setheaderspaces{*}{12pt}{*} % specify only the headsep (distance from the bottom of the header to text block)
\checkandfixthelayout

\setlength{\pdfpagewidth}{\paperwidth}
\setlength{\pdfpageheight}{\paperheight}

% Font stuff
\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{Bookman Old Style}
\setlxvchars[\normalfont] % main font, involved in optimal character to line fitting
\font\bookmanNine="Bookman Old Style" at 9pt
\font\bookmanNineItalic="Bookman Old Style Italic" at 9pt

% Graphics
\newcommand{\starBreakChapterStart}{%
	\begin{center}
	\makebox(\textwidth, 72pt){\includegraphics{WingDing24.eps}} 
	\end{center}
}

% Page & Chapter setup
\makepagestyle{fragPage}
\makefootrule{fragPage}{\textwidth}{0.5pt}{0pt} % NOTE THE EXTRA footskip parameter % for testing only
\makeevenhead{fragPage}{}{\fontsize{11.5}{13.8} \fontspec[Color=AAAAAA, FakeSlant=0.2]{Bookman Old Style} \leftmark}{}
\makeoddhead{fragPage}{}{\fontsize{11.5}{13.8} \fontspec[Color=AAAAAA, FakeSlant=0.2]{Bookman Old Style} \rightmark}{}

\makeoddfoot{fragPage}%
	{\raisebox{26pt}[0pt][0pt]{Ch\thechapter{}P\thesheetsequence{}.eps}}% raise to align with top of graphic
	{\includegraphics[height=36pt]{TestChapterGraphic.eps}}%
	{\raisebox{26pt}[0pt][0pt]{\thepage}}
\makeevenfoot{fragPage}%
	{\raisebox{26pt}[0pt][0pt]{\thepage}} % raise to align with top of graphic
	{\includegraphics[height=36pt]{TestChapterGraphic.eps}}%
	{\raisebox{26pt}[0pt][0pt]{Ch\thechapter{}P\thesheetsequence{}.eps}}

\makeatletter % GENERALLY required in case of \@chapapp usage in \makepsmarks
	\makepsmarks{fragPage}{
	\nouppercaseheads % I don't like the uppercase heads
	\createmark{chapter}{both}{nonumber}{}{}
	}
\makeatother % RETURN @ to being a non-letter

\makepagestyle{fragFirstChPage}
\makefootrule{fragFirstChPage}{\textwidth}{0.5pt}{0pt} % NOTE THE EXTRA footskip parameter % for testing only
\makeevenhead{fragFirstChPage}{}{}{}
\makeoddhead{fragFirstChPage}{}{}{}
\makeoddfoot{fragFirstChPage}%
	{\raisebox{26pt}[0pt][0pt]{Ch\thechapter{}P\thesheetsequence{}.eps}}%
	{\includegraphics[height=36pt]{TestChapterGraphic.eps}}%
	{\raisebox{26pt}[0pt][0pt]{\thepage}}
\makeevenfoot{fragFirstChPage}{}{}{}
  
\makechapterstyle{fragChap}{% Param 1 is the name of the chapter style to be made, and #2 is the code...
  \setlength{\beforechapskip}{-2\headsep}
  \setlength{\midchapskip}{0pt}
  \setlength{\afterchapskip}{0.9\headsep}
  
	\renewcommand*{\printchaptername}{}
	\renewcommand*{\printchapternum}{}
	\renewcommand*{\printchapternonum}{}
	\renewcommand*{\afterchapternum}{}
	\renewcommand*{\chaptitlefont}{\fontsize{24}{24} \fontspec{Bookman Old Style}}
	\renewcommand*{\printchaptertitle}[1]{\centering\chaptitlefont ##1}
}

\aliaspagestyle{chapter}{fragFirstChPage}	% this points the "chapter" pagestyle at the fragFirstChPage style
	
% Based on the implementation of chapterprecis this handles the placement of the chapter myth a bit like a chapterprecis
\newcommand{\chaptermyth}[1]{%
  \chaptermythhere{#1}}
  
\newcommand{\chaptermythhere}[1]{%
  \premyth #1 \postmyth}

\newcommand{\premyth}{%
	\setcounter{sheetsequence}{1} % reset "per chapter" page count, get as \thesheetsequence
  \begin{myth}}

\newcommand*{\postmyth}{\vfill \end{myth}}

% Environments
\newenvironment{myth}
	{\bookmanNineItalic \centering \setlength{\parindent}{0pt} \setlength{\parskip}{6pt}}
	{}
\newenvironment{narrative}%
	{\bookmanNine \setlength{\parindent}{12pt} \setlength{\parskip}{0pt}}
	{}
	
\begin{document}
	\pagestyle{fragPage} \chapterstyle{fragChap} 
	\aliaspagestyle{cleared}{fragPage}
	\chapter{Star}
		\chaptermyth{\lipsum[1-4]}
		\cleardoublepage
		\starBreakChapterStart
		\begin{narrative}
			\lipsum[5-12]
		\end{narrative}
\end{document}
Thanks!
Attachments
Texblock MWE EPS files.zip
(10.88 KiB) Downloaded 278 times
Last edited by Julian_S_Moore on Fri Nov 20, 2009 12:13 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Julian_S_Moore
Posts: 72
Joined: Sun Nov 16, 2008 1:26 pm

Re: Text block not as spec'd & now hits footer? [Memoir]

Post by Julian_S_Moore »

A clue perhaps...

It occurred to me that Memoir prefers the textheight to be an integral number of lines. I had calculated the text block height to be 540pt based on 45 lines of 12pt (10pt + 2pt leading = 10pt font size and 12pt \baselineskip) but what if the font wasn't 10pt...

I don't know how to interpret the log where there are some references to Bookman scaling so I've attached it, in case it's relevant.

However, on the basis of this hypothesis I measured the text block size and counted the lines: 550pt, but 46 lines... 45 lines is 538pt (measured in Photoshop). So I reduced the requested size to 538pt (no change) and then 537pt and suddenly the textheight is now 538pt.

It would seem (I haven't cross checked with the manual yet) that Memoir only rounds up...

However, the smaller text block still hits the footer (3 out of 4 pages in another test run).

Help?

Where's the footskip gone?
Attachments
TextBlock oversized MWE.log
Log for MWE (not as amended in my own reply)
(21.75 KiB) Downloaded 290 times
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Text block not as spec'd & now hits footer? [Memoir]

Post by meho_r »

Sorry for not giving a constructive solution of suggestion, but did you try to set your layout with geometry instead of doing it "memoir's way"? I find it much easier to set. Just a thought...
Julian_S_Moore
Posts: 72
Joined: Sun Nov 16, 2008 1:26 pm

Text block not as spec'd & now hits footer? [Memoir]

Post by Julian_S_Moore »

Thanks for the input meho_r.

The problem is now Solved. I misunderstood the way Memoir does its textheight calculation and mistook \footskip for a footer separation (my value was far too small...)

When things don't work the lesson seems to be: check any assumptions about the way things work and what commands/macros/values refer to!

Copied from my post in reply to Lars Madsen's response in comp.text.tex

From the Memoir manual (\flushbottom in effect): "if b is the \baselineskip and t is the \topskip, N is an integer (the number of lines in the typeblock), and T is the \textheight then to avoid underfull vboxes the following relationship must hold T =(N−1)b+t "

Since it has not been cbanged from the default \topskip is (assumed to be) 10pt, and since \baselineskip is 12pt, the formula gives T=(45-1)x12 +10 = 538pt, which is therefore exactly right wrt to the \textheight.

\topskip specifies the distance from the top of the typeblock to the bottom of the 1st line (so as not to waste the (\baselineskip - \topskip) empty space), similarly \footskip specifies the distance from the bottom of the text block to the bottom of the footer.
Post Reply