Newgeometry and afterpage don't adjust the geometry












4















In the following sample, the geometry doesn't change even though I believe it should. What am I doing wrong and how can I fix it?



documentclass{article}
usepackage{lipsum}
usepackage{afterpage}
usepackage[bottom=5cm]{geometry}
begin{document}
afterpage{newgeometry{bottom=1cm}}
lipsum
lipsum
end{document}









share|improve this question























  • Are you trying to make the first page shorter than the following ones?

    – egreg
    Sep 11 '15 at 10:50











  • Do not use afterpage or newgeometry for this. Just use enlargethispage on the first page to change its size.

    – David Carlisle
    Sep 11 '15 at 11:17











  • I have a letter with a giant footer on the first page. The pages after the first one have small ones that would fit without any fiddling. So yes I am trying to decrease the typearea on the first page in favour of the footer

    – Max
    Sep 11 '15 at 11:21











  • so use enlargethispage{-3cm} on the first page.

    – David Carlisle
    Sep 11 '15 at 11:25
















4















In the following sample, the geometry doesn't change even though I believe it should. What am I doing wrong and how can I fix it?



documentclass{article}
usepackage{lipsum}
usepackage{afterpage}
usepackage[bottom=5cm]{geometry}
begin{document}
afterpage{newgeometry{bottom=1cm}}
lipsum
lipsum
end{document}









share|improve this question























  • Are you trying to make the first page shorter than the following ones?

    – egreg
    Sep 11 '15 at 10:50











  • Do not use afterpage or newgeometry for this. Just use enlargethispage on the first page to change its size.

    – David Carlisle
    Sep 11 '15 at 11:17











  • I have a letter with a giant footer on the first page. The pages after the first one have small ones that would fit without any fiddling. So yes I am trying to decrease the typearea on the first page in favour of the footer

    – Max
    Sep 11 '15 at 11:21











  • so use enlargethispage{-3cm} on the first page.

    – David Carlisle
    Sep 11 '15 at 11:25














4












4








4


3






In the following sample, the geometry doesn't change even though I believe it should. What am I doing wrong and how can I fix it?



documentclass{article}
usepackage{lipsum}
usepackage{afterpage}
usepackage[bottom=5cm]{geometry}
begin{document}
afterpage{newgeometry{bottom=1cm}}
lipsum
lipsum
end{document}









share|improve this question














In the following sample, the geometry doesn't change even though I believe it should. What am I doing wrong and how can I fix it?



documentclass{article}
usepackage{lipsum}
usepackage{afterpage}
usepackage[bottom=5cm]{geometry}
begin{document}
afterpage{newgeometry{bottom=1cm}}
lipsum
lipsum
end{document}






geometry afterpage






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 11 '15 at 10:34









MaxMax

3,0891840




3,0891840













  • Are you trying to make the first page shorter than the following ones?

    – egreg
    Sep 11 '15 at 10:50











  • Do not use afterpage or newgeometry for this. Just use enlargethispage on the first page to change its size.

    – David Carlisle
    Sep 11 '15 at 11:17











  • I have a letter with a giant footer on the first page. The pages after the first one have small ones that would fit without any fiddling. So yes I am trying to decrease the typearea on the first page in favour of the footer

    – Max
    Sep 11 '15 at 11:21











  • so use enlargethispage{-3cm} on the first page.

    – David Carlisle
    Sep 11 '15 at 11:25



















  • Are you trying to make the first page shorter than the following ones?

    – egreg
    Sep 11 '15 at 10:50











  • Do not use afterpage or newgeometry for this. Just use enlargethispage on the first page to change its size.

    – David Carlisle
    Sep 11 '15 at 11:17











  • I have a letter with a giant footer on the first page. The pages after the first one have small ones that would fit without any fiddling. So yes I am trying to decrease the typearea on the first page in favour of the footer

    – Max
    Sep 11 '15 at 11:21











  • so use enlargethispage{-3cm} on the first page.

    – David Carlisle
    Sep 11 '15 at 11:25

















Are you trying to make the first page shorter than the following ones?

– egreg
Sep 11 '15 at 10:50





Are you trying to make the first page shorter than the following ones?

– egreg
Sep 11 '15 at 10:50













Do not use afterpage or newgeometry for this. Just use enlargethispage on the first page to change its size.

