Italics in math equations

75 views
Skip to first unread message

Björn Dahlgren

unread,
May 24, 2016, 5:09:09 AM5/24/16
to sympy
I was recently made aware that only variables should be in italics in equations (see e.g. [1], [2], [3]).
I never really reflected over the distinction, but now it seems obvious. Should we make LaTeX output of SymPy follow this?

e.g. change:

>>> x = sympy.Symbol('x')
>>> print(sympy.latex(sympy.Integral(x, x)))
\int x\, dx

to:

>>> x = sympy.Symbol('x')
>>> print(sympy.latex(sympy.Integral(x, x)))
\int x\, \mathrm{d}x


what do you think?

Best regards,
Björn

Kalevi Suominen

unread,
May 24, 2016, 7:32:25 AM5/24/16
to sympy

I have always disliked the trend to interpret the single letter d in dx (with no space between d and x) as an 'operator' comparable to sin, cos, etc. (with a space between sin and its argument). The result is typographically displeasing.
I prefer to consider the d as paired with the integral sign. In other words, if the integral sign is slanted, so should be d.

Ondřej Čertík

unread,
May 24, 2016, 8:16:13 AM5/24/16
to sympy
Hi Björn,
Indeed, I always define

\def\d{{\rm d}}

and use as:

\d x

(I guess I should rather use the Latex's style \mathrm, as you did,
but that's minor.)

So I am in fact following this rule, but I didn't realize that the
rule is as simple as "only variables should be in italics", but it
does make sense.

Regarding "dx", there are two styles in typesetting, and I've seen
lots of textbooks in the U.S. to type "d" in italics. Also some people
prefer that, as Kalevi wrote above.

As such, I think the solution is to add an option to the printer so
that the user can choose which style he or she prefers.

Ondrej

Aaron Meurer

unread,
May 24, 2016, 1:03:42 PM5/24/16
to sy...@googlegroups.com
I remember discussing this once in an issue (I can't find it right
now). We decided to use dx with no roman type, which is what is done
now. I can't remember what the reason for the decision was, although
I do recall that I personally prefer using dx with no roman type, as
the roman d to me looks bad and out of place.

I also disagree that only variables should be italics is a hard and
fast rule. This is just some people's opinion, which they've stated as
a universal rule. But if you look for instance at Wikipedia, at
https://en.wikipedia.org/wiki/Integral and
https://en.wikipedia.org/wiki/Derivative the d is always typeset in
italics (see https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Mathematics#Roman_versus_italic).
The rule for this varies between disciplines. Some use a roman d and
some don't. I wouldn't be opposed to adding an option for this,
although I think that the italics d should remain the default.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CADDwiVCseDMagGt4sGsV1PpecTA2Xx7uyV5dWNeV5nxP_ps6Fw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages