newgeometry is not remembered when writing a new page












1















I'm using the package geometry to customize my document. I specify the geometry I want using newgeometry after a title that I will make later.



If I do that using the code below, the first page is ok, but after executing newpage the document seems to forget the geometry I want to use for the whole document, and then this new page is not centered with respect to the first page anymore.



Is there a way to use my defined geometry with newgeometry in the page right after newpage?



documentclass{book}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[a4paper]{geometry}

usepackage{sidenotes} % Notes in the margin
usepackage{comment}

begin{comment}

begin{marginfigure}
includegraphics[width=marginparwidth]{example-image-a}%
caption{This is in the margin.}%
end{marginfigure}

end{comment}

usepackage{graphicx}

usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{headrulewidth}{0.4pt}
renewcommand{footrulewidth}{0.4pt}

begin{document}
% Future title here
newgeometry{
a4paper,
centering,
layoutwidth=20cm,
layouthoffset = -1cm,
layoutheight = 34cm,
layoutvoffset = -2.5cm
}

setcounter{chapter}{-1}
chapter{Basic concepts}
thispagestyle{fancy}
section{Multiply two numbers}

When we have to numbers $ a $ and $ b $ and we want to multiply them we have
[
acdot b = c
]
where $ c $ is the result of multiplying $ a $ and $ b $
newpage
a
end{document}









share|improve this question

























  • Do you want to use documentclass[oneside]{book}? Book documentclass is twoside by default and may be this is what you suppose is the problem. But if you imagine the book printed then the left pages has to leave a space for notes (etc) on their left ant the right pages on their right. Is this the part you didn't realized?

    – koleygr
    Jan 19 at 19:49











  • @koleygr Well, that did the trick! I will use a oneside book. But maybe is a way to fix that for the two-sided book, because in the left page there is almost no margin.

    – Martín
    Jan 19 at 20:37


















1















I'm using the package geometry to customize my document. I specify the geometry I want using newgeometry after a title that I will make later.



If I do that using the code below, the first page is ok, but after executing newpage the document seems to forget the geometry I want to use for the whole document, and then this new page is not centered with respect to the first page anymore.



Is there a way to use my defined geometry with newgeometry in the page right after newpage?



documentclass{book}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[a4paper]{geometry}

usepackage{sidenotes} % Notes in the margin
usepackage{comment}

begin{comment}

begin{marginfigure}
includegraphics[width=marginparwidth]{example-image-a}%
caption{This is in the margin.}%
end{marginfigure}

end{comment}

usepackage{graphicx}

usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{headrulewidth}{0.4pt}
renewcommand{footrulewidth}{0.4pt}

begin{document}
% Future title here
newgeometry{
a4paper,
centering,
layoutwidth=20cm,
layouthoffset = -1cm,
layoutheight = 34cm,
layoutvoffset = -2.5cm
}

setcounter{chapter}{-1}
chapter{Basic concepts}
thispagestyle{fancy}
section{Multiply two numbers}

When we have to numbers $ a $ and $ b $ and we want to multiply them we have
[
acdot b = c
]
where $ c $ is the result of multiplying $ a $ and $ b $
newpage
a
end{document}









share|improve this question

























  • Do you want to use documentclass[oneside]{book}? Book documentclass is twoside by default and may be this is what you suppose is the problem. But if you imagine the book printed then the left pages has to leave a space for notes (etc) on their left ant the right pages on their right. Is this the part you didn't realized?

    – koleygr
    Jan 19 at 19:49











  • @koleygr Well, that did the trick! I will use a oneside book. But maybe is a way to fix that for the two-sided book, because in the left page there is almost no margin.

    – Martín
    Jan 19 at 20:37
















1












1








1








I'm using the package geometry to customize my document. I specify the geometry I want using newgeometry after a title that I will make later.



If I do that using the code below, the first page is ok, but after executing newpage the document seems to forget the geometry I want to use for the whole document, and then this new page is not centered with respect to the first page anymore.



Is there a way to use my defined geometry with newgeometry in the page right after newpage?



documentclass{book}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[a4paper]{geometry}

usepackage{sidenotes} % Notes in the margin
usepackage{comment}

begin{comment}

begin{marginfigure}
includegraphics[width=marginparwidth]{example-image-a}%
caption{This is in the margin.}%
end{marginfigure}

end{comment}

usepackage{graphicx}

usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{headrulewidth}{0.4pt}
renewcommand{footrulewidth}{0.4pt}

begin{document}
% Future title here
newgeometry{
a4paper,
centering,
layoutwidth=20cm,
layouthoffset = -1cm,
layoutheight = 34cm,
layoutvoffset = -2.5cm
}

setcounter{chapter}{-1}
chapter{Basic concepts}
thispagestyle{fancy}
section{Multiply two numbers}

When we have to numbers $ a $ and $ b $ and we want to multiply them we have
[
acdot b = c
]
where $ c $ is the result of multiplying $ a $ and $ b $
newpage
a
end{document}









share|improve this question
















I'm using the package geometry to customize my document. I specify the geometry I want using newgeometry after a title that I will make later.



If I do that using the code below, the first page is ok, but after executing newpage the document seems to forget the geometry I want to use for the whole document, and then this new page is not centered with respect to the first page anymore.



Is there a way to use my defined geometry with newgeometry in the page right after newpage?



documentclass{book}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[a4paper]{geometry}

usepackage{sidenotes} % Notes in the margin
usepackage{comment}

begin{comment}

begin{marginfigure}
includegraphics[width=marginparwidth]{example-image-a}%
caption{This is in the margin.}%
end{marginfigure}

end{comment}

usepackage{graphicx}

usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{headrulewidth}{0.4pt}
renewcommand{footrulewidth}{0.4pt}

begin{document}
% Future title here
newgeometry{
a4paper,
centering,
layoutwidth=20cm,
layouthoffset = -1cm,
layoutheight = 34cm,
layoutvoffset = -2.5cm
}

setcounter{chapter}{-1}
chapter{Basic concepts}
thispagestyle{fancy}
section{Multiply two numbers}

When we have to numbers $ a $ and $ b $ and we want to multiply them we have
[
acdot b = c
]
where $ c $ is the result of multiplying $ a $ and $ b $
newpage
a
end{document}






header-footer margins geometry






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 19 at 19:31







Martín

















asked Jan 19 at 19:09









MartínMartín

665




665













  • Do you want to use documentclass[oneside]{book}? Book documentclass is twoside by default and may be this is what you suppose is the problem. But if you imagine the book printed then the left pages has to leave a space for notes (etc) on their left ant the right pages on their right. Is this the part you didn't realized?

    – koleygr
    Jan 19 at 19:49











  • @koleygr Well, that did the trick! I will use a oneside book. But maybe is a way to fix that for the two-sided book, because in the left page there is almost no margin.

    – Martín
    Jan 19 at 20:37





















  • Do you want to use documentclass[oneside]{book}? Book documentclass is twoside by default and may be this is what you suppose is the problem. But if you imagine the book printed then the left pages has to leave a space for notes (etc) on their left ant the right pages on their right. Is this the part you didn't realized?

    – koleygr
    Jan 19 at 19:49











  • @koleygr Well, that did the trick! I will use a oneside book. But maybe is a way to fix that for the two-sided book, because in the left page there is almost no margin.

    – Martín
    Jan 19 at 20:37



















Do you want to use documentclass[oneside]{book}? Book documentclass is twoside by default and may be this is what you suppose is the problem. But if you imagine the book printed then the left pages has to leave a space for notes (etc) on their left ant the right pages on their right. Is this the part you didn't realized?

– koleygr
Jan 19 at 19:49





Do you want to use documentclass[oneside]{book}? Book documentclass is twoside by default and may be this is what you suppose is the problem. But if you imagine the book printed then the left pages has to leave a space for notes (etc) on their left ant the right pages on their right. Is this the part you didn't realized?

– koleygr
Jan 19 at 19:49













@koleygr Well, that did the trick! I will use a oneside book. But maybe is a way to fix that for the two-sided book, because in the left page there is almost no margin.

– Martín
Jan 19 at 20:37







@koleygr Well, that did the trick! I will use a oneside book. But maybe is a way to fix that for the two-sided book, because in the left page there is almost no margin.

– Martín
Jan 19 at 20:37












1 Answer
1






active

oldest

votes


















0














If you are going to use the same geometry for the whole document, you don't need to call newgeometry command in the biggining of the document but call usepackage command of geometry with the options you wish to have.



Also, as mentioned in the comment, you need oneside documentclass.



So, Something like this could work for you (adjust the numbers to fit your needs):



documentclass[a4paper,oneside]{book}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[centering,
layoutwidth=20cm,
layouthoffset = -0.5cm,
layoutheight = 34cm,
layoutvoffset = -2.5cm]{geometry}

usepackage{sidenotes} % Notes in the margin
usepackage{comment}

begin{comment}

begin{marginfigure}
includegraphics[width=marginparwidth]{example-image-a}%
caption{This is in the margin.}%
end{marginfigure}

end{comment}

usepackage{graphicx}

usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{headrulewidth}{0.4pt}
renewcommand{footrulewidth}{0.4pt}

begin{document}
% Future title here

setcounter{chapter}{-1}
chapter{Basic concepts}
thispagestyle{fancy}
section{Multiply two numbers}

When we have to numbers $ a $ and $ b $ and we want to multiply them we have
[
acdot b = c
]
where $ c $ is the result of multiplying $ a $ and $ b $
newpage
noindent a
end{document}





