Is it just me or $f(x) = x^2 + 17 mod 43$ adds too much space before the mod operator?












1















documentclass[a4paper]{article}
usepackage{amsmath}
begin{document}

Instead of $f(x) = x^2 + 17 mod 43$, I prefer $f(x) = x^2 + 17hspace{-1mm}mod 43$.

end{document}


Why was the modulo operator defined with this apparent extra space? Is there a rationale behind it?



I'm on the brink of redefining it.










share|improve this question


















  • 1





    Related/duplicate: Writing mod in congruence problems without leading space

    – Werner
    Feb 11 at 23:35
















1















documentclass[a4paper]{article}
usepackage{amsmath}
begin{document}

Instead of $f(x) = x^2 + 17 mod 43$, I prefer $f(x) = x^2 + 17hspace{-1mm}mod 43$.

end{document}


Why was the modulo operator defined with this apparent extra space? Is there a rationale behind it?



I'm on the brink of redefining it.










share|improve this question


















  • 1





    Related/duplicate: Writing mod in congruence problems without leading space

    – Werner
    Feb 11 at 23:35














1












1








1








documentclass[a4paper]{article}
usepackage{amsmath}
begin{document}

Instead of $f(x) = x^2 + 17 mod 43$, I prefer $f(x) = x^2 + 17hspace{-1mm}mod 43$.

end{document}


Why was the modulo operator defined with this apparent extra space? Is there a rationale behind it?



I'm on the brink of redefining it.










share|improve this question














documentclass[a4paper]{article}
usepackage{amsmath}
begin{document}

Instead of $f(x) = x^2 + 17 mod 43$, I prefer $f(x) = x^2 + 17hspace{-1mm}mod 43$.

end{document}


Why was the modulo operator defined with this apparent extra space? Is there a rationale behind it?



I'm on the brink of redefining it.







spacing amsmath






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 11 at 23:26









Joep AwinitaJoep Awinita

815




815








  • 1





    Related/duplicate: Writing mod in congruence problems without leading space

    – Werner
    Feb 11 at 23:35














  • 1





    Related/duplicate: Writing mod in congruence problems without leading space

    – Werner
    Feb 11 at 23:35








1




1





Related/duplicate: Writing mod in congruence problems without leading space

– Werner
Feb 11 at 23:35





Related/duplicate: Writing mod in congruence problems without leading space

– Werner
Feb 11 at 23:35










2 Answers
2






active

oldest

votes


















3














First and foremost: it is not an “operator”, but a traditional way to write a particular equivalence relation. Also the correct syntax is mod{43}.



Plain TeX only has pmod, defined as



% plain.tex, line 1089
defpmod#1{allowbreakmkern18mu({rm mod},,#1)}


so the space is 1em (in the math symbol font), because 18mu is 1em.



In the LaTeX kernel the definition is essentially the same, namely



% latex.ltx, line 4437:
defpmod#1{%
allowbreakmkern18mu({operator@font mod},,#1)}


On the other hand, amsmath also defines mod and pod. The former omits parentheses and the latter has parentheses but no “mod”.



newcommand{pod}[1]{allowbreak
if@displaymkern18muelsemkern8mufi(#1)}
renewcommand{pmod}[1]{pod{{operator@font mod}mkern6mu#1}}
newcommand{mod}[1]{allowbreakif@displaymkern18mu
elsemkern12mufi{operator@font mod},,#1}


The definition of pmod is in terms of pod; you can see that aequiv bpod{n} will have, after b, 1em of space in display style or 8/18em in other styles, followed by (n). With pmod the spacing before the parenthesis is the same, but after the parentheses “mod” and a space of 6/18em will precede n.



With mod the spacing is essentially the same, but 12/18em would be used instead of 8/18em in text style or below. Note that ,, is the same as mkern 6mu.



So it's just you. ;-)



Of course you're free to change the spacing by redefining pod and mod.






share|improve this answer
























  • It's great that you prove your comments by showing the original definitions.

    – Joep Awinita
    Feb 13 at 18:07



















1














The even spaced version is bmod as in Sebastiano's now deleted answer which has the spacing you seem to want but is the wrong thing here as it would mean x^2 + (17 mod 43) which is the wrong interpretation. You want the bigger space before mod to separate it from the 17 and make it clear that it's a side condition applying to the equality which is to be interpreted as a congruence mod 43.






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%2f474433%2fis-it-just-me-or-fx-x2-17-mod-43-adds-too-much-space-before-the-mod-op%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    First and foremost: it is not an “operator”, but a traditional way to write a particular equivalence relation. Also the correct syntax is mod{43}.



    Plain TeX only has pmod, defined as



    % plain.tex, line 1089
    defpmod#1{allowbreakmkern18mu({rm mod},,#1)}


    so the space is 1em (in the math symbol font), because 18mu is 1em.



    In the LaTeX kernel the definition is essentially the same, namely



    % latex.ltx, line 4437:
    defpmod#1{%
    allowbreakmkern18mu({operator@font mod},,#1)}


    On the other hand, amsmath also defines mod and pod. The former omits parentheses and the latter has parentheses but no “mod”.



    newcommand{pod}[1]{allowbreak
    if@displaymkern18muelsemkern8mufi(#1)}
    renewcommand{pmod}[1]{pod{{operator@font mod}mkern6mu#1}}
    newcommand{mod}[1]{allowbreakif@displaymkern18mu
    elsemkern12mufi{operator@font mod},,#1}


    The definition of pmod is in terms of pod; you can see that aequiv bpod{n} will have, after b, 1em of space in display style or 8/18em in other styles, followed by (n). With pmod the spacing before the parenthesis is the same, but after the parentheses “mod” and a space of 6/18em will precede n.



    With mod the spacing is essentially the same, but 12/18em would be used instead of 8/18em in text style or below. Note that ,, is the same as mkern 6mu.



    So it's just you. ;-)



    Of course you're free to change the spacing by redefining pod and mod.






    share|improve this answer
























    • It's great that you prove your comments by showing the original definitions.

      – Joep Awinita
      Feb 13 at 18:07
















    3














    First and foremost: it is not an “operator”, but a traditional way to write a particular equivalence relation. Also the correct syntax is mod{43}.



    Plain TeX only has pmod, defined as



    % plain.tex, line 1089
    defpmod#1{allowbreakmkern18mu({rm mod},,#1)}


    so the space is 1em (in the math symbol font), because 18mu is 1em.



    In the LaTeX kernel the definition is essentially the same, namely



    % latex.ltx, line 4437:
    defpmod#1{%
    allowbreakmkern18mu({operator@font mod},,#1)}


    On the other hand, amsmath also defines mod and pod. The former omits parentheses and the latter has parentheses but no “mod”.



    newcommand{pod}[1]{allowbreak
    if@displaymkern18muelsemkern8mufi(#1)}
    renewcommand{pmod}[1]{pod{{operator@font mod}mkern6mu#1}}
    newcommand{mod}[1]{allowbreakif@displaymkern18mu
    elsemkern12mufi{operator@font mod},,#1}


    The definition of pmod is in terms of pod; you can see that aequiv bpod{n} will have, after b, 1em of space in display style or 8/18em in other styles, followed by (n). With pmod the spacing before the parenthesis is the same, but after the parentheses “mod” and a space of 6/18em will precede n.



    With mod the spacing is essentially the same, but 12/18em would be used instead of 8/18em in text style or below. Note that ,, is the same as mkern 6mu.



    So it's just you. ;-)



    Of course you're free to change the spacing by redefining pod and mod.






    share|improve this answer
























    • It's great that you prove your comments by showing the original definitions.

      – Joep Awinita
      Feb 13 at 18:07














    3












    3








    3







    First and foremost: it is not an “operator”, but a traditional way to write a particular equivalence relation. Also the correct syntax is mod{43}.



    Plain TeX only has pmod, defined as



    % plain.tex, line 1089
    defpmod#1{allowbreakmkern18mu({rm mod},,#1)}


    so the space is 1em (in the math symbol font), because 18mu is 1em.



    In the LaTeX kernel the definition is essentially the same, namely



    % latex.ltx, line 4437:
    defpmod#1{%
    allowbreakmkern18mu({operator@font mod},,#1)}


    On the other hand, amsmath also defines mod and pod. The former omits parentheses and the latter has parentheses but no “mod”.



    newcommand{pod}[1]{allowbreak
    if@displaymkern18muelsemkern8mufi(#1)}
    renewcommand{pmod}[1]{pod{{operator@font mod}mkern6mu#1}}
    newcommand{mod}[1]{allowbreakif@displaymkern18mu
    elsemkern12mufi{operator@font mod},,#1}


    The definition of pmod is in terms of pod; you can see that aequiv bpod{n} will have, after b, 1em of space in display style or 8/18em in other styles, followed by (n). With pmod the spacing before the parenthesis is the same, but after the parentheses “mod” and a space of 6/18em will precede n.



    With mod the spacing is essentially the same, but 12/18em would be used instead of 8/18em in text style or below. Note that ,, is the same as mkern 6mu.



    So it's just you. ;-)



    Of course you're free to change the spacing by redefining pod and mod.






    share|improve this answer













    First and foremost: it is not an “operator”, but a traditional way to write a particular equivalence relation. Also the correct syntax is mod{43}.



    Plain TeX only has pmod, defined as



    % plain.tex, line 1089
    defpmod#1{allowbreakmkern18mu({rm mod},,#1)}


    so the space is 1em (in the math symbol font), because 18mu is 1em.



    In the LaTeX kernel the definition is essentially the same, namely



    % latex.ltx, line 4437:
    defpmod#1{%
    allowbreakmkern18mu({operator@font mod},,#1)}


    On the other hand, amsmath also defines mod and pod. The former omits parentheses and the latter has parentheses but no “mod”.



    newcommand{pod}[1]{allowbreak
    if@displaymkern18muelsemkern8mufi(#1)}
    renewcommand{pmod}[1]{pod{{operator@font mod}mkern6mu#1}}
    newcommand{mod}[1]{allowbreakif@displaymkern18mu
    elsemkern12mufi{operator@font mod},,#1}


    The definition of pmod is in terms of pod; you can see that aequiv bpod{n} will have, after b, 1em of space in display style or 8/18em in other styles, followed by (n). With pmod the spacing before the parenthesis is the same, but after the parentheses “mod” and a space of 6/18em will precede n.



    With mod the spacing is essentially the same, but 12/18em would be used instead of 8/18em in text style or below. Note that ,, is the same as mkern 6mu.



    So it's just you. ;-)



    Of course you're free to change the spacing by redefining pod and mod.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 11 at 23:41









    egregegreg

    720k8719093208




    720k8719093208













    • It's great that you prove your comments by showing the original definitions.

      – Joep Awinita
      Feb 13 at 18:07



















    • It's great that you prove your comments by showing the original definitions.

      – Joep Awinita
      Feb 13 at 18:07

















    It's great that you prove your comments by showing the original definitions.

    – Joep Awinita
    Feb 13 at 18:07





    It's great that you prove your comments by showing the original definitions.

    – Joep Awinita
    Feb 13 at 18:07











    1














    The even spaced version is bmod as in Sebastiano's now deleted answer which has the spacing you seem to want but is the wrong thing here as it would mean x^2 + (17 mod 43) which is the wrong interpretation. You want the bigger space before mod to separate it from the 17 and make it clear that it's a side condition applying to the equality which is to be interpreted as a congruence mod 43.






    share|improve this answer




























      1














      The even spaced version is bmod as in Sebastiano's now deleted answer which has the spacing you seem to want but is the wrong thing here as it would mean x^2 + (17 mod 43) which is the wrong interpretation. You want the bigger space before mod to separate it from the 17 and make it clear that it's a side condition applying to the equality which is to be interpreted as a congruence mod 43.






      share|improve this answer


























        1












        1








        1







        The even spaced version is bmod as in Sebastiano's now deleted answer which has the spacing you seem to want but is the wrong thing here as it would mean x^2 + (17 mod 43) which is the wrong interpretation. You want the bigger space before mod to separate it from the 17 and make it clear that it's a side condition applying to the equality which is to be interpreted as a congruence mod 43.






        share|improve this answer













        The even spaced version is bmod as in Sebastiano's now deleted answer which has the spacing you seem to want but is the wrong thing here as it would mean x^2 + (17 mod 43) which is the wrong interpretation. You want the bigger space before mod to separate it from the 17 and make it clear that it's a side condition applying to the equality which is to be interpreted as a congruence mod 43.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 12 at 1:01









        David CarlisleDavid Carlisle

        491k4111341883




        491k4111341883






























            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%2f474433%2fis-it-just-me-or-fx-x2-17-mod-43-adds-too-much-space-before-the-mod-op%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

            mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

            How to change which sound is reproduced for terminal bell?

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