LaTeX forum ⇒ Page LayoutHow to change trimmed paper size mid-document with the same stock paper size

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Posts: 1
Joined: Fri Dec 22, 2017 11:25 pm

How to change trimmed paper size mid-document with the same stock paper size

Postby krow4869 » Sat Dec 23, 2017 2:37 am

Basically what the subject says.

Project MWE code can be found in this link:

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.


User avatar
Stefan Kottwitz
Site Admin
Posts: 8954
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Dec 27, 2017 12:49 pm


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.

  1. \documentclass{memoir}
  2. \usepackage{showframe}
  3. \usepackage{lipsum}
  4. \setstocksize{7in}{5in}
  5. \settrimmedsize{7in}{5in}{*}
  6. \setlrmarginsandblock{.5in}{1in}{*}
  7. \setulmarginsandblock{1in}{1in}{*}
  8. \checkandfixthelayout
  9. \makeatletter
  10. % adapted from \Gm@changelayout geometry.sty
  11. \newenvironment{newlayout}[1]{%
  12. \newpage
  13. #1%
  14. \setlength{\@colht}{\textheight}
  15. \setlength{\@colroom}{\textheight}%
  16. \setlength{\vsize}{\textheight}
  17. \setlength{\columnwidth}{\textwidth}%
  18. \if@twocolumn%
  19. \advance\columnwidth-\columnsep
  20. \divide\columnwidth\tw@%
  21. \@firstcolumntrue%
  22. \fi%
  23. \setlength{\hsize}{\columnwidth}%
  24. \setlength{\linewidth}{\hsize}}{\newpage}
  25. \makeatother
  26. \begin{document}
  27. \lipsum[2]
  28. \begin{newlayout}{%
  29. \setstocksize{6in}{4in}
  30. \settrimmedsize{6in}{4in}{*}
  31. \setlrmarginsandblock{.5in}{1in}{*}
  32. \setulmarginsandblock{1in}{1in}{*}
  33. \checkandfixthelayout
  34. \fixpdflayout}
  35. \lipsum[2]
  36. \end{newlayout}
  37. \lipsum[2]
  38. \end{document}

memoir.png (27.59 KiB) Viewed 612 times

Site admin

Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 2 guests