具有方形箭头路径的线积分

具有方形箭头路径的线积分

enter image description here

我知道 esint 包可以输入带有平方路径的线积分:$\sqint$,但今天我需要一个带箭头的平方线积分。有人知道怎么做吗?

答案1

\stackinset使用from stackengine\squintfromesint\Lsh from命令的建议mathabx(不加载 mathabx):

\documentclass{article}
\usepackage{amsmath, amssymb,}
\usepackage{nccmath}
\usepackage{esint}


\DeclareFontFamily{U}{mathb}{\hyphenchar\font45}
\DeclareFontShape{U}{mathb}{m}{n}{ <-6> mathb5 <6-7> mathb6 <7-8>
mathb7 <8-9> mathb8 <9-10> mathb9 <10-12> mathb10 <12-> mathb12 }{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
%
\DeclareMathSymbol{\Lsh}{\mathrel}{mathb}{"E8}
\usepackage{xcolor} 
 \usepackage{stackengine} %
\newcommand{\mysqint}{\mathop{{\stackMath\stackinset{c}{0.03ex}{c}{0.235ex}{\scriptstyle\Lsh}{\sqint}}}}

\begin{document}

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

\end{document} 

enter image description here

答案2

今天我也发现自己想要一个类似的符号,不同之处在于我希望箭头位于正方形右侧的垂直边缘上。我发现了两个有用的帖子: 这个, 和这个经过对这些进行一些调整,我得出了以下解决方案,这对于我的目的来说已经足够了:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[margin=1.2in]{geometry}
\usepackage{amsfonts,amssymb,amsmath,amsthm}
\usepackage{mathabx}
\usepackage{enumerate}
\usepackage{lmodern}
\usepackage{physics} % Differentials
\usepackage{xcolor}  % Colors 
\usepackage{placeins} % FloatBarrier
\usepackage{array}
\usepackage{tikz-cd} % Commutative diagrams
\usetikzlibrary{matrix,arrows,backgrounds}
\usepackage{centernot}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{hyperref}
\usepackage{nccmath}
\usepackage{esint}



% 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:
\newcommand{\docircint}[2]{%
  \ifx#1\displaystyle
    \displaycircint
  \else
    \normalcircint{#1}%
  \fi
}

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

% (Textstyle = Inline math)
\newcommand{\normalcircint}[1]{%
  \smallerc{#1}\ifx#1\textstyle\mkern-9mu\else\mkern-14.3mu\fi
}

\newcommand{\smallerc}[1]{%
  \vcenter{\hbox{$\ifx#1\textstyle\scriptstyle\else\scriptscriptstyle\fi\wedge$}}%
}

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

% Clockwise BIG (Display Style):
\newcommand{\scalefactor}{0.7}
\newcommand{\rotatefactor}{0}
\newcommand{\raiseamt}{0.07em}
\newcommand{\leftamt}{-1.287em}

\newcommand{\clockboxintegral}{%
\phantom{\int} \hspace{-1mm}
  \raisebox{\raiseamt}{%
    \rotatebox{\rotatefactor}{%
      \scalebox{\scalefactor}{\(\lor\)}%
    }%
  }%
\hspace{\leftamt}\sqint}

% Counterclockwise BIG (Display Style):
\newcommand{\scalefactorr}{0.7}
\newcommand{\rotatefactorr}{0}
\newcommand{\raiseamtt}{0.15em}
\newcommand{\leftamtt}{-1.287em}

\newcommand{\counterclockboxintegral}{%
\phantom{\int} \hspace{-1mm}
  \raisebox{\raiseamtt}{%
    \rotatebox{\rotatefactorr}{%
      \scalebox{\scalefactorr}{\(\land\)}%
    }%
  }%
\hspace{\leftamtt}\sqint}


% Clockwise SMALL (Inline Mode):
\newcommand{\scalefactorrr}{0.6}
\newcommand{\rotatefactorrr}{0}
\newcommand{\raiseamttt}{0.07em}
\newcommand{\leftamttt}{-0.965em}

\newcommand{\clockboxintegralinline}{%
  \raisebox{\raiseamttt}{%
    \rotatebox{\rotatefactorrr}{%
      \scalebox{\scalefactorrr}{\(\lor\)}%
    }%
  }%
\hspace{\leftamttt}\sqint}

\begin{document}
\[\boxintanticlockwise\]
\[
  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}
\]
\noindent 
\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\).'
\\[2mm]
`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 ...'


\end{document}

输出: enter image description here enter image description here

抱歉,没有提供一个最小的工作示例;我无法确定需要哪些包来产生给定的输出。

我也不确定如何使该符号的内联版本与下标和周围的文本很好地配合。

相关内容