0

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 ?

4
  • 1
    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, 2015 at 11:50
  • 1
    Please have a look at packages like physics or skamth or ...
    – Johannes_B
    May 10, 2015 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. May 10, 2015 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, 2015 at 12:17

1 Answer 1

2

May I suggest

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

to be used as follows:

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.