2

Is there a way to do quadruple integrals, arbitrary-length integrals, and integrals with an ellipsis as closed-manifold integrals in LaTeX? If someone could define some macros, that would be great. This question How to insert a triple line integral? goes over triple integrals and this link https://www.overleaf.com/learn/latex/Integrals%2C_sums_and_limits goes over the topic for "regular" (non-closed-manifold) integrals.

EDIT: This is a partial answer but 1) the manifold of integration is set in the preamble and 2) the ellipses are not centered on the integral symbols

\documentclass{article}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{txfonts}
\usepackage{tikz}

\usetikzlibrary{math} \usetikzlibrary{shapes}

\makeatletter \ams@newcommand{\iiiiint}{\DOTSI\protect\MultiIntegral{5}} \renewcommand{\MultiIntegral}[1]{% \edef\ints@c{\noexpand\intop \ifnum#1=\z@\noexpand\intdots@\else\noexpand\intkern@\fi \ifnum#1>\tw@\noexpand\intop\noexpand\intkern@\fi \ifnum#1>\thr@@\noexpand\intop\noexpand\intkern@\fi \ifnum#1>4 \noexpand\intop\noexpand\intkern@\fi % <---- added \noexpand\intop \noexpand\ilimits@ }% \futurelet@let@token\ints@a } \makeatother

\newcommand*\oiiiint{% \tikz \node[draw, ellipse, inner xsep=-4pt, inner ysep=-9pt] {$\displaystyle\iiiint$};% }

\newcommand*\oiiiintM{% \tikz \node[draw, ellipse, inner xsep=-4pt, inner ysep=-13pt] {$\displaystyle\iiiint\limits_M$};% }

\newcommand*\oiiiiint{% \tikz \node[draw, ellipse, inner xsep=-4pt, inner ysep=-9pt] {$\displaystyle\iiiiint$};% }

\newcommand*\oiiiiintM{% \tikz \node[draw, ellipse, inner xsep=-4pt, inner ysep=-13pt] {$\displaystyle\iiiiint\limits_M$};% }

\newcommand*\oidotsint{% \tikz \node[draw, ellipse, inner xsep=-4pt, inner ysep=-9pt] {$\displaystyle\idotsint$};% }

\newcommand*\oidotsintM{% \tikz \node[draw, ellipse, inner xsep=-4pt, inner ysep=-12pt] {$\displaystyle\idotsint\limits_M$};% }

\begin{document}

\noindent $\displaystyle \oint\limits_C \omega$ \ $\displaystyle \oiint\limits_S \eta$ \ $\displaystyle \oiiint\limits_M \theta$ \ \indexspace $\oiiiint _M \alpha$ \ \indexspace $\oiiiintM \alpha$ \ \indexspace $\oiiiiint _M \beta$ \ \indexspace $\oiiiiintM \beta$ \ \indexspace $\oidotsint _M \gamma$ \ \indexspace $\oidotsintM \gamma$ \ \indexspace Can this be done with $\ignorespaces $\backslash$oiiiint_M $\backslash$xi$, $\ignorespaces $\backslash$oint[n]_M $\backslash$phi$, and $\ignorespaces $\backslash$oidotsint_M $\backslash$lambda$?

\end{document}

LaTex output

  • 2
    Can you explain your issue better, for example with some TeX code or a sketch? – Mensch Nov 17 '21 at 19:57
  • 1
    I don't know of any font with "closed" multiple integrals with more than three integrals. The ellipse can be supplied by an overlay created with tikz, but that's not my specialty. – barbara beeton Nov 18 '21 at 02:07

3 Answers3

4

pdfMsym provides a macro for rendering arbitrary length closed integrals with \oiNint, for example:

\[ \oiNint{5} \]

oiNint macro

In order to create such a construction, pdfMsym utilizes two macros: \putexsym and \@skewedlim@op which place "extended symbols" (like the loop in \oiNint) over material and create large math operators which have skewed limits like \int respectively. The latter is of less interest, and details on it are provided in the pdfMsym documentation section 3.1, the same is true for \putexsym. To showcase the use of \putexsym I will demonstrate how to create \oidotsint:

\def\oidotsint{\putexsym{\int\mkern-8mu\cdots\mkern-8mu\int}\@BigLeftcirclecap\@BigRightcirclecap{2.5}{4}}

[ \oidotsint ]

idotsint macro

This places an extended symbol capped by the linecaps/lineheads \@BigLeftcirclecap and \@BigRightcirclecap which are big half circle linecaps over \int\mkern-8mu\cdots\mkern-8mu\int. The value 2.5 is the height of these linecaps (and should not be changed), and 4 tells pdfMsym how much to reduce the width of the symbol (if we replace 4 with 0 the caps would be placed at the edges of \int...\int which doesn't look great). The exact dimensions of 4 and 2.5 are relative to the fontsize (given to \pdfmsymsetscalefactor) and the current mathmode. This definition will not properly set limits for \oidotsint, either surround this with a \mathop{...} or use \@skewedlim@op.

More information can be found in pdfMsym's documentation. pdfMsym is a package I wrote, and I don't have much experience writing packages so I don't know how reliable it is. Furthermore, I suspect that some features will change in the future so the details in this post may become outdated in the future.

Slurp
  • 876
  • 1
    Interesting, but an ellipse would be nicer, in my opinion. – egreg Dec 23 '22 at 13:27
  • @egreg Thank you for the feedback, it is greatly appreciated! I think I may add some extended functionality to the \putexsym and related macros in the future which would allow doing this. I will update this answer if I ever do. – Slurp Dec 23 '22 at 14:07
  • Unfortunately the circle caps appear to be broken in latest LaTeX version. // Side note, maybe it's better if you default the scale factor to \f@size? For me setting \pdfmsymsetscalefactor{\f@size} at the start of the document works, maybe you can automate it; or at least give a descriptive error message if user forget to do that instead of "undefined control sequence". – user202729 Oct 22 '23 at 03:15
3

With package esint:

\documentclass[border=12pt]{standalone}
\usepackage{esint}
\begin{document}
\def\arraystretch{2}
\begin{tabular}{c c c}
macro  & textstyle & displaystyle \\
\verb+\int+ & $\int$ & $\displaystyle \int$\\
\verb+\iint+ & $\iint$& $\displaystyle \iint$\\
\verb+\iiint+ & $\iiint$ & $\displaystyle \iiint$\\
\verb+\iiiint+ & $\iiiint$ & $\displaystyle \iiiint$\\
\verb+\idotsint+ & $\idotsint$ & $\displaystyle \idotsint$\\
%
\verb+\oint+ & $\oint$ & $\displaystyle \oint$\\
\verb+\oiint+ & $\oiint$ & $\displaystyle \oiint$\\
\verb+\varoiint+ & $\varoiint$ & $\displaystyle \varoiint$\\
\verb+\sqint+ & $\sqint$ &$\displaystyle \sqint$\\
\verb+\sqiint+ & $\sqiint$ & $\displaystyle \sqiint$\\
\verb+\ointctrclockwise+ & $\ointctrclockwise$ & $\displaystyle \ointctrclockwise$\\
\verb+\ointclockwise+ & $\ointclockwise$ & $\displaystyle \ointclockwise$\\
\verb+\varointclockwise+ & $\varointclockwise$ & $\displaystyle \varointclockwise$\\
\verb+\varointctrclockwise+ & $\varointctrclockwise$ & $\displaystyle \varointctrclockwise$\\
\verb+\fint+ & $\fint$  &$\displaystyle \fint$\\
\verb+\landupint+ & $\landupint$  &$\displaystyle \landupint$\\
\verb+\landdownint+ & $\landdownint$ & $\displaystyle \landdownint$
\end{tabular}
\end{document}

enter image description here

user187802
  • 16,850
3

These commands are defined in unicode-math, so you can use them with your font of choice in LuaTeX or XeTeX.

\documentclass{article}
\tracinglostchars=3 % Error if a symbol is missing
\usepackage{unicode-math}
\usepackage{newcomputermodern}

\begin{document} \begin{align} & \iiiint_a^b \ % quadruple integral & \oiiint_C \ % Triple contour integral & \idotsint_a^b % ellipsis integral \end{align} \end{document}

New Computer Modern Math sample

There aren’t aribrarily-large integral symbols. You could, I suppose, fake one with negative kerning between single integral signs, but if you end up needing to distinguish between quintuple and sextuple integration, I recommend you find a notation that’s easier to read. Possibly \int_B where $B$ is a higher-dimensional region, if that makes sense in your research area?

Not all fonts will have all these symbols, but New Computer Modern Math, STIX Two Math and XITS Math are three that are especially comprehensive. These fonts also let you choose between upright and slanted integrals as stylistic sets.

If your math font does not contain one of the symbols, you can swap it in with a command like

\setmathfont{STIX Two Math}[
  range={\iiiint,\oiiint},
  Scale=MatchUppercase]
Davislor
  • 44,045
  • Hi I hope you see this. How did you make that image of your latex? I really want to figure out how. Thanks! – jackson Apr 07 '22 at 04:42
  • @jackson I compiled my MWE to PDF, then converted to PNG and cropped it. I used ImageMagick, but many other tools will work. – Davislor Apr 07 '22 at 11:18
  • @jackson Note that, if this site accepted the format, I would instead have saved as a vector format like SVG, or perhaps an embedded standalone PDF. – Davislor Apr 07 '22 at 11:22