enter image description here

I know esint package can type line integral with square paths: $\sqint$, but today I need a square arrowed line integral. Does anyone know how to do it ?

2 Answers 2


A proposotoin with the \stackinset command from stackengine, \squint from esint and \Lsh from mathabx (without loading mathabx):

\usepackage{amsmath, amssymb,}

\DeclareFontShape{U}{mathb}{m}{n}{ <-6> mathb5 <6-7> mathb6 <7-8>
mathb7 <8-9> mathb8 <9-10> mathb9 <10-12> mathb10 <12-> mathb12 }{}
 \usepackage{stackengine} %


\[ I = \mysqint g(z)\,\mathrm d z \]


enter image description here


Today I also found myself wanting a similar symbol, the difference being that I wanted the arrow to be on the vertical edge to the right of the square. I found two helpful post: this one, and this one. Making some tweaks to these, I arrived at the following solution, which was sufficient for my purposes:

\usepackage{physics} % Differentials
\usepackage{xcolor}  % Colors 
\usepackage{placeins} % FloatBarrier
\usepackage{tikz-cd} % Commutative diagrams

% Approach 1: 

% Contour integral with box and upward-pointing arrow. 
% Needs the package esint and nccmath
\newcommand{\boxintanticlockwise}{\mathop{\mathpalette\docircint\relax}\! \sqint}

% Determine what to do based on where the symbol is beign used:

% (Display style = Math on separate line) 
\newcommand{\displaycircint}{\scriptsize \boldsymbol{\wedge} \mkern-30.5mu}

% (Textstyle = Inline math)


% Approach 2: 
% Source: https://tex.stackexchange.com/questions/237784/how-to-increase-the-arrow-size-on-oint

% Clockwise BIG (Display Style):

\phantom{\int} \hspace{-1mm}

% Counterclockwise BIG (Display Style):

\phantom{\int} \hspace{-1mm}

% Clockwise SMALL (Inline Mode):


  A+\ointctrclockwise\frac{\dd t}{\log t} \text{ vs. } A+\clockboxintegral\frac{\dd t}{\log t} \text{ vs. } A+\counterclockboxintegral\frac{\dd t}{\log t}

  \ointctrclockwise_{a}^{b} \text{ vs. } \clockboxintegral_{a}^{b} \text{ vs. } \counterclockboxintegral_{a}^{b}

  \frac{1}{2\pi}\ointctrclockwise_{\gamma} \text{ vs. } \frac{1}{2\pi}\clockboxintegral_{\gamma} \text{ vs. } \frac{1}{2\pi}\counterclockboxintegral_{\gamma}

  \frac{1}{2\pi}\ointctrclockwise_{X} \text{ vs. } \frac{1}{2\pi}\clockboxintegral_{X} \text{ vs. } \frac{1}{2\pi}\counterclockboxintegral_{X}
\textbf{Inline examples} \\[1mm]
There is a size difference between the inline integrals \(\int \hspace{1mm} \sqint \). \\[2mm]
But this can more or less fixed : \(\int\) \scalebox{1.1}{\(\sqint\)}. \\
Example: `The integral \(\int f(x)\dd x\) is harder to compute than \scalebox{1.1}{\(\sqint\)}\hspace{0.5mm}\(f(x)\dd x\).'
`The integrals \(\int f(z)\dd z\) and \(\int_{\Gamma} f(z)\dd z\)...'\\[2mm]
`The integrals \(\sqint f(z)\dd z\) and \(\sqint_{\Gamma} f(z)\dd z\)...' (`\textbackslash sqint' is incapable of handlign the subscript \(\Gamma\) by default)\\[2mm]
`The integral \(\hspace{2mm}\clockboxintegralinline f(z)\dd z\) describes a ...'


Output: enter image description here enter image description here

My apologies for not providing a minimal working example; I was not quite able to determine exactly which packages were needed to produce the given output.

I am also not sure how to make the inline version of this symbol play well with subscripts and the surrounding text.

You must log in to answer this question.

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