3

Is it only me or does it get annoying whenever I've to write \limits before every operator? Is there a way to make that happen for every operator without having to list them all one by one?

\newcommand{\myint}{\int\limits} % <= Unwanted solution...
\myint_{\lambda_1}^{\lambda_2}

Context: I had to write over a thousand limits to realise really how redundant it is in my pdf... lol. So, I would really appreciate any tips.

  • 1
    Why are you adding \limits everytime in the first place? – daleif Sep 17 '21 at 11:26
  • @daleif It is better stylistically (and for readability) for the purposes of compiling multiple proofs about important theorems around Lebesgue integrals. –  Sep 17 '21 at 11:29
  • You wrote, "does it get annoying whenever I've to write \limits before every operator?" Real quick (just in case it wasn't a simple typo): The modifier \limits should be written after, not *before", the associated "operator" -- ``\int,\sum,\prod`, etc. – Mico Sep 17 '21 at 15:00
  • I was thinking of _{...} when I said operator (i.e. \int\limts_{\lambda_1}, sorry! @Mico –  Sep 17 '21 at 15:37

2 Answers2

6

\int is defined as \DeclareRobustCommand\int{\intop\nolimits} specifically to avoid getting limits so you could use \intop or simply repeat the definition without the \nolimits which is fine although going against the usual mathematical typesetting tradition.

David Carlisle
  • 757,742
  • This answers is tor my context (hence my acceptance), but could this be modified for every operator without going through them all or no? –  Sep 17 '21 at 11:39
  • 1
    \int is the only command defined in the base latex that has \nolimits forced in this way. @Math3147 what other operator are you doing this with? – David Carlisle Sep 17 '21 at 11:44
  • Not specifically one, just generally, do you know of any way this could be done without listing every operator in a \newcommand way, as above? Or does it have to be listed always? –  Sep 17 '21 at 11:55
  • 1
    @Math3147 I do not understand the question. You only need to do \DeclareRobustCommand\int{\intop} so that is just one line and applies to every \int in the document. The problem you describe (defaulting to \nolimits) does not apply to anything other than \int so I do not understand which operators you are "listing" – David Carlisle Sep 17 '21 at 12:46
  • When you've \sum or \bigoplus , et cetera, when inline, don't you need to put \limits? Or for example, when \limsup is said without \limits, it will look different. Or am I misunderstanding what you're referring to? (If so, sorry!) –  Sep 17 '21 at 15:42
  • (I understand, you can use \displaystyle, but that's even longer, and it doesn't need to be typed as often as you could just put it and the whole math-mode block will look like what you might approximately want, or in this case, myself.) –  Sep 17 '21 at 15:43
  • that is completely different to the situation with \int, using limits completely breaks the intention of inline math setting so if you don't want that use display style – David Carlisle Sep 17 '21 at 15:45
  • Yes, I understand, I'm referring to other ones, like I've exemplified. Your answers solve that already. :) Also, there are many situations were the formulae are just too short or there are too many similar formulae that I would've put a display every couple of lines which looks stylistically unpleasant for pages on pages, thus why I still want to figure out if there is a general solution, if you're not aware of one, that's fine. Also, if you still think it is not an issue (even with the examples), then fine too. –  Sep 17 '21 at 15:46
  • I think you are asking for \everymath{\displaystyle} but there are many reasons not to do that. @Math3147 – David Carlisle Sep 17 '21 at 15:50
  • Is there a post on this site that explains why not to do so? (Also, thank you, again... that will save me so much typing...) –  Sep 17 '21 at 15:51
  • @Math3147 https://tex.stackexchange.com/q/323367/1090 – David Carlisle Sep 17 '21 at 15:53
  • Thank you, David. :) –  Sep 17 '21 at 15:54
5

You could load the amsmath package (or the mathtools package) with the option intlimits in order to save yourself from having to type

\int\limits

each and every time.

Mico
  • 506,678
  • 2
    ah I should have remembered that: if the OP moves the tick I may delete mine:-) – David Carlisle Sep 17 '21 at 12:47
  • Thank you, that seems like a viable solution too. :) –  Sep 17 '21 at 15:50
  • 1
    @DavidCarlisle please don't: your answer is useful for those who use not-really-LaTeX parsers (like MathJax) and can't control options in packages. \intop works fine there. – Ruslan Sep 17 '21 at 19:55