¿Por qué el paquete de geometría está alterando mis márgenes?

¿Por qué el paquete de geometría está alterando mis márgenes?

Quiero escribir un documento aprovechando la mayor cantidad de página posible. El código que estoy usando es este (descargo de responsabilidad: tomé el texto de muestra deaquí):

\documentclass[12pt, oneside, a4paper]{memoir}

\usepackage{layout}
\usepackage{showframe}

%\usepackage[a4paper]{geometry}

\usepackage{amssymb, amsfonts, amsthm}
\newtheorem{problem}{Problem}

\begin{document}
\title{Sample Document}
\author{John Doe}
\maketitle

\layout{}

Here is some sample text to show you what LaTeX does. 

To start a new paragraph, you need to leave a line of white space in your tex file.

To include math, you have two options. The first is called ``in line,'' and you do this by putting your math between two dollar signs (\$). For example, Fermat's Little Theorem tells us that if $p$ is a prime and $a$ is an integer such that $p \nmid a$, then $a^{p-1} \equiv 1 \pmod{p}$. Note that the exponent on $a$ has to go in braces (in the tex file). 

But if you really want an equation (or congruence) to stand out, then you ``display'' the math. It looks like this:
\[
    a^{p-1} \equiv 1 \pmod{p}.
\]
Nice, right?

Finally, we can make things look really nice for homeworks as follows:

\begin{problem}
    Let $X$ and $Y$ be blah blah blah \ldots
\end{problem}

\begin{problem}
    Let $X$ and $Y$ be as in the previous problem. What is $Z$?
\end{problem}

Notice that LaTeX automatically numbers the problems for us. 

\end{document}

Se ve bonito, pero con mucho papel sin usar en los lados: Sin geometría

Sin embargo, tan pronto como descomento la línea que invoca el paquete de geometría, los márgenes se estropean, aunque ni siquiera he emitido ningún comando para modificarlos. Geometría

Intenté consultar algunas fuentes, pero no mencionan que haya sucedido algo así, por lo que me gustaría entender por qué la geometría se comporta de esa manera.

Además, si es posible, algo de ayuda puede ayudar a escribir el código correctamente para dejar el menor espacio de papel posible sin utilizar.

Respuesta1

memoirtiene sus propios medios para definir el diseño de la página y es mejor no utilizarlo geometry. El MWE a continuación aumenta el tamaño del bloque de texto al disminuir los márgenes.

% memgeomprob.tex  SE 562072

\documentclass[12pt, oneside, a4paper]{memoir}

\setlrmarginsandblock{0.8in}{*}{1.0} % set left/right margins to 0.8in
\setulmarginsandblock{1in}{*}{1.0}   % set upper/lower margins to 1in
\checkandfixthelayout

\usepackage{layout}
\usepackage{showframe}

%\usepackage[a4paper]{geometry}
%\usepackage{geometry}

\usepackage{amssymb, amsfonts, amsthm}
\newtheorem{problem}{Problem}

\begin{document}
\title{Sample Document}
\author{John Doe}
\maketitle

\layout{}

Here is some sample text to show you what LaTeX does. 

To start a new paragraph, you need to leave a line of white space in your tex file.

To include math, you have two options. The first is called ``in line,'' and you do this by putting your math between two dollar signs (\$). For example, Fermat's Little Theorem tells us that if $p$ is a prime and $a$ is an integer such that $p \nmid a$, then $a^{p-1} \equiv 1 \pmod{p}$. Note that the exponent on $a$ has to go in braces (in the tex file). 

But if you really want an equation (or congruence) to stand out, then you ``display'' the math. It looks like this:
\[
    a^{p-1} \equiv 1 \pmod{p}.
\]
Nice, right?

Finally, we can make things look really nice for homeworks as follows:

\begin{problem}
    Let $X$ and $Y$ be blah blah blah \ldots
\end{problem}

\begin{problem}
    Let $X$ and $Y$ be as in the previous problem. What is $Z$?
\end{problem}

Notice that LaTeX automatically numbers the problems for us. 

\end{document}

Lea el manual ( > texdoc memoir) para obtener más información.

información relacionada