Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How do I customize the size of the output pages in the memoir class?

For example, how could I change the page size to 6x9 (while preserving the margin proportions and headers/footers I use) in the following MWE?

\documentclass[11pt,a4paper]{memoir}

% customize
\setstocksize{297mm}{210mm}
\settrimmedsize{\stockheight}{195mm}{*}
\settypeblocksize{671.6pt}{335.8pt}{*}
\setlrmargins{*}{*}{4}
\setulmargins{*}{*}{2}
\setmarginnotes{5mm}{45.23mm}{\onelineskip}
\setlength{\footskip}{3.0\baselineskip}
\checkandfixthelayout

% headers and footers
\nouppercaseheads
\makepagestyle{mystyle} 
\setlength{\headwidth}{\dimexpr\textwidth+\marginparsep+\marginparwidth\relax}
\makerunningwidth{mystyle}{\headwidth}
\makeevenhead{mystyle}{\itshape\leftmark}{}{}
\makeoddhead{mystyle}{}{}{\itshape\leftmark}
\makeevenfoot{mystyle}{\thepage}{}{}
\makeoddfoot{mystyle}{}{}{\thepage}
\makepsmarks{mystyle}{\createmark{chapter}{left}{}{}{}}
\makeatletter
\makepsmarks{mystyle}{\createmark{chapter}{left}{shownumber}{\@chapapp\ }{:\ }}
\makeatother
\makepagestyle{plain}
\makerunningwidth{plain}{\headwidth}
\makeevenfoot{plain}{\thepage}{}{}
\makeoddfoot{plain}{}{}{\thepage}
\pagestyle{mystyle}

\begin{document}
Here is some text.
\end{document}

P.S. Currently, my document has \documentclass[11pt,a4paper]{memoir} at the top--does this control the page size?

share|improve this question
2  
You could use the geometry package. –  Peter Grill Dec 25 '11 at 2:32
add comment

1 Answer 1

up vote 12 down vote accepted

Since memoir provides its own set of page layout macros, it's best to use them rather than resort to something like geometry. Also, using a4paper followed \setstocksize{297mm}{210mm} is superfluous, since a4paper has those dimensions exactly. In fact, if you choose the document class option a4paper with memoir, it executes \stockaiv, which is defined as

\newcommand*{\stockaiv} {\stockheight=297mm \stockwidth=210mm}

So, either use a4paper or \setstocksize{297mm}{210mm}, but not both.

In order to reduce the page size from 297mm x 210mm to 9in x 6in "while preserving the margin proportions and headers/footers", I would figure out the ratios between the two sizes knowing that

1mm ~  2.84526pt
1in ~ 72.26999pt

As such, the following settings are used:

\documentclass[11pt,showtrims]{memoir}

% Original setup
% \setstocksize{297mm}{210mm}
% \settrimmedsize{\stockheight}{195mm}{*}
% \settypeblocksize{671.6pt}{335.8pt}{*}

% New setup
\setstocksize{9in}{6in}
\settrimmedsize{\stockheight}{\dimexpr 6in-15mm}{*}
\settypeblocksize{516.9312pt}{243.6962pt}{*}

It kept the same proportions between the page size and the text block, but kept the trimming margins the same (15mm less than \stockwidth). The original is shown on the left, while the new is shown on the right at the same resolution (for comparison purposes):

enter image description here

share|improve this answer
    
Is \checkandfixthelayout needed for the new layout to be applied in mid-document? Also, do you change layout before or after a newpage? –  Nyiti Apr 23 '13 at 7:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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