## OpenType-based math typesetting: An introduction to the STIX2 OpenType fonts

## Introduction

In this article we take a brief look at the STIX2 fonts, the latest set of high quality OpenType text and math fonts produced by the Scientific and Technical Information Exchange (STIX) font project. To assist with using and understanding the STIX2 fonts Overleaf is pleased to provide the following resources:

- a ShareLaTeX template containing the STIX2 fonts loaded and configured ready for use;
- a short video showing the wealth of glyphs contained in the STIX2Math.otf math font;
- a detailed glyph chart for STIX2Math.otf produced with, and for use with, LuaTeX (LuaLaTeX).

## An Overview of STIX

Development of the STIX fonts is funded and managed through STI Pub, a consortium of publishers of mathematical, scientific, and technical books and journals:

- The American Mathematical Society
- The American Physical Society
- The American Institute of Physics
- The American Chemical Society
- The Institute of Electrical and Electronics Engineering, Inc
- Elsevier

Version 1.0 of the STIX fonts were released on 24 May 2010 followed by additional interim releases which can still be downloaded from the SourceForge repository. The current version of the STIX fonts, version 2, were released on 1 December 2016, delivering the latest set of fonts to arise from a project that spans over 2 decades. Included in the version 2 release are 5 OpenType fonts:

- STIX2Math.otf
- STIX2Text-Bold.otf
- STIX2Text-BoldItalic.otf
- STIX2Text-Italic.otf
- STIX2Text-Regular.otf

The accompanying release notes observe:

“Version 2.0.0 of the STIX fonts, now known as "STIX Two", is a thorough revision undertaken by the renowned type house Tiro Typeworks. The STIX Two fonts consist of four text fonts (Regular, Italic, Bold, and Bold Italic) and one Math font. Together, they provide a uniform set of fonts that can be used throughout the production process, whether that be a traditional print-only process, an entirely electronic one, or a combination of the two.”

### Where can I get the STIX2 fonts?

The latest version of the STIX fonts can be downloaded from SourceForge.

## STIX2/OpenType: for use with XeTeX and LuaTeX only

The STIX2 fonts are designed for use with modern TeX engines— LuaTeX and XeTeX—because those engines are capable of using OpenType fonts and both support OpenType-based mathematical typesetting. You can use the STIX2 fonts with Plain TeX (using LuaTeX or XeTeX) but you’ll need to undertake a lot of configuration (setting math codes etc) to enable them with Plain TeX. This excellent example on tex.stackexchange shows the sort of configuration you’ll need to undertake—for thousands of characters. Fortunately for LaTeX users the `unicode-math`

package has done all this hard work for you.

To have both your text and mathematics typeset with the STIX2 fonts you just need to use the `fontspec`

package package (to configure the STIX2 text fonts) and the `unicode-math`

package to configure and enable the STIX2 math font.

## Laying the foundations: Unicode math encoding

A key prerequisite to production of the STIX fonts was creating a comprehensive/definitive list of the symbols in use by those needing to write and publish mathematics—which symbols (glyphs) should be contained in the font(s)? Through literature searches, liaison with publishers, consultations with authoring communities and examination of existing technical standards, such a list was constructed and applications were made to the Unicode Technical Committee to have that set of symbols formally approved for inclusion into the Unicode standard. For the purposes of Unicode, mathematics has specific challenges because of the subtleties presented by glyphs with slightly different visual appearances actually having quite different semantics, thus needing to be encoded separately.

Some interesting background on obtaining formal Unicode approval can be found in the paper *Unicode and math, a combination whose time has come — Finally!* written by Barbara Beeton (of the AMS) whose work has been instrumental in the success of the STIX project. Readers looking for further background information may also like to read the Unicode® Technical Report #25: UNICODE SUPPORT FOR MATHEMATICS.

## Another milestone: OpenType-based math typesetting pioneered by Microsoft

Obtaining Unicode approval to encode a large number of mathematical characters (symbols) was a crucial first step in producing the STIX fonts. Another vital ingredient was an extension to the OpenType font specification which enabled OpenType fonts to contain additional data required by mathematical typesetting engines. This was pioneered by Microsoft through the specification of the MATH table in OpenType fonts and made its debut with Microsoft Word 2007 which contained a new and very powerful typesetting engine together with the first OpenType math font: Cambria Math. Additional background can be found in the article *High-Quality Editing and Display of Mathematical Text in Office 2007* (by Professor Murray Sargent).

TeX-based mathematical typesetting involves a complex interplay between the algorithms built into TeX-based typesetting engines and the fonts used for math typesetting. Fonts designed for mathematics need to contain a number of parameters which are used in the sizing/positioning calculations deep inside TeX-based typesetting engines. The MATH table parameters defined by the OpenType specification are detailed here.

## TeX engines follow suit

It was a natural progression for TeX engines to support OpenType math typesetting and, as noted in the presentation *The state of OpenType math typesetting* (by Ulrik Vieth, 2011) XeTeX introduced support for OpenType math in version 0.97 (2007) and LuaTeX added it in in version 0.4 (2009). The LuaTeX and XeTeX implementations usually produce compatible results but there is the possibility for some slight variation/differences in behaviour between the two engines.

Readers wishing to explore the parameters requited by legacy TeX fonts or the newer OpenType fonts can refer to an appendix contained in the `unicode-math`

package documentation which lists all the legacy (traditional) TeX math font parameters together with the new (OpenType) parameters used by XeTeX. Chapter 6 of LuaTeX’s Reference Manual similarly lists the parameters used by LuaTeX’s math typesetting engine.

## A ShareLaTeX template with the STIX2 fonts

At the time of writing, the STIX2 fonts were not included in the latest TeX Live distribution (2017). To help you use the STIX2 fonts on ShareLaTeX we have prepared a “getting started” template which contains the STIX2 fonts loaded and configured for use via `fontspec`

and `unicode-math`

. Of course, feel free to reconfigure the `fontspec`

and `unicode-math`

packages with options that better suit your particular requirements.

The template is available on the ShareLaTeX gallery.

## Browsing the STIX2 math font: A video and a glyph table

The STIX2 math font (STIX2Math.otf) contains a wealth of symbols—over 5,200 glyphs as you can see in this short video (no sound) which shows the font opened inside FontLab Studio:

If you are interested to further explore the STIX2 math font (STIX2Math.otf) we have used LuaTeX to prepare a detailed glyph chart [PDF ~560kb]—the tabulated data is designed for use with LuaTeX.

## Further reading

Readers interested to learn more about TeX’s math typesetting may like to read some of these excellent papers and articles:

*Math typesetting in TeX: The good, the bad, the ugly*(by Ulrik Vieth)*Appendix G illuminated*(by Bogusław Jackowski)*OpenType Math Illuminated*(by Ulrik Vieth)*Understanding the æsthetics of math typesetting*(by Ulrik Vieth)*Math in LuaTEX 0.40*(by Taco Hoekwater)