# Changing textblock and margin size mid-document with memoir

In a memoir document, I'd like to set different textblock size and margins for the back matter, to give wider space for a glossary.

Similar questions have been asked about changing page layout settings in memoir, nonetheless I can't produce a consistent result (if any). I'm probably missing some trivial step in the MWE below.

\documentclass[11pt]{memoir}

\usepackage{multicol}
\usepackage{calc}

\setstocksize{9in}{6in}
\settrimmedsize{\stockheight}{\stockwidth}{*}
\settrims{0pt}{0pt}
\settypeblocksize{32\baselineskip + \topskip}{*}{0.577}% 1/1.732 (sqrt(3)), Hexagon ratio
\setlrmargins{*}{*}{1.125}% 1/0.889 major 2nd ratio
\setulmargins{*}{*}{1.701}% Tall Pentagon ratio
\setlength{\footskip}{3\baselineskip}
\checkandfixthelayout

\begin{document}

\mainmatter

\chapter{A Message From Mars}

In plain English, at 4 a.m., a ray of light had been observed on the
disc of the planet Mars in or near the "terminator"; that is to
say\ldots

\backmatter

\settypeblocksize{32\baselineskip + \topskip}{110mm}{*}
\setlrmargins{*}{14mm}{*}
\checkandfixthelayout

\chapter{Glossary}

Some ten times round the world. Well, is that tremendous vacuum
absolutely impassable?''

\begin{multicols}{2}

\begin{description}
\item[The next] evening promised well, and I kept my appointment, but unfortunately a slight haze
\item[gathered] in the sky and prevented us from making further observations.
\item[While] hoping in vain for it to clear away, Professor Gazen and I talked
\end{description}

\end{multicols}

\end{document}


The log prints the new page dimensions:

...
Text height and width: 446.2002pt by 257pt
Spine and edge margins: 82.88574pt and 93.2786pt
...
Text height and width: 446.2002pt by 312pt
Spine and edge margins: 80.80585pt and 39.83385pt
...


But somehow it ain't happening:

-

Add this after \checkandfixthelayout (might also be a good idea to add a \clearpage before changing the layout)

\setlength{\vsize}{\textheight}
\setlength{\columnwidth}{\textwidth}%
\setlength{\hsize}{\columnwidth}%
\setlength{\linewidth}{\hsize}


It is taken from geometry.sty

Edit:

\makeatletter
\ch@ngetext
\makeatletter


should do the same. Not quite sure why this was not added to \checkandfix...

-
Awesome! This has been driving me nuts! –  sh1ftst0rm May 13 '13 at 19:07

Here's a MWE of @daleif's solution:

\documentclass[b5paper]{memoir}

% Set some custom paper size and layout
\setstocksize{240mm}{170mm}
\settrimmedsize{240mm}{170mm}{*}
\medievalpage[9]
\checkandfixthelayout

\usepackage{lipsum} % dummy text

\begin{document}
% Reset the margins to be symmetric
\setlrmarginsandblock{2cm}{2cm}{*}
\setulmarginsandblock{2cm}{2cm}{*}
\checkandfixthelayout

% Magic happens here. Comment this to get non-symmetric margins
\makeatletter
\ch@ngetext
\makeatletter
\clearpage

% Now center something on the page.
% Vertical centering is still somewhat off?
\vspace*{\fill}
\begin{center}
{\Huge + }
\end{center}
\vspace*{\fill}
\clearpage

\lipsum
\lipsum

\end{document}


To revert this, it seems the following works (although I don't know why), \ch@ngetext seems to be a toggle:

\medievalpage[9]
\checkandfixthelayout
\makeatletter
\ch@ngetext
\makeatletter
\clearpage
\cleardoublepage

-