Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. MathML
  3. Guides
  4. Fonts

Fonts for MathML

Fonts with appropriate Unicode coverage and Open Font Format features are required for good math rendering.This page describes how users can install such math fonts to properly display MathML in browsers.

Installation instructions

As a general rule of thumb, it is recommended to install bothLatin Modern Math (which usesComputer Modern style popular for math formulas) andSTIX Two Math (which has large unicode coverage for scientific characters). In the next sections, you will find detailed instructions to install these fonts in various operating systems.

Windows

Install theLatin Modern Math andSTIX Two Math fonts as follows:

  1. Downloadlatinmodern-math-1959.zip.
  2. Open the ZIP archive, move inside thelatinmodern-math-1959 directory and then inside theotf directory. You will find alatinmodern-math font file.
  3. Open thelatinmodern-math font file and click theInstall button.
  4. Downloadstatic_otf.zip.
  5. Open thestatic_otf.zip ZIP archive, and then move inside thestatic_otf directory. Among the files there, you will find aSTIXTwoMath-Regular file.
  6. Open theSTIXTwoMath-Regular file and click theInstall button. If desired, you may also do the same for the other font files in the directory.

Note:Cambria Math is installed by default on Windows and should ensure relatively good MathML rendering.

macOS

Install theLatin Modern Math font as follows:

  1. Downloadlatinmodern-math-1959.zip.
  2. Extract the ZIP archive, move inside thelatinmodern-math-1959 directory and then inside theotf directory. You will find alatinmodern-math font file.
  3. Double-click thelatinmodern-math font file click theInstall font button from the window that opens.

Note:If you are using macOS Ventura (version 13) or higher, thenSTIX Two Math is already pre-installed and you can skip the steps below.

Install theSTIX Two Math font as follows:

  1. Downloadstatic_otf.zip.
  2. Open thestatic_otf.zip ZIP archive, and then move inside thestatic_otf directory. Among the files there, you will find aSTIXTwoMath-Regular.otf file.
  3. Open theSTIXTwoMath-Regular.otf file and click theInstall Font button from the window that opens. If desired, you may also do the same for the other font files in the directory.

Note:A deprecated version ofSTIX is preinstalled starting with OS X Lion (version 10.7). Although some browsers are able to make use of it, it is strongly recommended to follow the instructions above for optimal math rendering.

Linux

Below, you can find commands to execute on popular Linux distributionsin order to install theLatin Modern Math andSTIX Two Math fonts from yourpackage manager. Alternative approaches are also provided if your Linuxdistribution does not provide dedicated packages for these fonts.

Debian-based distributions (including Ubuntu and Mint)

bash
sudo apt-get install fonts-lmodern fonts-stix

Fedora-based distributions

bash
sudo dnf install texlive-lm-math stix-math-fonts

openSUSE-based distributions

bash
sudo zypper install texlive-lm-math stix-fonts

Arch Linux

bash
sudo pacman -S otf-latinmodern-math otf-stix

TeXLive packages

If your Linux distribution does not provide packages for theLatin Modern Math andSTIX fonts, consider instead installing thetexlive packages containing theLatin Modern Math andXITS fonts. For example on Mageia:

bash
sudo urpmi texlive-dist texlive-fontsextra

However, you will likely need to ensure that these fonts are known by your system. Add a fontconfig configuration/etc/fonts/conf.avail/09-texlive-fonts.conf that points to theopentype directory of TeXLive, such as:

xml
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd"><fontconfig>  <dir>/your/path/to/texmf-dist/fonts/opentype</dir></fontconfig>

Finally, add this configuration file to the system font location list and regenerate the fontconfig cache:

bash
ln -sf /etc/fonts/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/fc-cache -sf

Upstream packages

If no packages are available on your Linux distributions, or if you just want to install upstream packages then try this:

  1. Downloadlatinmodern-math-1959.zip andstatic_otf.zip.
  2. Create a~/.fonts if it does not exist already and placelatinmodern-math.otf andSTIXTwoMath-Regular.otf in that directory.
  3. Runfc-cache -f to regenerate the fontconfig cache.

Android

You must use theMathML-fonts add-on.

Noto Sans Math provides good Unicode coverage for math symbols andmath layout.

Other systems

On other systems, consider installing afont with a MATH table using your package manager. Note that these fonts are generally delivered with TeX distributions such asTeX Live, but you might need to follow specific instructions so that your system is aware of the fonts. As a last resort, install theMathML fonts add-on.

Advanced setup

In the next sections, you will find other useful tips for installation andconfiguration of fonts for MathML.

Arabic mathematical alphabetic symbols

Currently, very few fonts have appropriate glyphs for the Arabic Mathematical Alphabetic Symbols. If you are likely to need these characters, we recommend to install theXITS orAmiri fonts.

Installation without administrator privilege

If you need to install fonts on a system without administrator privilege, the easiest option is to use math font theMathML-fonts add-on. Note that using the add-on is not optimal since it forces your Gecko browser to load a CSS stylesheet on each page you visit as well as Web math fonts on all pages with MathML content.

A better alternative on UNIX systems is to install the OTF files forLatin Modern Math andSTIX into some local font folder and (if necessary) to runfc-cache on it. On macOS and Linux, the standard paths are respectively~/Library/Fonts/ and~/.fonts.

Fonts with a MATH table

You can actually install anymathematical OpenType font and use them for MathML rendering. Some browsers provide a way to configure the default font for MathML in their font preference menu. Alternatively, you can try theMathML Font Settings add-on.

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp