Command for argmin or argmax?











up vote
176
down vote

favorite
46












How can you get the argmin or argmax in Latex? Two solutions I found are:



underset{x}{operatorname{argmax}} 

DeclareMathOperator*{argmin}{arg,min}


Any other ideas?



[1] http://www.breakthru.altervista.org/?p=27



[2] http://researchonsearch.blogspot.com/2007/05/enter-argmax-argmin-in-latex.html










share|improve this question




















  • 28




    How do these solutions (especially the second) feel not right? The DeclareMathOperator is the way to go in this case.
    – Pieter
    Nov 11 '10 at 17:57






  • 1




    Personally, I like the look of text{arg},maxlimits_{theta},
    – Jean-Paul
    Sep 7 '16 at 8:11

















up vote
176
down vote

favorite
46












How can you get the argmin or argmax in Latex? Two solutions I found are:



underset{x}{operatorname{argmax}} 

DeclareMathOperator*{argmin}{arg,min}


Any other ideas?



[1] http://www.breakthru.altervista.org/?p=27



[2] http://researchonsearch.blogspot.com/2007/05/enter-argmax-argmin-in-latex.html










share|improve this question




















  • 28




    How do these solutions (especially the second) feel not right? The DeclareMathOperator is the way to go in this case.
    – Pieter
    Nov 11 '10 at 17:57






  • 1




    Personally, I like the look of text{arg},maxlimits_{theta},
    – Jean-Paul
    Sep 7 '16 at 8:11















up vote
176
down vote

favorite
46









up vote
176
down vote

favorite
46






46





How can you get the argmin or argmax in Latex? Two solutions I found are:



underset{x}{operatorname{argmax}} 

DeclareMathOperator*{argmin}{arg,min}


Any other ideas?



[1] http://www.breakthru.altervista.org/?p=27



[2] http://researchonsearch.blogspot.com/2007/05/enter-argmax-argmin-in-latex.html










share|improve this question















How can you get the argmin or argmax in Latex? Two solutions I found are:



underset{x}{operatorname{argmax}} 

DeclareMathOperator*{argmin}{arg,min}


Any other ideas?



[1] http://www.breakthru.altervista.org/?p=27



[2] http://researchonsearch.blogspot.com/2007/05/enter-argmax-argmin-in-latex.html







math-mode symbols math-operators






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 '10 at 18:30









Stefan Kottwitz

175k63566756




175k63566756










asked Nov 11 '10 at 17:45









Alejandro

1,31121016




1,31121016








  • 28




    How do these solutions (especially the second) feel not right? The DeclareMathOperator is the way to go in this case.
    – Pieter
    Nov 11 '10 at 17:57






  • 1




    Personally, I like the look of text{arg},maxlimits_{theta},
    – Jean-Paul
    Sep 7 '16 at 8:11
















  • 28




    How do these solutions (especially the second) feel not right? The DeclareMathOperator is the way to go in this case.
    – Pieter
    Nov 11 '10 at 17:57






  • 1




    Personally, I like the look of text{arg},maxlimits_{theta},
    – Jean-Paul
    Sep 7 '16 at 8:11










28




28




How do these solutions (especially the second) feel not right? The DeclareMathOperator is the way to go in this case.
– Pieter
Nov 11 '10 at 17:57




How do these solutions (especially the second) feel not right? The DeclareMathOperator is the way to go in this case.
– Pieter
Nov 11 '10 at 17:57




1




1




Personally, I like the look of text{arg},maxlimits_{theta},
– Jean-Paul
Sep 7 '16 at 8:11






Personally, I like the look of text{arg},maxlimits_{theta},
– Jean-Paul
Sep 7 '16 at 8:11












8 Answers
8






active

oldest

votes

















up vote
173
down vote



accepted










As Pieter pointed out, the correct way to define argmin and argmax operators in LaTeX is:



usepackage{amsmath}
DeclareMathOperator*{argmax}{arg,max}
DeclareMathOperator*{argmin}{arg,min}


Actually, using the amsopn package would be sufficient but it's loaded by amsmath internally, which is recommended for math typesetting anyway.



The * in DeclareMathOperator* places the underscored argument underneath the word rather than to the bottom right of it.






share|improve this answer



















  • 36




    If you use DeclareMathOperator*{argmin}{arg!min} you get rid of the ugly space between arg and min.
    – rbp
    Apr 6 '11 at 21:39






  • 18




    @rbp Why should one use argmin when simply argmin does the same?
    – egreg
    Jul 8 '12 at 15:31






  • 2




    @egreg you're right. I arrived at this one from some experimentation with other options, and didn't look back :)
    – rbp
    Jul 9 '12 at 11:56






  • 4




    In ConTeXt that is: definemathcommand [argmin] [limop] {mfunction{arg,min}}
    – mb21
    Jul 30 '13 at 11:49






  • 3




    Explanation: I left the thin space (,) between the arg and min because that's what the original poster had in the question, so I assumed that they wanted the space there. Personally I would just do DeclareMathOperator*{argmin}{argmin}, without the space.
    – Jan Hlavacek
    Aug 28 '15 at 1:14


















up vote
65
down vote













Summary



In the sequel, LaTeX is assumed.



Preliminary questions



1. Should a thin space separate “arg” from “min”?



This is a matter of personal preference. The default definition for limsup has a thin space, on the other hand “arcsin” is usually written without a space between the two components. Consistency is, as always, the keyword: using a macro definition will ensure it and also easiness in modifying the typesetting in the whole document, if switching from one option to another is needed.



2. Should limits go below the operator in display style?



Also this is debatable and conventions used in the field the document is written for should be followed.



3. Should the operator name be typeset upright?



Definitely, like all other operator/function names such as sine and cosine.



Available tools



1. amsmath



With amsmath one can do, in the preamble,



DeclareMathOperator*{argmin}{arg,min} % thin space, limits underneath in displays
DeclareMathOperator*{argmin}{argmin} % no space, limits underneath in displays
DeclareMathOperator{argmin}{arg,min} % thin space, limits on side in displays
DeclareMathOperator{argmin}{argmin} % no space, limits on side in displays


Of course, only one of these should be used. In the document it's sufficient to type argmin and the spacing around the operator will be the right one according to the common rules of math typesetting.



The seemingly different



newcommand{argmin}{operatornamewithlimits{argmin}}


is not really so, because it's essentially the same as DeclareMathOperator*{argmin}{argmin}; moreover it uses a deprecated command, that should be operatorname*.



2. No package



The following definitions are very similar to the ones above, in the same order



newcommand{argmin}{mathop{mathrm{arg,min}}
newcommand{argmin}{mathop{mathrm{argmin}}
newcommand{argmin}{mathop{mathrm{arg,min}nolimits}
newcommand{argmin}{mathop{mathrm{argmin}nolimits}


With underset



underset{x}{mathrm{argmin}}


This also was mentioned in the question and in one answer, but it is wrong, as the visual comparison will show.



3. Differences



The “no package” version is much more rigid than the amsmath version, because this package can receive the nonamelimits option that will automatically change all operators such as lim, max that usually have limits underneath (in displays) to have them on the side. The same option would of course act also on newly defined operators, provided DeclareMathOperator* has been used.



Test document



In the following test document, the proposed definitions or constructions will be compared.



documentclass{article}
usepackage{amsmath}

% limits underneath
DeclareMathOperator*{argminA}{arg,min} % Jan Hlavacek
DeclareMathOperator*{argminB}{argmin} % Jan Hlavacek
DeclareMathOperator*{argminC}{argmin} % rbp

newcommand{argminD}{arg!min} % AlfC

newcommand{argminE}{mathop{mathrm{argmin}}} % ASdeL
newcommand{argminF}{mathop{mathrm{argmin}}limits} % ASdeL

% limits on side
DeclareMathOperator{argminG}{arg,min} % Jan Hlavacek
DeclareMathOperator{argminH}{argmin} % Jan Hlavacek
newcommand{argminI}{mathop{mathrm{argmin}}nolimits} % ASdeL

newcommand{cs}[1]{texttt{symbol{`\}#1}}

begin{document}

begin{align}
&cs{argminA} & argminA_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
&cs{argminB} & argminB_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
&cs{argminC} & argminC_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
&cs{argminD} & argminD_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
&cs{argminE} & argminE_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
&cs{argminF} & argminF_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
&cs{underset} & underset{x}{mathrm{argmin}} f(x) &= {x mid f(x) = min_{x'} f(x')}\
&cs{argminG} & argminG_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
&cs{argminH} & argminH_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
&cs{argminI} & argminI_x f(x) &= {x mid f(x) = min_{x'} f(x')}
end{align}

end{document}


enter image description here



Results



As predicted, many lines typeset the same. However, the macros defined with mathop will not obey the nonamelimits option. Also the result of argminD is clearly wrong, as the limit is typeset below “max” and not below the whole operator name.



The construction with underset is wrong because it will not use the correct spacing after the operator: a thin space follows all others and it is the right way to typeset. Compare sin x and mathrm{sin}x to see this thin space in a different context.



Note that argminC and argminA give the same result, as well as argminD and argminB. Explanation: arg and max are already defined as operators, so TeX inserts a thin space if one directly follows another one. Using argminC or argminD just makes TeX spin its wheels a little more, with no advantage over argminA or argminB.






share|improve this answer























  • This should be the accepted answer.
    – Alex
    Nov 7 at 21:30


















up vote
26
down vote













I use newcommand{argmin}{operatornamewithlimits{argmin}}.






share|improve this answer

















  • 3




    +1 I like this - why overcomplicate things? This looks exactly the same as the DeclareMathOperator* answer.
    – zelanix
    Aug 13 '14 at 13:52






  • 3




    This yields "argmin". To get "arg min" (arguably the most usual notation), set it to {arg,min}.
    – Waldir Leoncio
    Jan 21 '16 at 16:38






  • 1




    Google gave me 669,000 answers for "arg min" and 520,000 answers for "argmin", so I'd call it a tie. ;-)
    – PatrickT
    Dec 3 at 4:49


















up vote
12
down vote













Use usepackage{amsmath} and then:



operatorname*{argmin}_theta f(x)


enter image description here



Or similarly (for adding a space),



operatorname*{arg,max}_theta f(x)


enter image description here






share|improve this answer




























    up vote
    6
    down vote













    Just another alternative (in some sense the poorer solution around, see comment below), could be to define argmin in terms of min and arg commands.



    newcommand{argmin}{arg!min}


    In this way, 1) argmin will behave always the same way as min, 2) doesn't need amsmath or care about operator... commands 3) yes, the variable in not centered (it is centered in the min part), but that may even be what you want (since it is centered in the same ways a min, also the 'g' in arg doesn't further lower the under-argument).



    documentclass[fleqn]{article}
    newcommand{argmin}{arg!min}
    begin{document}

    [ argmin_x f(x) = {x | f(x) = min_{x'} f(x')} ]
    [ min_x f(x) = {f(x) | f(x) < f(x_0) forall x_0 in R ]

    end{document}


    argmin






    share|improve this answer



















    • 3




      This doesn't look like a good idea. argmin_{xin Xcap Y} f(x) will break it completely.
      – boycott.se - yo'
      Feb 2 '14 at 18:03










    • What is the arg command for anyway?
      – Thomas Ahle
      Jun 3 '14 at 12:47






    • 1




      @ThomasAhle, arg is for the argument function (angle in the complex plane, $z = |z| e^{i arg z}$. tohecz is right by the way.
      – alfC
      Jun 3 '14 at 15:33










    • @boycott.se-yo', good point.
      – alfC
      15 mins ago


















    up vote
    2
    down vote













    or you could use the underset command. For example:



        R = underset{n} {mathrm{argmax}} ~P(L_n|mathbf{x})





    share|improve this answer

















    • 10




      Please don't use this. This makes argmin a mathord rather than a mathop and the spacing is incorrect. Moreover, this will not automatically adjust the limits in inline math mode.
      – Aditya
      Sep 19 '13 at 15:19


















    up vote
    0
    down vote













    I would use mathop and mathrm, and eventually limits or nolimits, depending on the desired behavior when combined with _ and ^. See below.



    documentclass{article}

    begin{document}

    {
    nothing:
    newcommand{argmin}{mathop{mathrm{argmin}}}
    $argmin_a^b$
    $$argmin_a^b$$
    }

    {
    limits:
    newcommand{argmin}{mathop{mathrm{argmin}}limits}
    $argmin_a^b$
    $$argmin_a^b$$
    }

    {
    nolimits:
    newcommand{argmin}{mathop{mathrm{argmin}}nolimits}
    $argmin_a^b$
    $$argmin_a^b$$
    }

    end{document}





    share|improve this answer




























      up vote
      -1
      down vote













      This works without any additional package. However it will create a new line.



      $$pi(s) = argmax_theta$$





      share|improve this answer





















      • $$...$$ is not recommended to use with LaTeX. Better use [ ... ] for correct vertical spacing.
        – Stefan Kottwitz
        Dec 20 '15 at 20:17








      • 3




        This solution will not typeset argmax correctly. Here arg will be in italic (and with bad spacing), and max will be upright.
        – Håkon Marthinsen
        Dec 20 '15 at 20:17











      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',
      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%2f5223%2fcommand-for-argmin-or-argmax%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      8 Answers
      8






      active

      oldest

      votes








      8 Answers
      8






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      173
      down vote



      accepted










      As Pieter pointed out, the correct way to define argmin and argmax operators in LaTeX is:



      usepackage{amsmath}
      DeclareMathOperator*{argmax}{arg,max}
      DeclareMathOperator*{argmin}{arg,min}


      Actually, using the amsopn package would be sufficient but it's loaded by amsmath internally, which is recommended for math typesetting anyway.



      The * in DeclareMathOperator* places the underscored argument underneath the word rather than to the bottom right of it.






      share|improve this answer



















      • 36




        If you use DeclareMathOperator*{argmin}{arg!min} you get rid of the ugly space between arg and min.
        – rbp
        Apr 6 '11 at 21:39






      • 18




        @rbp Why should one use argmin when simply argmin does the same?
        – egreg
        Jul 8 '12 at 15:31






      • 2




        @egreg you're right. I arrived at this one from some experimentation with other options, and didn't look back :)
        – rbp
        Jul 9 '12 at 11:56






      • 4




        In ConTeXt that is: definemathcommand [argmin] [limop] {mfunction{arg,min}}
        – mb21
        Jul 30 '13 at 11:49






      • 3




        Explanation: I left the thin space (,) between the arg and min because that's what the original poster had in the question, so I assumed that they wanted the space there. Personally I would just do DeclareMathOperator*{argmin}{argmin}, without the space.
        – Jan Hlavacek
        Aug 28 '15 at 1:14















      up vote
      173
      down vote



      accepted










      As Pieter pointed out, the correct way to define argmin and argmax operators in LaTeX is:



      usepackage{amsmath}
      DeclareMathOperator*{argmax}{arg,max}
      DeclareMathOperator*{argmin}{arg,min}


      Actually, using the amsopn package would be sufficient but it's loaded by amsmath internally, which is recommended for math typesetting anyway.



      The * in DeclareMathOperator* places the underscored argument underneath the word rather than to the bottom right of it.






      share|improve this answer



















      • 36




        If you use DeclareMathOperator*{argmin}{arg!min} you get rid of the ugly space between arg and min.
        – rbp
        Apr 6 '11 at 21:39






      • 18




        @rbp Why should one use argmin when simply argmin does the same?
        – egreg
        Jul 8 '12 at 15:31






      • 2




        @egreg you're right. I arrived at this one from some experimentation with other options, and didn't look back :)
        – rbp
        Jul 9 '12 at 11:56






      • 4




        In ConTeXt that is: definemathcommand [argmin] [limop] {mfunction{arg,min}}
        – mb21
        Jul 30 '13 at 11:49






      • 3




        Explanation: I left the thin space (,) between the arg and min because that's what the original poster had in the question, so I assumed that they wanted the space there. Personally I would just do DeclareMathOperator*{argmin}{argmin}, without the space.
        – Jan Hlavacek
        Aug 28 '15 at 1:14













      up vote
      173
      down vote



      accepted







      up vote
      173
      down vote



      accepted






      As Pieter pointed out, the correct way to define argmin and argmax operators in LaTeX is:



      usepackage{amsmath}
      DeclareMathOperator*{argmax}{arg,max}
      DeclareMathOperator*{argmin}{arg,min}


      Actually, using the amsopn package would be sufficient but it's loaded by amsmath internally, which is recommended for math typesetting anyway.



      The * in DeclareMathOperator* places the underscored argument underneath the word rather than to the bottom right of it.






      share|improve this answer














      As Pieter pointed out, the correct way to define argmin and argmax operators in LaTeX is:



      usepackage{amsmath}
      DeclareMathOperator*{argmax}{arg,max}
      DeclareMathOperator*{argmin}{arg,min}


      Actually, using the amsopn package would be sufficient but it's loaded by amsmath internally, which is recommended for math typesetting anyway.



      The * in DeclareMathOperator* places the underscored argument underneath the word rather than to the bottom right of it.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Feb 8 at 11:52


























      community wiki





      4 revs, 4 users 58%
      danijar









      • 36




        If you use DeclareMathOperator*{argmin}{arg!min} you get rid of the ugly space between arg and min.
        – rbp
        Apr 6 '11 at 21:39






      • 18




        @rbp Why should one use argmin when simply argmin does the same?
        – egreg
        Jul 8 '12 at 15:31






      • 2




        @egreg you're right. I arrived at this one from some experimentation with other options, and didn't look back :)
        – rbp
        Jul 9 '12 at 11:56






      • 4




        In ConTeXt that is: definemathcommand [argmin] [limop] {mfunction{arg,min}}
        – mb21
        Jul 30 '13 at 11:49






      • 3




        Explanation: I left the thin space (,) between the arg and min because that's what the original poster had in the question, so I assumed that they wanted the space there. Personally I would just do DeclareMathOperator*{argmin}{argmin}, without the space.
        – Jan Hlavacek
        Aug 28 '15 at 1:14














      • 36




        If you use DeclareMathOperator*{argmin}{arg!min} you get rid of the ugly space between arg and min.
        – rbp
        Apr 6 '11 at 21:39






      • 18




        @rbp Why should one use argmin when simply argmin does the same?
        – egreg
        Jul 8 '12 at 15:31






      • 2




        @egreg you're right. I arrived at this one from some experimentation with other options, and didn't look back :)
        – rbp
        Jul 9 '12 at 11:56






      • 4




        In ConTeXt that is: definemathcommand [argmin] [limop] {mfunction{arg,min}}
        – mb21
        Jul 30 '13 at 11:49






      • 3




        Explanation: I left the thin space (,) between the arg and min because that's what the original poster had in the question, so I assumed that they wanted the space there. Personally I would just do DeclareMathOperator*{argmin}{argmin}, without the space.
        – Jan Hlavacek
        Aug 28 '15 at 1:14








      36




      36




      If you use DeclareMathOperator*{argmin}{arg!min} you get rid of the ugly space between arg and min.
      – rbp
      Apr 6 '11 at 21:39




      If you use DeclareMathOperator*{argmin}{arg!min} you get rid of the ugly space between arg and min.
      – rbp
      Apr 6 '11 at 21:39




      18




      18




      @rbp Why should one use argmin when simply argmin does the same?
      – egreg
      Jul 8 '12 at 15:31




      @rbp Why should one use argmin when simply argmin does the same?
      – egreg
      Jul 8 '12 at 15:31




      2




      2




      @egreg you're right. I arrived at this one from some experimentation with other options, and didn't look back :)
      – rbp
      Jul 9 '12 at 11:56




      @egreg you're right. I arrived at this one from some experimentation with other options, and didn't look back :)
      – rbp
      Jul 9 '12 at 11:56




      4




      4




      In ConTeXt that is: definemathcommand [argmin] [limop] {mfunction{arg,min}}
      – mb21
      Jul 30 '13 at 11:49




      In ConTeXt that is: definemathcommand [argmin] [limop] {mfunction{arg,min}}
      – mb21
      Jul 30 '13 at 11:49




      3




      3




      Explanation: I left the thin space (,) between the arg and min because that's what the original poster had in the question, so I assumed that they wanted the space there. Personally I would just do DeclareMathOperator*{argmin}{argmin}, without the space.
      – Jan Hlavacek
      Aug 28 '15 at 1:14




      Explanation: I left the thin space (,) between the arg and min because that's what the original poster had in the question, so I assumed that they wanted the space there. Personally I would just do DeclareMathOperator*{argmin}{argmin}, without the space.
      – Jan Hlavacek
      Aug 28 '15 at 1:14










      up vote
      65
      down vote













      Summary



      In the sequel, LaTeX is assumed.



      Preliminary questions



      1. Should a thin space separate “arg” from “min”?



      This is a matter of personal preference. The default definition for limsup has a thin space, on the other hand “arcsin” is usually written without a space between the two components. Consistency is, as always, the keyword: using a macro definition will ensure it and also easiness in modifying the typesetting in the whole document, if switching from one option to another is needed.



      2. Should limits go below the operator in display style?



      Also this is debatable and conventions used in the field the document is written for should be followed.



      3. Should the operator name be typeset upright?



      Definitely, like all other operator/function names such as sine and cosine.



      Available tools



      1. amsmath



      With amsmath one can do, in the preamble,



      DeclareMathOperator*{argmin}{arg,min} % thin space, limits underneath in displays
      DeclareMathOperator*{argmin}{argmin} % no space, limits underneath in displays
      DeclareMathOperator{argmin}{arg,min} % thin space, limits on side in displays
      DeclareMathOperator{argmin}{argmin} % no space, limits on side in displays


      Of course, only one of these should be used. In the document it's sufficient to type argmin and the spacing around the operator will be the right one according to the common rules of math typesetting.



      The seemingly different



      newcommand{argmin}{operatornamewithlimits{argmin}}


      is not really so, because it's essentially the same as DeclareMathOperator*{argmin}{argmin}; moreover it uses a deprecated command, that should be operatorname*.



      2. No package



      The following definitions are very similar to the ones above, in the same order



      newcommand{argmin}{mathop{mathrm{arg,min}}
      newcommand{argmin}{mathop{mathrm{argmin}}
      newcommand{argmin}{mathop{mathrm{arg,min}nolimits}
      newcommand{argmin}{mathop{mathrm{argmin}nolimits}


      With underset



      underset{x}{mathrm{argmin}}


      This also was mentioned in the question and in one answer, but it is wrong, as the visual comparison will show.



      3. Differences



      The “no package” version is much more rigid than the amsmath version, because this package can receive the nonamelimits option that will automatically change all operators such as lim, max that usually have limits underneath (in displays) to have them on the side. The same option would of course act also on newly defined operators, provided DeclareMathOperator* has been used.



      Test document



      In the following test document, the proposed definitions or constructions will be compared.



      documentclass{article}
      usepackage{amsmath}

      % limits underneath
      DeclareMathOperator*{argminA}{arg,min} % Jan Hlavacek
      DeclareMathOperator*{argminB}{argmin} % Jan Hlavacek
      DeclareMathOperator*{argminC}{argmin} % rbp

      newcommand{argminD}{arg!min} % AlfC

      newcommand{argminE}{mathop{mathrm{argmin}}} % ASdeL
      newcommand{argminF}{mathop{mathrm{argmin}}limits} % ASdeL

      % limits on side
      DeclareMathOperator{argminG}{arg,min} % Jan Hlavacek
      DeclareMathOperator{argminH}{argmin} % Jan Hlavacek
      newcommand{argminI}{mathop{mathrm{argmin}}nolimits} % ASdeL

      newcommand{cs}[1]{texttt{symbol{`\}#1}}

      begin{document}

      begin{align}
      &cs{argminA} & argminA_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminB} & argminB_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminC} & argminC_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminD} & argminD_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminE} & argminE_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminF} & argminF_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{underset} & underset{x}{mathrm{argmin}} f(x) &= {x mid f(x) = min_{x'} f(x')}\
      &cs{argminG} & argminG_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminH} & argminH_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminI} & argminI_x f(x) &= {x mid f(x) = min_{x'} f(x')}
      end{align}

      end{document}


      enter image description here



      Results



      As predicted, many lines typeset the same. However, the macros defined with mathop will not obey the nonamelimits option. Also the result of argminD is clearly wrong, as the limit is typeset below “max” and not below the whole operator name.



      The construction with underset is wrong because it will not use the correct spacing after the operator: a thin space follows all others and it is the right way to typeset. Compare sin x and mathrm{sin}x to see this thin space in a different context.



      Note that argminC and argminA give the same result, as well as argminD and argminB. Explanation: arg and max are already defined as operators, so TeX inserts a thin space if one directly follows another one. Using argminC or argminD just makes TeX spin its wheels a little more, with no advantage over argminA or argminB.






      share|improve this answer























      • This should be the accepted answer.
        – Alex
        Nov 7 at 21:30















      up vote
      65
      down vote













      Summary



      In the sequel, LaTeX is assumed.



      Preliminary questions



      1. Should a thin space separate “arg” from “min”?



      This is a matter of personal preference. The default definition for limsup has a thin space, on the other hand “arcsin” is usually written without a space between the two components. Consistency is, as always, the keyword: using a macro definition will ensure it and also easiness in modifying the typesetting in the whole document, if switching from one option to another is needed.



      2. Should limits go below the operator in display style?



      Also this is debatable and conventions used in the field the document is written for should be followed.



      3. Should the operator name be typeset upright?



      Definitely, like all other operator/function names such as sine and cosine.



      Available tools



      1. amsmath



      With amsmath one can do, in the preamble,



      DeclareMathOperator*{argmin}{arg,min} % thin space, limits underneath in displays
      DeclareMathOperator*{argmin}{argmin} % no space, limits underneath in displays
      DeclareMathOperator{argmin}{arg,min} % thin space, limits on side in displays
      DeclareMathOperator{argmin}{argmin} % no space, limits on side in displays


      Of course, only one of these should be used. In the document it's sufficient to type argmin and the spacing around the operator will be the right one according to the common rules of math typesetting.



      The seemingly different



      newcommand{argmin}{operatornamewithlimits{argmin}}


      is not really so, because it's essentially the same as DeclareMathOperator*{argmin}{argmin}; moreover it uses a deprecated command, that should be operatorname*.



      2. No package



      The following definitions are very similar to the ones above, in the same order



      newcommand{argmin}{mathop{mathrm{arg,min}}
      newcommand{argmin}{mathop{mathrm{argmin}}
      newcommand{argmin}{mathop{mathrm{arg,min}nolimits}
      newcommand{argmin}{mathop{mathrm{argmin}nolimits}


      With underset



      underset{x}{mathrm{argmin}}


      This also was mentioned in the question and in one answer, but it is wrong, as the visual comparison will show.



      3. Differences



      The “no package” version is much more rigid than the amsmath version, because this package can receive the nonamelimits option that will automatically change all operators such as lim, max that usually have limits underneath (in displays) to have them on the side. The same option would of course act also on newly defined operators, provided DeclareMathOperator* has been used.



      Test document



      In the following test document, the proposed definitions or constructions will be compared.



      documentclass{article}
      usepackage{amsmath}

      % limits underneath
      DeclareMathOperator*{argminA}{arg,min} % Jan Hlavacek
      DeclareMathOperator*{argminB}{argmin} % Jan Hlavacek
      DeclareMathOperator*{argminC}{argmin} % rbp

      newcommand{argminD}{arg!min} % AlfC

      newcommand{argminE}{mathop{mathrm{argmin}}} % ASdeL
      newcommand{argminF}{mathop{mathrm{argmin}}limits} % ASdeL

      % limits on side
      DeclareMathOperator{argminG}{arg,min} % Jan Hlavacek
      DeclareMathOperator{argminH}{argmin} % Jan Hlavacek
      newcommand{argminI}{mathop{mathrm{argmin}}nolimits} % ASdeL

      newcommand{cs}[1]{texttt{symbol{`\}#1}}

      begin{document}

      begin{align}
      &cs{argminA} & argminA_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminB} & argminB_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminC} & argminC_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminD} & argminD_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminE} & argminE_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminF} & argminF_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{underset} & underset{x}{mathrm{argmin}} f(x) &= {x mid f(x) = min_{x'} f(x')}\
      &cs{argminG} & argminG_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminH} & argminH_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminI} & argminI_x f(x) &= {x mid f(x) = min_{x'} f(x')}
      end{align}

      end{document}


      enter image description here



      Results



      As predicted, many lines typeset the same. However, the macros defined with mathop will not obey the nonamelimits option. Also the result of argminD is clearly wrong, as the limit is typeset below “max” and not below the whole operator name.



      The construction with underset is wrong because it will not use the correct spacing after the operator: a thin space follows all others and it is the right way to typeset. Compare sin x and mathrm{sin}x to see this thin space in a different context.



      Note that argminC and argminA give the same result, as well as argminD and argminB. Explanation: arg and max are already defined as operators, so TeX inserts a thin space if one directly follows another one. Using argminC or argminD just makes TeX spin its wheels a little more, with no advantage over argminA or argminB.






      share|improve this answer























      • This should be the accepted answer.
        – Alex
        Nov 7 at 21:30













      up vote
      65
      down vote










      up vote
      65
      down vote









      Summary



      In the sequel, LaTeX is assumed.



      Preliminary questions



      1. Should a thin space separate “arg” from “min”?



      This is a matter of personal preference. The default definition for limsup has a thin space, on the other hand “arcsin” is usually written without a space between the two components. Consistency is, as always, the keyword: using a macro definition will ensure it and also easiness in modifying the typesetting in the whole document, if switching from one option to another is needed.



      2. Should limits go below the operator in display style?



      Also this is debatable and conventions used in the field the document is written for should be followed.



      3. Should the operator name be typeset upright?



      Definitely, like all other operator/function names such as sine and cosine.



      Available tools



      1. amsmath



      With amsmath one can do, in the preamble,



      DeclareMathOperator*{argmin}{arg,min} % thin space, limits underneath in displays
      DeclareMathOperator*{argmin}{argmin} % no space, limits underneath in displays
      DeclareMathOperator{argmin}{arg,min} % thin space, limits on side in displays
      DeclareMathOperator{argmin}{argmin} % no space, limits on side in displays


      Of course, only one of these should be used. In the document it's sufficient to type argmin and the spacing around the operator will be the right one according to the common rules of math typesetting.



      The seemingly different



      newcommand{argmin}{operatornamewithlimits{argmin}}


      is not really so, because it's essentially the same as DeclareMathOperator*{argmin}{argmin}; moreover it uses a deprecated command, that should be operatorname*.



      2. No package



      The following definitions are very similar to the ones above, in the same order



      newcommand{argmin}{mathop{mathrm{arg,min}}
      newcommand{argmin}{mathop{mathrm{argmin}}
      newcommand{argmin}{mathop{mathrm{arg,min}nolimits}
      newcommand{argmin}{mathop{mathrm{argmin}nolimits}


      With underset



      underset{x}{mathrm{argmin}}


      This also was mentioned in the question and in one answer, but it is wrong, as the visual comparison will show.



      3. Differences



      The “no package” version is much more rigid than the amsmath version, because this package can receive the nonamelimits option that will automatically change all operators such as lim, max that usually have limits underneath (in displays) to have them on the side. The same option would of course act also on newly defined operators, provided DeclareMathOperator* has been used.



      Test document



      In the following test document, the proposed definitions or constructions will be compared.



      documentclass{article}
      usepackage{amsmath}

      % limits underneath
      DeclareMathOperator*{argminA}{arg,min} % Jan Hlavacek
      DeclareMathOperator*{argminB}{argmin} % Jan Hlavacek
      DeclareMathOperator*{argminC}{argmin} % rbp

      newcommand{argminD}{arg!min} % AlfC

      newcommand{argminE}{mathop{mathrm{argmin}}} % ASdeL
      newcommand{argminF}{mathop{mathrm{argmin}}limits} % ASdeL

      % limits on side
      DeclareMathOperator{argminG}{arg,min} % Jan Hlavacek
      DeclareMathOperator{argminH}{argmin} % Jan Hlavacek
      newcommand{argminI}{mathop{mathrm{argmin}}nolimits} % ASdeL

      newcommand{cs}[1]{texttt{symbol{`\}#1}}

      begin{document}

      begin{align}
      &cs{argminA} & argminA_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminB} & argminB_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminC} & argminC_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminD} & argminD_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminE} & argminE_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminF} & argminF_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{underset} & underset{x}{mathrm{argmin}} f(x) &= {x mid f(x) = min_{x'} f(x')}\
      &cs{argminG} & argminG_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminH} & argminH_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminI} & argminI_x f(x) &= {x mid f(x) = min_{x'} f(x')}
      end{align}

      end{document}


      enter image description here



      Results



      As predicted, many lines typeset the same. However, the macros defined with mathop will not obey the nonamelimits option. Also the result of argminD is clearly wrong, as the limit is typeset below “max” and not below the whole operator name.



      The construction with underset is wrong because it will not use the correct spacing after the operator: a thin space follows all others and it is the right way to typeset. Compare sin x and mathrm{sin}x to see this thin space in a different context.



      Note that argminC and argminA give the same result, as well as argminD and argminB. Explanation: arg and max are already defined as operators, so TeX inserts a thin space if one directly follows another one. Using argminC or argminD just makes TeX spin its wheels a little more, with no advantage over argminA or argminB.






      share|improve this answer














      Summary



      In the sequel, LaTeX is assumed.



      Preliminary questions



      1. Should a thin space separate “arg” from “min”?



      This is a matter of personal preference. The default definition for limsup has a thin space, on the other hand “arcsin” is usually written without a space between the two components. Consistency is, as always, the keyword: using a macro definition will ensure it and also easiness in modifying the typesetting in the whole document, if switching from one option to another is needed.



      2. Should limits go below the operator in display style?



      Also this is debatable and conventions used in the field the document is written for should be followed.



      3. Should the operator name be typeset upright?



      Definitely, like all other operator/function names such as sine and cosine.



      Available tools



      1. amsmath



      With amsmath one can do, in the preamble,



      DeclareMathOperator*{argmin}{arg,min} % thin space, limits underneath in displays
      DeclareMathOperator*{argmin}{argmin} % no space, limits underneath in displays
      DeclareMathOperator{argmin}{arg,min} % thin space, limits on side in displays
      DeclareMathOperator{argmin}{argmin} % no space, limits on side in displays


      Of course, only one of these should be used. In the document it's sufficient to type argmin and the spacing around the operator will be the right one according to the common rules of math typesetting.



      The seemingly different



      newcommand{argmin}{operatornamewithlimits{argmin}}


      is not really so, because it's essentially the same as DeclareMathOperator*{argmin}{argmin}; moreover it uses a deprecated command, that should be operatorname*.



      2. No package



      The following definitions are very similar to the ones above, in the same order



      newcommand{argmin}{mathop{mathrm{arg,min}}
      newcommand{argmin}{mathop{mathrm{argmin}}
      newcommand{argmin}{mathop{mathrm{arg,min}nolimits}
      newcommand{argmin}{mathop{mathrm{argmin}nolimits}


      With underset



      underset{x}{mathrm{argmin}}


      This also was mentioned in the question and in one answer, but it is wrong, as the visual comparison will show.



      3. Differences



      The “no package” version is much more rigid than the amsmath version, because this package can receive the nonamelimits option that will automatically change all operators such as lim, max that usually have limits underneath (in displays) to have them on the side. The same option would of course act also on newly defined operators, provided DeclareMathOperator* has been used.



      Test document



      In the following test document, the proposed definitions or constructions will be compared.



      documentclass{article}
      usepackage{amsmath}

      % limits underneath
      DeclareMathOperator*{argminA}{arg,min} % Jan Hlavacek
      DeclareMathOperator*{argminB}{argmin} % Jan Hlavacek
      DeclareMathOperator*{argminC}{argmin} % rbp

      newcommand{argminD}{arg!min} % AlfC

      newcommand{argminE}{mathop{mathrm{argmin}}} % ASdeL
      newcommand{argminF}{mathop{mathrm{argmin}}limits} % ASdeL

      % limits on side
      DeclareMathOperator{argminG}{arg,min} % Jan Hlavacek
      DeclareMathOperator{argminH}{argmin} % Jan Hlavacek
      newcommand{argminI}{mathop{mathrm{argmin}}nolimits} % ASdeL

      newcommand{cs}[1]{texttt{symbol{`\}#1}}

      begin{document}

      begin{align}
      &cs{argminA} & argminA_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminB} & argminB_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminC} & argminC_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminD} & argminD_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminE} & argminE_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminF} & argminF_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{underset} & underset{x}{mathrm{argmin}} f(x) &= {x mid f(x) = min_{x'} f(x')}\
      &cs{argminG} & argminG_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminH} & argminH_x f(x) &= {x mid f(x) = min_{x'} f(x')} \
      &cs{argminI} & argminI_x f(x) &= {x mid f(x) = min_{x'} f(x')}
      end{align}

      end{document}


      enter image description here



      Results



      As predicted, many lines typeset the same. However, the macros defined with mathop will not obey the nonamelimits option. Also the result of argminD is clearly wrong, as the limit is typeset below “max” and not below the whole operator name.



      The construction with underset is wrong because it will not use the correct spacing after the operator: a thin space follows all others and it is the right way to typeset. Compare sin x and mathrm{sin}x to see this thin space in a different context.



      Note that argminC and argminA give the same result, as well as argminD and argminB. Explanation: arg and max are already defined as operators, so TeX inserts a thin space if one directly follows another one. Using argminC or argminD just makes TeX spin its wheels a little more, with no advantage over argminA or argminB.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      answered Dec 20 '15 at 21:45


























      community wiki





      egreg













      • This should be the accepted answer.
        – Alex
        Nov 7 at 21:30


















      • This should be the accepted answer.
        – Alex
        Nov 7 at 21:30
















      This should be the accepted answer.
      – Alex
      Nov 7 at 21:30




      This should be the accepted answer.
      – Alex
      Nov 7 at 21:30










      up vote
      26
      down vote













      I use newcommand{argmin}{operatornamewithlimits{argmin}}.






      share|improve this answer

















      • 3




        +1 I like this - why overcomplicate things? This looks exactly the same as the DeclareMathOperator* answer.
        – zelanix
        Aug 13 '14 at 13:52






      • 3




        This yields "argmin". To get "arg min" (arguably the most usual notation), set it to {arg,min}.
        – Waldir Leoncio
        Jan 21 '16 at 16:38






      • 1




        Google gave me 669,000 answers for "arg min" and 520,000 answers for "argmin", so I'd call it a tie. ;-)
        – PatrickT
        Dec 3 at 4:49















      up vote
      26
      down vote













      I use newcommand{argmin}{operatornamewithlimits{argmin}}.






      share|improve this answer

















      • 3




        +1 I like this - why overcomplicate things? This looks exactly the same as the DeclareMathOperator* answer.
        – zelanix
        Aug 13 '14 at 13:52






      • 3




        This yields "argmin". To get "arg min" (arguably the most usual notation), set it to {arg,min}.
        – Waldir Leoncio
        Jan 21 '16 at 16:38






      • 1




        Google gave me 669,000 answers for "arg min" and 520,000 answers for "argmin", so I'd call it a tie. ;-)
        – PatrickT
        Dec 3 at 4:49













      up vote
      26
      down vote










      up vote
      26
      down vote









      I use newcommand{argmin}{operatornamewithlimits{argmin}}.






      share|improve this answer












      I use newcommand{argmin}{operatornamewithlimits{argmin}}.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered May 22 '12 at 19:55









      Michael Litvin

      36132




      36132








      • 3




        +1 I like this - why overcomplicate things? This looks exactly the same as the DeclareMathOperator* answer.
        – zelanix
        Aug 13 '14 at 13:52






      • 3




        This yields "argmin". To get "arg min" (arguably the most usual notation), set it to {arg,min}.
        – Waldir Leoncio
        Jan 21 '16 at 16:38






      • 1




        Google gave me 669,000 answers for "arg min" and 520,000 answers for "argmin", so I'd call it a tie. ;-)
        – PatrickT
        Dec 3 at 4:49














      • 3




        +1 I like this - why overcomplicate things? This looks exactly the same as the DeclareMathOperator* answer.
        – zelanix
        Aug 13 '14 at 13:52






      • 3




        This yields "argmin". To get "arg min" (arguably the most usual notation), set it to {arg,min}.
        – Waldir Leoncio
        Jan 21 '16 at 16:38






      • 1




        Google gave me 669,000 answers for "arg min" and 520,000 answers for "argmin", so I'd call it a tie. ;-)
        – PatrickT
        Dec 3 at 4:49








      3




      3




      +1 I like this - why overcomplicate things? This looks exactly the same as the DeclareMathOperator* answer.
      – zelanix
      Aug 13 '14 at 13:52




      +1 I like this - why overcomplicate things? This looks exactly the same as the DeclareMathOperator* answer.
      – zelanix
      Aug 13 '14 at 13:52




      3




      3




      This yields "argmin". To get "arg min" (arguably the most usual notation), set it to {arg,min}.
      – Waldir Leoncio
      Jan 21 '16 at 16:38




      This yields "argmin". To get "arg min" (arguably the most usual notation), set it to {arg,min}.
      – Waldir Leoncio
      Jan 21 '16 at 16:38




      1




      1




      Google gave me 669,000 answers for "arg min" and 520,000 answers for "argmin", so I'd call it a tie. ;-)
      – PatrickT
      Dec 3 at 4:49




      Google gave me 669,000 answers for "arg min" and 520,000 answers for "argmin", so I'd call it a tie. ;-)
      – PatrickT
      Dec 3 at 4:49










      up vote
      12
      down vote













      Use usepackage{amsmath} and then:



      operatorname*{argmin}_theta f(x)


      enter image description here



      Or similarly (for adding a space),



      operatorname*{arg,max}_theta f(x)


      enter image description here






      share|improve this answer

























        up vote
        12
        down vote













        Use usepackage{amsmath} and then:



        operatorname*{argmin}_theta f(x)


        enter image description here



        Or similarly (for adding a space),



        operatorname*{arg,max}_theta f(x)


        enter image description here






        share|improve this answer























          up vote
          12
          down vote










          up vote
          12
          down vote









          Use usepackage{amsmath} and then:



          operatorname*{argmin}_theta f(x)


          enter image description here



          Or similarly (for adding a space),



          operatorname*{arg,max}_theta f(x)


          enter image description here






          share|improve this answer












          Use usepackage{amsmath} and then:



          operatorname*{argmin}_theta f(x)


          enter image description here



          Or similarly (for adding a space),



          operatorname*{arg,max}_theta f(x)


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 25 '17 at 16:54









          iamaziz

          25125




          25125






















              up vote
              6
              down vote













              Just another alternative (in some sense the poorer solution around, see comment below), could be to define argmin in terms of min and arg commands.



              newcommand{argmin}{arg!min}


              In this way, 1) argmin will behave always the same way as min, 2) doesn't need amsmath or care about operator... commands 3) yes, the variable in not centered (it is centered in the min part), but that may even be what you want (since it is centered in the same ways a min, also the 'g' in arg doesn't further lower the under-argument).



              documentclass[fleqn]{article}
              newcommand{argmin}{arg!min}
              begin{document}

              [ argmin_x f(x) = {x | f(x) = min_{x'} f(x')} ]
              [ min_x f(x) = {f(x) | f(x) < f(x_0) forall x_0 in R ]

              end{document}


              argmin






              share|improve this answer



















              • 3




                This doesn't look like a good idea. argmin_{xin Xcap Y} f(x) will break it completely.
                – boycott.se - yo'
                Feb 2 '14 at 18:03










              • What is the arg command for anyway?
                – Thomas Ahle
                Jun 3 '14 at 12:47






              • 1




                @ThomasAhle, arg is for the argument function (angle in the complex plane, $z = |z| e^{i arg z}$. tohecz is right by the way.
                – alfC
                Jun 3 '14 at 15:33










              • @boycott.se-yo', good point.
                – alfC
                15 mins ago















              up vote
              6
              down vote













              Just another alternative (in some sense the poorer solution around, see comment below), could be to define argmin in terms of min and arg commands.



              newcommand{argmin}{arg!min}


              In this way, 1) argmin will behave always the same way as min, 2) doesn't need amsmath or care about operator... commands 3) yes, the variable in not centered (it is centered in the min part), but that may even be what you want (since it is centered in the same ways a min, also the 'g' in arg doesn't further lower the under-argument).



              documentclass[fleqn]{article}
              newcommand{argmin}{arg!min}
              begin{document}

              [ argmin_x f(x) = {x | f(x) = min_{x'} f(x')} ]
              [ min_x f(x) = {f(x) | f(x) < f(x_0) forall x_0 in R ]

              end{document}


              argmin






              share|improve this answer



















              • 3




                This doesn't look like a good idea. argmin_{xin Xcap Y} f(x) will break it completely.
                – boycott.se - yo'
                Feb 2 '14 at 18:03










              • What is the arg command for anyway?
                – Thomas Ahle
                Jun 3 '14 at 12:47






              • 1




                @ThomasAhle, arg is for the argument function (angle in the complex plane, $z = |z| e^{i arg z}$. tohecz is right by the way.
                – alfC
                Jun 3 '14 at 15:33










              • @boycott.se-yo', good point.
                – alfC
                15 mins ago













              up vote
              6
              down vote










              up vote
              6
              down vote









              Just another alternative (in some sense the poorer solution around, see comment below), could be to define argmin in terms of min and arg commands.



              newcommand{argmin}{arg!min}


              In this way, 1) argmin will behave always the same way as min, 2) doesn't need amsmath or care about operator... commands 3) yes, the variable in not centered (it is centered in the min part), but that may even be what you want (since it is centered in the same ways a min, also the 'g' in arg doesn't further lower the under-argument).



              documentclass[fleqn]{article}
              newcommand{argmin}{arg!min}
              begin{document}

              [ argmin_x f(x) = {x | f(x) = min_{x'} f(x')} ]
              [ min_x f(x) = {f(x) | f(x) < f(x_0) forall x_0 in R ]

              end{document}


              argmin






              share|improve this answer














              Just another alternative (in some sense the poorer solution around, see comment below), could be to define argmin in terms of min and arg commands.



              newcommand{argmin}{arg!min}


              In this way, 1) argmin will behave always the same way as min, 2) doesn't need amsmath or care about operator... commands 3) yes, the variable in not centered (it is centered in the min part), but that may even be what you want (since it is centered in the same ways a min, also the 'g' in arg doesn't further lower the under-argument).



              documentclass[fleqn]{article}
              newcommand{argmin}{arg!min}
              begin{document}

              [ argmin_x f(x) = {x | f(x) = min_{x'} f(x')} ]
              [ min_x f(x) = {f(x) | f(x) < f(x_0) forall x_0 in R ]

              end{document}


              argmin







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited 17 mins ago

























              answered Nov 27 '13 at 23:15









              alfC

              7,672550111




              7,672550111








              • 3




                This doesn't look like a good idea. argmin_{xin Xcap Y} f(x) will break it completely.
                – boycott.se - yo'
                Feb 2 '14 at 18:03










              • What is the arg command for anyway?
                – Thomas Ahle
                Jun 3 '14 at 12:47






              • 1




                @ThomasAhle, arg is for the argument function (angle in the complex plane, $z = |z| e^{i arg z}$. tohecz is right by the way.
                – alfC
                Jun 3 '14 at 15:33










              • @boycott.se-yo', good point.
                – alfC
                15 mins ago














              • 3




                This doesn't look like a good idea. argmin_{xin Xcap Y} f(x) will break it completely.
                – boycott.se - yo'
                Feb 2 '14 at 18:03










              • What is the arg command for anyway?
                – Thomas Ahle
                Jun 3 '14 at 12:47






              • 1




                @ThomasAhle, arg is for the argument function (angle in the complex plane, $z = |z| e^{i arg z}$. tohecz is right by the way.
                – alfC
                Jun 3 '14 at 15:33










              • @boycott.se-yo', good point.
                – alfC
                15 mins ago








              3




              3




              This doesn't look like a good idea. argmin_{xin Xcap Y} f(x) will break it completely.
              – boycott.se - yo'
              Feb 2 '14 at 18:03




              This doesn't look like a good idea. argmin_{xin Xcap Y} f(x) will break it completely.
              – boycott.se - yo'
              Feb 2 '14 at 18:03












              What is the arg command for anyway?
              – Thomas Ahle
              Jun 3 '14 at 12:47




              What is the arg command for anyway?
              – Thomas Ahle
              Jun 3 '14 at 12:47




              1




              1




              @ThomasAhle, arg is for the argument function (angle in the complex plane, $z = |z| e^{i arg z}$. tohecz is right by the way.
              – alfC
              Jun 3 '14 at 15:33




              @ThomasAhle, arg is for the argument function (angle in the complex plane, $z = |z| e^{i arg z}$. tohecz is right by the way.
              – alfC
              Jun 3 '14 at 15:33












              @boycott.se-yo', good point.
              – alfC
              15 mins ago




              @boycott.se-yo', good point.
              – alfC
              15 mins ago










              up vote
              2
              down vote













              or you could use the underset command. For example:



                  R = underset{n} {mathrm{argmax}} ~P(L_n|mathbf{x})





              share|improve this answer

















              • 10




                Please don't use this. This makes argmin a mathord rather than a mathop and the spacing is incorrect. Moreover, this will not automatically adjust the limits in inline math mode.
                – Aditya
                Sep 19 '13 at 15:19















              up vote
              2
              down vote













              or you could use the underset command. For example:



                  R = underset{n} {mathrm{argmax}} ~P(L_n|mathbf{x})





              share|improve this answer

















              • 10




                Please don't use this. This makes argmin a mathord rather than a mathop and the spacing is incorrect. Moreover, this will not automatically adjust the limits in inline math mode.
                – Aditya
                Sep 19 '13 at 15:19













              up vote
              2
              down vote










              up vote
              2
              down vote









              or you could use the underset command. For example:



                  R = underset{n} {mathrm{argmax}} ~P(L_n|mathbf{x})





              share|improve this answer












              or you could use the underset command. For example:



                  R = underset{n} {mathrm{argmax}} ~P(L_n|mathbf{x})






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Sep 19 '13 at 13:07









              drben

              291




              291








              • 10




                Please don't use this. This makes argmin a mathord rather than a mathop and the spacing is incorrect. Moreover, this will not automatically adjust the limits in inline math mode.
                – Aditya
                Sep 19 '13 at 15:19














              • 10




                Please don't use this. This makes argmin a mathord rather than a mathop and the spacing is incorrect. Moreover, this will not automatically adjust the limits in inline math mode.
                – Aditya
                Sep 19 '13 at 15:19








              10




              10




              Please don't use this. This makes argmin a mathord rather than a mathop and the spacing is incorrect. Moreover, this will not automatically adjust the limits in inline math mode.
              – Aditya
              Sep 19 '13 at 15:19




              Please don't use this. This makes argmin a mathord rather than a mathop and the spacing is incorrect. Moreover, this will not automatically adjust the limits in inline math mode.
              – Aditya
              Sep 19 '13 at 15:19










              up vote
              0
              down vote













              I would use mathop and mathrm, and eventually limits or nolimits, depending on the desired behavior when combined with _ and ^. See below.



              documentclass{article}

              begin{document}

              {
              nothing:
              newcommand{argmin}{mathop{mathrm{argmin}}}
              $argmin_a^b$
              $$argmin_a^b$$
              }

              {
              limits:
              newcommand{argmin}{mathop{mathrm{argmin}}limits}
              $argmin_a^b$
              $$argmin_a^b$$
              }

              {
              nolimits:
              newcommand{argmin}{mathop{mathrm{argmin}}nolimits}
              $argmin_a^b$
              $$argmin_a^b$$
              }

              end{document}





              share|improve this answer

























                up vote
                0
                down vote













                I would use mathop and mathrm, and eventually limits or nolimits, depending on the desired behavior when combined with _ and ^. See below.



                documentclass{article}

                begin{document}

                {
                nothing:
                newcommand{argmin}{mathop{mathrm{argmin}}}
                $argmin_a^b$
                $$argmin_a^b$$
                }

                {
                limits:
                newcommand{argmin}{mathop{mathrm{argmin}}limits}
                $argmin_a^b$
                $$argmin_a^b$$
                }

                {
                nolimits:
                newcommand{argmin}{mathop{mathrm{argmin}}nolimits}
                $argmin_a^b$
                $$argmin_a^b$$
                }

                end{document}





                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  I would use mathop and mathrm, and eventually limits or nolimits, depending on the desired behavior when combined with _ and ^. See below.



                  documentclass{article}

                  begin{document}

                  {
                  nothing:
                  newcommand{argmin}{mathop{mathrm{argmin}}}
                  $argmin_a^b$
                  $$argmin_a^b$$
                  }

                  {
                  limits:
                  newcommand{argmin}{mathop{mathrm{argmin}}limits}
                  $argmin_a^b$
                  $$argmin_a^b$$
                  }

                  {
                  nolimits:
                  newcommand{argmin}{mathop{mathrm{argmin}}nolimits}
                  $argmin_a^b$
                  $$argmin_a^b$$
                  }

                  end{document}





                  share|improve this answer












                  I would use mathop and mathrm, and eventually limits or nolimits, depending on the desired behavior when combined with _ and ^. See below.



                  documentclass{article}

                  begin{document}

                  {
                  nothing:
                  newcommand{argmin}{mathop{mathrm{argmin}}}
                  $argmin_a^b$
                  $$argmin_a^b$$
                  }

                  {
                  limits:
                  newcommand{argmin}{mathop{mathrm{argmin}}limits}
                  $argmin_a^b$
                  $$argmin_a^b$$
                  }

                  {
                  nolimits:
                  newcommand{argmin}{mathop{mathrm{argmin}}nolimits}
                  $argmin_a^b$
                  $$argmin_a^b$$
                  }

                  end{document}






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 21 '15 at 13:35









                  ASdeL

                  1,91531220




                  1,91531220






















                      up vote
                      -1
                      down vote













                      This works without any additional package. However it will create a new line.



                      $$pi(s) = argmax_theta$$





                      share|improve this answer





















                      • $$...$$ is not recommended to use with LaTeX. Better use [ ... ] for correct vertical spacing.
                        – Stefan Kottwitz
                        Dec 20 '15 at 20:17








                      • 3




                        This solution will not typeset argmax correctly. Here arg will be in italic (and with bad spacing), and max will be upright.
                        – Håkon Marthinsen
                        Dec 20 '15 at 20:17















                      up vote
                      -1
                      down vote













                      This works without any additional package. However it will create a new line.



                      $$pi(s) = argmax_theta$$





                      share|improve this answer





















                      • $$...$$ is not recommended to use with LaTeX. Better use [ ... ] for correct vertical spacing.
                        – Stefan Kottwitz
                        Dec 20 '15 at 20:17








                      • 3




                        This solution will not typeset argmax correctly. Here arg will be in italic (and with bad spacing), and max will be upright.
                        – Håkon Marthinsen
                        Dec 20 '15 at 20:17













                      up vote
                      -1
                      down vote










                      up vote
                      -1
                      down vote









                      This works without any additional package. However it will create a new line.



                      $$pi(s) = argmax_theta$$





                      share|improve this answer












                      This works without any additional package. However it will create a new line.



                      $$pi(s) = argmax_theta$$






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Dec 20 '15 at 20:12









                      MiaeKim

                      1012




                      1012












                      • $$...$$ is not recommended to use with LaTeX. Better use [ ... ] for correct vertical spacing.
                        – Stefan Kottwitz
                        Dec 20 '15 at 20:17








                      • 3




                        This solution will not typeset argmax correctly. Here arg will be in italic (and with bad spacing), and max will be upright.
                        – Håkon Marthinsen
                        Dec 20 '15 at 20:17


















                      • $$...$$ is not recommended to use with LaTeX. Better use [ ... ] for correct vertical spacing.
                        – Stefan Kottwitz
                        Dec 20 '15 at 20:17








                      • 3




                        This solution will not typeset argmax correctly. Here arg will be in italic (and with bad spacing), and max will be upright.
                        – Håkon Marthinsen
                        Dec 20 '15 at 20:17
















                      $$...$$ is not recommended to use with LaTeX. Better use [ ... ] for correct vertical spacing.
                      – Stefan Kottwitz
                      Dec 20 '15 at 20:17






                      $$...$$ is not recommended to use with LaTeX. Better use [ ... ] for correct vertical spacing.
                      – Stefan Kottwitz
                      Dec 20 '15 at 20:17






                      3




                      3




                      This solution will not typeset argmax correctly. Here arg will be in italic (and with bad spacing), and max will be upright.
                      – Håkon Marthinsen
                      Dec 20 '15 at 20:17




                      This solution will not typeset argmax correctly. Here arg will be in italic (and with bad spacing), and max will be upright.
                      – Håkon Marthinsen
                      Dec 20 '15 at 20:17


















                      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.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • 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%2f5223%2fcommand-for-argmin-or-argmax%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

                      Accessing regular linux commands in Huawei's Dopra Linux

                      Can't connect RFCOMM socket: Host is down

                      Kernel panic - not syncing: Fatal Exception in Interrupt