What's the difference between mathrm and operatorname?Difference between mathrm, operatorname and text?Define...

Etiquette around loan refinance - decision is going to cost first broker a lot of money

Is there a hemisphere-neutral way of specifying a season?

Today is the Center

How can I tell someone that I want to be his or her friend?

Arrow those variables!

Can a rocket refuel on Mars from water?

Theorems that impeded progress

What reasons are there for a Capitalist to oppose a 100% inheritance tax?

What do you call someone who asks many questions?

Python: return float 1.0 as int 1 but float 1.5 as float 1.5

Why are electrically insulating heatsinks so rare? Is it just cost?

How to say in German "enjoying home comforts"

Has there ever been an airliner design involving reducing generator load by installing solar panels?

When a company launches a new product do they "come out" with a new product or do they "come up" with a new product?

What killed these X2 caps?

Infinite Abelian subgroup of infinite non Abelian group example

How do I write bicross product symbols in latex?

Does a druid starting with a bow start with no arrows?

Is it canonical bit space?

Forgetting the musical notes while performing in concert

Combinations of multiple lists

intersection of two sorted vectors in C++

What is the PIE reconstruction for word-initial alpha with rough breathing?

In a Spin are Both Wings Stalled?



What's the difference between mathrm and operatorname?


Difference between mathrm, operatorname and text?Define additional math operators to be typeset in romanWhich command should I use for textual subscripts in math mode?Further questions about mathrm and operatorname: spacing after colonHow to properly typeset E_{mathrm{k}} in beamerCorrectly left align a set of equationsHow to insert long subscripts involving characters?Error using equation*Incompatibility of lmodern and fourier?What's the difference between align and align*?Difference between textrm{} and mathrm{}What is the difference of mathop, operatorname and DeclareMathOperator?Difference between mathrm, operatorname and text?What is the difference between dfrac and frac?What's the difference between split and aligned?What's the difference between DeclareMathOperator and mathop?What is the difference between ifmmode and textormath?What's the difference between mspace and hspace in math mode?Further questions about mathrm and operatorname: spacing after colon













167















I apparently can't see the difference in a compilation (pdflatex) between mathrm and operatorname. So, as in the title the question is: is there a difference? Which one is preferable in what occasions?










share|improve this question





























    167















    I apparently can't see the difference in a compilation (pdflatex) between mathrm and operatorname. So, as in the title the question is: is there a difference? Which one is preferable in what occasions?










    share|improve this question



























      167












      167








      167


      51






      I apparently can't see the difference in a compilation (pdflatex) between mathrm and operatorname. So, as in the title the question is: is there a difference? Which one is preferable in what occasions?










      share|improve this question
















      I apparently can't see the difference in a compilation (pdflatex) between mathrm and operatorname. So, as in the title the question is: is there a difference? Which one is preferable in what occasions?







      math-mode amsmath math-operators






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 25 '12 at 13:28









      doncherry

      35.3k23137209




      35.3k23137209










      asked Mar 18 '12 at 9:42









      AndyAndy

      945278




      945278






















          3 Answers
          3






          active

          oldest

          votes


















          194














          There are many differences. The main one is in the fact that mathrm{xyz} behaves like an ordinary letter, while operatorname{xyz} behaves like function names such as sin. Here's an illustration



          $sin x + sin(x+y) + asin z$

          $mathrm{sin} x + mathrm{sin}(x+y) + amathrm{sin}z$


          enter image description here



          where it's clear that the second line is wrongly typeset. Even if your "operator" requires parentheses after it, it should be operatorname, as the third summand shows, where a thin space separates the coefficient from the operator.



          Another subtle difference is in how some characters are interpreted in mathrm and in operatorname. Suppose you have an operator to be called "pre-norm", with a hyphen. Here's the example



          $operatorname{pre-norm}(mathbf{v})$

          $mathrm{pre-norm}(mathbf{v})$


          enter image description here



          and now it's clear what is to be used. Indeed operatorname (and the same holds for macros defined with DeclareMathOperator) treats in a special way punctuation symbols; mathrm, instead, treats them as math symbols.






          share|improve this answer



















          • 1





            Can you please tell the full form of the rm in mathrm? Thank you!

            – Gaurang Tandon
            Feb 14 '18 at 5:12






          • 2





            @GaurangTandon rm stands for “roman”, that conventionally denotes the upright type used in the document.

            – egreg
            Feb 14 '18 at 8:59



















          34














          mathrm:



          It is like math mode (no spaces), but in upright mode. The font size isn't changed.



          operatorname:



          The argument is written in upright mode but with some additional
          space before and behind.



          The following example shows the differences:



          documentclass[]{article}
          usepackage{amsmath}
          begin{document}
          [xoperatorname{foo}y]
          [xmathrm{foo}y]
          end{document}


          enter image description here






          share|improve this answer































            9














            In other LaTeX environments mathrm{xyz} is useful. In MathJax v 2.0



            $ i \, mathrm{sinh} ; $


            gave the equivalent output as $ i sinh x $. MathJax did not recognize operatorname.






            share|improve this answer





















            • 9





              operatorname is now supported with the ASMmath.js TeX extension.

              – ChrisR
              Dec 4 '13 at 16:10












            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%2f48459%2fwhats-the-difference-between-mathrm-and-operatorname%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









            194














            There are many differences. The main one is in the fact that mathrm{xyz} behaves like an ordinary letter, while operatorname{xyz} behaves like function names such as sin. Here's an illustration



            $sin x + sin(x+y) + asin z$

            $mathrm{sin} x + mathrm{sin}(x+y) + amathrm{sin}z$


            enter image description here



            where it's clear that the second line is wrongly typeset. Even if your "operator" requires parentheses after it, it should be operatorname, as the third summand shows, where a thin space separates the coefficient from the operator.



            Another subtle difference is in how some characters are interpreted in mathrm and in operatorname. Suppose you have an operator to be called "pre-norm", with a hyphen. Here's the example



            $operatorname{pre-norm}(mathbf{v})$

            $mathrm{pre-norm}(mathbf{v})$


            enter image description here



            and now it's clear what is to be used. Indeed operatorname (and the same holds for macros defined with DeclareMathOperator) treats in a special way punctuation symbols; mathrm, instead, treats them as math symbols.






            share|improve this answer



















            • 1





              Can you please tell the full form of the rm in mathrm? Thank you!

              – Gaurang Tandon
              Feb 14 '18 at 5:12






            • 2





              @GaurangTandon rm stands for “roman”, that conventionally denotes the upright type used in the document.

              – egreg
              Feb 14 '18 at 8:59
















            194














            There are many differences. The main one is in the fact that mathrm{xyz} behaves like an ordinary letter, while operatorname{xyz} behaves like function names such as sin. Here's an illustration



            $sin x + sin(x+y) + asin z$

            $mathrm{sin} x + mathrm{sin}(x+y) + amathrm{sin}z$


            enter image description here



            where it's clear that the second line is wrongly typeset. Even if your "operator" requires parentheses after it, it should be operatorname, as the third summand shows, where a thin space separates the coefficient from the operator.



            Another subtle difference is in how some characters are interpreted in mathrm and in operatorname. Suppose you have an operator to be called "pre-norm", with a hyphen. Here's the example



            $operatorname{pre-norm}(mathbf{v})$

            $mathrm{pre-norm}(mathbf{v})$


            enter image description here



            and now it's clear what is to be used. Indeed operatorname (and the same holds for macros defined with DeclareMathOperator) treats in a special way punctuation symbols; mathrm, instead, treats them as math symbols.






            share|improve this answer



















            • 1





              Can you please tell the full form of the rm in mathrm? Thank you!

              – Gaurang Tandon
              Feb 14 '18 at 5:12






            • 2





              @GaurangTandon rm stands for “roman”, that conventionally denotes the upright type used in the document.

              – egreg
              Feb 14 '18 at 8:59














            194












            194








            194







            There are many differences. The main one is in the fact that mathrm{xyz} behaves like an ordinary letter, while operatorname{xyz} behaves like function names such as sin. Here's an illustration



            $sin x + sin(x+y) + asin z$

            $mathrm{sin} x + mathrm{sin}(x+y) + amathrm{sin}z$


            enter image description here



            where it's clear that the second line is wrongly typeset. Even if your "operator" requires parentheses after it, it should be operatorname, as the third summand shows, where a thin space separates the coefficient from the operator.



            Another subtle difference is in how some characters are interpreted in mathrm and in operatorname. Suppose you have an operator to be called "pre-norm", with a hyphen. Here's the example



            $operatorname{pre-norm}(mathbf{v})$

            $mathrm{pre-norm}(mathbf{v})$


            enter image description here



            and now it's clear what is to be used. Indeed operatorname (and the same holds for macros defined with DeclareMathOperator) treats in a special way punctuation symbols; mathrm, instead, treats them as math symbols.






            share|improve this answer













            There are many differences. The main one is in the fact that mathrm{xyz} behaves like an ordinary letter, while operatorname{xyz} behaves like function names such as sin. Here's an illustration



            $sin x + sin(x+y) + asin z$

            $mathrm{sin} x + mathrm{sin}(x+y) + amathrm{sin}z$


            enter image description here



            where it's clear that the second line is wrongly typeset. Even if your "operator" requires parentheses after it, it should be operatorname, as the third summand shows, where a thin space separates the coefficient from the operator.



            Another subtle difference is in how some characters are interpreted in mathrm and in operatorname. Suppose you have an operator to be called "pre-norm", with a hyphen. Here's the example



            $operatorname{pre-norm}(mathbf{v})$

            $mathrm{pre-norm}(mathbf{v})$


            enter image description here



            and now it's clear what is to be used. Indeed operatorname (and the same holds for macros defined with DeclareMathOperator) treats in a special way punctuation symbols; mathrm, instead, treats them as math symbols.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 18 '12 at 10:05









            egregegreg

            731k8919303252




            731k8919303252








            • 1





              Can you please tell the full form of the rm in mathrm? Thank you!

              – Gaurang Tandon
              Feb 14 '18 at 5:12






            • 2





              @GaurangTandon rm stands for “roman”, that conventionally denotes the upright type used in the document.

              – egreg
              Feb 14 '18 at 8:59














            • 1





              Can you please tell the full form of the rm in mathrm? Thank you!

              – Gaurang Tandon
              Feb 14 '18 at 5:12






            • 2





              @GaurangTandon rm stands for “roman”, that conventionally denotes the upright type used in the document.

              – egreg
              Feb 14 '18 at 8:59








            1




            1





            Can you please tell the full form of the rm in mathrm? Thank you!

            – Gaurang Tandon
            Feb 14 '18 at 5:12





            Can you please tell the full form of the rm in mathrm? Thank you!

            – Gaurang Tandon
            Feb 14 '18 at 5:12




            2




            2





            @GaurangTandon rm stands for “roman”, that conventionally denotes the upright type used in the document.

            – egreg
            Feb 14 '18 at 8:59





            @GaurangTandon rm stands for “roman”, that conventionally denotes the upright type used in the document.

            – egreg
            Feb 14 '18 at 8:59











            34














            mathrm:



            It is like math mode (no spaces), but in upright mode. The font size isn't changed.



            operatorname:



            The argument is written in upright mode but with some additional
            space before and behind.



            The following example shows the differences:



            documentclass[]{article}
            usepackage{amsmath}
            begin{document}
            [xoperatorname{foo}y]
            [xmathrm{foo}y]
            end{document}


            enter image description here






            share|improve this answer




























              34














              mathrm:



              It is like math mode (no spaces), but in upright mode. The font size isn't changed.



              operatorname:



              The argument is written in upright mode but with some additional
              space before and behind.



              The following example shows the differences:



              documentclass[]{article}
              usepackage{amsmath}
              begin{document}
              [xoperatorname{foo}y]
              [xmathrm{foo}y]
              end{document}


              enter image description here






              share|improve this answer


























                34












                34








                34







                mathrm:



                It is like math mode (no spaces), but in upright mode. The font size isn't changed.



                operatorname:



                The argument is written in upright mode but with some additional
                space before and behind.



                The following example shows the differences:



                documentclass[]{article}
                usepackage{amsmath}
                begin{document}
                [xoperatorname{foo}y]
                [xmathrm{foo}y]
                end{document}


                enter image description here






                share|improve this answer













                mathrm:



                It is like math mode (no spaces), but in upright mode. The font size isn't changed.



                operatorname:



                The argument is written in upright mode but with some additional
                space before and behind.



                The following example shows the differences:



                documentclass[]{article}
                usepackage{amsmath}
                begin{document}
                [xoperatorname{foo}y]
                [xmathrm{foo}y]
                end{document}


                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 18 '12 at 9:48









                Marco DanielMarco Daniel

                78.5k13223388




                78.5k13223388























                    9














                    In other LaTeX environments mathrm{xyz} is useful. In MathJax v 2.0



                    $ i \, mathrm{sinh} ; $


                    gave the equivalent output as $ i sinh x $. MathJax did not recognize operatorname.






                    share|improve this answer





















                    • 9





                      operatorname is now supported with the ASMmath.js TeX extension.

                      – ChrisR
                      Dec 4 '13 at 16:10
















                    9














                    In other LaTeX environments mathrm{xyz} is useful. In MathJax v 2.0



                    $ i \, mathrm{sinh} ; $


                    gave the equivalent output as $ i sinh x $. MathJax did not recognize operatorname.






                    share|improve this answer





















                    • 9





                      operatorname is now supported with the ASMmath.js TeX extension.

                      – ChrisR
                      Dec 4 '13 at 16:10














                    9












                    9








                    9







                    In other LaTeX environments mathrm{xyz} is useful. In MathJax v 2.0



                    $ i \, mathrm{sinh} ; $


                    gave the equivalent output as $ i sinh x $. MathJax did not recognize operatorname.






                    share|improve this answer















                    In other LaTeX environments mathrm{xyz} is useful. In MathJax v 2.0



                    $ i \, mathrm{sinh} ; $


                    gave the equivalent output as $ i sinh x $. MathJax did not recognize operatorname.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Aug 26 '12 at 16:17









                    bodo

                    4,66211856




                    4,66211856










                    answered Aug 26 '12 at 16:02









                    cheltonchelton

                    9911




                    9911








                    • 9





                      operatorname is now supported with the ASMmath.js TeX extension.

                      – ChrisR
                      Dec 4 '13 at 16:10














                    • 9





                      operatorname is now supported with the ASMmath.js TeX extension.

                      – ChrisR
                      Dec 4 '13 at 16:10








                    9




                    9





                    operatorname is now supported with the ASMmath.js TeX extension.

                    – ChrisR
                    Dec 4 '13 at 16:10





                    operatorname is now supported with the ASMmath.js TeX extension.

                    – ChrisR
                    Dec 4 '13 at 16:10


















                    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%2f48459%2fwhats-the-difference-between-mathrm-and-operatorname%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

                    El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

                    Castillo d'Acher Características Menú de navegación

                    Connecting two nodes from the same mother node horizontallyTikZ: What EXACTLY does the the |- notation for...