# Are spaces necessary between operators when we write a math formula?

**URL:** <https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646>\
**Category:** Factual Questions\
**Created:** [December 4, 2008, 8:47am UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646 "2008-12-04T08:47:08Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isamu](https://avatars.discourse-cdn.com/v4/letter/i/7c8e57/32.png) [@Isamu](https://boards.straightdope.com/u/Isamu)\
**Post date:** [December 4, 2008, 8:47am UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/1 "2008-12-04T08:47:08Z")

</div>

Professional Mathematicians/ Math Writers I ask for your help.

According to the dictates of your style guides, do we need spaces between operators when we write a formula?

i.e., x - y = z

Or can we exclude the spaces?

i.e., x-y=z

What does your style guide say (I can’t seem to find one on the net)?

What’s the rationale for having a preference of one over the other.

Thanks a lot for your help in this pretty trivial, but important to me right now (work wise), problem.

---

<div class="post-metadata">

**Author:** ![sturmhauke](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@sturmhauke](https://boards.straightdope.com/u/sturmhauke)\
**Post date:** [December 4, 2008, 8:53am UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/2 "2008-12-04T08:53:08Z")

</div>

As a programmer, I find that spaces greatly improve readability, especially when looking at someone else’s code.

---

<div class="post-metadata">

**Author:** ![nivlac](https://avatars.discourse-cdn.com/v4/letter/n/3bc359/32.png) [@nivlac](https://boards.straightdope.com/u/nivlac)\
**Post date:** [December 4, 2008, 8:56am UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/3 "2008-12-04T08:56:40Z")

</div>

In professional publications, you will see a space (really a half-space) between common operators.

---

<div class="post-metadata">

**Author:** ![Tim\_T-Bonham.net](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Tim\_T-Bonham.net](https://boards.straightdope.com/u/Tim_T-Bonham.net)\
**Post date:** [December 4, 2008, 9:03am UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/4 "2008-12-04T09:03:18Z")

</div>

In many programming languages, you do need the spaces to avoid ambiguity. “x-y” could be a variable, or it could be subtracting variable y from variable x.

---

<div class="post-metadata">

**Author:** ![RayMan](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@RayMan](https://boards.straightdope.com/u/RayMan)\
**Post date:** [December 4, 2008, 9:23am UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/5 "2008-12-04T09:23:02Z")

</div>

Most professionals in mathematics and the sciences use LaTeX when creating professional documents with mathematical formulae. LaTeX automatically includes a small amount of space around math symbols, which seems to be a fairly standard convention. Obviously, if you are coding, you would follow whatever convention exists (if there is one).

[LaTeX spacing](http://web.image.ufl.edu/help/latex/spacing.shtml)

---

<div class="post-metadata">

**Author:** ![MikeS](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@MikeS](https://boards.straightdope.com/u/MikeS)\
**Post date:** [December 4, 2008, 1:27pm UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/6 "2008-12-04T13:27:07Z")

</div>

The Chicago Manual of Style says the following (bolding mine):

> [@](#):
>
> An em space (or “quad”) is approximately the width of an em (or, again approximately, a capital M) in the font in use. In mathematical typesetting, a thick space is 5/18 of an em, a medium space is 2/9 of an em, and a thin space is 1/6 of an em. **Signs for binary operations are preceded and followed by medium spaces, and signs for binary relations are preceded and followed by thick spaces.** Signs for binary operations are not followed by a space when they are used to modify a symbol rather than combine two mathematical symbols or expressions [e.g. “-1 + x”, but “x - 1”.] No space is inserted before or after operation or relation signs in subscripts and superscripts.

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [December 4, 2008, 2:53pm UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/7 "2008-12-04T14:53:50Z")

</div>

> [@sturmhauke](#):
>
> As a programmer, I find that spaces greatly improve readability, especially when looking at someone else’s code.

- 1

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [December 4, 2008, 3:02pm UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/8 "2008-12-04T15:02:22Z")

</div>

> [@t-bonham@scc.net](#):
>
> In many programming languages, you do need the spaces to avoid ambiguity. “x-y” could be a variable, or it could be subtracting variable y from variable x.

Many? Name one. All programming languages I’m familiar with are lexed such that ‘x-y’, ‘x - y’, and ‘x -y’ become the same stream of tokens.

---

<div class="post-metadata">

**Author:** ![Isamu](https://avatars.discourse-cdn.com/v4/letter/i/7c8e57/32.png) [@Isamu](https://boards.straightdope.com/u/Isamu)\
**Post date:** [December 4, 2008, 3:03pm UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/9 "2008-12-04T15:03:12Z")

</div>

Thanks all. Spaces (medium and thick) it is.

You helped me out.

MikeS - I found that Chicago Manual of Style, and checked in the mathematics section but couldn’t find that part you quoted. My internet blindness must be acting up again.

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [December 4, 2008, 3:14pm UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/10 "2008-12-04T15:14:04Z")

</div>

> [@derleth](#):
>
> many? Name one. All programming languages i’m familiar with are lexed such that ‘x-y’, ‘x - y’, and ‘x -y’ become the same stream of tokens.

You know what sucks? When writing “COBOL” as the reply to a post, the Board thinks you’re shouting.

Anyway, COBOL.

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [December 4, 2008, 3:24pm UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/11 "2008-12-04T15:24:49Z")

</div>

> [@friedo](#):
>
> You know what sucks? When writing “COBOL” as the reply to a post, the Board thinks you’re shouting.
> 
> Anyway, COBOL.

Bah. I should have known. (The interesting thing is that old-fashioned FORTRAN worked precisely the opposite way: “DO 10 I = 1.10” (a typo for “DO 10 I = 1,10”, which begins a counted loop setting I from 1 to 10, inclusive) creates a variable DO10I and assigns it the value 1.10, because FORTRAN lexers ignored _all_ spaces outside of quoted strings.)

---

<div class="post-metadata">

**Author:** ![MikeS](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@MikeS](https://boards.straightdope.com/u/MikeS)\
**Post date:** [December 4, 2008, 3:57pm UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/12 "2008-12-04T15:57:02Z")

</div>

> [@Isamu](#):
>
> MikeS - I found that Chicago Manual of Style, and checked in the mathematics section but couldn’t find that part you quoted. My internet blindness must be acting up again.

For the record, it’s section 14.14, “Basic Spacing in Mathematics.”

---

<div class="post-metadata">

**Author:** ![Isamu](https://avatars.discourse-cdn.com/v4/letter/i/7c8e57/32.png) [@Isamu](https://boards.straightdope.com/u/Isamu)\
**Post date:** [December 4, 2008, 4:20pm UTC](https://boards.straightdope.com/t/are-spaces-necessary-between-operators-when-we-write-a-math-formula/475646/13 "2008-12-04T16:20:39Z")

</div>

> [@MikeS](#):
>
> For the record, it’s section 14.14, “Basic Spacing in Mathematics.”

Hiding it in plain sight - how devious of them 😛
