# Setting new command in LaTeX for the differential [duplicate]

I am writing a document in LaTeX and since I use quite often the command ${\rm d}$ for inserting the differential in the integrals , I decided to make a new command and insert in the preamble.

I wrote it as: \newcommand{\d}{d} but it does not compile. It say "your command has been ignored. What am I doing wrong here? How can I insert the command to work properly ?

## marked as duplicate by egreg macros StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); May 10 '15 at 12:27

• Related: tex.stackexchange.com/q/14821/14757 or tex.stackexchange.com/q/178946/14757 or search for differential here in TEX.SE. – Sigur May 10 '15 at 11:50
• Please have a look at packages like physics or skamth or ... – Johannes_B May 10 '15 at 11:50
• you probably got the error ! LaTeX Error: Command \d already defined. \d is one of the "predefined" accent commands. it's not a good idea to try to redefine it. – barbara beeton May 10 '15 at 12:11
• @barbarabeeton I did not know that. Anyway, thanks for the links. I'll check them out. It is that I do not use commands that often, expect for defing new theorems of new definitions or lemmas etc. – Tolaso May 10 '15 at 12:17

May I suggest

\newcommand{\dee}{\mathop{\mathrm{d}\!}}


to be used as follows:

\int_0^1 x\dee x = \frac{1}{2}

• It is a good command. Also the links given above helped me declare a new command. Thank you! – Tolaso May 10 '15 at 12:19
• @Tolaso No, it isn't good. Try $\frac{\dee y}{\dee x}$ to know why. – egreg May 10 '15 at 12:28
• @Tolaso - I've posted an improved version of the \dee macro, which should pass egreg's muster. :-) – Mico May 10 '15 at 14:31
• @egreg Ohh... I did not try that. Thanks for the observation. – Tolaso May 10 '15 at 19:07