Partial derivative command with Deltas in line
I would like to create a new command for partial derivatives. I have something like this in mind:
newcommand{deriv}[2]{frac{partial #1}{partial #2}}
However, the partial
commands are unfortunately not horizontally aligned, if I have e.g something like:
deriv{x^alpha}{t},
i.e. if argument #1
has a wider horizontal extent as argument #2
. How can I enforce that the partial
commands are always horizontally aligned?
math-mode horizontal-alignment
add a comment |
I would like to create a new command for partial derivatives. I have something like this in mind:
newcommand{deriv}[2]{frac{partial #1}{partial #2}}
However, the partial
commands are unfortunately not horizontally aligned, if I have e.g something like:
deriv{x^alpha}{t},
i.e. if argument #1
has a wider horizontal extent as argument #2
. How can I enforce that the partial
commands are always horizontally aligned?
math-mode horizontal-alignment
1
I am pretty sure, the usual suspects will show up withesdiff
solutions etc. ;-)
– Christian Hupfer
Jul 29 '17 at 21:49
@egreg I want a horizontal slash, accordingly/
does not suit well for me.
– DonkeyKong
Jul 29 '17 at 22:06
2
Like @JohnKormylo, I suspect that, when you say “in line”, you actually mean “vertically aligned” (like what you would get from, say,newcommand*{deriv}[2]{frac{partial #1}{partial #2hfill}}
).
– GuM
Jul 29 '17 at 22:41
2
@GuM - You could add another hfill to the top, just in case.
– John Kormylo
Jul 29 '17 at 22:46
add a comment |
I would like to create a new command for partial derivatives. I have something like this in mind:
newcommand{deriv}[2]{frac{partial #1}{partial #2}}
However, the partial
commands are unfortunately not horizontally aligned, if I have e.g something like:
deriv{x^alpha}{t},
i.e. if argument #1
has a wider horizontal extent as argument #2
. How can I enforce that the partial
commands are always horizontally aligned?
math-mode horizontal-alignment
I would like to create a new command for partial derivatives. I have something like this in mind:
newcommand{deriv}[2]{frac{partial #1}{partial #2}}
However, the partial
commands are unfortunately not horizontally aligned, if I have e.g something like:
deriv{x^alpha}{t},
i.e. if argument #1
has a wider horizontal extent as argument #2
. How can I enforce that the partial
commands are always horizontally aligned?
math-mode horizontal-alignment
math-mode horizontal-alignment
edited Jul 30 '17 at 12:55
Werner
446k699871692
446k699871692
asked Jul 29 '17 at 21:27
DonkeyKongDonkeyKong
587
587
1
I am pretty sure, the usual suspects will show up withesdiff
solutions etc. ;-)
– Christian Hupfer
Jul 29 '17 at 21:49
@egreg I want a horizontal slash, accordingly/
does not suit well for me.
– DonkeyKong
Jul 29 '17 at 22:06
2
Like @JohnKormylo, I suspect that, when you say “in line”, you actually mean “vertically aligned” (like what you would get from, say,newcommand*{deriv}[2]{frac{partial #1}{partial #2hfill}}
).
– GuM
Jul 29 '17 at 22:41
2
@GuM - You could add another hfill to the top, just in case.
– John Kormylo
Jul 29 '17 at 22:46
add a comment |
1
I am pretty sure, the usual suspects will show up withesdiff
solutions etc. ;-)
– Christian Hupfer
Jul 29 '17 at 21:49
@egreg I want a horizontal slash, accordingly/
does not suit well for me.
– DonkeyKong
Jul 29 '17 at 22:06
2
Like @JohnKormylo, I suspect that, when you say “in line”, you actually mean “vertically aligned” (like what you would get from, say,newcommand*{deriv}[2]{frac{partial #1}{partial #2hfill}}
).
– GuM
Jul 29 '17 at 22:41
2
@GuM - You could add another hfill to the top, just in case.
– John Kormylo
Jul 29 '17 at 22:46
1
1
I am pretty sure, the usual suspects will show up with
esdiff
solutions etc. ;-)– Christian Hupfer
Jul 29 '17 at 21:49
I am pretty sure, the usual suspects will show up with
esdiff
solutions etc. ;-)– Christian Hupfer
Jul 29 '17 at 21:49
@egreg I want a horizontal slash, accordingly
/
does not suit well for me.– DonkeyKong
Jul 29 '17 at 22:06
@egreg I want a horizontal slash, accordingly
/
does not suit well for me.– DonkeyKong
Jul 29 '17 at 22:06
2
2
Like @JohnKormylo, I suspect that, when you say “in line”, you actually mean “vertically aligned” (like what you would get from, say,
newcommand*{deriv}[2]{frac{partial #1}{partial #2hfill}}
).– GuM
Jul 29 '17 at 22:41
Like @JohnKormylo, I suspect that, when you say “in line”, you actually mean “vertically aligned” (like what you would get from, say,
newcommand*{deriv}[2]{frac{partial #1}{partial #2hfill}}
).– GuM
Jul 29 '17 at 22:41
2
2
@GuM - You could add another hfill to the top, just in case.
– John Kormylo
Jul 29 '17 at 22:46
@GuM - You could add another hfill to the top, just in case.
– John Kormylo
Jul 29 '17 at 22:46
add a comment |
2 Answers
2
active
oldest
votes
Set the numerator and denominator in a box of similar width and ensure they are both [l]
eft-aligned. This is easily done using eqparbox
and automated below to allow for any number of deriv
s (using a counter).
documentclass{article}
usepackage{eqparbox}
newcounter{derivcnt}
newcommand{deriv}[2]{%
stepcounter{derivcnt}%
frac
{eqmakebox[deriv-thederivcnt][l]{$partial #1$}}
{eqmakebox[deriv-thederivcnt][l]{$partial #2$}}}
begin{document}
[
deriv{a}{b} + deriv{abc}{d} - deriv{a}{bcd}
]
end{document}
Since this approach uses the .aux
files to store the lengths of the boxes, multiple compilations are required with every change in the deriv
content.
add a comment |
You can check the diffcoeff
package. It has many ready to use commands for a variety of differential operators
documentclass{article}
usepackage{amsmath}
usepackage{diffcoeff}
begin{document}
[ diff{y}{x} , diffp[2]{f}{t} , diffp{f}{x,y} ]
end{document}
I don't know this package, but I think it's not correctly made. For 2nd partial on should use different spacing like $partial^2!f$
– Jan Filip
Jul 30 '17 at 13:14
You are right I know what you mean. I don't think it will work like this.
– mac
Jul 30 '17 at 13:25
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f383913%2fpartial-derivative-command-with-deltas-in-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Set the numerator and denominator in a box of similar width and ensure they are both [l]
eft-aligned. This is easily done using eqparbox
and automated below to allow for any number of deriv
s (using a counter).
documentclass{article}
usepackage{eqparbox}
newcounter{derivcnt}
newcommand{deriv}[2]{%
stepcounter{derivcnt}%
frac
{eqmakebox[deriv-thederivcnt][l]{$partial #1$}}
{eqmakebox[deriv-thederivcnt][l]{$partial #2$}}}
begin{document}
[
deriv{a}{b} + deriv{abc}{d} - deriv{a}{bcd}
]
end{document}
Since this approach uses the .aux
files to store the lengths of the boxes, multiple compilations are required with every change in the deriv
content.
add a comment |
Set the numerator and denominator in a box of similar width and ensure they are both [l]
eft-aligned. This is easily done using eqparbox
and automated below to allow for any number of deriv
s (using a counter).
documentclass{article}
usepackage{eqparbox}
newcounter{derivcnt}
newcommand{deriv}[2]{%
stepcounter{derivcnt}%
frac
{eqmakebox[deriv-thederivcnt][l]{$partial #1$}}
{eqmakebox[deriv-thederivcnt][l]{$partial #2$}}}
begin{document}
[
deriv{a}{b} + deriv{abc}{d} - deriv{a}{bcd}
]
end{document}
Since this approach uses the .aux
files to store the lengths of the boxes, multiple compilations are required with every change in the deriv
content.
add a comment |
Set the numerator and denominator in a box of similar width and ensure they are both [l]
eft-aligned. This is easily done using eqparbox
and automated below to allow for any number of deriv
s (using a counter).
documentclass{article}
usepackage{eqparbox}
newcounter{derivcnt}
newcommand{deriv}[2]{%
stepcounter{derivcnt}%
frac
{eqmakebox[deriv-thederivcnt][l]{$partial #1$}}
{eqmakebox[deriv-thederivcnt][l]{$partial #2$}}}
begin{document}
[
deriv{a}{b} + deriv{abc}{d} - deriv{a}{bcd}
]
end{document}
Since this approach uses the .aux
files to store the lengths of the boxes, multiple compilations are required with every change in the deriv
content.
Set the numerator and denominator in a box of similar width and ensure they are both [l]
eft-aligned. This is easily done using eqparbox
and automated below to allow for any number of deriv
s (using a counter).
documentclass{article}
usepackage{eqparbox}
newcounter{derivcnt}
newcommand{deriv}[2]{%
stepcounter{derivcnt}%
frac
{eqmakebox[deriv-thederivcnt][l]{$partial #1$}}
{eqmakebox[deriv-thederivcnt][l]{$partial #2$}}}
begin{document}
[
deriv{a}{b} + deriv{abc}{d} - deriv{a}{bcd}
]
end{document}
Since this approach uses the .aux
files to store the lengths of the boxes, multiple compilations are required with every change in the deriv
content.
answered Jul 30 '17 at 13:00
WernerWerner
446k699871692
446k699871692
add a comment |
add a comment |
You can check the diffcoeff
package. It has many ready to use commands for a variety of differential operators
documentclass{article}
usepackage{amsmath}
usepackage{diffcoeff}
begin{document}
[ diff{y}{x} , diffp[2]{f}{t} , diffp{f}{x,y} ]
end{document}
I don't know this package, but I think it's not correctly made. For 2nd partial on should use different spacing like $partial^2!f$
– Jan Filip
Jul 30 '17 at 13:14
You are right I know what you mean. I don't think it will work like this.
– mac
Jul 30 '17 at 13:25
add a comment |
You can check the diffcoeff
package. It has many ready to use commands for a variety of differential operators
documentclass{article}
usepackage{amsmath}
usepackage{diffcoeff}
begin{document}
[ diff{y}{x} , diffp[2]{f}{t} , diffp{f}{x,y} ]
end{document}
I don't know this package, but I think it's not correctly made. For 2nd partial on should use different spacing like $partial^2!f$
– Jan Filip
Jul 30 '17 at 13:14
You are right I know what you mean. I don't think it will work like this.
– mac
Jul 30 '17 at 13:25
add a comment |
You can check the diffcoeff
package. It has many ready to use commands for a variety of differential operators
documentclass{article}
usepackage{amsmath}
usepackage{diffcoeff}
begin{document}
[ diff{y}{x} , diffp[2]{f}{t} , diffp{f}{x,y} ]
end{document}
You can check the diffcoeff
package. It has many ready to use commands for a variety of differential operators
documentclass{article}
usepackage{amsmath}
usepackage{diffcoeff}
begin{document}
[ diff{y}{x} , diffp[2]{f}{t} , diffp{f}{x,y} ]
end{document}
edited 14 mins ago
quark67
19615
19615
answered Jul 30 '17 at 13:00
macmac
695716
695716
I don't know this package, but I think it's not correctly made. For 2nd partial on should use different spacing like $partial^2!f$
– Jan Filip
Jul 30 '17 at 13:14
You are right I know what you mean. I don't think it will work like this.
– mac
Jul 30 '17 at 13:25
add a comment |
I don't know this package, but I think it's not correctly made. For 2nd partial on should use different spacing like $partial^2!f$
– Jan Filip
Jul 30 '17 at 13:14
You are right I know what you mean. I don't think it will work like this.
– mac
Jul 30 '17 at 13:25
I don't know this package, but I think it's not correctly made. For 2nd partial on should use different spacing like $partial^2!f$
– Jan Filip
Jul 30 '17 at 13:14
I don't know this package, but I think it's not correctly made. For 2nd partial on should use different spacing like $partial^2!f$
– Jan Filip
Jul 30 '17 at 13:14
You are right I know what you mean. I don't think it will work like this.
– mac
Jul 30 '17 at 13:25
You are right I know what you mean. I don't think it will work like this.
– mac
Jul 30 '17 at 13:25
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f383913%2fpartial-derivative-command-with-deltas-in-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I am pretty sure, the usual suspects will show up with
esdiff
solutions etc. ;-)– Christian Hupfer
Jul 29 '17 at 21:49
@egreg I want a horizontal slash, accordingly
/
does not suit well for me.– DonkeyKong
Jul 29 '17 at 22:06
2
Like @JohnKormylo, I suspect that, when you say “in line”, you actually mean “vertically aligned” (like what you would get from, say,
newcommand*{deriv}[2]{frac{partial #1}{partial #2hfill}}
).– GuM
Jul 29 '17 at 22:41
2
@GuM - You could add another hfill to the top, just in case.
– John Kormylo
Jul 29 '17 at 22:46