-
Notifications
You must be signed in to change notification settings - Fork 0
Using formulae
Formulae (the plural of formula) are something of an inevitability within the realm of STEM (Science, Technology, Engineering and Mathematics) fields. As such those writing in those fields would want to know how to implement formulae into their e-books.
Formulae can range in complexity from taking up one-line with just letters and an equals sign to using a whole array of mathematical symbols (as I learned doing set theory).
Simple formulae such as Isaac Newton’s Second Law of Motion: F = ma, Albert Einstein’s Mass-energy equivalence: e = mc2, Pythagoras’ theorem: a2 + b2 = c2 and even the Haber process: N2 + 3H2 ⇌ NH3 require little effort to represent using standard text formatting, but what about something more complicated such as the quadratic formula or the Shannon-Hartley theorem?
In the case of the quadratic formula and other formulae that cannot be represented in a single-line or rely on mathematical symbols that most typefaces do not represent, there are two possible solutions for implementation.
Choosing to present formulae as images is a reliable way of typesetting them in almost any format including ePub as most readers will at least render images consistently. Programs such as LibreOffice Math provide a means to easily construct the formula, from there one can take a screenshot using the built-in screenshot tool or a 3rd party utility such as Greenshot (at the time of writing LibreOffice Math has no image export) and the scale and resize it using image manipulation tools or leave as is.
//Diagram
Infact, prior to making this document I typeset the Shannon-Harley theorm formula in this very same way and I am pleased with the end result. Additionally you can save formulae created in LibreOffice Math as .odf files that can modified later.
The only downside to using LibreOffice Math is you are stuck with Liberation Serif as the only font choice. But the image looks more presentable than C = B log2(1 + S/N).
One of the main new features of the ePub 3 release was the inclusion of support of the mathematical markup language or MathML, the de jure standard for representing mathematical formulae for web pages (although some web browsers such as Google Chrome deliberately refuse to support it).
- MathML – Official website of MathML.
- LibreOffice Math – part of the LibreOffice suite, that allows construction of formulae and then exports the code to MathML. While there is no official way to save the formula as an image, it can be taken as a screenshot.
- Greenshot – a useful 3rd party screenshot utility for Windows that allows users to draw an area, choose where the image is saved and also edit the screenshot.
- MathML in Chromium – an ambitious endeavour to implement the MathML standard into Chromium and eventually Chrome itself.