-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use regular sans-serif italic/upright greek letter in math mode? #620
Comments
Sans-serif italic/upright greek letters are not defined in Unicode. |
What can I do if I want some greek letters be sans-serif but a lot more others don't? For example:
|
It's clearly impossible to use a glyph that doesn't exist in a font, unless you modify the font and add the things you need. |
No |
Here is a suggestion that relies on the XITS Math fonts and makes use of % !TeX program = xelatex
\documentclass{article}
\usepackage[mathsf=sym]{unicode-math}
\setmathfont{XITSMath-Regular.otf}[BoldFont = XITSMath-Bold.otf]
\newcommand{\mitsanseta}{%
\textit{%
\fontspec{XITSMath-Regular.otf}[
StylisticSet = 2,
Color = red
]%
\miteta%
}%
}
\newcommand{\msanseta}{%
\textit{%
\fontspec{XITSMath-Regular.otf}[
StylisticSet = 2,
Color = blue
]%
\mupeta%
}%
}
\begin{document}
\[ X^\mu_\nu = X^{\mu\rho} \eta_{\rho_\nu} = \mathsf{X \eta \msanseta} \mathsfit{X \eta \mitsanseta} \mathsfup{X \eta \msanseta} \mathbfsf{X \eta} \mathbfsfit{X \eta} \]
\boldmath
\[ X^\mu_\nu = X^{\mu\rho} \eta_{\rho_\nu} = \mathsf{X \eta \msanseta} \mathsfit{X \eta \mitsanseta} \mathsfup{X \eta \msanseta} \mathbfsf{X \eta} \mathbfsfit{X \eta} \]
\end{document} Result: I have made use of the |
Sure, but @Firestar-Reimu wants math to be serif in general and only select symbols to be sans-serif:
It is true, though, that one take the upright sans-serif glyphs out of many different math (or even text fonts) that include Greek letters. For instance, % !TeX program = xelatex
\documentclass{article}
\usepackage{xcolor}
\usepackage[mathsf=text]{unicode-math}
\setmainfont{XITS-Regular.otf}[
ItalicFont = XITS-Italic.otf,
BoldFont = XITS-Bold.otf,
BoldItalicFont = XITS-BoldItalic.otf,
]
\setsansfont{FiraSans-Regular.otf}[
ItalicFont = FiraSans-Italic.otf,
BoldFont = FiraSans-Bold.otf,
BoldItalicFont = FiraSans-BoldItalic.otf,
Scale = 0.9,
]
\setmonofont{FiraMono-Regular.otf}[
BoldFont = FiraMono-Bold.otf,
Scale = 0.9,
]
\setmathfont{XITSMath-Regular.otf}[BoldFont = XITSMath-Bold.otf]
\setmathfontface{\mathsf}{FiraMath-Regular.otf}[
BoldFont = FiraMath-Bold.otf,
Color = cyan
]
% FiraMath-Bold.otf is NOT included in CTAN; it must be downloaded from
% https://github.com/firamath/firamath/releases/tag/v0.4-beta-3.
\setmathfont{FiraMath-Regular.otf}[
BoldFont = FiraMath-Bold.otf,
range = {sfup, sfit->it},
Color = teal,
]
\setmathfont{FiraMath-Bold.otf}[
range = {bfsfup->up, bfsfit->it},
Color = orange,
]
\newcommand{\mitsanseta}{%
\textit{%
\fontspec{FiraMath-Regular.otf}[
Color = red
]%
\miteta%
}%
}
\newcommand{\msanseta}{%
\textup{%
\fontspec{FiraMath-Regular.otf}[
Color = blue
]%
\mupeta%
}%
}
\AtBeginDocument{%
\renewcommand{\mbfsanseta}{%
\textbf{%
\fontspec{FiraMath-Bold.otf}[
Color = green
]%
\mupeta%
}%
}%
\renewcommand{\mbfitsanseta}{%
\textbf{%
\fontspec{FiraMath-Bold.otf}[
Color = magenta
]%
\miteta%
}%
}%
}
\begin{document}
Test \texttt{\textbackslash mathversion[normal]}:
\[
X^\mu_\nu = X^{\mu\rho} \eta_{\rho_\nu} =
\mathsf{X \eta \msanseta} \mathsfit{X \eta \mitsanseta} \mathsfup{X \eta \msanseta} \mathbfsf{X \eta \mbfsanseta} \mathbfsfit{X \eta \mbfitsanseta}
\]
\bfseries\boldmath
Test \texttt{\textbackslash mathversion[bold]}/\texttt{\textbackslash boldmath}:
\[
X^\mu_\nu = X^{\mu\rho} \eta_{\rho_\nu} =
\mathsf{X \eta \msanseta} \mathsfit{X \eta \mitsanseta} \mathsfup{X \eta \msanseta} \mathbfsf{X \eta \mbfsanseta} \mathbfsfit{X \eta \mbfitsanseta}
\]
\end{document} |
Description
Unicode-math does not support sans-serif italic/upright greek letter
Add info or delete as appropriate:
Minimal example demonstrating the issue
You can try STIX Two Math, still do not support
Further details
https://mirrors.zju.edu.cn/CTAN/macros/unicodetex/latex/unicode-math/unimath-symbols.pdf
The text was updated successfully, but these errors were encountered: