Group Abstract Group Abstract

Message Boards Message Boards

0
|
205 Views
|
4 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Partial derivative notation and output

Posted 11 days ago

Is there aglobal way to change the partial derivative notation in the output form to the "partial" symbol (instead of superscript braces form like in the picture).
I want to convert the output later to latex directly and this notation is not what i use in my document. thanks

Attachment

Attachments:
POSTED BY: dor gelem
4 Replies

I recall trying to do this, but in the end I gave up. I suppose you know the inherent ambiguity of expressions like ${\partial f \over \partial q} (t, t)$, and I suppose you avoid that in your work. Here's a way to do what you show:

Format[Derivative[1, 0][f_][a_, b_]] := HoldForm[D[f[a, b], x]];

TeXForm will use this FormatValue:

D[g[x, y], x]
% /. x -> 7 // TeXForm
(*
\!\(
\*SubscriptBox[\(\[PartialD]\), \(x\)]\(g[x, y]\)\)

\frac{\partial g(7,y)}{\partial x}
*)

First-order, higher-order and zero-order each usually get typeset differently. It's not clear whether you need only first-order derivative, or a way to handle all derivatives. As I said, I gave up on handling all derivatives.

POSTED BY: Michael Rogers
Posted 10 days ago

thanks ! i only need up to 2nd order so itll defenetliy do

POSTED BY: dor gelem
Posted 11 days ago

A bit of a roundabout way:

POSTED BY: Hans Milton
Posted 11 days ago

For a particular instance, you can use HoldForm:

HoldForm[D[f[x, y], x]]

For a "global" solution, you could probably use Format to define how you want Derivative to display in output cells (you could restrict it to TraditionalForm so you can choose when to see it and when to not).

But you might not need to do this at all if your concern is just exporting to TeX. I think TeXForm knows how to convert a Derivative expression to a "nice" TeX form.

You might also be interested in MaTeX:

https://resources.wolframcloud.com/FunctionRepository/resources/MaTeXInstall/

http://szhorvat.net/pelican/latex-typesetting-in-mathematica.html

https://github.com/szhorvat/MaTeX

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard