Markdown to Word with formulas

Chemical formulas, financial ratios and short expressions written inside sentences stay inside the sentence in Word, flowing and wrapping with the text without throwing off line spacing.

Pro · preview is free

Water treatment memo

Dissolving CaCO3 in water that already holds CO2 produces Ca(HCO3)2, and every litre of H2O treated this way raises hardness by about 12 mg/L.

The plant upgrade is worth doing if NPV=∑t=0TCt(1+r)t>0 at a discount rate r of 8%, which it is: the payback period Tp≈4.3 years falls inside the board's limit.

Prices such as $5 and $10 per unit are left alone, and $ prints a dollar sign.

Converted in your browser. Your file never leaves your device.
1

Write formulas in your sentences

Single dollar signs around a short expression. Currency amounts like $5 are detected and left as text.

2

Check the line spacing in the preview

Inline formulas are typeset compactly so lines with formulas are the same height as lines without.

3

Download and keep writing

In Word the formula is part of the paragraph. Type before it, after it, or click into it to edit.

How inline formulas flow with the text in Word

Word draws two kinds of equation. A display equation sits in its own paragraph, centred, with limits stacked above and below operators and fractions at full height. An inline equation lives inside a run of ordinary text and has to behave like a word: it wraps at the end of a line, it takes the paragraph's alignment, and, critically, it should not make its line taller than its neighbours. In OMML terms a display equation is an m:oMathPara containing m:oMath, while an inline formula is a bare m:oMath placed between w:r text runs inside the same w:p. MDtoDOCX writes single-dollar formulas the second way. That single choice is what makes the formula flow rather than break the paragraph in two, and it is what most converters get wrong by promoting everything to display. The other two math pages cover symbol coverage and numbered block equations; this one is about what happens inside a sentence.

Keeping line height stable

A stacked fraction is roughly twice the height of the surrounding text, and a sum with limits above and below is taller still. Inserted in the middle of a paragraph, either one pushes its line apart and produces the ragged spacing you see in badly converted reports. When a formula is inline, MDtoDOCX applies Word's own inline conventions: n-ary limits are written with m:limLoc set to subSup so they sit beside the operator, and fractions are written with m:type set to skw, the slanted form Word calls a skewed fraction, unless you wrote \dfrac to insist on the stacked version. Superscripts and subscripts are already compact. The result is a formula whose height is within the paragraph's normal line box, so spacing stays even through the whole page. In the preview the same rules are applied, which is why the memo sample above has equal line spacing despite containing a sum and a fraction.

Chemistry formulas and upright text

Word italicises single letters in equations because it assumes they are variables. For a chemical formula that is wrong: H₂O should be upright. MDtoDOCX detects element-symbol patterns, a capital letter optionally followed by one lowercase letter and a digit subscript, and writes them as upright runs with the m:nor flag, which is what Word does when you choose Normal Text in the equation editor. The result is H2O, upright and correctly subscripted, while r in the finance sentence stays italic because it is a variable. If you use the \ce{} notation from mhchem, the contents are treated the same way. Multi-letter identifiers such as NPV are also set upright, matching the convention in financial documents.

Dollar signs that are not math

Inline math and currency share a delimiter, and a memo that mentions prices must not turn $5 and $10 into an equation. The rule is CommonMark-compatible: an opening dollar must be followed immediately by a non-space character and the closing dollar must be preceded by a non-space character and not followed by a digit. $5 and $10 fails that test on both ends and is left as text. Writing \$ always produces a literal dollar sign. If your document is finance-heavy and never uses math, the option treat $ as currency disables inline math entirely.

Font matching

Formulas render in Cambria Math no matter which body font you choose, because that is the only math font Word ships and Word ignores font changes on math runs. Cambria Math is a serif, so an inline formula in a Calibri paragraph is visibly a different face. This is how Word itself behaves when you insert an equation, and readers are used to it. The formula's size follows the paragraph's font size, so a 12-point paragraph gets 12-point formulas.

Editing and Pro

In Word, click into an inline formula and the Equation tab appears. You can convert it to display with one click, change to linear form, or edit any symbol. Inline formulas are exported as native Word math objects; free users get the preview and the LaTeX source in the file, while Pro unlocks the download with the flowing equations. Formulas inside table cells follow the same inline rules. For full-line derivations use display math, described on the LaTeX to Word page.

Inline formulas in Word: MDtoDOCX vs Pandoc vs copy-paste

Inline behaviourMDtoDOCXPandocCopy into Word
Formula placementInside the text run, wraps with the sentenceInline m:oMathRaw dollar text
Line height with fractionsSkewed fractions, side limits, even spacingStacked, line growsn/a
Chemical formulas uprightAutomaticItalic unless mathrm is usedn/a
Currency detectionYes, $5 and $10 stay textYes, similar rulen/a
Convert inline to display in WordOne clickOne clickNot possible
Preview of spacingYesNon/a
InstallNonePandocNone

Frequently asked questions

Will an inline formula break my paragraph into pieces?
No. It is written as an inline math object between text runs in the same paragraph, so the sentence continues around it and wraps normally at line ends.
Why does the line not get taller when there is a fraction?
Inline fractions are exported in Word's skewed form and operator limits move to the side, keeping the formula within the normal line box. Write dfrac if you want a stacked fraction anyway.
Are chemical formulas italic?
No. Element symbols are detected and written as upright normal text, matching chemistry convention, while genuine variables remain italic.
What about dollar amounts in my text?
A dollar followed by a digit and then a space is currency, not a math delimiter. Backslash-dollar always prints a dollar sign, and an option can turn inline math off completely.
Can I change an inline formula to display in Word?
Yes. Click the formula, open the small menu at its right edge and choose Change to Display. It is an ordinary Word equation.
Does the formula use my body font?
No. Word renders all equations in Cambria Math, its only math font. Size follows the paragraph, so formulas match the text height.
How is this page different from the math and equations pages?
This page is about formulas inside sentences. The math page documents symbol and structure mapping, and the equations page covers standalone numbered equations with cross-references.
Is inline formula export free?
The preview is free. Downloading native inline equations requires Pro. Free downloads carry the LaTeX source in place of each formula.