6

When compiling:

\documentclass{article}
\usepackage{derivative}


\begin{document}
    \noindent
    \[\pdv{P}{r}\]
    \[\pdv{T}{r}\]
    \[\pdv{X}{r}\]
\end{document}

one gets:

enter image description here

where it is clear that the T get spaced or kerned differently than the other letters. I would like to ensure the P and the X are also kerned/spaced like the T in this example.

I believe I can insert \! spacings, but that can quickly become a nuisance if I decide to change font (where the kerning happens correctly somehow), or if derivative updates to address this issue.

edit: egreg's corrections

5
  • 4
    Welcome! Please, don't use minimal for examples, but rather article. Note also that $$ should never be used in a LaTeX document environment.
    – egreg
    Commented Jan 2 at 10:18
  • I read that one should use \partial\, y in the numerator and \partial x in the denomiator. It appears \pdv does that automatically. Commented Jan 2 at 16:46
  • You could use \pdv[sep-inf-fun=1]{T}{r} or \pdv{\mkern1mu T}{r} as they result in the same code. For a higher order derivative you would need to use sep-ord-fun=1 instead.
    – Simon
    Commented Jan 4 at 6:28
  • Thanks for this. Personally, I'm more of a fan of reducing the spacing in the letters other than the T. Or is the philosophy to let d/dt act as an operator (like \log), meriting the space?
    – Matthias
    Commented Jan 4 at 9:12
  • The package default of \odv{y}{x} is reducing to \frac{dy}{dx} without adding or removing any spacing, same for \pdv but with \partial instead of d. What you see is the default kerning between those characters. The package was made to give a simple and flexible way to consistently write derivatives. The philosophy behind the package default is to reproduce "the standard notation" (or rather a consistent notation) without adding or removing any spacing.
    – Simon
    Commented Jan 4 at 18:57

1 Answer 1

7

This has nothing to do with derivative. Look at the bounding boxes of P and T from the math symbol font:

enter image description here

Perhaps Knuth should have added a kern between \partial and T. He didn't.

\documentclass{article}

\begin{document}

$\partial P$ $\partial T$

\setlength{\fboxsep}{0pt}
\setlength{\fboxrule}{0.1pt}

\fbox{\the\textfont1 P}
\fbox{\the\textfont1 T}

\end{document}

The tokens \the\textfont1 point to the symbol font.

2
  • 1
    Aha! Thanks for this analysis. Could I manually add a kern between the symbols \partial and P, or otherwise modify kerning uniformly over a whole document? IIRC, LuaLaTeX allows this directly in some way, but I'm using PdfLaTeX.
    – Matthias
    Commented Jan 2 at 14:37
  • @Matthias With \partial\mkern1mu T. I don't know what would happen with derivative.
    – egreg
    Commented Jan 2 at 14:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .