# Curve Integral typeset problem

I would like typeset equation on the figure below:

I've tried code:

$$\label{fyz:eq_fey_curveint1} \Psi(2)-\Psi(1) = \begin{array}{l} \displaystyle\int_{(1)}^{(2)}(\nabla\Psi)\cdot\,d{\vec{s}} \\ \text{po}\,\Gamma \end{array}$$


with result:

As you can see on the left hand side of the equation is not correctly centered on the character of the integral. I try use solution from similar problem, discussed at the stackexchange web, but I did not get a satisfactory result. I hope that this group of very experienced users advise me again.

• Drop the array, the po stuff is a (strange) part of the lower bound. Try _{\substack{(1)\\po....}}. Untested – daleif Oct 26 '13 at 11:03

\documentclass[preview,border=12pt]{standalone}
\usepackage{mathtools}
\DeclareMathOperator{\po}{po}

\begin{document}
\abovedisplayskip=0pt\relax% don't use this line in your production
$\Psi(2)-\Psi(1) = \int_{\substack{(1)\\\po\Gamma}}^{(2)}(\nabla\Psi)\cdot \textrm{d}\vec{s}$
\end{document}


## Output

Compare with the scanned image on the question.

Is there any significant difference? I don't think so.

• Now the limits (1) and (2) are not places similarly relativt to the integral; the (1) is placed too high. Also, the differential operator should be typeset using, e.g., \newcommand*\dif{\mathop{}\!\mathrm{d}} and the \dif. – Svend Tveskæg Oct 26 '13 at 12:30
• @SvendTveskæg: It is exactly similar to the requested answer, see the scanned image on the question. – kiss my armpit Oct 26 '13 at 12:32
• in the original scan, the \psis look like lowercase. it's definitely an uppercase \Gamma, but i'm not anywhere i can check how to make it italic. – barbara beeton Oct 26 '13 at 13:27
• @barbarabeeton: Yes it is one of the insignificant differences. – kiss my armpit Oct 26 '13 at 13:33
• @Marienplatz - How do you know that use of \Psi instead of \psi constitutes an insignificant difference? – Mico Oct 26 '13 at 18:05
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$\Psi(2)-\Psi(1)={\displaystyle \int_{\underset{\operatorname{{po}\, \Gamma}}{(1)}}^{(2)}} (\nabla\Psi)\cdot \mathrm{d}{\vec{s}}$$
\end{document}


• This looks like a "proper" solution. The only thing is the differential operator; see comment to Marienplatz' answer. – Svend Tveskæg Oct 26 '13 at 12:32
• @SvendTveskæg, I see, thanks. Now "d" is uprigth. – Fran Oct 26 '13 at 13:33

TeX Primitives are still cool:

\documentclass{article}

\begin{document}
$$\label{fyz:eq_fey_curveint1} \Psi(2)-\Psi(1) = \displaystyle\int_{(1)\atop\text{po}\,\Gamma}^{(2)}(\nabla\Psi)\cdot\,\mathrm{d}\vec{s}$$
\end{document}


Edit 1: There is one thing that I would adjust. Instead of the \text{po}\,\Gamma, I would rather do

\usepackage{amsmath}
\DeclareMathOperator{\po}{po}


and replace it by \po\Gamma.

Edit 2: For size correction of the subscript you have to do _{\scriptstyle (1)\atop\scriptstyle\po\Gamma}.

• As always, \text is not the proper command to use here. Po is most likely an operator so declare it as such or use say \operatorname. Then we don't risk that user going through the archives end up thinking that \text is a good solution in cases like this – daleif Oct 26 '13 at 11:12
• @daleif, this is what came to me in my mind just now :-) See my edit. – Ruben Oct 26 '13 at 11:17
• @daleif: There still is a chance that on the contrary, this po is not an operator, but just a Polish word (=English in). – g.kov Oct 26 '13 at 21:37
• @g.kov, makes sense. Though never seen that syntax before – daleif Oct 27 '13 at 7:12

With a new definition of subarray taking also an optional argument [t] (for “top alignment”), the result seems better. The following document shows two variants: one with left alignment in the subarray, the other one with center alignment (and \hidewidth so that the bottom line is “invisible” as far as the width of the subarray is concerned).

\documentclass{article}
\usepackage{amsmath}
\usepackage{bm} % for the bold italic s

\DeclareMathOperator{\po}{po}
\newcommand{\diff}{\mathop{}\!\mathrm{d}}

\makeatletter
\renewenvironment{subarray}[2][c]{%
\if#1t\vtop\else\vcenter\fi\bgroup
\Let@ \restore@math@cr \default@tag
\baselineskip\fontdimen10 \scriptfont\tw@
\lineskip\thr@@\fontdimen8 \scriptfont\thr@@
\lineskiplimit\lineskip
\ialign\bgroup\ifx c#2\hfil\fi
$\m@th\scriptstyle##$\hfil\crcr
}{%
\crcr\egroup\egroup
}
\makeatother

\begin{document}
$\psi(2)-\psi(1)= \int_{\begin{subarray}[t]{l} (1)\\ \po\Gamma \end{subarray}} ^{(2)} (\nabla\psi)\cdot\diff\bm{s}.$

$\psi(2)-\psi(1)= \int_{\begin{subarray}[t]{c} (1)\\ \hidewidth\po\Gamma\hidewidth \end{subarray}} ^{(2)} (\nabla\psi)\cdot\diff\bm{s}.$

\end{document}


It's not clear whether the psi in the text is lower or upper case; my impression is that it's lower case. The slanted or upright Gamma is probably a stylistic decision.

With the new form of subarray the optional argument can be t or c (which is the default). I don't think adding a b option is worthwhile.

• There should be no dot between \nabla and \psi. It is not in the original and it does not make mathematical sense. Also the original scan contains a bold s. This could be gotten with \bm{s} if the bm package is loaded. – Dan Oct 27 '13 at 3:29
• @Dan Oh, I overlooked it. – egreg Oct 27 '13 at 9:27