1

I'd like to know how you prefer to typeset integrals. As you see in the following minimal working example I've made the space between the integral symbol \int and the integrand a little bit smaller and added some space between the integrand and the differential dx. What's the commonly prefered way to typeset an integral? It would be nice to hear different opinions because I'm looking for a way to set it in my bachelor thesis.

MWE:

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{lmodern}

\newcommand{\IntI}[2]{\int_{#1}^{#2} \!}
\newcommand{\Int}{\int \!}
\newcommand{\D}{\, d}

\begin{document}
\begin{align*}
\Int x^2 \D x \\
\IntI{0}{1} \sin x \D x
\end{align*}
\end{document}
Conny
  • 55
  • A better definition for the differential symbol (borrowed from @egreg) would be \newcommand*{\D}{\mathop{}\!\mathrm{d}}. – Bernard Sep 20 '17 at 16:13
  • It's definitely considered good form to insert a thinspace between the integrand and the "dx" (or "dy", "du", ...) part. Whether one should typeset the "d" in "dx" with an upright-roman or an italic letter is a subject over which mathematicians and physicists seem to argue endlessly, with neither side ever managing to declare victory or being willing to concede defeat. Many writers (but certainly not all) reduce the amount of whitespace between the integral symbol and the integrand (via \!, as you do) if the material is typeset in display-math mode, but not if it's in inline-math mode. – Mico Sep 20 '17 at 17:08
  • @Bernard I didn't unterstand what \mathop{} does. What's the advantage of your definition for \D? – Conny Sep 21 '17 at 09:50
  • @Mico Because I'm writing my thesis in mathematics I think the italic letter "d" is for me the better choice. One more question: Is there a way to introduce something like a "if display-math mode than reduce amount of whitespace, else let the whitespace unchanged" in the preamble? Since my thesis does already contain 40 pages I don't want to change the \Int and \IntI everywhere. – Conny Sep 21 '17 at 09:55
  • If I remember well (no time to check now), it adds some kerning between the differential symbol and the variable. B.t.w. I'm a mathematician, and I use an upright d. – Bernard Sep 21 '17 at 09:55
  • @Bernard Thanks for the answer! What does "kerning" mean in this context? – Conny Sep 21 '17 at 09:56
  • It adds a very thin space (less than \,). – Bernard Sep 21 '17 at 09:57
  • @Bernard Would you still remove some whitespace between the integral symbol and the integrand? – Conny Sep 21 '17 at 10:24
  • I think \! as you did is fine in general, but this may depend on the actual integral. For instance, if you have a wide subscript, it may be useful to write \int_{\mathrlap{subscript}}: \mathrlap is defined in mathtools and makes the subscript to have 0 width, so the integrand is much closer to the integral sign. – Bernard Sep 21 '17 at 10:36
  • I don't have really wide subscripts but I'll keep this in mind. The question I asked @Mico remains. Do you know how to manage such a "if-else-condition" (see the comment at Mico). I have to submit a beta version of my thesis this evening and would be very happy if it is possible to deal with the problem in the preamble without changing anything in the document itself... – Conny Sep 21 '17 at 12:57

0 Answers0