share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f470917%2fnewgeometry-is-not-remembered-when-writing-a-new-page%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    If you are going to use the same geometry for the whole document, you don't need to call newgeometry command in the biggining of the document but call usepackage command of geometry with the options you wish to have.



    Also, as mentioned in the comment, you need oneside documentclass.



    So, Something like this could work for you (adjust the numbers to fit your needs):



    documentclass[a4paper,oneside]{book}

    usepackage[T1]{fontenc}
    usepackage[utf8]{inputenc}
    usepackage[centering,
    layoutwidth=20cm,
    layouthoffset = -0.5cm,
    layoutheight = 34cm,
    layoutvoffset = -2.5cm]{geometry}

    usepackage{sidenotes} % Notes in the margin
    usepackage{comment}

    begin{comment}

    begin{marginfigure}
    includegraphics[width=marginparwidth]{example-image-a}%
    caption{This is in the margin.}%
    end{marginfigure}

    end{comment}

    usepackage{graphicx}

    usepackage{fancyhdr}
    pagestyle{fancy}
    renewcommand{headrulewidth}{0.4pt}
    renewcommand{footrulewidth}{0.4pt}

    begin{document}
    % Future title here

    setcounter{chapter}{-1}
    chapter{Basic concepts}
    thispagestyle{fancy}
    section{Multiply two numbers}

    When we have to numbers $ a $ and $ b $ and we want to multiply them we have
    [
    acdot b = c
    ]
    where $ c $ is the result of multiplying $ a $ and $ b $
    newpage
    noindent a
    end{document}





    share|improve this answer




























      0














      If you are going to use the same geometry for the whole document, you don't need to call newgeometry command in the biggining of the document but call usepackage command of geometry with the options you wish to have.



      Also, as mentioned in the comment, you need oneside documentclass.



      So, Something like this could work for you (adjust the numbers to fit your needs):



      documentclass[a4paper,oneside]{book}

      usepackage[T1]{fontenc}
      usepackage[utf8]{inputenc}
      usepackage[centering,
      layoutwidth=20cm,
      layouthoffset = -0.5cm,
      layoutheight = 34cm,
      layoutvoffset = -2.5cm]{geometry}

      usepackage{sidenotes} % Notes in the margin
      usepackage{comment}

      begin{comment}

      begin{marginfigure}
      includegraphics[width=marginparwidth]{example-image-a}%
      caption{This is in the margin.}%
      end{marginfigure}

      end{comment}

      usepackage{graphicx}

      usepackage{fancyhdr}
      pagestyle{fancy}
      renewcommand{headrulewidth}{0.4pt}
      renewcommand{footrulewidth}{0.4pt}

      begin{document}
      % Future title here

      setcounter{chapter}{-1}
      chapter{Basic concepts}
      thispagestyle{fancy}
      section{Multiply two numbers}

      When we have to numbers $ a $ and $ b $ and we want to multiply them we have
      [
      acdot b = c
      ]
      where $ c $ is the result of multiplying $ a $ and $ b $
      newpage
      noindent a
      end{document}





      share|improve this answer


























        0












        0








        0







        If you are going to use the same geometry for the whole document, you don't need to call newgeometry command in the biggining of the document but call usepackage command of geometry with the options you wish to have.



        Also, as mentioned in the comment, you need oneside documentclass.



        So, Something like this could work for you (adjust the numbers to fit your needs):



        documentclass[a4paper,oneside]{book}

        usepackage[T1]{fontenc}
        usepackage[utf8]{inputenc}
        usepackage[centering,
        layoutwidth=20cm,
        layouthoffset = -0.5cm,
        layoutheight = 34cm,
        layoutvoffset = -2.5cm]{geometry}

        usepackage{sidenotes} % Notes in the margin
        usepackage{comment}

        begin{comment}

        begin{marginfigure}
        includegraphics[width=marginparwidth]{example-image-a}%
        caption{This is in the margin.}%
        end{marginfigure}

        end{comment}

        usepackage{graphicx}

        usepackage{fancyhdr}
        pagestyle{fancy}
        renewcommand{headrulewidth}{0.4pt}
        renewcommand{footrulewidth}{0.4pt}

        begin{document}
        % Future title here

        setcounter{chapter}{-1}
        chapter{Basic concepts}
        thispagestyle{fancy}
        section{Multiply two numbers}

        When we have to numbers $ a $ and $ b $ and we want to multiply them we have
        [
        acdot b = c
        ]
        where $ c $ is the result of multiplying $ a $ and $ b $
        newpage
        noindent a
        end{document}





        share|improve this answer













        If you are going to use the same geometry for the whole document, you don't need to call newgeometry command in the biggining of the document but call usepackage command of geometry with the options you wish to have.



        Also, as mentioned in the comment, you need oneside documentclass.



        So, Something like this could work for you (adjust the numbers to fit your needs):



        documentclass[a4paper,oneside]{book}

        usepackage[T1]{fontenc}
        usepackage[utf8]{inputenc}
        usepackage[centering,
        layoutwidth=20cm,
        layouthoffset = -0.5cm,
        layoutheight = 34cm,
        layoutvoffset = -2.5cm]{geometry}

        usepackage{sidenotes} % Notes in the margin
        usepackage{comment}

        begin{comment}

        begin{marginfigure}
        includegraphics[width=marginparwidth]{example-image-a}%
        caption{This is in the margin.}%
        end{marginfigure}

        end{comment}

        usepackage{graphicx}

        usepackage{fancyhdr}
        pagestyle{fancy}
        renewcommand{headrulewidth}{0.4pt}
        renewcommand{footrulewidth}{0.4pt}

        begin{document}
        % Future title here

        setcounter{chapter}{-1}
        chapter{Basic concepts}
        thispagestyle{fancy}
        section{Multiply two numbers}

        When we have to numbers $ a $ and $ b $ and we want to multiply them we have
        [
        acdot b = c
        ]
        where $ c $ is the result of multiplying $ a $ and $ b $
        newpage
        noindent a
        end{document}






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 19 at 22:49









        koleygrkoleygr

        11.2k11038




        11.2k11038






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f470917%2fnewgeometry-is-not-remembered-when-writing-a-new-page%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents