Por que o pacote de geometria está atrapalhando minhas margens?

Por que o pacote de geometria está atrapalhando minhas margens?

Quero escrever um documento aproveitando o máximo possível da página. O código que estou usando é este (isenção de responsabilidade: peguei o texto de exemplo deaqui):

\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}

Parece bonito, mas com muito papel não utilizado nas laterais: Sem geometria

No entanto, assim que eu descomente a linha que invoca o pacote de geometria, as margens ficam confusas, mesmo que eu nem tenha emitido nenhum comando para alterá-las. Geometria

Tentei consultar algumas fontes, mas elas não mencionam nada parecido com isso, então gostaria de entender por que a geometria está se comportando dessa maneira.

Além disso, se possível, alguns ajudam a acertar o código para deixar o mínimo possível de espaço de papel não utilizado.

Responder1

memoirtem seus próprios meios de definir o layout da página e é melhor não usá- geometrylo. O MWE abaixo aumenta o tamanho do bloco de texto diminuindo as margens.

% 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}

Leia o manual ( > texdoc memoir) para obter mais informações.

informação relacionada