Open miccoli opened 1 year ago
I cannot see it with up-to-date TeXLive
I cannot see it with up-to-date TeXLive
I tested on Overleaf with TeXLive 2022. From the logs:
This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex 2022.8.9) 7 JAN 2023 09:05
<snip>
Package: fontspec 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX
<snip>
Package: unicode-math 2020/01/31 v0.8q Unicode maths in XeLaTeX and LuaLaTeX
Just for completeness I add also the full log.
From the log you see that if unicode-math.sty is loaded, fontspec will create two font families, SourceCodePro-Regular.otf(0)
and SourceCodePro-Regular.otf(1)
, the first with the correct settings, the second with default ones.
my fault. My xelatex
was a link to lualatex
, which works well. With xelatex
I can confirm it ...
A quick-and-dirty fix would be to change line 163 of um-code-mathtext.dtx from
%<XE> \fontspec_gset_family:Nnn \g__fontspec_mathtt_tl {#1} {#2}
to
%<XE> \fontspec_gset_family:Nnn \g__fontspec_mathtt_tl {WordSpace={1,0,0},HyphenChar=None,PunctuationSpace=WordSpace,#1} {#2}
namely to add the features from fontspec.cfg
into the definition of \__fontspec_setmonofont_hook:nn
. I just tried on my setup, editing unicode-math-xetex.sty
, and this seems to work.
A better way to go would be to pick up whatever's in fontspec.cfg
, which the user may have customized.
Description
After
\usepackage{unicode-math}
the command\setmonofont
does not work as expected.Add info or delete as appropriate:
Minimal example demonstrating the issue
Further details
In the above example the paragraph is justified and hyphenated, while it should be raggedright and not hyphenated. It seems that the default settings for
\ttfamily
infontspec.cfg
are not respected:In fact the correct behavior is restored by either one of this changes:
\usepackage{unicode-math}
\setmonofont{SourceCodePro-Regular.otf}[]
before\usepackage{unicode-math}
WordSpace={1,0,0},
... in\setmonofont