Disclaimer: Writing is a holistic art, not an algorithm. Any answer offering suggestions on how to write is necessarily subjective. The items below are scattered observations and opinions, possibly debatable or provocative. Originally this was to be community-wiki. As the list took shape, I decided it's sufficiently personal that non-CW is preferable.
"Writing well" is a practice, not a destination. Compiling and following a list of "good habits" does not of itself result in "good writing." An author must also study existing writing to analyze its effectiveness. Most importantly, an author must write, and rewrite, and candidly critique their own writing.
Thanks: Multiple references at the end are included thanks to Jair Taylor's link to Tao's blog, which itself mentions other references.
Organization
- Mathematics is a metaphorical landscape. Statements are destinations, and proofs are trails. Some trails are short and steep, others are longer but paved. (Also, some are long and rocky, others are short and paved!) As an author, you are the reader's guide to the terrain. Enjoy sharing the spectacular views, but remember also to point out the protruding rock where people are prone to trip, the place where four identical-looking trails meet, the slippery spot where the stream crosses the trail. Use extra care when traversing the ledge with no railing.
- Human readers are not efficient at cognitive task-switching. Separate the steps, ideas, and techniques of a proof to allow the reader to focus on one item at a time. Use sentences and paragraphs to effect this level of organization.
- Human readers are not machines. We get tired, we forget, we skim when we should scan. Write accordingly. Highlight essential, subtle hypotheses. Emphasize the flow of reasoning. Include a judicious amount of expository error-correction.
- To the extent possible, organize proof logic to follow the same order as the prose.
- Especially in a long proof, give the reader short, orienting cues.
"We first establish existence. [Three paragraphs later.] This completes the proof of existence. [Paragraph break.] To prove uniqueness ...."
- If some calculation or logical idiom is used repeatedly in a proof, factor it out as a lemma. A lemma is to a proof what a subroutine is to an algorithm.
- Clearly separate examples from abstract reasoning.
Style
- Know your readership and write accordingly. (Similarly, know your audience and speak accordingly.)
- Invite the reader into a beautiful, compelling story without ingratiating. Develop material in a way that a reader can easily perceive the embodied beauty.
- Be direct. Say what is needed as simply as possible. Prefer shorter sentences to longer sentences.
- Prefer the active voice.
"We will prove every continuous function is integrable." (Active and direct.)
"It will be shown in the following theorem that every element of the set of continuous functions is an element of the set of integrable functions." (Passive and indirect.)
- In the active voice, referring to the author and the reader as "we" can create a sense of camaraderie.
- There is no harm in making the reader's life easier.
- Inversely, there is no benefit in making the reader's life harder. Mathematical prose should not be an access barrier a reader must overcome to prove their worthiness.
- Write parallel constructions serially. Avoid parentheticals and "respectively."
- Introduce notation before it is used.
"Let $f:M \to N$ be a local isometry, where $M$ (resp. $N$) is a Riemannian manifold with metric $g$ (resp. $h$) and we assume $g$ is complete (resp. $h$ has non-positive curvature)."
"Let $(M, g)$ be a complete Riemannian manifold, $(N, h)$ a Riemannian manifold with non-positive curvature, and let $f:(M, g) \to (N, h)$ be a local isometry."
- Be accurate even when being imprecise. The first example below is morally true ... to someone who already understands the technical details. The second is more literal and therefore less liable to cause confusion.
"A function $f$ is continuous at $x$ if at every nearby point $x'$, the value $f(x')$ is close to $f(x)$."
"A function $f$ is continuous at $x$ if we can make $f(x')$ as close to $f(x)$ as we like by taking $x'$ sufficiently close to $x$."
Write, wait, re-read, and revise. We all sometimes write sentences that mis-convey intentions, paragraphs that over-complicate, proofs with jumbled structure.
Do not say some piece of mathematics is beautiful and move on. Substantively convey the beauty to the reader, ideally in a compelling manner the reader can directly apprehend so that authorly exhortations of beauty are superfluous.
Avoid writing "obviously," "clearly," "everyone knows," and "as you should have learned in calculus." Each phrase is micro-aggressive, implicitly judging readers for whom the point was not obvious or clear or known. Cumulatively, this excludes and eventually alienates valuable prospective contributors to the subject. (I'm dispelling this ingrained habit only now, after nearly four decades of university/college teaching.)
"The function $f$ is obviously integrable because it is continuous."
"The function $f$ is integrable because it is continuous."
- Avoid pronouns. If you aren't sure what noun "it" refers to, there is an important detail you don't understand.
"If $f$ is continuous and $F(x) = \int_{a}^{x} f(t)\, dt$, it is integrable because it is continuous."
- Avoid making wry quips about specific disciplines, people who work in them, and how they conceptualize or what standards are used. Over time these cultivate disdain for "others."
- That said, a good-natured joke can be illustrative and memorable. Some favorite punch lines:
The mathematician drips water on the fire's edge, says "A solution exists," and goes back to bed.
The mathematician says, "No, we know one of these hundred sheep is black on one side."
The mathematician muses, "If one person goes into the house, it will be empty again."
Notation
- Choose notation to enhance clarity and readability, in parallel with concepts.
- Choose notation according to conventions of the field and the reader's expectations.
- LaTeX grants bewildering typographical power. Do not use this power heedlessly.
- In ordinary prose, write out "for every," "there exist," "implies," "therefore," "if and only if," etc., instead of using symbols or abbreviations. Generally, do not make a goal of being terse.
- Relation symbols are verb phrases, not prepositions. For example:
$$
\begin{array}{cl|cl}
= &\text{equals/is equal to} & \neq & \text{is not equal to} \\
< &\text{is less than} & > & \text{is greater than} \\
\in & \text{is an element of} & \subset & \text{is a subset of/is contained in}
\end{array}
$$
Read mathematical prose with the verbs expanded to check that it sounds grammatical.
Many people write $\in$ for in, but strictly "for all $x \in A$" reads "for all $x$ is an element of $A$."
It's common to see, e.g., "let $x < y$ be real numbers," which reads "let $x$ is less than $y$ be real numbers." In a final draft, write out, "Let $x$ and $y$ be real numbers such that $x < y$...."
- Use Latin abbreviations with care:
$$
\begin{array}{cll}
\text{Abbreviation} & \text{Means} & \text{Latin} \\
\hline
\text{i.e.} & \text{that is} & \textit{id est} \\
\text{e.g.} & \text{for example} & \textit{exempli gratia} \\
\text{cf.} & \text{compare} & \textit{confer}
\end{array}
$$
Particularly, confer is one word (not c.f.), and it does not originally mean see.
- In light of the preceding two points, this is as good a place as any to note the tension between Obeying the Rules of Grammar and Usage, and Letting Language Evolve as it Naturally Does such as by letting common usage ("$\in$" for in, or "cf." for see) guide meaning. On the one hand, "rules" establish useful conventions, and mathematical prose has a particularly high need for precision. On the other, language and culture change over time, and what was once clear becomes difficult to read and understand. As already noted, human authors and readers are not machines. Meaning is not conveyed solely by symbols or words or sentences, but by subtle emotional associations and expectations. All authors strike a balance in the moment, and somehow communication happens.
LaTeX Usage
- Centralize presentational code, which describes how the document will appear, in the preamble. Use macros
- To code for flexibility.
- To match code syntax to semantics.
\newcommand{\Number}[1]{\mathbf{#1}}
\newcommand{\Reals}{\Number{R}}
\newcommand{\Ratio}{\Number{Q}}
\newcommand{\Vec}[1]{\mathbf{#1}} % Same typographical effect, different meaning, e.g.,
% Let $\Vec{v}$ be an element of $\Reals^{n}$.
- Study and use the
amsmath
package.
- Do not hard-code widths to achieve alignment. If the
amsmath
package cannot easily align some construct, use a macro that measures its contents, e.g.
\newlength{\TmpLen}
\newcommand{\PadTo}[3][c]{%
\settowidth{\TmpLen}{$#2$}%
\makebox[\TmpLen][#1]{$#3$}%
}
% Usage: \PadTo[l]{a_{k} \cos(2\pi kx)}{a_{0}} typesets $a_{0}$
% left-aligned in a box as wide as $a_{k} \cos(2\pi kx)$
- A document body should contain no commands that explicitly set the font (except possibly individual instances), and very few that explicitly introduce spacing.
- Use braces around macro arguments, even if (La)TeX does not require them. Your future self, who needs to do regular-expression search-and-replace or otherwise parse source files, will thank you.
- Use line breaks and indentation in a source file to improve human readability.
Would you rather find and fix typos in this:
\ba\lim_{n\to\infty}\left(1+\frac xn\right)^n&=\lim_{h\to0^+}\left(1+
xh\right)^{1/h} \\&=\lim_{h\to0^+}\exp\left[\frac1h\log(1+xh)\right] \\
or this:
\begin{align*}
\lim_{n \to \infty} \left(1 + \frac{x}{n} \right)^{n}
&= \lim_{h \to 0^{+}} (1 + xh)^{1/h} \\
&= \lim_{h \to 0^{+}} \exp\left[\frac{1}{h} \log(1 + xh)\right] \\
Further Reading
that/which
frequently non-trivially conveys a different meaning than intended. – ryang May 24 '22 at 13:10