# First page number misplaced when using subfile and loadgeometry

In a document (memoir class), I need to have a title page with large margins compared to the rest of the document. To do that, I use \savegeometry/\loadgeometry. However, if I include this title using subfile (that allows individual compilation of chapters), the first page numering is misplaced (way too below, actually in the MWE it even touches the border of the page, making it hard to even see).

MWE:

in e.tex:

\documentclass[../e]{subfiles}
\begin{document}
\savegeometry{Mem}
\newgeometry{margin=2.7cm}
%%%% Title %%%%%
\noindent\rule{\linewidth}{1cm}

My title with large margins

\noindent\rule{\linewidth}{1cm}
\clearpage
\end{document}


in d.tex:

\documentclass[a4paper,12pt]{memoir}

%% To change the size of the title page
% https://tex.stackexchange.com/questions/308795/in-memoir-remove-all-margins-from-a-page
\usepackage[pass]{geometry}

%% ========== Page numbering, headers/foooters ==========
% The pages are numbered consecutively at the bottom centre of the page
\makepagestyle{myvf}
\makeoddfoot{myvf}{}{\thepage}{}
\makeevenfoot{myvf}{}{\thepage}{}
% Chapter is written on even pages (left aligned), sections are written on odd pages (right aligned)
\pagestyle{myvf}

\usepackage{xr-hyper} %% Allow cross references between files in subfiles
\usepackage{subfiles}
\externaldocument{\subfix{}}

\begin{document}
\subfile{e}

\pagenumbering{roman}
Blabla

\newpage
Blabla
\end{document}


EDIT In my larger document, I also have the same issue when I use \input, but this is not reproducible in this MWE... I've no idea what's going on...

EDIT2 According to Different typeblocksize in the same document with memoir it seems that using \twocolumn\onecolumn forces TeX to recompute the layout... and actually it seems to work... except that it seems to add some blank pages (but only in my actual document, this is not visible on the MWE, not sure why...)

• Were you able to solve the problem? Was Simon's answer helpful? Feb 10 at 15:54
• @gernot not really. Basically, \twocolumn\onecolumn solves the position in the page in the MWE, but in my actual document it seems to add two blank pages (no idea why, I need to investigate). On the other hand, Simon's answer does not really work as he actually removed the bottom margin in the \newgeometry. And I actually need to change the bottom margin as well. Feb 10 at 16:09

Having e.tex in the same directory as d.tex

and using this file you get a nice clean title page and the number of the first page in the right place.

\documentclass[./d]{subfiles} % changed from  ../e to .d <<<<

\begin{document}

• Thanks, and sorry, I don't know why but I missed your answer. You example seems to work because you removed the bottom margin in the newgeometry. But I do need need to change also the bottom margin. Try to use instead \newgeometry{left=1cm, right=1cm, bottom=1cm}, you will have the same problem as me. Feb 10 at 16:04