> 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/zh-cn/shen-ru-wen-zhang/34-opentype-based-math-typesetting-an-introduction-to-the-stix2-opentype-fonts.md).

# 基于 OpenType 的数学排版：STIX2 OpenType 字体简介

## 引言

在本文中，我们简要介绍 STIX2 字体——由……制作的最新一套高质量 OpenType 文本和数学字体 [科学与技术信息交换（STIX）字体项目](http://www.stixfonts.org)。为了帮助使用和理解 STIX2 字体，Overleaf 很高兴提供以下资源：

* 一份 [Overleaf 模板](#an-overleaf-template-with-the-stix2-fonts) ，其中已加载并配置好 STIX2 字体，可直接使用；
* a [简短视频](#browsing-the-stix2-math-font-a-video-and-a-glyph-table) 展示 STIX2Math.otf 数学字体中包含的大量字形；
* a [详细字形表](#browsing-the-stix2-math-font-a-video-and-a-glyph-table) 用于 STIX2Math.otf，由 LuaTeX（LuaLaTeX）生成并供其使用。

## STIX 概述

STIX 字体的开发由……资助并管理 [STI Pub](http://www.stixfonts.org/stipubs.html)，这是一个由数学、科学和技术类书籍与期刊出版商组成的联盟：

* [美国数学学会](http://www.ams.org)
* [美国物理学会](http://www.aps.org)
* [美国物理学研究所](http://www.aip.org)
* [美国化学学会](http://www.chemistry.org)
* [电气与电子工程师学会有限公司](http://www.ieee.org)
* [爱思唯尔](http://www.elsevier.com)

STIX 字体 1.0 版于 2010 年 5 月 24 日发布，随后又发布了若干中间版本——最新版本可从……下载 [GitHub 仓库](https://github.com/stipub/stixfonts)。当前的 STIX 字体版本 2 于 2016 年 12 月 1 日发布，为一个历时超过 20 年的项目带来了最新一套字体， [跨越 20 多年](http://www.stixfonts.org/proj_timeline.html)。2 版发布中包含 5 款 OpenType 字体：

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

随附的发行说明指出：

> “STIX 字体 2.0.0 版，现在称为‘STIX Two’，是由著名字型公司 [Tiro Typeworks](http://www.tiro.com/)进行的一次彻底修订。STIX Two 字体由四款文本字体（Regular、Italic、Bold 和 Bold Italic）以及一款数学字体组成。它们共同提供了一套统一的字体，可在整个制作流程中使用，无论是传统的纯印刷流程、完全电子化的流程，还是两者的结合。”

### 我在哪里可以获取 STIX2 字体？

STIX 字体的最新版本可以 [从 GitHub 下载](https://github.com/stipub/stixfonts).

## STIX2/OpenType：仅供 XeTeX 和 LuaTeX 使用

STIX2 字体专为现代 TeX 引擎——LuaTeX 和 XeTeX——而设计，因为这些引擎能够使用 OpenType 字体，并且都支持基于 OpenType 的数学排版。你可以在 Plain TeX 中使用 STIX2 字体（使用 LuaTeX 或 XeTeX），但你需要进行大量配置（设置数学代码等）才能在 Plain TeX 中启用它们。这个很棒的 [tex.stackexchange 上的示例](https://tex.stackexchange.com/questions/178753/changing-math-fonts-with-luaotfload-in-plain-tex) 展示了你需要进行的那类配置——针对数千个字符。幸运的是，对于 LaTeX 用户， [unicode-math 宏包](https://ctan.org/pkg/unicode-math?lang=en) 已经为你完成了所有这些艰苦工作。

要让文本和数学内容都使用 STIX2 字体排版，你只需使用 [fontspec 宏包](https://ctan.org/pkg/fontspec?lang=en) 宏包（用于配置 STIX2 文本字体）以及 [unicode-math 宏包](https://ctan.org/pkg/unicode-math?lang=en) 来配置并启用 STIX2 数学字体。

## 奠定基础：Unicode 数学编码

STIX 字体制作的一个关键前提是创建一份全面/权威的符号清单，这些符号是供需要书写和发布数学内容的人使用的——字体中应该包含哪些符号（字形）？通过文献检索、与出版商联络、与作者群体磋商以及考察现有技术标准，构建了这样一份清单，并向 Unicode 技术委员会提交申请，要求正式批准将这些符号集合纳入 Unicode 标准。就 Unicode 而言，数学排版有特殊挑战，因为外观略有不同的字形在语义上实际上可能有很大差异，因此需要分别编码。

关于获得 Unicode 正式批准的一些有趣背景，可参见论文 [Unicode 与数学，一个时机已到的组合——终于来了！](https://www.tug.org/TUGboat/tb21-3/tb68beet.pdf) 由 Barbara Beeton（AMS）撰写，她的工作对 STIX 项目的成功起到了关键作用。想了解更多背景信息的读者也可以阅读 [Unicode® 技术报告 #25：数学的 Unicode 支持](http://www.unicode.org/reports/tr25/).

## 另一个里程碑：微软开创的基于 OpenType 的数学排版

获得 Unicode 批准以编码大量数学字符（符号）是制作 STIX 字体的关键第一步。另一个重要组成部分是对 OpenType 字体规范的扩展，使 OpenType 字体能够包含数学排版引擎所需的附加数据。这一工作由微软通过以下方式开创： [OpenType 字体中的 MATH 表规范](https://www.microsoft.com/typography/otspec/math.htm) 并随 Microsoft Word 2007 首次亮相，其中包含一个新的、功能非常强大的排版引擎以及第一款 OpenType 数学字体：Cambria Math。更多背景可参见文章 [《Office 2007 中数学文本的高质量编辑与显示》](https://blogs.msdn.microsoft.com/murrays/2006/09/13/high-quality-editing-and-display-of-mathematical-text-in-office-2007/) （作者 Murray Sargent 教授）。

基于 TeX 的数学排版涉及 TeX 排版引擎内置算法与用于数学排版的字体之间复杂的相互作用。专为数学设计的字体需要包含若干参数，这些参数用于 TeX 排版引擎深处的大小/位置计算。OpenType 规范定义的 MATH 表参数详见 [这里](https://www.microsoft.com/typography/otspec/math.htm).

## TeX 引擎也随之跟进

TeX 引擎支持基于 OpenType 的数学排版是一个自然而然的进展，正如演讲 [OpenType 数学排版的现状](http://www.gust.org.pl/bachotex/2011-en/presentations/Vieth_1_2011) （Ulrik Vieth，2011）中所指出，XeTeX 在 0.97 版（2007）中引入了对 OpenType 数学的支持，而 LuaTeX 在 0.4 版（2009）中加入了该支持。LuaTeX 和 XeTeX 的实现通常会产生兼容的结果，但两种引擎在行为上可能会有一些细微差异/不同。

想探索传统 TeX 字体或较新的 OpenType 字体所需参数的读者，可以参考 `unicode-math` 宏包 [文档](http://mirrors.ctan.org/macros/latex/contrib/unicode-math/unicode-math-code.pdf) 中包含的一个附录，其中列出了所有传统（传统式）TeX 数学字体参数，以及 XeTeX 使用的新（OpenType）参数。 [LuaTeX 参考手册](http://www.luatex.org/svn/trunk/manual/luatex.pdf) 第 6 章也同样列出了 LuaTeX 数学排版引擎使用的参数。

## 带有 STIX2 字体的 Overleaf 模板

在撰写本文时（2017 年），STIX2 字体尚未包含在最新的 TeX Live 发行版中。为了帮助你在 Overleaf 上使用 STIX2 字体，我们准备了一个“入门”模板，其中已加载并配置好 STIX2 字体，可通过 `fontspec` 和 `unicode-math`使用。 `fontspec` 和 `unicode-math` 当然，你也可以根据自己的具体需求，重新配置这些

该模板可在 [Overleaf 画廊](https://www.overleaf.com/latex/templates/using-the-stix2-opentype-fonts-with-lualatex-or-xelatex/hdfvhzqmhnpx).

## 浏览 STIX2 数学字体：视频与字形表

STIX2 数学字体（STIX2Math.otf）包含了大量符号——正如你在这段简短视频（无声）中看到的那样，字形超过 5,200 个，视频展示了该字体在 FontLab Studio 中打开后的样子：

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

如果你想进一步探索 STIX2 数学字体（STIX2Math.otf），我们已经使用 LuaTeX 制作了一份 [详细字形表](https://www.filepicker.io/api/file/Gkmlty9USh2B52EFReAw) （PDF 约 560kb）——表格化数据旨在供 LuaTeX 使用。

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

## 进一步阅读

对了解更多 TeX 数学排版感兴趣的读者，可能会想阅读以下一些优秀论文和文章：

* [TeX 中的数学排版：好、坏与丑](https://www.ntg.nl/maps/26/27.pdf) （Ulrik Vieth 著）
* [附录 G 详解](https://www.tug.org/TUGboat/tb27-1/tb86jackowski.pdf) （Bogusław Jackowski 著）
* [OpenType 数学详解](https://www.tug.org/~vieth/papers/bachotex2009/ot-math-paper.pdf) （Ulrik Vieth 著）
* [理解数学排版的美学](http://www.gust.org.pl/projects/e-foundry/math/math-support/vieth2008.pdf) （Ulrik Vieth 著）
* [LuaTEX 0.40 中的数学](https://www.ntg.nl/maps/38/04.pdf) （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/zh-cn/shen-ru-wen-zhang/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.
