I have using LuaLaTeX Version 1.12.0. I have need to maintain same text fonts in math mode (only alphabetic, numbers). All the Alphabetic characters (like A to Z, a to z) need to maintain same \setmainfont in mathmode (it means in between $....$ and \begin{align*}...\end{align*}).

When \textit{c} in LaTeX, PDF c character font is Times New Roman. When $c$ in LaTeX, PDF c character font is XITS. How to change this Times New Roman.

How to achieve this?



\setmainfont{Times New Roman}
\title{Article Title Here}
\author{Author Here}


The investigations of cylindrically symmetric spacetimes can be traced $1=2$ back as far as to 1919 when Levi-Civita (LC) \textit{c} discovered a class $c$ of solutions \textit{E} of ${E}^{2}$ Einstein’s vacuum field equations, corresponding to static cylindrical spacetimes.


  • You don't want that c in math mode is taken from the text font, because it should be mathematical character, precisely U+1D450 MATHEMATICAL ITALIC SMALL C
    – egreg
    Oct 21, 2020 at 19:58

1 Answer 1


One way to do this is to select the same font family in both text and math mode, such as

\setmathfont{XITS Math}

(Note that \setmathfont{XITS} is not correct.) Or:

\setmainfont{TeX Gyre Termes}
\setmathfont{TeX Gyre Termes Math}

All the TeX Gyre fonts are clones of a popular font with a different name, so Palatino matches TeX Gyre Pagella Math or Asana Math and TeX Gyre Termes Math matches Times, Times New Roman, and any other version of TImes.

If you want to replace the letters of your text font, you can do that with the range= option of \setmathfont. Note that you must choose a font that contains Greek letters to be able to use Greek, and the TeX Gyre fonts do not. You would need to set the upright, italic, bold and bold italic alphabets in order to be able to use them, and you can do the same for sans-serif, calligraphic, script, typewriter or Fraktur.

In this contrived example, I set the math alphabets to use New Computer Modern Book with Latin Modern Math, even though there is a math font that matches.

\setmainfont{New Computer Modern Book}[Scale=1.0, Ligatures={Common,Discretionary,TeX}]
\setmathfont{Latin Modern Math}
  • Its working fine. How do define greek letters and numbers and keyboard characters like (=,+-,(,) etc...)?
    – Balaji
    Oct 22, 2020 at 6:01
  • @Balaji That does define Greek letters, and the upright and bold-upright alphabets have numbers. You can define range=up/{Greek,greek} (for example) to replace only uppercase and lowercase Greek, for example. See the unicode-math manual at CTAN.org for full details.
    – Davislor
    Oct 22, 2020 at 12:49
  • @Balaji You can replace any command with its Unicode hex code, e.g. range="220E, a backtick followed by the UTF-8 symbol, or its name, e.g. range=\QED.
    – Davislor
    Oct 22, 2020 at 12:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .