% definition of the Cauchy principal value integral symbol
\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-.5\wd0}}
\def\ddashint{\Xint=}
\def\dashint{\Xint-}
This works fairly good for simple integration limits but it is totally
unacceptable for others. Example:
\[
{\mathrm Ei}(x) = -
\dashint\limits_{-x}^\infty \frac{e^{-t}}{t}\:dt =
\dashint\limits_{-\infty}^x \frac{e^t}{t}\:dt =
\dashint\limits_{a-b+c-d}^x \frac{e^t}{t}\:dt =
\pvint\limits_{a-b+c-d}^x \frac{e^t}{t}\:dt
\]
The third integral (which has non-sense limits to show the shortcoming
of \dashint) actually looks like having a minus-sign in front of it.
The last integral uses
\newcommand*{\pvint}{\mathop{\ooalign{$\int$\cr$-$}}}
The \pvint command has all the wishful features, EXCEPT that it's
integral symbol always looks like textmode.
Are there any known fixes to either of these or is there another
properly working command?
Wolfgang
I am new to Latex and I want to write a text which includes among
> others the Cauchy principal value integrals for Ei(x). After a lot of
> searching I found that there are some references to \dashint:
>
> % definition of the Cauchy principal value integral symbol
> \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-.5\wd0}}
> \def\ddashint{\Xint=}
> \def\dashint{\Xint-}
that command appeared in the tex faq's first (paper) release, in 1994.
> This works fairly good for simple integration limits but it is totally
> unacceptable for others. Example:
>
> \[
> {\mathrm Ei}(x) = -
> \dashint\limits_{-x}^\infty \frac{e^{-t}}{t}\:dt =
> \dashint\limits_{-\infty}^x \frac{e^t}{t}\:dt =
> \dashint\limits_{a-b+c-d}^x \frac{e^t}{t}\:dt =
> \pvint\limits_{a-b+c-d}^x \frac{e^t}{t}\:dt
> \]
>
> The third integral (which has non-sense limits to show the shortcoming
> of \dashint) actually looks like having a minus-sign in front of it.
impressively bad. the mathematicians who suggested the macro for
inclusion in the faq seemed quite satisfied with it. obviously they had
never used it with your parameters.
> The last integral uses
>
> \newcommand*{\pvint}{\mathop{\ooalign{$\int$\cr$-$}}}
>
> The \pvint command has all the wishful features, EXCEPT that it's
> integral symbol always looks like textmode.
it would: you enclose each of the maths commands in single-$ selectors.
you need to have the command embedded in a \mathchoice (as the original)
and to put the appropriate state selectors in each bit of maths. see
chapter 23, page 201, of tex by topic, on ctan at
info/texbytopic/TeXbyTopic.pdf
--
Robin Fairbairns, Cambridge
my address is @cl.cam.ac.uk, regardless of the header. sorry about that.
The problem is that \XXint measures the operator without its limits.
I can't see how to measure with the limits unless the limits are
given as an argument to \dashint:
\def\Xint#1#2{\mathchoice
{\XXint\displaystyle\textstyle{#1}{#2}}%
{\XXint\textstyle\scriptstyle{#1}{#2}}%
{\XXint\scriptstyle\scriptscriptstyle{#1}{#2}}%
{\XXint\scriptscriptstyle\scriptscriptstyle{#1}{#2}}%
\!\int#2}
\def\XXint#1#2#3#4{{\setbox0=\hbox{${\int#4}$}%#1{#2#3}
\rlap {\hbox to\wd\z@ {\hss$#3$\hss}}%
}}%
\def\ddashint{\Xint=}
\def\dashint{\Xint-}
\newcommand*{\pvint}{\mathop{\ooalign{$\int$\cr$-$}}}
\fontdimen22\textfont2=2.5pt
\def\axis{2.5pt}
$$
{\mathrm Ei}(x) =
\dashint{\limits_{-x}^\infty }\frac{e^{-t}}{t}\:dt =
\dashint{\limits_{-\infty}^x }\frac{e^t}{t}\:dt =
\dashint{\limits_{a-b+c-d}^x}\frac{e^t}{t}\:dt =
\int\limits_{a-b+c-d}^x \frac{e^t}{t}\:dt =
\pvint\limits_{a-b+c-d}^x \frac{e^t}{t}\:dt
$$
\newcommand*{\pvint}{
\mathop{\,\,\vphantom{\intop}\!\!\!
\mathpalette\pvintop\relax}\nolimits}
\newcommand*{\pvintop}[2]{
\ooalign{$#1\intop$\cr\hidewidth$#1-$\hidewidth}}
The placement of limits is not perfect, the lower limit should
be backspaced a bit.
\[\pvint\limits_a^b f(t)\,dt\]
Ciao
Enrico
>> \newcommand*{\pvint}{\mathop{\ooalign{$\int$\cr$-$}}}
>>
>> The \pvint command has all the wishful features, EXCEPT that it's
>> integral symbol always looks like textmode.
>
>it would: you enclose each of the maths commands in single-$ selectors.
>
>you need to have the command embedded in a \mathchoice (as the original)
>and to put the appropriate state selectors in each bit of maths. see
>chapter 23, page 201, of tex by topic, on ctan at
>info/texbytopic/TeXbyTopic.pdf
Thank you for the quick and informative answer! I will have a look at
that document tomorrow (and will be back if there are more questions).
Wolfgang
> I am new to Latex and I want to write a text which includes among
> others the Cauchy principal value integrals for Ei(x). After a lot of
> searching I found that there are some references to \dashint:
>
> % definition of the Cauchy principal value integral symbol
> \def\Xint#1{\mathchoice
The \Xint definition is mine, in response to a question from
"Erica Harris".
> \dashint\limits_{-x}^\infty \frac{e^{-t}}{t}\:dt =
> \dashint\limits_{-\infty}^x \frac{e^t}{t}\:dt =
> \dashint\limits_{a-b+c-d}^x \frac{e^t}{t}\:dt =
> \pvint\limits_{a-b+c-d}^x \frac{e^t}{t}\:dt
It was never made to use \limits formatting (\int is \nolimits).
I am surprised any of the iterations are "acceptible".
> \newcommand*{\pvint}{\mathop{\ooalign{$\int$\cr$-$}}}
>
> The \pvint command has all the wishful features, EXCEPT that it's
> integral symbol always looks like textmode.
It also has the big failing of not following the slope of the
integral sign. That is what \Xint is written as a horizontal
overlap instead of a vertical stack alignment.
> Are there any known fixes to either of these or is there another
> properly working command?
There are certainly various handlers for subscripts on boxed
sloped math. They get convoluted.
By the way, the best solution is to use a math symbols font that
actually includes a dashed integral.
Donald Arseneau as...@triumf.ca
Yes of course. esint provides \fint with a `slanted dash' which is not
beautiful but probably increase the readability since it is set apart
from minus — and the fraction bars.
>
>
> Donald Arseneau as...@triumf.ca
>\newcommand*{\pvint}{
> \mathop{\,\,\vphantom{\intop}\!\!\!
> \mathpalette\pvintop\relax}\nolimits}
>\newcommand*{\pvintop}[2]{
> \ooalign{$#1\intop$\cr\hidewidth$#1-$\hidewidth}}
>
>The placement of limits is not perfect, the lower limit should
>be backspaced a bit.
>
>\[\pvint\limits_a^b f(t)\,dt\]
Thank you very much. This looks good for the given test cases.
Wolfgang
[quote]
! Undefined control sequence.
<argument> \hbox to\wd \z
@ {\hss $-$\hss }
l.348 \dashint{\limits_{-x}^\infty }
\frac{e^{-t}}{t}\:dt =
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
@
l.348 \dashint{\limits_{-x}^\infty }
\frac{e^{-t}}{t}\:dt =
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Missing { inserted.
<to be read again>
@
l.348 \dashint{\limits_{-x}^\infty }
\frac{e^{-t}}{t}\:dt =
A left brace was mandatory here, so I've put one in.
You might want to delete and/or insert some corrections
so that I will find a matching right brace soon.
(If you're confused by all this, try typing `I}' now.)
[/quote]
There are more messages for the first line \dashint line. As already
said I am new to this, and if you say
>I can't see how to measure with the limits unless the limits are
>given as an argument to \dashint:
I would naively assume that the definition \def\dashint{\Xint-}
should reflect your intent sowehow, but I cannot see how?
Thank you
Wolfgang
> Unfortunately I cannot run your code without producing a lot of error
> messages, starting with (from the log file):
>
> [quote]
> ! Undefined control sequence.
> <argument> \hbox to\wd \z
> @ {\hss $-$\hss }
> l.348 \dashint{\limits_{-x}^\infty }
> \frac{e^{-t}}{t}\:dt =
\makeatletter before the original definition, \makeatother after it.
(\z@ is a latex internal token signifying "0", and \makeatletter puts
you into a "latex internal" sort of state).
Unless you say \z@ =\p@ in which case funny things happen ;-)
>I am new to Latex and I want to write a text which includes among
>others the Cauchy principal value integrals for Ei(x).
The overwhelming majority of papers I have read use some
variation of
\newcommand{\pvint}{\mathop{\mathrm PV}\!\int}
Simple and easy. I would use it.
Also, the integral sign with a dash through it is
overwhelmingly used for the integral average, not the
principle value integral. (I detest this symbol. In
handwriting it looks far too much like an "f").
Dan
To reply by email, change LookInSig to luecking