– David Carlisle
Sep 11 '15 at 11:17





Do not use afterpage or newgeometry for this. Just use enlargethispage on the first page to change its size.

– David Carlisle
Sep 11 '15 at 11:17













I have a letter with a giant footer on the first page. The pages after the first one have small ones that would fit without any fiddling. So yes I am trying to decrease the typearea on the first page in favour of the footer

– Max
Sep 11 '15 at 11:21





I have a letter with a giant footer on the first page. The pages after the first one have small ones that would fit without any fiddling. So yes I am trying to decrease the typearea on the first page in favour of the footer

– Max
Sep 11 '15 at 11:21













so use enlargethispage{-3cm} on the first page.

– David Carlisle
Sep 11 '15 at 11:25





so use enlargethispage{-3cm} on the first page.

– David Carlisle
Sep 11 '15 at 11:25










5 Answers
5






active

oldest

votes


















4














enter image description here



documentclass{article}
usepackage{lipsum}
%please, no:-)usepackage{afterpage}
%usepackage[bottom=5cm]{geometry}
begin{document}
enlargethispage{-5cm}
lipsum
lipsum
end{document}





share|improve this answer
























  • I am sorry. While this solves it for the minimal sample, I run into issues with geometry. If I use the showframe option to that package, I can see that while the text obeys the enlargethispage the textarea and more importantly the footer does not and runs off the page's end.

    – Max
    Sep 11 '15 at 11:45











  • @Max Yes but the normal thing is to put the footer into smash{some big image} so the height is hidden and so it overprints the space left in the text area.

    – David Carlisle
    Sep 11 '15 at 12:11



















2














afterpage puts it argument in a group and then (most of) the settings of newgeometry don't work as you can see here:



documentclass{article}
usepackage{lipsum}
usepackage{afterpage}
usepackage[bottom=5cm]{geometry}
begin{document}
lipsum
lipsum
{newgeometry{bottom=1cm}} %bottom ignored
lipsum
lipsum
newgeometry{bottom=1cm}
lipsum
lipsum

end{document}





share|improve this answer
























  • Hmm Is there some way to break out of the group or some other way to achieve this?

    – Max
    Sep 11 '15 at 11:23











  • Use David's suggestion. You can hide the height of the large footer with e.g. lfoot{smash{rule{3cm}{5cm}}}. afterpage injects code in the output routine and you really don't want it to leak out.

    – Ulrike Fischer
    Sep 11 '15 at 12:39



















1














The trick is not using newgeometry, that would issue a page break anyway, but enlargethispage; with fancyhdr you are ensured that the footer will stay in position, it's only sufficient to smash the giant footer for the first page.



documentclass{article}
usepackage{fancyhdr}
usepackage{graphicx}

usepackage{lipsum}

pagestyle{fancy}
fancyhf{}
renewcommand{headrulewidth}{0pt}
fancyfoot[C]{smallthepage}

fancypagestyle{first}{%
fancyhf{}%
renewcommand{headrulewidth}{0pt}%
fancyfoot[C]{giantfooter}%
}

newcommand{giantfooter}{%
leavevmodesmash{includegraphics[height=5cm]{duck}}%
}

begin{document}
thispagestyle{first}enlargethispage{-5cm}

lipsum[1-20]

end{document}


enter image description here






share|improve this answer































    1














    Here is a solution



    documentclass{article}
    usepackage{lipsum}

    usepackage{atbegshi}
    usepackage[bottom=5cm]{geometry}
    begin{document}
    makeatletter
    AtBeginShipoutNext{%
    globaladdtolength{textheight}{4cm}%
    globalsetlength{@colht}{textheight}}
    makeatother
    lipsum
    lipsum
    lipsum
    lipsum
    lipsum
    end{document}





    share|improve this answer































      0














      After searching the entire internet for a solution (the ones listed here did not work for my setup), I finally came up with this one:



      %setup your default geometry:
      usepackage[a4paper, left=2.3cm, right=2.3cm, bottom=2.0cm, top=3.0cm]{geometry}

      %use this package to get the "on-every-page-do-this-Hook" below
      usepackage{everypage}

      begin{document}

      %this line registers the reset-hook:
      AddEverypageHook{ifnumvalue{page}=2restoregeometryelsefi}

      %and this line sets your special geometry which is cleared by the hook above on page N (with N=2 in this case)
      newgeometry{left=2.3cm, right=1.7cm, bottom=2.0cm, top=9.7cm}


      EDIT:



      After wrapping up my proposal to a compilable example spanning several pages with lorem-ipsum-text I found it actually not working properly!



      So, instead, the afterpage-package in combination with globaldefs=1 seems like the way to go here:



      documentclass{article}
      usepackage{lipsum}
      usepackage{afterpage}
      usepackage[bottom=5cm]{geometry}
      begin{document}
      afterpage{globaldefs=1 newgeometry{bottom=1cm}}
      lipsum
      lipsum
      end{document}





      share|improve this answer





















      • 2





        Can you please make this code compilable and add an screenshot of your result to your answer?

        – Kurt
        Mar 9 at 11:55











      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%2f267067%2fnewgeometry-and-afterpage-dont-adjust-the-geometry%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      5 Answers
      5






      active

      oldest

      votes








      5 Answers
      5






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      4














      enter image description here



      documentclass{article}
      usepackage{lipsum}
      %please, no:-)usepackage{afterpage}
      %usepackage[bottom=5cm]{geometry}
      begin{document}
      enlargethispage{-5cm}
      lipsum
      lipsum
      end{document}





      share|improve this answer
























      • I am sorry. While this solves it for the minimal sample, I run into issues with geometry. If I use the showframe option to that package, I can see that while the text obeys the enlargethispage the textarea and more importantly the footer does not and runs off the page's end.

        – Max
        Sep 11 '15 at 11:45











      • @Max Yes but the normal thing is to put the footer into smash{some big image} so the height is hidden and so it overprints the space left in the text area.

        – David Carlisle
        Sep 11 '15 at 12:11
















      4














      enter image description here



      documentclass{article}
      usepackage{lipsum}
      %please, no:-)usepackage{afterpage}
      %usepackage[bottom=5cm]{geometry}
      begin{document}
      enlargethispage{-5cm}
      lipsum
      lipsum
      end{document}





      share|improve this answer
























      • I am sorry. While this solves it for the minimal sample, I run into issues with geometry. If I use the showframe option to that package, I can see that while the text obeys the enlargethispage the textarea and more importantly the footer does not and runs off the page's end.

        – Max
        Sep 11 '15 at 11:45











      • @Max Yes but the normal thing is to put the footer into smash{some big image} so the height is hidden and so it overprints the space left in the text area.

        – David Carlisle
        Sep 11 '15 at 12:11














      4












      4








      4







      enter image description here



      documentclass{article}
      usepackage{lipsum}
      %please, no:-)usepackage{afterpage}
      %usepackage[bottom=5cm]{geometry}
      begin{document}
      enlargethispage{-5cm}
      lipsum
      lipsum
      end{document}





      share|improve this answer













      enter image description here



      documentclass{article}
      usepackage{lipsum}
      %please, no:-)usepackage{afterpage}
      %usepackage[bottom=5cm]{geometry}
      begin{document}
      enlargethispage{-5cm}
      lipsum
      lipsum
      end{document}






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Sep 11 '15 at 11:27









      David CarlisleDavid Carlisle

      494k4111381886




      494k4111381886













      • I am sorry. While this solves it for the minimal sample, I run into issues with geometry. If I use the showframe option to that package, I can see that while the text obeys the enlargethispage the textarea and more importantly the footer does not and runs off the page's end.

        – Max
        Sep 11 '15 at 11:45











      • @Max Yes but the normal thing is to put the footer into smash{some big image} so the height is hidden and so it overprints the space left in the text area.

        – David Carlisle
        Sep 11 '15 at 12:11



















      • I am sorry. While this solves it for the minimal sample, I run into issues with geometry. If I use the showframe option to that package, I can see that while the text obeys the enlargethispage the textarea and more importantly the footer does not and runs off the page's end.

        – Max
        Sep 11 '15 at 11:45











      • @Max Yes but the normal thing is to put the footer into smash{some big image} so the height is hidden and so it overprints the space left in the text area.

        – David Carlisle
        Sep 11 '15 at 12:11

















      I am sorry. While this solves it for the minimal sample, I run into issues with geometry. If I use the showframe option to that package, I can see that while the text obeys the enlargethispage the textarea and more importantly the footer does not and runs off the page's end.

      – Max
      Sep 11 '15 at 11:45





      I am sorry. While this solves it for the minimal sample, I run into issues with geometry. If I use the showframe option to that package, I can see that while the text obeys the enlargethispage the textarea and more importantly the footer does not and runs off the page's end.

      – Max
      Sep 11 '15 at 11:45













      @Max Yes but the normal thing is to put the footer into smash{some big image} so the height is hidden and so it overprints the space left in the text area.

      – David Carlisle
      Sep 11 '15 at 12:11





      @Max Yes but the normal thing is to put the footer into smash{some big image} so the height is hidden and so it overprints the space left in the text area.

      – David Carlisle
      Sep 11 '15 at 12:11











      2














      afterpage puts it argument in a group and then (most of) the settings of newgeometry don't work as you can see here:



      documentclass{article}
      usepackage{lipsum}
      usepackage{afterpage}
      usepackage[bottom=5cm]{geometry}
      begin{document}
      lipsum
      lipsum
      {newgeometry{bottom=1cm}} %bottom ignored
      lipsum
      lipsum
      newgeometry{bottom=1cm}
      lipsum
      lipsum

      end{document}





      share|improve this answer
























      • Hmm Is there some way to break out of the group or some other way to achieve this?

        – Max
        Sep 11 '15 at 11:23











      • Use David's suggestion. You can hide the height of the large footer with e.g. lfoot{smash{rule{3cm}{5cm}}}. afterpage injects code in the output routine and you really don't want it to leak out.

        – Ulrike Fischer
        Sep 11 '15 at 12:39
















      2














      afterpage puts it argument in a group and then (most of) the settings of newgeometry don't work as you can see here:



      documentclass{article}
      usepackage{lipsum}
      usepackage{afterpage}
      usepackage[bottom=5cm]{geometry}
      begin{document}
      lipsum
      lipsum
      {newgeometry{bottom=1cm}} %bottom ignored
      lipsum
      lipsum
      newgeometry{bottom=1cm}
      lipsum
      lipsum

      end{document}





      share|improve this answer
























      • Hmm Is there some way to break out of the group or some other way to achieve this?

        – Max
        Sep 11 '15 at 11:23











      • Use David's suggestion. You can hide the height of the large footer with e.g. lfoot{smash{rule{3cm}{5cm}}}. afterpage injects code in the output routine and you really don't want it to leak out.

        – Ulrike Fischer
        Sep 11 '15 at 12:39














      2












      2








      2







      afterpage puts it argument in a group and then (most of) the settings of newgeometry don't work as you can see here:



      documentclass{article}
      usepackage{lipsum}
      usepackage{afterpage}
      usepackage[bottom=5cm]{geometry}
      begin{document}
      lipsum
      lipsum
      {newgeometry{bottom=1cm}} %bottom ignored
      lipsum
      lipsum
      newgeometry{bottom=1cm}
      lipsum
      lipsum

      end{document}





      share|improve this answer













      afterpage puts it argument in a group and then (most of) the settings of newgeometry don't work as you can see here:



      documentclass{article}
      usepackage{lipsum}
      usepackage{afterpage}
      usepackage[bottom=5cm]{geometry}
      begin{document}
      lipsum
      lipsum
      {newgeometry{bottom=1cm}} %bottom ignored
      lipsum
      lipsum
      newgeometry{bottom=1cm}
      lipsum
      lipsum

      end{document}






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Sep 11 '15 at 10:48









      Ulrike FischerUlrike Fischer

      196k8302689




      196k8302689













      • Hmm Is there some way to break out of the group or some other way to achieve this?

        – Max
        Sep 11 '15 at 11:23











      • Use David's suggestion. You can hide the height of the large footer with e.g. lfoot{smash{rule{3cm}{5cm}}}. afterpage injects code in the output routine and you really don't want it to leak out.

        – Ulrike Fischer
        Sep 11 '15 at 12:39



















      • Hmm Is there some way to break out of the group or some other way to achieve this?

        – Max
        Sep 11 '15 at 11:23











      • Use David's suggestion. You can hide the height of the large footer with e.g. lfoot{smash{rule{3cm}{5cm}}}. afterpage injects code in the output routine and you really don't want it to leak out.

        – Ulrike Fischer
        Sep 11 '15 at 12:39

















      Hmm Is there some way to break out of the group or some other way to achieve this?

      – Max
      Sep 11 '15 at 11:23





      Hmm Is there some way to break out of the group or some other way to achieve this?

      – Max
      Sep 11 '15 at 11:23













      Use David's suggestion. You can hide the height of the large footer with e.g. lfoot{smash{rule{3cm}{5cm}}}. afterpage injects code in the output routine and you really don't want it to leak out.

      – Ulrike Fischer
      Sep 11 '15 at 12:39





      Use David's suggestion. You can hide the height of the large footer with e.g. lfoot{smash{rule{3cm}{5cm}}}. afterpage injects code in the output routine and you really don't want it to leak out.

      – Ulrike Fischer
      Sep 11 '15 at 12:39











      1














      The trick is not using newgeometry, that would issue a page break anyway, but enlargethispage; with fancyhdr you are ensured that the footer will stay in position, it's only sufficient to smash the giant footer for the first page.



      documentclass{article}
      usepackage{fancyhdr}
      usepackage{graphicx}

      usepackage{lipsum}

      pagestyle{fancy}
      fancyhf{}
      renewcommand{headrulewidth}{0pt}
      fancyfoot[C]{smallthepage}

      fancypagestyle{first}{%
      fancyhf{}%
      renewcommand{headrulewidth}{0pt}%
      fancyfoot[C]{giantfooter}%
      }

      newcommand{giantfooter}{%
      leavevmodesmash{includegraphics[height=5cm]{duck}}%
      }

      begin{document}
      thispagestyle{first}enlargethispage{-5cm}

      lipsum[1-20]

      end{document}


      enter image description here






      share|improve this answer




























        1














        The trick is not using newgeometry, that would issue a page break anyway, but enlargethispage; with fancyhdr you are ensured that the footer will stay in position, it's only sufficient to smash the giant footer for the first page.



        documentclass{article}
        usepackage{fancyhdr}
        usepackage{graphicx}

        usepackage{lipsum}

        pagestyle{fancy}
        fancyhf{}
        renewcommand{headrulewidth}{0pt}
        fancyfoot[C]{smallthepage}

        fancypagestyle{first}{%
        fancyhf{}%
        renewcommand{headrulewidth}{0pt}%
        fancyfoot[C]{giantfooter}%
        }

        newcommand{giantfooter}{%
        leavevmodesmash{includegraphics[height=5cm]{duck}}%
        }

        begin{document}
        thispagestyle{first}enlargethispage{-5cm}

        lipsum[1-20]

        end{document}


        enter image description here






        share|improve this answer


























          1












          1








          1







          The trick is not using newgeometry, that would issue a page break anyway, but enlargethispage; with fancyhdr you are ensured that the footer will stay in position, it's only sufficient to smash the giant footer for the first page.



          documentclass{article}
          usepackage{fancyhdr}
          usepackage{graphicx}

          usepackage{lipsum}

          pagestyle{fancy}
          fancyhf{}
          renewcommand{headrulewidth}{0pt}
          fancyfoot[C]{smallthepage}

          fancypagestyle{first}{%
          fancyhf{}%
          renewcommand{headrulewidth}{0pt}%
          fancyfoot[C]{giantfooter}%
          }

          newcommand{giantfooter}{%
          leavevmodesmash{includegraphics[height=5cm]{duck}}%
          }

          begin{document}
          thispagestyle{first}enlargethispage{-5cm}

          lipsum[1-20]

          end{document}


          enter image description here






          share|improve this answer













          The trick is not using newgeometry, that would issue a page break anyway, but enlargethispage; with fancyhdr you are ensured that the footer will stay in position, it's only sufficient to smash the giant footer for the first page.



          documentclass{article}
          usepackage{fancyhdr}
          usepackage{graphicx}

          usepackage{lipsum}

          pagestyle{fancy}
          fancyhf{}
          renewcommand{headrulewidth}{0pt}
          fancyfoot[C]{smallthepage}

          fancypagestyle{first}{%
          fancyhf{}%
          renewcommand{headrulewidth}{0pt}%
          fancyfoot[C]{giantfooter}%
          }

          newcommand{giantfooter}{%
          leavevmodesmash{includegraphics[height=5cm]{duck}}%
          }

          begin{document}
          thispagestyle{first}enlargethispage{-5cm}

          lipsum[1-20]

          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 11 '15 at 13:16









          egregegreg

          727k8819223231




          727k8819223231























              1














              Here is a solution



              documentclass{article}
              usepackage{lipsum}

              usepackage{atbegshi}
              usepackage[bottom=5cm]{geometry}
              begin{document}
              makeatletter
              AtBeginShipoutNext{%
              globaladdtolength{textheight}{4cm}%
              globalsetlength{@colht}{textheight}}
              makeatother
              lipsum
              lipsum
              lipsum
              lipsum
              lipsum
              end{document}





              share|improve this answer




























                1














                Here is a solution



                documentclass{article}
                usepackage{lipsum}

                usepackage{atbegshi}
                usepackage[bottom=5cm]{geometry}
                begin{document}
                makeatletter
                AtBeginShipoutNext{%
                globaladdtolength{textheight}{4cm}%
                globalsetlength{@colht}{textheight}}
                makeatother
                lipsum
                lipsum
                lipsum
                lipsum
                lipsum
                end{document}





                share|improve this answer


























                  1












                  1








                  1







                  Here is a solution



                  documentclass{article}
                  usepackage{lipsum}

                  usepackage{atbegshi}
                  usepackage[bottom=5cm]{geometry}
                  begin{document}
                  makeatletter
                  AtBeginShipoutNext{%
                  globaladdtolength{textheight}{4cm}%
                  globalsetlength{@colht}{textheight}}
                  makeatother
                  lipsum
                  lipsum
                  lipsum
                  lipsum
                  lipsum
                  end{document}





                  share|improve this answer













                  Here is a solution



                  documentclass{article}
                  usepackage{lipsum}

                  usepackage{atbegshi}
                  usepackage[bottom=5cm]{geometry}
                  begin{document}
                  makeatletter
                  AtBeginShipoutNext{%
                  globaladdtolength{textheight}{4cm}%
                  globalsetlength{@colht}{textheight}}
                  makeatother
                  lipsum
                  lipsum
                  lipsum
                  lipsum
                  lipsum
                  end{document}






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 11 '15 at 16:37









                  touhamitouhami

                  17.1k21246




                  17.1k21246























                      0














                      After searching the entire internet for a solution (the ones listed here did not work for my setup), I finally came up with this one:



                      %setup your default geometry:
                      usepackage[a4paper, left=2.3cm, right=2.3cm, bottom=2.0cm, top=3.0cm]{geometry}

                      %use this package to get the "on-every-page-do-this-Hook" below
                      usepackage{everypage}

                      begin{document}

                      %this line registers the reset-hook:
                      AddEverypageHook{ifnumvalue{page}=2restoregeometryelsefi}

                      %and this line sets your special geometry which is cleared by the hook above on page N (with N=2 in this case)
                      newgeometry{left=2.3cm, right=1.7cm, bottom=2.0cm, top=9.7cm}


                      EDIT:



                      After wrapping up my proposal to a compilable example spanning several pages with lorem-ipsum-text I found it actually not working properly!



                      So, instead, the afterpage-package in combination with globaldefs=1 seems like the way to go here:



                      documentclass{article}
                      usepackage{lipsum}
                      usepackage{afterpage}
                      usepackage[bottom=5cm]{geometry}
                      begin{document}
                      afterpage{globaldefs=1 newgeometry{bottom=1cm}}
                      lipsum
                      lipsum
                      end{document}





                      share|improve this answer





















                      • 2





                        Can you please make this code compilable and add an screenshot of your result to your answer?

                        – Kurt
                        Mar 9 at 11:55
















                      0














                      After searching the entire internet for a solution (the ones listed here did not work for my setup), I finally came up with this one:



                      %setup your default geometry:
                      usepackage[a4paper, left=2.3cm, right=2.3cm, bottom=2.0cm, top=3.0cm]{geometry}

                      %use this package to get the "on-every-page-do-this-Hook" below
                      usepackage{everypage}

                      begin{document}

                      %this line registers the reset-hook:
                      AddEverypageHook{ifnumvalue{page}=2restoregeometryelsefi}

                      %and this line sets your special geometry which is cleared by the hook above on page N (with N=2 in this case)
                      newgeometry{left=2.3cm, right=1.7cm, bottom=2.0cm, top=9.7cm}


                      EDIT:



                      After wrapping up my proposal to a compilable example spanning several pages with lorem-ipsum-text I found it actually not working properly!



                      So, instead, the afterpage-package in combination with globaldefs=1 seems like the way to go here:



                      documentclass{article}
                      usepackage{lipsum}
                      usepackage{afterpage}
                      usepackage[bottom=5cm]{geometry}
                      begin{document}
                      afterpage{globaldefs=1 newgeometry{bottom=1cm}}
                      lipsum
                      lipsum
                      end{document}





                      share|improve this answer





















                      • 2





                        Can you please make this code compilable and add an screenshot of your result to your answer?

                        – Kurt
                        Mar 9 at 11:55














                      0












                      0








                      0







                      After searching the entire internet for a solution (the ones listed here did not work for my setup), I finally came up with this one:



                      %setup your default geometry:
                      usepackage[a4paper, left=2.3cm, right=2.3cm, bottom=2.0cm, top=3.0cm]{geometry}

                      %use this package to get the "on-every-page-do-this-Hook" below
                      usepackage{everypage}

                      begin{document}

                      %this line registers the reset-hook:
                      AddEverypageHook{ifnumvalue{page}=2restoregeometryelsefi}

                      %and this line sets your special geometry which is cleared by the hook above on page N (with N=2 in this case)
                      newgeometry{left=2.3cm, right=1.7cm, bottom=2.0cm, top=9.7cm}


                      EDIT:



                      After wrapping up my proposal to a compilable example spanning several pages with lorem-ipsum-text I found it actually not working properly!



                      So, instead, the afterpage-package in combination with globaldefs=1 seems like the way to go here:



                      documentclass{article}
                      usepackage{lipsum}
                      usepackage{afterpage}
                      usepackage[bottom=5cm]{geometry}
                      begin{document}
                      afterpage{globaldefs=1 newgeometry{bottom=1cm}}
                      lipsum
                      lipsum
                      end{document}





                      share|improve this answer















                      After searching the entire internet for a solution (the ones listed here did not work for my setup), I finally came up with this one:



                      %setup your default geometry:
                      usepackage[a4paper, left=2.3cm, right=2.3cm, bottom=2.0cm, top=3.0cm]{geometry}

                      %use this package to get the "on-every-page-do-this-Hook" below
                      usepackage{everypage}

                      begin{document}

                      %this line registers the reset-hook:
                      AddEverypageHook{ifnumvalue{page}=2restoregeometryelsefi}

                      %and this line sets your special geometry which is cleared by the hook above on page N (with N=2 in this case)
                      newgeometry{left=2.3cm, right=1.7cm, bottom=2.0cm, top=9.7cm}


                      EDIT:



                      After wrapping up my proposal to a compilable example spanning several pages with lorem-ipsum-text I found it actually not working properly!



                      So, instead, the afterpage-package in combination with globaldefs=1 seems like the way to go here:



                      documentclass{article}
                      usepackage{lipsum}
                      usepackage{afterpage}
                      usepackage[bottom=5cm]{geometry}
                      begin{document}
                      afterpage{globaldefs=1 newgeometry{bottom=1cm}}
                      lipsum
                      lipsum
                      end{document}






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Mar 9 at 14:28

























                      answered Mar 9 at 11:29









                      SebastianSebastian

                      133




                      133








                      • 2





                        Can you please make this code compilable and add an screenshot of your result to your answer?

                        – Kurt
                        Mar 9 at 11:55














                      • 2





                        Can you please make this code compilable and add an screenshot of your result to your answer?

                        – Kurt
                        Mar 9 at 11:55








                      2




                      2





                      Can you please make this code compilable and add an screenshot of your result to your answer?

                      – Kurt
                      Mar 9 at 11:55





                      Can you please make this code compilable and add an screenshot of your result to your answer?

                      – Kurt
                      Mar 9 at 11:55


















                      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%2f267067%2fnewgeometry-and-afterpage-dont-adjust-the-geometry%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