Page Layout ⇒ How to change trimmed paper size mid-document with the same stock paper size
How to change trimmed paper size mid-document with the same stock paper size
Project MWE code can be found in this link: https://www.sharelatex.com/5258121182fkxppbnvfsjr
The problem is in pages ix and x (9 and 10). The code for this page are located in /intro/Not_blank.tex.
The paper size initializations are located in /setup/papersetup.tex and the geometry package initialization is located in /setup/packages.tex.
The file you need to compile is /main.tex.
I tried doing a Google search, but nothing came up.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
How to change trimmed paper size mid-document with the same stock paper size
as information for our readers, this question has been posted to TeX.SE too, and there's already a solution by David Purton. He wrote:
You can use the standard memoir commands to change the document page layout.
The only catch is that the size of the type set text block isn't automatically changed by memoir. Changing this mid-document can be a bit tricky, but you can copy what the geometry package does to do this provided you also surround things with a couple of \newpage commands.
Code: Select all
\documentclass{memoir}
\usepackage{showframe}
\usepackage{lipsum}
\setstocksize{7in}{5in}
\settrimmedsize{7in}{5in}{*}
\setlrmarginsandblock{.5in}{1in}{*}
\setulmarginsandblock{1in}{1in}{*}
\checkandfixthelayout
\makeatletter
% adapted from \Gm@changelayout geometry.sty
\newenvironment{newlayout}[1]{%
\newpage
#1%
\setlength{\@colht}{\textheight}
\setlength{\@colroom}{\textheight}%
\setlength{\vsize}{\textheight}
\setlength{\columnwidth}{\textwidth}%
\if@twocolumn%
\advance\columnwidth-\columnsep
\divide\columnwidth\tw@%
\@firstcolumntrue%
\fi%
\setlength{\hsize}{\columnwidth}%
\setlength{\linewidth}{\hsize}}{\newpage}
\makeatother
\begin{document}
\lipsum[2]
\begin{newlayout}{%
\setstocksize{6in}{4in}
\settrimmedsize{6in}{4in}{*}
\setlrmarginsandblock{.5in}{1in}{*}
\setulmarginsandblock{1in}{1in}{*}
\checkandfixthelayout
\fixpdflayout}
\lipsum[2]
\end{newlayout}
\lipsum[2]
\end{document}