1

I'm working on a two-sided document which collates a number of files using the subfiles package, some of which require wider margins for margin notes. However, the \newgeometry command consistently fails to apply to the last page of each subfile in the main document, despite applying correctly in each of the individual subfiles. Here's a vastly simplified example to illustrate:

Main file (name.tex):

\documentclass{book}

\usepackage{subfiles}
\usepackage{geometry}
\usepackage{lipsum}
\usepackage{showframe}

\begin{document}
\subfile{name2}
\end{document}

subfile (name2.tex):

\documentclass[/name]{subfiles}
\begin{document}
\newgeometry{
    top=72pt, inner=72pt, bottom=72pt, outer=216pt, marginparwidth =144pt
    }
\lipsum[1-10]
\end{document}

Which results in this pdf compiled from the subfile: enter image description here

And this pdf compiled from the main file: enter image description here

Does anyone know how this might be resolved?

0

1 Answer 1

1

End your subfile with a \newpage to force LaTeX to finish the page under the current settings:

\documentclass[name]{subfiles} %changed /name to name, needed on my system
\begin{document}
\newgeometry{
    top=72pt, inner=72pt, bottom=72pt, outer=216pt, marginparwidth =144pt
    }
\lipsum[1-10]
\newpage
\end{document}
1
  • This resolves the issue. Thank you!
    – cora
    Commented Jul 8, 2021 at 13:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .