8

I try to typeset bar over/under integral symbol with

\overline\int,\underline\int

But the line looks too long, any solution?

1
  • these are in unicode: U+2A1B and U+2A1C respectively. as such, they should be in the stix or xits fonts, or other fonts supporting unicode. Nov 8, 2014 at 15:48

3 Answers 3

15

This should do (not in script styles)

\documentclass{article}

\makeatletter
\newcommand\tint{\mathop{\mathpalette\tb@int{t}}\!\int}
\newcommand\bint{\mathop{\mathpalette\tb@int{b}}\!\int}
\newcommand\tb@int[2]{%
  \sbox\z@{$\m@th#1\int$}%
  \if#2t%
    \rlap{\hbox to\wd\z@{%
      \hfil
      \vrule width .35em height \dimexpr\ht\z@+1.4pt\relax depth -\dimexpr\ht\z@+1pt\relax
      \kern.05em % a small correction on the top
    }}
  \else
    \rlap{\hbox to\wd\z@{%
      \vrule width .35em height -\dimexpr\dp\z@+1pt\relax depth \dimexpr\dp\z@+1.4pt\relax
      \hfil
    }}
  \fi
}
\makeatother

\begin{document}
\[
\tint_a^b f(t)\,dt=\bint_a^b f(t)\,dt
\textstyle
\tint_a^b f(t)\,dt=\bint_a^b f(t)\,dt
\]
\end{document}

enter image description here

1
\documentclass[a4paper]{paper}
\usepackage{STIX}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}

\[ \upint\limits_{a}^{b} f(x) \ \text{d}x \ \ \ \lowint\limits_{a}^{b} f(x) \ \text{d}x \]

\end{document}
2
  • 1
    Adding a few words wouldn't hurt. Aug 6, 2021 at 14:08
  • And no you should not be using \text{d} here at all try \itshape \[ \int \text{d} x \] oops! Use \mathrm{d} (there are a lot of people who does not understand what the \text command is for.
    – daleif
    Aug 6, 2021 at 14:26
0

How about this?

$$\mathop{\smash{\hspace{4.44444pt}\overline{\hspace{-4.44444pt}\int}}\vphantom{\int}}
\nolimits^b_{\hspace{-4.44444pt}a}$$

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.