A contact has asked for a documents pages to be set to 130 x 198mm – and so my \documentclass[12pt,a5paper]{book}
isn't going to cut it – how do I specify page size in mm?
[Tex/LaTex] Set page size in mm’s
paper-size
Related Solutions
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):
I think this does the job. Thnaks to the idea \pdfpageheight=\pagetotal
from wipet's answer How to have a precise control on the size of each page?
\documentclass{article}
\newlength{\initialVerticalInset}
\setlength{\initialVerticalInset}{4.5cm}
\usepackage[paperwidth=10cm,
paperheight=-\dimexpr\initialVerticalInset- 10cm\relax,
margin=0mm]{geometry}
\makeatletter
\newcommand{\setnewvsize}[1]{%
\global\paperheight\dimexpr#1+\initialVerticalInset\relax%
\global\pdfpageheight\paperheight%
\global\textheight\paperheight%
\global\@colht\textheight \global\@colroom\textheight \global\vsize\textheight%
\global\initialVerticalInset=0pt}
\let\mt@outputpage\@outputpage
\def\@outputpage{\mt@outputpage\setnewvsize\paperheight}
\makeatother
\AtEndDocument{\initialVerticalInset=0pt\vskip-\lastskip\nobreak\par\vskip1pt\par\setnewvsize\pagetotal}
\usepackage{lipsum}
\begin{document}
This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it?
This is a test:
\begin{itemize}
\item Hello
\item This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test.
\item Good Bye
\item Hello
\item This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test.
\end{itemize}
This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it?
This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it?
This is a test. This is a longer sentence with some more words, isn't it? This is a test. This is a longer sentence with some more words, isn't it?
\end{document}
Itemize
mdframed
Example 2 pages only
Example only one page
Best Answer
See page 6 of the
geometry
package manual: