Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Memoir - Footskip awol (and Memoir's textheight adjustments)

55 views
Skip to first unread message

Julian I-Do-Stuff

unread,
Nov 20, 2009, 8:33:08 AM11/20/09
to
As shown in the MWE below I set the textblock height to be 537pt (when
processed it comes out at 538pt) but I do not seem to have the
specified \footskip.

When I had spec'd the textheight as (45 lines of 10pt text) to be
540pt (=45*(10+2)pt), it was coming out as 550pt. I guess the
adjustment is done by \checkandfixthelayout, I know Memoir prefers the
textheight to be an integral number of lines... so what if the font
wasn't exactly 10pt (owing to the use of XeTeX, fontspec, etc.)?

On the basis of this hypothesis I measured the text block size in
Photoshop. I confirmed the nominal page size as correct on open and
measured the height to be 660x440 in printer's points of 72.27/in. I
then counted the lines and found 46 lines in the 550pt textblock,
which implied a font size of 11.957pt.

I therefore reduced the requested size (to force Memoir to round-up
closer the value I wanted) first to 538pt (no change) and then 537pt -
which gave me the current \textheight of 538pt.

However, whilst the text block is now (almost) exactly the size I
require and contains 45 lines, it still hits the footer. The
\uppermargin is correctly 56pt and the lower margin is correctly 66pt
(both values calculated and measured). but where is my 12pt \footskip?

Even eliminating the raiseboxes and thr graphic from the footers does
not give me the 12pt \footskip specified.
(\makeoddfoot{fragPage} {\thepage}{}{} \makeevenfoot{fragPage}
{\thepage}{}{})

I hope that's enough info to allow someone to help clear this up!

Thanks...

Minimal working example: (use anything you like for the graphics
files, they have nominal square bounding boxes of 368pt
(TestChapterGraphic) and 26pt (WIngDing24) but they are scaled when
inserted).

NB The \textwidth is not the lxvchars value of 322.6pt because that
caused some ugly wrapping and page overlflow on text that must fit on
exactly one page.

PS this description and MWE supersedes that at LaTeX Community

\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{537pt}{344pt}{*}

\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}{12pt} % 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-30]
\end{narrative}
\end{document}

Lars Madsen

unread,
Nov 20, 2009, 9:16:48 AM11/20/09
to
Julian I-Do-Stuff wrote:
> As shown in the MWE below I set the textblock height to be 537pt (when
> processed it comes out at 538pt) but I do not seem to have the
> specified \footskip.
>
> When I had spec'd the textheight as (45 lines of 10pt text) to be
> 540pt (=45*(10+2)pt), it was coming out as 550pt. I guess the
> adjustment is done by \checkandfixthelayout, I know Memoir prefers the
> textheight to be an integral number of lines... so what if the font
> wasn't exactly 10pt (owing to the use of XeTeX, fontspec, etc.)?
>

no, that it not the right way to calculate it it is \topskip + (n-1) x
\baselineskip (or something like that)

depending on the algorithm used by \checkandfixthelayout you will always
get a textheight \leq the requested height, or a height that is slightly
larger than the requested height.

--

/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html

Julian I-Do-Stuff

unread,
Nov 20, 2009, 10:38:59 AM11/20/09
to
Lars Madsen wrote:

> no, that it not the right way to calculate it it is \topskip + (n-1) x
> \baselineskip (or something like that)
>
> depending on the algorithm used by \checkandfixthelayout you will always
> get a textheight \leq the requested height, or a height that is slightly
> larger than the requested height.

Thank you for the clarification and prompting me to look again more
closely; \topskip doesn't appear in the Memoir page layout diagrams
(which I was entirely focussed on) so I didn't take it into account
(because I now know I don't need to either!). My mistake... I had
also mistaken the \footskip for a footer separation: it was far too
small. My second mistake. Understanding considerably advanced now.

The rest is for the benefit of others who might find this helpful.

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.

Lars Madsen

unread,
Nov 20, 2009, 10:48:06 AM11/20/09
to

it is a bit hard to understand, so I'm going to explain it a bit better
in the manual, also in relation to an earlier posting.

Julian I-Do-Stuff

unread,
Nov 20, 2009, 3:35:55 PM11/20/09
to
Lars Madsen wrote:

> it is a bit hard to understand, so I'm going to explain it a bit better
> in the manual, also in relation to an earlier posting.

All clarifications welcome! As a novice of ~2 working weeks standing
it appears that documentation is generally written for the initiated,
and whilst there are some things that obviously must be taken as read,
sometimes a little too much is assumed (in general); having said that,
the Memoir manual is generally delightful.

It's not so much "hard to understand" as "slippery to grasp";
inconsistencies in approach - such as specifying the upper margin,
then the header by height at a certain heigh above the text block, and
then the footer by a completely different method is not easy to get to
grips with at first.

Personally I would have had a headsep (from top of page to top of
header), header height, block sept (to top of text block), footer sep
and then footer height - so that all lengths stacked up, but defining
the upper margin to be the 1st three elements, and the lower margin
the last two... I'm sure there are good reasons for things being the
way they are, but unless one knows it's just arcane :)

It's good there are many helpful people around willing to tackle the
questions of the confused beginner. - Thanks.

Lars Madsen

unread,
Nov 21, 2009, 4:23:49 AM11/21/09
to

there are many things in LaTeX that are odd. But if you look at them
closer there is often a good reason behind them.

0 new messages