a4paper, where should I declare it? In document class or geometry?












29















I currently have an article document class and I previously changed it to include printing on A4 paper:



documentclass[12pt, a4paper]{article}


However, I had to change my margins to meet my university requirements and the answer I received used A4 in the geometry package too.



geometry{a4paper,margin=15mm,bindingoffset=25mm,heightrounded,}


Partially practical and partially theoretical, is there any difference to using either declaration and/or is there an effect by using both?










share|improve this question




















  • 3





    It's irrelevant: options to the class are automatically passed to all loaded packages.

    – egreg
    Jul 5 '12 at 15:51











  • @egreg: If you specify the paper size via documentclass and don't use geometry, the paper will be of the correct size, so something changes. The question is, could these changes interfere with geometry in any way? (It doesn't seem like it.)

    – doncherry
    Jul 5 '12 at 16:30











  • @doncherry The class understands a4paper and sets the text block dimensions accordingly. If you also load geometry the dimensions are changed again according to geometry default for A4 paper, unless you use the pass option.

    – egreg
    Jul 5 '12 at 16:36
















29















I currently have an article document class and I previously changed it to include printing on A4 paper:



documentclass[12pt, a4paper]{article}


However, I had to change my margins to meet my university requirements and the answer I received used A4 in the geometry package too.



geometry{a4paper,margin=15mm,bindingoffset=25mm,heightrounded,}


Partially practical and partially theoretical, is there any difference to using either declaration and/or is there an effect by using both?










share|improve this question




















  • 3





    It's irrelevant: options to the class are automatically passed to all loaded packages.

    – egreg
    Jul 5 '12 at 15:51











  • @egreg: If you specify the paper size via documentclass and don't use geometry, the paper will be of the correct size, so something changes. The question is, could these changes interfere with geometry in any way? (It doesn't seem like it.)

    – doncherry
    Jul 5 '12 at 16:30











  • @doncherry The class understands a4paper and sets the text block dimensions accordingly. If you also load geometry the dimensions are changed again according to geometry default for A4 paper, unless you use the pass option.

    – egreg
    Jul 5 '12 at 16:36














29












29








29


3






I currently have an article document class and I previously changed it to include printing on A4 paper:



documentclass[12pt, a4paper]{article}


However, I had to change my margins to meet my university requirements and the answer I received used A4 in the geometry package too.



geometry{a4paper,margin=15mm,bindingoffset=25mm,heightrounded,}


Partially practical and partially theoretical, is there any difference to using either declaration and/or is there an effect by using both?










share|improve this question
















I currently have an article document class and I previously changed it to include printing on A4 paper:



documentclass[12pt, a4paper]{article}


However, I had to change my margins to meet my university requirements and the answer I received used A4 in the geometry package too.



geometry{a4paper,margin=15mm,bindingoffset=25mm,heightrounded,}


Partially practical and partially theoretical, is there any difference to using either declaration and/or is there an effect by using both?







best-practices paper-size geometry package-options






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 5 '12 at 16:31









doncherry

35.2k23136208




35.2k23136208










asked Jul 5 '12 at 15:41









Mike StumpfMike Stumpf

70931431




70931431








  • 3





    It's irrelevant: options to the class are automatically passed to all loaded packages.

    – egreg
    Jul 5 '12 at 15:51











  • @egreg: If you specify the paper size via documentclass and don't use geometry, the paper will be of the correct size, so something changes. The question is, could these changes interfere with geometry in any way? (It doesn't seem like it.)

    – doncherry
    Jul 5 '12 at 16:30











  • @doncherry The class understands a4paper and sets the text block dimensions accordingly. If you also load geometry the dimensions are changed again according to geometry default for A4 paper, unless you use the pass option.

    – egreg
    Jul 5 '12 at 16:36














  • 3





    It's irrelevant: options to the class are automatically passed to all loaded packages.

    – egreg
    Jul 5 '12 at 15:51











  • @egreg: If you specify the paper size via documentclass and don't use geometry, the paper will be of the correct size, so something changes. The question is, could these changes interfere with geometry in any way? (It doesn't seem like it.)

    – doncherry
    Jul 5 '12 at 16:30











  • @doncherry The class understands a4paper and sets the text block dimensions accordingly. If you also load geometry the dimensions are changed again according to geometry default for A4 paper, unless you use the pass option.

    – egreg
    Jul 5 '12 at 16:36








3




3





It's irrelevant: options to the class are automatically passed to all loaded packages.

– egreg
Jul 5 '12 at 15:51





It's irrelevant: options to the class are automatically passed to all loaded packages.

– egreg
Jul 5 '12 at 15:51













@egreg: If you specify the paper size via documentclass and don't use geometry, the paper will be of the correct size, so something changes. The question is, could these changes interfere with geometry in any way? (It doesn't seem like it.)

