sjelatex / derivative

Nice and easy derivatives for LaTeX
LaTeX Project Public License v1.3c
24 stars 3 forks source link

How to define derivatives with 2 symbols? #17

Open Firestar-Reimu opened 3 months ago

Firestar-Reimu commented 3 months ago
\DeclareDerivative{\pdv}{\partial}[style-var=multiple, style-var-/=multiple,
style-var-!=mixed, style-var-/!=multiple, delims-eval=(), delims-eval-/=(),
delims-eval-!=()]

this only can define \frac{symbol_1}{symbol_1}, but how to define derivatives like \frac{symbol_1}{symbol_2}

for example: Cosmological Physics -- J. A. Peacock

image

sjelatex commented 3 months ago

The keys style-inf-num and style-inf-den sets the symbol of the differential d in the numerator and denominator, respectively. So this should do the trick:

\DeclareDerivative{\cdv}{\partial}[style-inf-num=D, style-inf-den=\partial, style-var=multiple, style-var-/=multiple,
style-var-!=mixed, style-var-/!=multiple, delims-eval=(), delims-eval-/=(),
delims-eval-!=()]
Firestar-Reimu commented 3 months ago
\documentclass{article}
\usepackage{amsmath}
\usepackage{derivative}
\DeclareDerivative{\cdv}{\partial}[style-inf-num=D, style-inf-den=\partial, style-var=multiple, style-var-/=multiple,style-var-!=mixed, style-var-/!=multiple, delims-eval=(), delims-eval-/=(),
delims-eval-!=()]

\begin{document}
\[
\cdv{V}{x}
\]
\end{document}

No, this returns:

image

But \pdv[style-inf-num=D]{V}{x} is able to produce:

image

sjelatex commented 3 months ago

Then that must be a bug. I will have to look into that. Got a new pc recently, so I have to install TexLive again...

For the time being I suggest you use

\derivset{\pdv}[style-inf-num=D]

That should work. In the mean time I will work on an update.

EDIT: This doesn't work either. This mystery deepens.