> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/in-depth-articles/34-opentype-based-math-typesetting-an-introduction-to-the-stix2-opentype-fonts.md).

# 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](http://www.stixfonts.org). To assist with using and understanding the STIX2 fonts Overleaf is pleased to provide the following resources:

* an [Overleaf template](#an-overleaf-template-with-the-stix2-fonts) containing the STIX2 fonts loaded and configured ready for use;
* a [short video](#browsing-the-stix2-math-font-a-video-and-a-glyph-table) showing the wealth of glyphs contained in the STIX2Math.otf math font;
* a [detailed glyph chart](#browsing-the-stix2-math-font-a-video-and-a-glyph-table) 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](http://www.stixfonts.org/stipubs.html), a consortium of publishers of mathematical, scientific, and technical books and journals:

* [The American Mathematical Society](http://www.ams.org)
* [The American Physical Society](http://www.aps.org)
* [The American Institute of Physics](http://www.aip.org)
* [The American Chemical Society](http://www.chemistry.org)
* [The Institute of Electrical and Electronics Engineering, Inc](http://www.ieee.org)
* [Elsevier](http://www.elsevier.com)

Version 1.0 of the STIX fonts were released on 24 May 2010 followed by additional interim releases—the latest version can be downloaded from the [GitHub repository](https://github.com/stipub/stixfonts). 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](http://www.stixfonts.org/proj_timeline.html). 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](http://www.tiro.com/). 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 GitHub](https://github.com/stipub/stixfonts).

## 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](https://tex.stackexchange.com/questions/178753/changing-math-fonts-with-luaotfload-in-plain-tex) shows the sort of configuration you’ll need to undertake—for thousands of characters. Fortunately for LaTeX users the [unicode-math package](https://ctan.org/pkg/unicode-math?lang=en) 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](https://ctan.org/pkg/fontspec?lang=en) package (to configure the STIX2 text fonts) and the [unicode-math package](https://ctan.org/pkg/unicode-math?lang=en) 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!](https://www.tug.org/TUGboat/tb21-3/tb68beet.pdf) 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](http://www.unicode.org/reports/tr25/).

## 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](https://www.microsoft.com/typography/otspec/math.htm) 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](https://blogs.msdn.microsoft.com/murrays/2006/09/13/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](https://www.microsoft.com/typography/otspec/math.htm).

## 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](http://www.gust.org.pl/bachotex/2011-en/presentations/Vieth_1_2011) (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](http://mirrors.ctan.org/macros/latex/contrib/unicode-math/unicode-math-code.pdf) 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](http://www.luatex.org/svn/trunk/manual/luatex.pdf) similarly lists the parameters used by LuaTeX’s math typesetting engine.

## An Overleaf template with the STIX2 fonts

At the time of writing (2017) the STIX2 fonts were not included in the latest TeX Live distribution. To help you use the STIX2 fonts on Overleaf 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 [Overleaf gallery](https://www.overleaf.com/latex/templates/using-the-stix2-opentype-fonts-with-lualatex-or-xelatex/hdfvhzqmhnpx).

## 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:

{% embed url="<https://www.youtube.com/embed/FmxYH7lwNO0>" %}

If you are interested to further explore the STIX2 math font (STIX2Math.otf) we have used LuaTeX to prepare a [detailed glyph chart](https://www.filepicker.io/api/file/Gkmlty9USh2B52EFReAw) (PDF \~560kb)—the tabulated data is designed for use with LuaTeX.

[![{{{alt}}}](/files/sG87HcdLhPynUcbFz94n)](https://www.filepicker.io/api/file/Gkmlty9USh2B52EFReAw)

## 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](https://www.ntg.nl/maps/26/27.pdf) (by Ulrik Vieth)
* [Appendix G illuminated](https://www.tug.org/TUGboat/tb27-1/tb86jackowski.pdf) (by Bogusław Jackowski)
* [OpenType Math Illuminated](https://www.tug.org/~vieth/papers/bachotex2009/ot-math-paper.pdf) (by Ulrik Vieth)
* [Understanding the æsthetics of math typesetting](http://www.gust.org.pl/projects/e-foundry/math/math-support/vieth2008.pdf) (by Ulrik Vieth)
* [Math in LuaTEX 0.40](https://www.ntg.nl/maps/38/04.pdf) (by Taco Hoekwater)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/in-depth-articles/34-opentype-based-math-typesetting-an-introduction-to-the-stix2-opentype-fonts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
