30

Is there in LaTeX a symbol or a macro for the average integral with a horizontal slash? I know about \strokedint, but I'd prefer the dash to be horizontal.

2
  • 2
    Generally the first place to check for this kind of things is the Comprehensive LaTeX Symbol List ctan.org/tex-archive/info/symbols/comprehensive On page 71 it quotes the answer Vivi gives below and attributes it to the UK TeX FAQ. Aug 1, 2010 at 13:02
  • 1
    I have to wonder why the Unicode guys called it "finite part"; this symbol is traditionally used for the "(Cauchy) principal value", while the "(Hadamard) finite part" usually has two bars crossing over the integral sign.
    – user914
    Aug 24, 2010 at 14:56

7 Answers 7

14

I found a solution here. You can use the following instructions, which must be included on the preamble.

\def\Xint#1{\mathchoice
{\XXint\displaystyle\textstyle{#1}}%
{\XXint\textstyle\scriptstyle{#1}}%
{\XXint\scriptstyle\scriptscriptstyle{#1}}%
{\XXint\scriptscriptstyle\scriptscriptstyle{#1}}%
\!\int}
\def\XXint#1#2#3{{\setbox0=\hbox{$#1{#2#3}{\int}$ }
\vcenter{\hbox{$#2#3$ }}\kern-.6\wd0}}
\def\ddashint{\Xint=}
\def\dashint{\Xint-}

The commands to execute those macros are \dashint and \ddashint for single dash and double dash, respectively.

EDIT: I tested the code given in the page, and the dash was a bit to the left of the integral, so I changed it slightly, substituting the .5 from the line \vcenter{\hbox{$#2#3$ }}\kern-.5\wd0}} with a .6 . It worked for me, if it doesn't exactly do it for you, experiment with the .5 to find exactly where you want the dash to be, adding (subtracting) from the number to place it more to the right (left).

1
12

This answer probably will not help you right now, but it should sometime in the future.

There is a unicode entry for that symbol U+2A0D FINITE PART INTEGRAL: ⨍ (your computer might or might not display this correctly. At least modern Linux distros should). The STIX font and unicode-math seem to support that symbol, so if you have them set up you can just use the symbol. As Will Robertson remarked below, unicode-math provides the \intbar command to access the symbol.

0
12

The following example defines macro

\mint{<symbol>} (\limits|\nolimits|\displaylimits)* _{...} ^{...}
  • The first argument is the symbol that is put in smaller math style in the middle of the integral symbol.
  • Then a limits specification follows, any number and order. The last one is used.
  • Then one subscript and/or one superscript can follow in any order, but at most one of each type.

The implementation takes care of:

  • the current math style,
  • calculates the correct position for the middle of the integral
  • even, if subscript and/or superscript are given with \limits,
  • lets the horizontal spacing around the symbol intact and
  • is aware of \mathsurround.
\documentclass{article}

\makeatletter
\newcommand*{\mint}[1]{%
  % #1: overlay symbol
  \mint@l{#1}{}%
}
\newcommand*{\mint@l}[2]{%
  % #1: overlay symbol
  % #2: limits
  \@ifnextchar\limits{%
    \mint@l{#1}%
  }{%
    \@ifnextchar\nolimits{%
      \mint@l{#1}%
    }{%
      \@ifnextchar\displaylimits{%
        \mint@l{#1}%
      }{%
        \mint@s{#2}{#1}%
      }%
    }%
  }%
}
\newcommand*{\mint@s}[2]{%
  % #1: limits
  % #2: overlay symbol
  \@ifnextchar_{%
    \mint@sub{#1}{#2}%
  }{%
    \@ifnextchar^{%
      \mint@sup{#1}{#2}%
    }{%
      \mint@{#1}{#2}{}{}%
    }%
  }%
}
\def\mint@sub#1#2_#3{%
  \@ifnextchar^{%
    \mint@sub@sup{#1}{#2}{#3}%
  }{%
    \mint@{#1}{#2}{#3}{}%
  }%
}
\def\mint@sup#1#2^#3{%
  \@ifnextchar_{%
    \mint@sup@sub{#1}{#2}{#3}%
  }{%
    \mint@{#1}{#2}{}{#3}%
  }%
}
\def\mint@sub@sup#1#2#3^#4{%
  \mint@{#1}{#2}{#3}{#4}%
}
\def\mint@sup@sub#1#2#3_#4{%
  \mint@{#1}{#2}{#4}{#3}%
}
\newcommand*{\mint@}[4]{%
  % #1: \limits, \nolimits, \displaylimits
  % #2: overlay symbol: -, =, ...
  % #3: subscript
  % #4: superscript
  \mathop{}%
  \mkern-\thinmuskip
  \mathchoice{%
    \mint@@{#1}{#2}{#3}{#4}%
        \displaystyle\textstyle\scriptstyle
  }{%
    \mint@@{#1}{#2}{#3}{#4}%
        \textstyle\scriptstyle\scriptstyle
  }{%
    \mint@@{#1}{#2}{#3}{#4}%
        \scriptstyle\scriptscriptstyle\scriptscriptstyle
  }{%
    \mint@@{#1}{#2}{#3}{#4}%
        \scriptscriptstyle\scriptscriptstyle\scriptscriptstyle
  }%
  \mkern-\thinmuskip
  \int#1%
  \ifx\\#3\\\else_{#3}\fi
  \ifx\\#4\\\else^{#4}\fi  
}
\newcommand*{\mint@@}[7]{%
  % #1: limits
  % #2: overlay symbol
  % #3: subscript
  % #4: superscript
  % #5: math style
  % #6: math style for overlay symbol
  % #7: math style for subscript/superscript
  \begingroup
    \sbox0{$#5\int\m@th$}%
    \sbox2{$#5\int_{}\m@th$}%
    \dimen2=\wd0 %
    % => \dimen2 = width of \int
    \let\mint@limits=#1\relax
    \ifx\mint@limits\relax
      \sbox4{$#5\int_{\kern1sp}^{\kern1sp}\m@th$}%
      \ifdim\wd4>\wd2 %
        \let\mint@limits=\nolimits
      \else
        \let\mint@limits=\limits
      \fi
    \fi
    \ifx\mint@limits\displaylimits
      \ifx#5\displaystyle
        \let\mint@limits=\limits
      \fi
    \fi
    \ifx\mint@limits\limits
      \sbox0{$#7#3\m@th$}%
      \sbox2{$#7#4\m@th$}%
      \ifdim\wd0>\dimen2 %
        \dimen2=\wd0 %
      \fi
      \ifdim\wd2>\dimen2 %
        \dimen2=\wd2 %
      \fi
    \fi
    \rlap{%
      $#5%
        \vcenter{%
          \hbox to\dimen2{%
            \hss
            $#6{#2}\m@th$%
            \hss
          }%
        }%
      $%
    }%
  \endgroup
}

\begin{document}
\[
  \displaystyle A\int B
  \textstyle A\int B
  \scriptstyle A\int B
  \scriptscriptstyle A\int B
\]
\[
  \displaystyle A\mint{-} B
  \textstyle A\mint{-} B
  \scriptstyle A\mint{-} B
  \scriptscriptstyle A\mint{-} B
\]
\[
  \displaystyle A\mint{-}_{123}^{456} B
  \textstyle A\mint{-}_{123}^{456} B
  \scriptstyle A\mint{-}_{123}^{456} B
  \scriptscriptstyle A\mint{-}_{123}^{456} B
\]
\[
  \displaystyle A\mint{-}\limits_{12345}^{6} B
  \textstyle A\mint{-}\limits_{12345}^{6} B
  \scriptstyle A\mint{-}\limits_{12345}^{6} B
  \scriptscriptstyle A\mint{-}\limits_{12345}^{6} B
\]
\[
  \displaystyle A\mint{-}\limits_{1}^{23456} B
  \textstyle A\mint{-}\limits_{1}^{23456} B
  \scriptstyle A\mint{-}\limits_{1}^{23456} B
  \scriptscriptstyle A\mint{-}\limits_{1}^{23456} B
\]
\[
  \displaystyle A\mint{-}\displaylimits_{0}^{\infty} B
  \textstyle A\mint{-}\displaylimits_{0}^{\infty} B
  \scriptstyle A\mint{-}\displaylimits_{0}^{\infty} B
  \scriptscriptstyle A\mint{-}\displaylimits_{0}^{\infty} B
\]
\[
  \displaystyle A\mint{=} B
  \textstyle A\mint{=} B
  \scriptstyle A\mint{=} B
  \scriptscriptstyle A\mint{=} B
\]
\[
  \displaystyle A\mint{\equiv} B
  \textstyle A\mint{\equiv} B
  \scriptstyle A\mint{\equiv} B
  \scriptscriptstyle A\mint{\equiv} B
\]
\[
  \displaystyle A\mint{\circ} B
  \textstyle A\mint{\circ} B
  \scriptstyle A\mint{\circ} B
  \scriptscriptstyle A\mint{\circ} B
\]
\end{document}

Result

0
4

I did this using the scalerel/stackengine combination. The \stackengine part allows me to overlay glyphs conveniently. The scalerel part allows the glyphs and stacking distances to be automatically scaled with the current mathstyle, though the use of \ThisStyle{...\SavedStyle...} and math-scalable lengths like \LMex and \LMpt.

\documentclass{article}
\usepackage{scalerel}[2014/03/10]
\usepackage[usestackEOL]{stackengine}
\def\dashint{\,\ThisStyle{\ensurestackMath{%
  \stackinset{c}{.2\LMpt}{c}{.5\LMpt}{\SavedStyle-}{\SavedStyle\phantom{\int}}}%
  \setbox0=\hbox{$\SavedStyle\int\,$}\kern-\wd0}\int}
\def\ddashint{\,\ThisStyle{\ensurestackMath{%
  \stackinset{c}{.2\LMpt}{c}{.5\LMpt+.2\LMex}{\SavedStyle-}{%
    \stackinset{c}{.2\LMpt}{c}{.5\LMpt-.2\LMex}{\SavedStyle-}{%
      \SavedStyle\phantom{\int}}}}\setbox0=\hbox{$\SavedStyle\int\,$}\kern-\wd0}\int}
\def\test#1{$\displaystyle A #1_0^X dx  \quad \textstyle A #1_0^X dx \quad
  \scriptstyle A #1 dx \quad \scriptscriptstyle A #1 dx$}
\parskip 1em
\begin{document}
\test{\dashint}\par\test{\ddashint}\par\test{\int}\par
\end{document}

enter image description here

2

There is a very useful site for this sort of questions. It is a hand-writing interface to the comprehensive LaTeX symbol list: you draw the symbol you are looking for in a box (using your mouse,...) and the software tries to recognise it. You can teach the software by telling it which one (if any) of its suggestions is the one you wanted.

I tried it with the average integral symbol and it suggested the command \fint in the esint package. That package seems to contain a number of ornamented integral signs.

3
  • 2
    Quote from OP: > I know about \strokedint, but I'd prefer the dash to be horizontal. \fint also has the "wrong" direction of the slash.
    – qbi
    Aug 1, 2010 at 18:58
  • Oops -- somehow missed that. The offending line has been removed. At any rate, it might be useful to point out the Detexify website. Aug 1, 2010 at 23:30
  • The link to the Detexify LaTeX symbol classifier is useful for the general case of this problem.
    – mas
    Jul 30, 2011 at 12:16
0

I'm not aware of a pre-existing version of that sign. So you have to design it for yourself. I would suggest something like:

\newcommand*{\avint}{\mathop{\ooalign{$\int$\cr$-$}}}

\ooalign vertically overlaps symbols. Internally it creates a tabular environment. Thatswhy you need the \cr between the $\int$ and $-$.

edit: This example compiles and shows the correct sign:

\documentclass{article}
\newcommand*{\avint}{\mathop{\ooalign{$\int$\cr$-$}}}
\begin{document}
$\avint_{i=0}^{\infty} f(x)dx$ or
\[
\giint_{i=0}^{\infty} f(x)dx
\]
\end{document}
2
  • It doesn't work correctly in display mode or with limits.
    – kennytm
    Aug 1, 2010 at 11:18
  • Can you give some minimal example or a log message? I added a minimal example to my answer above.
    – qbi
    Aug 1, 2010 at 19:02
0

The following code works. See the beginning comment for credits.

% \vint barred integral, needs one index (use {} if none)
% Definition submitted by Tero Kilpel\"ainen and Pekka Koskela
% with articles for Arkiv f\"or matematik 37:2 (1999).
% Modified to give the same spacing to the left of the sign as the
% usual integral by Anders Bj\"orn, 4 January 2000.
%
% Modified to have distance in em and ex rather than pt to scale
% properly in 11pt and 12pt by Anders Bj\"orn, 16 February 2005
%
% \vintslides is provided for use with the slides style,
% uncomment the last line in this case. Anders Bj\"orn, 23 February 2005
%
\def\vint_#1{\mathchoice%
      {\mathop{\kern 0.2em\vrule width 0.6em height 0.69678ex depth -0.58065ex
              \kern -0.8em \intop}\nolimits_{\kern -0.4em#1}}%
      {\mathop{\kern 0.1em\vrule width 0.5em height 0.69678ex depth -0.60387ex
              \kern -0.6em \intop}\nolimits_{#1}}%
      {\mathop{\kern 0.1em\vrule width 0.5em height 0.69678ex depth -0.60387ex
              \kern -0.6em \intop}\nolimits_{#1}}%
      {\mathop{\kern 0.1em\vrule width 0.5em height 0.69678ex depth -0.60387ex
              \kern -0.6em \intop}\nolimits_{#1}}}
\def\vintslides_#1{\mathchoice%
      {\mathop{\kern 0.1em\vrule width 0.5em height 0.697ex depth -0.581ex
              \kern -0.6em \intop}\nolimits_{\kern -0.4em#1}}%
      {\mathop{\kern 0.1em\vrule width 0.3em height 0.697ex depth -0.604ex
              \kern -0.4em \intop}\nolimits_{#1}}%
      {\mathop{\kern 0.1em\vrule width 0.3em height 0.697ex depth -0.604ex
              \kern -0.4em \intop}\nolimits_{#1}}%
      {\mathop{\kern 0.1em\vrule width 0.3em height 0.697ex depth -0.604ex
              \kern -0.4em \intop}\nolimits_{#1}}}

\newcommand{\kint}{\vint}
\newcommand{\intav}{\vint}
\newcommand{\aveint}[2]{\mathchoice%
      {\mathop{\kern 0.2em\vrule width 0.6em height 0.69678ex depth -0.58065ex
              \kern -0.8em \intop}\nolimits_{\kern -0.45em#1}^{#2}}%
      {\mathop{\kern 0.1em\vrule width 0.5em height 0.69678ex depth -0.60387ex
              \kern -0.6em \intop}\nolimits_{#1}^{#2}}%
      {\mathop{\kern 0.1em\vrule width 0.5em height 0.69678ex depth -0.60387ex
              \kern -0.6em \intop}\nolimits_{#1}^{#2}}%
      {\mathop{\kern 0.1em\vrule width 0.5em height 0.69678ex depth -0.60387ex
              \kern -0.6em \intop}\nolimits_{#1}^{#2}}}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .