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?
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.
As a programmer, I find that spaces greatly improve readability, especially when looking at someone else’s code.
In professional publications, you will see a space (really a half-space) between common operators.
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.
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).
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.
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.
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.
You know what sucks? When writing “COBOL” as the reply to a post, the Board thinks you’re shouting.
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.)
For the record, it’s section 14.14, “Basic Spacing in Mathematics.”
Hiding it in plain sight - how devious of them