– doncherry
Jul 5 '12 at 16:30





@egreg: If you specify the paper size via documentclass and don't use geometry, the paper will be of the correct size, so something changes. The question is, could these changes interfere with geometry in any way? (It doesn't seem like it.)

– doncherry
Jul 5 '12 at 16:30













@doncherry The class understands a4paper and sets the text block dimensions accordingly. If you also load geometry the dimensions are changed again according to geometry default for A4 paper, unless you use the pass option.

– egreg
Jul 5 '12 at 16:36





@doncherry The class understands a4paper and sets the text block dimensions accordingly. If you also load geometry the dimensions are changed again according to geometry default for A4 paper, unless you use the pass option.

– egreg
Jul 5 '12 at 16:36










3 Answers
3






active

oldest

votes


















23














a4paper specified in document class will be passed to geometry. So there is no difference in your case if you specify the option in documentclass{article} or usepackage{geometry}.



However if other packages need to know document format, you need to specify a4paper in the document class.






share|improve this answer


























  • Looking at the source for the article class, how is the paper size being passed to geometry? I only see that paperheight and paperwidth are being directly set.

    – Tyler Crompton
    Oct 8 '15 at 3:18











  • @kissmyarmpit ! LaTeX Error: File a4paper.sty' not found.`

    – alhelal
    Jan 10 '18 at 3:32






  • 1





    Passing the option to documentclass gives any package a chance to react to the option; on the other hand, passing it to usepackage{geometry} doesn't, thus I wouldn't say there is no difference. It depends on what other packages do with the paper size. Nothing in most cases, but who knows...

    – frougon
    Dec 22 '18 at 10:22



















2














I'm not sure about the changes, but I think the standard way is the following:



documentclass[12pt]{article}
usepackage[a4paper]{geometry}
...


You can specify the margins further. The simplest way is writing



usepackage[a4paper, margin=2cm]{geometry}





share|improve this answer
























  • no, add a4paper to the class options, it only passed on to geometry then any later package that might also react to a4paper would never see it.

    – daleif
    Jul 5 '12 at 16:08











  • @daleif I don't understand your comment sorry...

    – Alenanno
    Jul 5 '12 at 21:42






  • 2





    type documentclass[12pt,a4paper]{...} not just usepackage[a4paper]{geometry}

    – daleif
    Jul 7 '12 at 10:02











  • @daleif I just realized but if that's true, how is this different from the accepted answer?

    – Alenanno
    Apr 23 '15 at 15:48











  • @daleif No answer? :P

    – Alenanno
    May 4 '17 at 10:18



















2














There might be a difference if you load some other packages that could use ...paper options. It is naturally global option of your manuscript so I think it is better declared global, similarly to the language options discussed here: https://tex.stackexchange.com/a/60298/11002



