0

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:

enter image description here

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?

yannis
  • 2,013
  • 19
  • 18

1 Answers1

1

If you declare it as \mathop the larger size will be found via the font metrics and you don't need \mathchoice

enter image description here

\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{\strokedintop}{\mathop}{MnSyF}{"60}

\def\strokedint{\strokedintop\nolimits}

\begin{document}

$\strokedint_D$ $\strokedint_D$ $\displaystyle\strokedint_D$

$$\strokedint_D$$

\end{document}

David Carlisle
  • 757,742