Hi Bernt, I’m not sure exactly how you want to use this in LyX. However, here are two options that spring to mind.
NB1: Both require you to add \usepackage{derivative} in your preamble.
NB2: According to my documentation the command is \pdv rather than \dv.
Option 1. Type your command in normal text mode, select it, and press
Ctrl-M (or Command-M) to turn it into a math object where required. AFAICT
this is the best option if you want to use any of the commands beyond the
simplest command format (e.g. the ! switch).
Option 2. You can create a math macro (see attached) which may or may not
be useful, where you can enter your values into the provided areas using
Tab to traverse to each space. You might find this slower than option 1.
The tricky part with option 1 is entering the {parameter} values when you
are already in a math box:
1. Enter the command \dv, press space
2. Type the optional parameter “[2]”
3. Press Ctrl-L to enter TeX code, and type “{“ to create the first
mandatory parameter
4. Type in the value and press space
5. Type Ctrl-L and “{” to create the second mandatory parameter, press
space
6. If you have Math preview enabled, it should generate a nice preview
when you exit the math box.
Your mileage may vary as to whether this is a worthwhile exercise, but at
least it might make your derivatives consistent.
An interesting diversion in any case 😀
Cheers
Shay
On Sun, 11 Jan 2026 at 15:14, Bernt Lie via lyx-users <
[email protected]> wrote:
> I am trying to use the "derivative" package to get consistent use of
> derivatives as operators, etc.
>
> I have *previously* written my own macro:
>
> \newcommand{\diff}{\mathrm{d}}
>
> To produce dx/dt = ..., I thus write: \frac + space + \diff + space + x +
> TAB + \diff + space + t + space = ...
>
> This is quite fast. But now I an trying to use the "derivative" package.
>
> My understanding is that to get
>
>
> with "derivative", I should be able to write:
>
> \dv[2]{x}{t} = f...
>
> Is there a way to make this work with LyX?
>
>
> --
> lyx-users mailing list
> [email protected]
> https://lists.lyx.org/mailman/listinfo/lyx-users
>
math_macro_test_derivative.lyx
Description: application/lyx
-- lyx-users mailing list [email protected] https://lists.lyx.org/mailman/listinfo/lyx-users