So I think that ...paper should be put as a global option of documentclass.






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%2f62311%2fa4paper-where-should-i-declare-it-in-document-class-or-geometry%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    23














    a4paper specified in document class will be passed to geometry. So there is no difference in your case if you specify the option in documentclass{article} or usepackage{geometry}.



    However if other packages need to know document format, you need to specify a4paper in the document class.






    share|improve this answer


























    • Looking at the source for the article class, how is the paper size being passed to geometry? I only see that paperheight and paperwidth are being directly set.

      – Tyler Crompton
      Oct 8 '15 at 3:18











    • @kissmyarmpit ! LaTeX Error: File a4paper.sty' not found.`

      – alhelal
      Jan 10 '18 at 3:32






    • 1





      Passing the option to documentclass gives any package a chance to react to the option; on the other hand, passing it to usepackage{geometry} doesn't, thus I wouldn't say there is no difference. It depends on what other packages do with the paper size. Nothing in most cases, but who knows...

      – frougon
      Dec 22 '18 at 10:22
















    23














    a4paper specified in document class will be passed to geometry. So there is no difference in your case if you specify the option in documentclass{article} or usepackage{geometry}.



    However if other packages need to know document format, you need to specify a4paper in the document class.






    share|improve this answer


























    • Looking at the source for the article class, how is the paper size being passed to geometry? I only see that paperheight and paperwidth are being directly set.

      – Tyler Crompton
      Oct 8 '15 at 3:18











    • @kissmyarmpit ! LaTeX Error: File a4paper.sty' not found.`

      – alhelal
      Jan 10 '18 at 3:32






    • 1





      Passing the option to documentclass gives any package a chance to react to the option; on the other hand, passing it to usepackage{geometry} doesn't, thus I wouldn't say there is no difference. It depends on what other packages do with the paper size. Nothing in most cases, but who knows...

      – frougon
      Dec 22 '18 at 10:22














    23












    23








    23







    a4paper specified in document class will be passed to geometry. So there is no difference in your case if you specify the option in documentclass{article} or usepackage{geometry}.



    However if other packages need to know document format, you need to specify a4paper in the document class.






    share|improve this answer















    a4paper specified in document class will be passed to geometry. So there is no difference in your case if you specify the option in documentclass{article} or usepackage{geometry}.



    However if other packages need to know document format, you need to specify a4paper in the document class.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 13 at 20:50









    Paradox

    1056




    1056










    answered Jul 5 '12 at 15:50









    kiss my armpitkiss my armpit

    13.2k20174407




    13.2k20174407













    • Looking at the source for the article class, how is the paper size being passed to geometry? I only see that paperheight and paperwidth are being directly set.

      – Tyler Crompton
      Oct 8 '15 at 3:18











    • @kissmyarmpit ! LaTeX Error: File a4paper.sty' not found.`

      – alhelal
      Jan 10 '18 at 3:32






    • 1





      Passing the option to documentclass gives any package a chance to react to the option; on the other hand, passing it to usepackage{geometry} doesn't, thus I wouldn't say there is no difference. It depends on what other packages do with the paper size. Nothing in most cases, but who knows...

      – frougon
      Dec 22 '18 at 10:22



















    • Looking at the source for the article class, how is the paper size being passed to geometry? I only see that paperheight and paperwidth are being directly set.

      – Tyler Crompton
      Oct 8 '15 at 3:18











    • @kissmyarmpit ! LaTeX Error: File a4paper.sty' not found.`

      – alhelal
      Jan 10 '18 at 3:32






    • 1





      Passing the option to documentclass gives any package a chance to react to the option; on the other hand, passing it to usepackage{geometry} doesn't, thus I wouldn't say there is no difference. It depends on what other packages do with the paper size. Nothing in most cases, but who knows...

      – frougon
      Dec 22 '18 at 10:22

















    Looking at the source for the article class, how is the paper size being passed to geometry? I only see that paperheight and paperwidth are being directly set.

    – Tyler Crompton
    Oct 8 '15 at 3:18





    Looking at the source for the article class, how is the paper size being passed to geometry? I only see that paperheight and paperwidth are being directly set.

    – Tyler Crompton
    Oct 8 '15 at 3:18













    @kissmyarmpit ! LaTeX Error: File a4paper.sty' not found.`

    – alhelal
    Jan 10 '18 at 3:32





    @kissmyarmpit ! LaTeX Error: File a4paper.sty' not found.`

    – alhelal
    Jan 10 '18 at 3:32




    1




    1





    Passing the option to documentclass gives any package a chance to react to the option; on the other hand, passing it to usepackage{geometry} doesn't, thus I wouldn't say there is no difference. It depends on what other packages do with the paper size. Nothing in most cases, but who knows...

    – frougon
    Dec 22 '18 at 10:22





    Passing the option to documentclass gives any package a chance to react to the option; on the other hand, passing it to usepackage{geometry} doesn't, thus I wouldn't say there is no difference. It depends on what other packages do with the paper size. Nothing in most cases, but who knows...

    – frougon
    Dec 22 '18 at 10:22











    2














    I'm not sure about the changes, but I think the standard way is the following:



    documentclass[12pt]{article}
    usepackage[a4paper]{geometry}
    ...


    You can specify the margins further. The simplest way is writing



    usepackage[a4paper, margin=2cm]{geometry}





    share|improve this answer
























    • no, add a4paper to the class options, it only passed on to geometry then any later package that might also react to a4paper would never see it.

      – daleif
      Jul 5 '12 at 16:08











    • @daleif I don't understand your comment sorry...

      – Alenanno
      Jul 5 '12 at 21:42






    • 2





      type documentclass[12pt,a4paper]{...} not just usepackage[a4paper]{geometry}

      – daleif
      Jul 7 '12 at 10:02











    • @daleif I just realized but if that's true, how is this different from the accepted answer?

      – Alenanno
      Apr 23 '15 at 15:48











    • @daleif No answer? :P

      – Alenanno
      May 4 '17 at 10:18
















    2














    I'm not sure about the changes, but I think the standard way is the following:



    documentclass[12pt]{article}
    usepackage[a4paper]{geometry}
    ...


    You can specify the margins further. The simplest way is writing



    usepackage[a4paper, margin=2cm]{geometry}





    share|improve this answer
























    • no, add a4paper to the class options, it only passed on to geometry then any later package that might also react to a4paper would never see it.

      – daleif
      Jul 5 '12 at 16:08











    • @daleif I don't understand your comment sorry...

      – Alenanno
      Jul 5 '12 at 21:42






    • 2





      type documentclass[12pt,a4paper]{...} not just usepackage[a4paper]{geometry}

      – daleif
      Jul 7 '12 at 10:02











    • @daleif I just realized but if that's true, how is this different from the accepted answer?

      – Alenanno
      Apr 23 '15 at 15:48











    • @daleif No answer? :P

      – Alenanno
      May 4 '17 at 10:18














    2












    2








    2







    I'm not sure about the changes, but I think the standard way is the following:



    documentclass[12pt]{article}
    usepackage[a4paper]{geometry}
    ...


    You can specify the margins further. The simplest way is writing



    usepackage[a4paper, margin=2cm]{geometry}





    share|improve this answer













    I'm not sure about the changes, but I think the standard way is the following:



    documentclass[12pt]{article}
    usepackage[a4paper]{geometry}
    ...


    You can specify the margins further. The simplest way is writing



    usepackage[a4paper, margin=2cm]{geometry}






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jul 5 '12 at 15:49









    AlenannoAlenanno

    28.7k557111




    28.7k557111













    • no, add a4paper to the class options, it only passed on to geometry then any later package that might also react to a4paper would never see it.

      – daleif
      Jul 5 '12 at 16:08











    • @daleif I don't understand your comment sorry...

      – Alenanno
      Jul 5 '12 at 21:42






    • 2





      type documentclass[12pt,a4paper]{...} not just usepackage[a4paper]{geometry}

      – daleif
      Jul 7 '12 at 10:02











    • @daleif I just realized but if that's true, how is this different from the accepted answer?

      – Alenanno
      Apr 23 '15 at 15:48











    • @daleif No answer? :P

      – Alenanno
      May 4 '17 at 10:18



















    • no, add a4paper to the class options, it only passed on to geometry then any later package that might also react to a4paper would never see it.

      – daleif
      Jul 5 '12 at 16:08











    • @daleif I don't understand your comment sorry...

      – Alenanno
      Jul 5 '12 at 21:42






    • 2





      type documentclass[12pt,a4paper]{...} not just usepackage[a4paper]{geometry}

      – daleif
      Jul 7 '12 at 10:02











    • @daleif I just realized but if that's true, how is this different from the accepted answer?

      – Alenanno
      Apr 23 '15 at 15:48











    • @daleif No answer? :P

      – Alenanno
      May 4 '17 at 10:18

















    no, add a4paper to the class options, it only passed on to geometry then any later package that might also react to a4paper would never see it.

    – daleif
    Jul 5 '12 at 16:08





    no, add a4paper to the class options, it only passed on to geometry then any later package that might also react to a4paper would never see it.

    – daleif
    Jul 5 '12 at 16:08













    @daleif I don't understand your comment sorry...

    – Alenanno
    Jul 5 '12 at 21:42





    @daleif I don't understand your comment sorry...

    – Alenanno
    Jul 5 '12 at 21:42




    2




    2





    type documentclass[12pt,a4paper]{...} not just usepackage[a4paper]{geometry}

    – daleif
    Jul 7 '12 at 10:02





    type documentclass[12pt,a4paper]{...} not just usepackage[a4paper]{geometry}

    – daleif
    Jul 7 '12 at 10:02













    @daleif I just realized but if that's true, how is this different from the accepted answer?

    – Alenanno
    Apr 23 '15 at 15:48





    @daleif I just realized but if that's true, how is this different from the accepted answer?

    – Alenanno
    Apr 23 '15 at 15:48













    @daleif No answer? :P

    – Alenanno
    May 4 '17 at 10:18





    @daleif No answer? :P

    – Alenanno
    May 4 '17 at 10:18











    2














    There might be a difference if you load some other packages that could use ...paper options. It is naturally global option of your manuscript so I think it is better declared global, similarly to the language options discussed here: https://tex.stackexchange.com/a/60298/11002



    So I think that ...paper should be put as a global option of documentclass.






    share|improve this answer






























      2














      There might be a difference if you load some other packages that could use ...paper options. It is naturally global option of your manuscript so I think it is better declared global, similarly to the language options discussed here: https://tex.stackexchange.com/a/60298/11002



      So I think that ...paper should be put as a global option of documentclass.






      share|improve this answer




























        2












        2








        2







        There might be a difference if you load some other packages that could use ...paper options. It is naturally global option of your manuscript so I think it is better declared global, similarly to the language options discussed here: https://tex.stackexchange.com/a/60298/11002



        So I think that ...paper should be put as a global option of documentclass.






        share|improve this answer















        There might be a difference if you load some other packages that could use ...paper options. It is naturally global option of your manuscript so I think it is better declared global, similarly to the language options discussed here: https://tex.stackexchange.com/a/60298/11002



        So I think that ...paper should be put as a global option of documentclass.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 13 '17 at 12:35









        Community

        1




        1










        answered Jul 5 '12 at 16:30









        yo'yo'

        39.7k8124233




        39.7k8124233






























            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%2f62311%2fa4paper-where-should-i-declare-it-in-document-class-or-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

            Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

            ComboBox Display Member on multiple fields

            Is it possible to collect Nectar points via Trainline?