Skip to content
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

Discrepancy between usepackage and setmathfont #14

Open
ImAWerewolfDuck opened this issue Dec 27, 2024 · 1 comment
Open

Discrepancy between usepackage and setmathfont #14

ImAWerewolfDuck opened this issue Dec 27, 2024 · 1 comment

Comments

@ImAWerewolfDuck
Copy link

ImAWerewolfDuck commented Dec 27, 2024

Hello, I found a weird behaviour when using the package on ctan compared to loading the font through setmathfont.
When using the font through the package, the scaling does not apply to mathrm (and therefore to other packages like siunitx) and microtype complains about "Unknown slot number of character" which cant be fixed using DeclareMicrotypeAlias or DeclareCharacterInheritance.
When using setmathfont, microtype still complains but can be patched by aforementioned commands. Additionally, the font scaling is correct in all environments.
MWE using usepackage compiled with LuaLaTeX:

\documentclass[a4paper, 12pt]{report}\usepackage{fontspec}
\usepackage[bold-style=ISO]{unicode-math} 
\usepackage{microtype}
\setmainfont[Scale=0.5]{Lato}
\usepackage[Scale=0.5]{lete-sans-math}
\usepackage[detect-all]{siunitx}
\begin{document}\noindent
	\begin{align}
		&\text{This is in normal text}\\
		&This\ is\ in\ math\\
		&\mathrm{This\ is\ in\ mathrm}\\
		&This\ is\ in\ siunitx\ inside\ math: \SI{1337}{\milli\mole}
	\end{align}	
\end{document}

usepackage
MWE using setmathfont compiled with LuaLaTeX:

\documentclass[a4paper, 12pt]{report}
\usepackage{fontspec}
\usepackage[bold-style=ISO]{unicode-math}
\usepackage{microtype}
\setmainfont[Scale=0.5]{Lato}
\setmathfont[Scale=0.5]{LeteSansMath}
\usepackage[detect-all]{siunitx}
\begin{document}\noindent
	\begin{align}
		&\text{This is in normal text}\\
		&This\ is\ in\ math\\
		&\mathrm{This\ is\ in\ mathrm}\\
		&This\ is\ in\ siunitx\ inside\ math: \SI{1337}{\milli\mole}
	\end{align}	
\end{document}

setmathfont

@dflipo
Copy link
Collaborator

dflipo commented Dec 27, 2024

This is a bug introduced in version 0.45, scaling options have been forgotten :-(

For a quick fix, comment out lines 51-53 in lete-sans-math.sty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants