79

Is there a possibility to draw large integral signs?

I have found the package bigints but I have the feeling it is not very professional...

Any better idea?

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
Marco
  • 4,435

4 Answers4

83

I'm aware of three packages that will let you create larger integral signs: bigints, mtpro2, and relsize.

  • The package bigints provides the following commands to scale up the symbol produced by \int: \bigintssss, \bigintsss, \bigintss, \bigints, and \bigint. Using the default math font family (Computer Modern) and the default text font size of 10pt, these commands (including the "ordinary" \int) produce the following symbols, with a dummy integrand thrown in for scale:

enter image description here

  • The mtpro2 package, which uses Times New Roman-style fonts, provides the commands \xl, \XL, and \XXL (as well as the gynormous, 10cm-tall \XXXL, not shown below) as prefixes to \int. This is how these integrals look like when typeset with the mtpro2 package:

enter image description here

By the way, the full mtpro2 package is not free. However, its "lite" subset (which is all that's needed to use the prefix commands \xl, etc.) is free. The package may be downloaded from this site.

  • The command \mathlarger of the relsize package can also produce larger integral symbols. (For multi-step enlargements, the exscale package must be loaded as well.) For a one-step increase in size, you'd type \mathop{\mathlarger{\int}}; for a two-step increase, you'd type \mathop{\mathlarger{\mathlarger{\int}}}, etc.

enter image description here

To my taste, all three sets of results look quite professional. :-)

Three further comments, and a caveat:

  • None of these packages seems to do a great job placing the lower and upper limits of integration. A reasonable positioning of the lower limit of integration, in particular, will require inserting either several "negative thinspace" (\!) directives -- the larger the integral symbol, the more \! instructions will likely be required -- or something like \mkern-18mu. (Use \mkern rather than \kern when in math mode.)

  • The bigints package can produce five large variants for \oint as well, but (again AFAICT) not for double, triple, surface, slashed, etc. integrals. The mtpro2 package, while providing "only" three large variants of \int (I'm disregarding the \XXXL-prefix variant!), can produce large variants of \iint, \iiint, \oiint, \oiiint, \barint, \slashint, and clockwise- and counterclockwise-oriented line integrals. Similarly, the \mathlarger command of the relsize package can be applied to any operator symbol -- including \iint, \iiint, etc.

  • The mtpro2 package can be used in conjunction with both the bigints and the relsize packages. If the mtpro2 package is loaded, the instructions \bigintssss, \bigintsss, ... \mathop{\mathlarger{\int}}, ... will produce integral symbols that are a bit "thicker", in keeping with the style of the \int symbols produced directly by the mtpro2 package.

  • May 2014 update: I have recently discovered that the bigints package doesn't seem to be compatible with the lmodern package, in the sense that the macros of the bigints pacakge do not generate "large" integral symbols if the lmodern package is loaded as well. For a work-around, please see this answer by @egreg. The work-around consists of inserting the instructions

    \DeclareFontFamily{OMX}{lmex}{}
    \DeclareFontShape{OMX}{lmex}{m}{n}{<-> lmex10}{}
    

    in the preamble, after loading the lmodern package.


Finally, here's the code that produced the three screenshots shown above.

With the bigints package:

\documentclass{article}
\usepackage{bigints}
\newcommand\dummy{\frac{a}{c}\,\mathrm{d}P}
\begin{document}
\[
\int\dummy\quad
\bigintssss\dummy\quad
\bigintsss\dummy\quad
\bigintss\dummy\quad
\bigints\dummy\quad
\bigint\dummy
\]
\end{document}

With the mtpro2 package:

\documentclass{article}
\usepackage[lite]{mtpro2}
\newcommand\dummy{\frac{a+b}{c+d}\,\mathrm{d}P\quad}
\begin{document}
\[
\int\dummy\quad
\xl\int\dummy\quad
\XL\int\dummy\quad
\XXL\int\dummy
\]
 \end{document}

With the relsize and exscale packages:

\documentclass{article}
\usepackage{relsize,exscale}
\newcommand\dummy{\frac{a}{c}\,\mathrm{d}P\quad}
\begin{document}
\[
\int\dummy\quad
\mathop{\mathlarger{\int}}\dummy\quad
\mathop{\mathlarger{\mathlarger{\int}}}\dummy\quad
\mathop{\mathlarger{\mathlarger{\mathlarger{\int}}}}\dummy\quad
\mathop{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\int}}}}}\dummy
\]
\end{document}
Mico
  • 506,678
  • 2
    It might be worth adding, that if the \limits command is used, it has to put in the correct place. So using \mathop{\mathlarger{\int\limits_t}} looks much better than \mathop{\mathlarger{\int}}\limits_t when using the relsize package, for example. – Patrick Häcker May 30 '13 at 12:55
  • @MMM -- but doesn't the size of the limits also get enlarged with \mathlarger when they're within that scope? if so, is there a way around it? and (i haven't tried this) what about the placement of "sub/sup"-positioned limits on an enlarged integral? – barbara beeton May 30 '13 at 14:36
  • @barbarabeeton - It turns out that none of these packages does a great job placing terms in the lower and upper limits of integration. And, as you point out, one wouldn't want to include the lower and upper limits inside the \mathlarger expression as doing so would increase the size of the limit terms as well -- probably not what the writer has in mind. I've updated my answer to include this – Mico May 30 '13 at 15:24
  • @barbarabeeton Please take a look at the alternate answer I just posted, to see if it addresses your concerns. – Steven B. Segletes May 30 '13 at 15:32
  • @barbarabeeton, Yes, you are right, thanks for pointing that out. Interestingly the slightly larger limits actually look better in the formula where I need the large integral. But this won't be true in general. So I'd say, that a universal solution is still lacking due to two points: First, the scaling of the integral sign should be automatic, as with \left or \right. Second, even when setting the size manually, the limits aren't placed correctly automatically. There are sill plenty of possibilities for LaTeX package authors … – Patrick Häcker May 31 '13 at 08:02
  • The bigints only version doesn't play well with the lmodern package, apparently. Any ideas why not? – Adrian Keister Mar 09 '18 at 17:28
  • 1
    @AdrianKeister - I'm afraid I don't know why that is. Did you read the final bullet point in my answer, with the link to another answer that provides a work-around? – Mico Mar 09 '18 at 17:31
  • Oh, I guess I didn't read your entire post carefully enough. Our work-around was simply to ditch lmodern. Thanks! – Adrian Keister Mar 09 '18 at 18:04
  • I saw you mentioned how the horizontal spacing of limits is sometimes off. I know how to use positive and negative space to adjust. How could you adjust the vertical position of the limits? Or could you lower the integral sign itself? Sometimes, for the \bigints-type integral signs, they appear too high. Thank you so much for your time and expertise! – Adrian Keister Mar 10 '18 at 16:48
  • 1
    Oh: just found out that a displayed environment does a much better job of placing both the integral sign and the limits than a non-displayed math environment. Cheers! – Adrian Keister Mar 10 '18 at 16:52
  • @AdrianKeister - I wouldn’t imagine large integral symbols being used much in an inline-math setting. At least, I would hope they won’t get deployed in inline-math settings... – Mico Mar 10 '18 at 17:45
29

The scalerel package gives you the added capability to constrain the scale. In general, it can either vertically stretch, while keeping a lower limit on aspect ratio, or it can vertically scale, keeping an upper limit on overall width. I demonstrate both cases below, following a normal invocation of \int. Furthermore, the scalability is continuous, rather than just having 4 or 5 discrete sizes.

In reference to barbara beeton's comment on the accepted answer, the limits with this approach will not scale with the integral size. However, some added gyrations are, nonetheless required to include limits. First, because \stretchint and \scaleint take a size argument, they have to be enclosed in braces for the subscript and superscript to understand to what it is actually referring. In addition, negative space has to be added to the subscript to account for the slant of the integral operator. EDITED to set in \displaystyle since that would be the general mode of using large integral signs, as pointed out by barbara beeton. EDITED further, based on Mico's comment. And thanks to egreg for instruction of use of \vcenter.

EDITED to reflect recent scalerel bug fix regarding \stretch... macros, in which limiting aspect ratio of optional argument had been miscalculated by a factor of 2. Thus, in this revision, the limiting aspect ratio for \stretchto is shown properly as 4.4 (i.e., [440]) rather than 2.2.

\documentclass{article}
\usepackage{scalerel}[2016-12-29]
\def\stretchint#1{\vcenter{\hbox{\stretchto[440]{\displaystyle\int}{#1}}}}
\def\scaleint#1{\vcenter{\hbox{\scaleto[3ex]{\displaystyle\int}{#1}}}}
\begin{document}
\def\x{\frac{a}{c}dP}
\verb|\stretchto| with aspect ratio limit of 4.4
\def\bs{\mkern-12mu} % set amount of backspacing for lower limit of integration
\[
\int_a^b\x ~~ \stretchint{7ex}_{\bs a}^b\x ~~ \stretchint{9ex}_{\bs a}^b\x
\]
\par
\verb|\scaleto| with width limit of 3ex
\def\bs{\mkern-15mu} % reset amount of backspacing for lower limit of integration
\[
\int_a^b\x ~~ \scaleint{7ex}_{\bs a}^b\x ~~ \scaleint{9ex}_{\bs a}^b\x 
\]
\end{document}

enter image description here

Mico
  • 506,678
  • all the limits look to be very close to the same size as the terms in the fraction -- appropriate for setting in text, but not (usually) in display. the example would be better if you used \[...\] rather than \(...\). – barbara beeton May 30 '13 at 16:23
  • An interesting suggestion to use either \stretchto or \scaleto. The integral symbol used by your macros appears to be the small one from inline-math, which is noticeably more upright than the displaystyle-math integral symbol. Since one would expect (or at least hope!!) that large integral symbols will be used only in display math settings, could you revise your code to use the larger symbols? A separate suggestion: Instead of using \raisebox to adjust the position of the integral symbol, could you use \vcenter and let TeX do the job of centering the symbol vertically? – Mico May 31 '13 at 13:07
  • @Mico I did change the answer to reflect the displaystyle integral sign, but I didn't master the use of \vcenter, as shown in the update. – Steven B. Segletes Jun 01 '13 at 13:01
  • @StevenB.Segletes \vcenter builds a \vbox, using the current \hsize if a paragraph is started. Put \scaleint{9ex} inside an \hbox so no paragraph is started. – egreg Jun 01 '13 at 13:02
  • Thanks for switching from the inline to the displaystyle math integral symbol. The output looks much better now, IMNSHO. – Mico Jun 01 '13 at 20:16
  • @Mico I should have picked up on that to begin with. You are so right. – Steven B. Segletes Jun 01 '13 at 20:22
  • @Mico Done, done, and done. – Steven B. Segletes Jan 23 '17 at 15:19
  • 1
    I've taken the liberty of editing your code some more. Feel free to revert or to change further. :-) – Mico Jan 23 '17 at 15:24
2

A trick for producing extensible upright integrals using LuaLaTeX is demonstrated in the documentation of the New Computer Modern package. It defines the slot uni222B (integral) as a delimiter.

\documentclass{article}
\usepackage{fontsetup}
\begin{document}
    \[
        \Uleft \Udelimiter 0 0 "222B
        \begin{pmatrix}
            1\\2\\3\\4\\5\\6\\7\\8\\9\\10\\11\\12\\13\\14\\15\\16\\17\\18\\19\\20
        \end{pmatrix}
        \Uright.
    \]
\end{document}

Extensible upright integral in newcomputermodern font

This trick can be used for other fonts as well, such as xcharter, stixtwo, concrete, tex-gyre-math fonts, gfsneohellenic*, kpfonts, etc. It does not seem to work for fonts such as erewhon and fira. I don't know why. The length of the integral symbol and the brackets varies according to the font.

*The matrix brackets collide at the top in this font.

0

Or use \scalebox from the graphicx package.

\[
t=\scalebox{1.2}[2.1]{$\displaystyle\int$}_{\hspace{-0.5em}0}^{\,a} 
\sqrt{\frac{1+\lr[{\phb y'(x)}]^2}{2gy(x)}}\,dx.
\]