I followed advice from here to add a symbol from MnSymbol to my document, and while the symbol appears the spacing is bad. In fact I have to use \mathchoice to get different integrals in text mode and in display mode, so I need \mathchoice but the spacing is bad. Here is the code:
\documentclass[12pt]{article}
\DeclareFontFamily{U} {MnSymbolF}{}
\DeclareFontShape{U}{MnSymbolF}{m}{n}{
<-6> MnSymbolF5
<6-7> MnSymbolF6
<7-8> MnSymbolF7
<8-9> MnSymbolF8
<9-10> MnSymbolF9
<10-12> MnSymbolF10
<12-> MnSymbolF12}{}
\DeclareFontShape{U}{MnSymbolF}{b}{n}{
<-6> MnSymbolF-Bold5
<6-7> MnSymbolF-Bold6
<7-8> MnSymbolF-Bold7
<8-9> MnSymbolF-Bold8
<9-10> MnSymbolF-Bold9
<10-12> MnSymbolF-Bold10
<12-> MnSymbolF-Bold12}{}
\DeclareSymbolFont{MnSyF} {U} {MnSymbolF}{m}{n}
\DeclareMathSymbol{\tstrokedint}{\mathbin}{MnSyF}{"60}
\DeclareMathSymbol{\dstrokedint}{\mathbin}{MnSyF}{"61}
\def\strokedint{\mathchoice{\dstrokedint}{\tstrokedint}{\tstrokedint}{\tstrokedint}}
\begin{document}
$\strokedint_D$ $\tstrokedint_D$ $\dstrokedint_D$
$$\strokedint_D$$
\end{document}
and here is the output:
The red arrows show the bad spacing (with \mathchoice) and the green arrows show the correct spacing (accessing the symbol directly, without \mathchoice).
Does somebody know how to have both \mathchoice and correct spacing?


\[…\]preferable to$$? :) – Werner May 24 '23 at 23:40\left\rightdelimiters, the tex side has no knowledge a different glyph is used, they are chained together in the tfm tables, so the second glyph can be anywhere in the encoding – David Carlisle May 25 '23 at 07:56