latex3 / unicode-math

XeLaTeX/LuaLaTeX package for using unicode/OpenType maths fonts
http://ctan.org/pkg/unicode-math
LaTeX Project Public License v1.3c
243 stars 28 forks source link

using \setmathfont with option range=bb breaks spacing around \big* delimiters #344

Closed nfdisco closed 6 years ago

nfdisco commented 8 years ago

Using \setmathfont with option range=bb results in additional white space being added after certain math delimiters, in particular \bigl( and \bigr) and related commands, but not after \left( and \right).

For details see the following post on TeX.SE: https://tex.stackexchange.com/questions/302628/

u-fischer commented 8 years ago

As already mentioned in the comment of the tex.sx question the problem happens only with xelatex and is caused by the implicit \right. in \Bigl(. The delcode of the period is changed by the second \setmathfont with the range option and leads to this message in the log (and to some space).

Missing character: There is no ^^@ in font LatinModernMath-Regular/OT:script=ma
th;language=DFLT;!

If one force the code to use the operators family for the delcode by removing the comment chars in the following example the issue disappears:

\documentclass{article}

\usepackage{unicode-math}

\ExplSyntaxOn
%\cs_set:Npn \__um_setup_delcodes:
% {
%  % ensure \left. and \right. work:
%  \__um_set_delcode:nnn {operators} {`\.} {\c_zero}  %<----- Changed!!!!!
%  % this is forcefully done to fix a bug -- indicates a larger problem!
%
%  \__um_assign_delcode:nn {`\/}   {\g__um_slash_delimiter_usv}
%  \__um_assign_delcode:nn {"2044} {\g__um_slash_delimiter_usv} % fracslash
%  \__um_assign_delcode:nn {"2215} {\g__um_slash_delimiter_usv} % divslash
%  \__um_assign_delcode:n {"005C} % backslash
%  \__um_assign_delcode:nn {`\<} {"27E8} % angle brackets with ascii notation
%  \__um_assign_delcode:nn {`\>} {"27E9} % angle brackets with ascii notation
%  \__um_assign_delcode:n {"2191} % up arrow
%  \__um_assign_delcode:n {"2193} % down arrow
%  \__um_assign_delcode:n {"2195} % updown arrow
%  \__um_assign_delcode:n {"219F} % up arrow twohead
%  \__um_assign_delcode:n {"21A1} % down arrow twohead
%  \__um_assign_delcode:n {"21A5} % up arrow from bar
%  \__um_assign_delcode:n {"21A7} % down arrow from bar
%  \__um_assign_delcode:n {"21A8} % updown arrow from bar
%  \__um_assign_delcode:n {"21BE} % up harpoon right
%  \__um_assign_delcode:n {"21BF} % up harpoon left
%  \__um_assign_delcode:n {"21C2} % down harpoon right
%  \__um_assign_delcode:n {"21C3} % down harpoon left
%  \__um_assign_delcode:n {"21C5} % arrows up down
%  \__um_assign_delcode:n {"21F5} % arrows down up
%  \__um_assign_delcode:n {"21C8} % arrows up up
%  \__um_assign_delcode:n {"21CA} % arrows down down
%  \__um_assign_delcode:n {"21D1} % double up arrow
%  \__um_assign_delcode:n {"21D3} % double down arrow
%  \__um_assign_delcode:n {"21D5} % double updown arrow
%  \__um_assign_delcode:n {"21DE} % up arrow double stroke
%  \__um_assign_delcode:n {"21DF} % down arrow double stroke
%  \__um_assign_delcode:n {"21E1} % up arrow dashed
%  \__um_assign_delcode:n {"21E3} % down arrow dashed
%  \__um_assign_delcode:n {"21E7} % up white arrow
%  \__um_assign_delcode:n {"21E9} % down white arrow
%  \__um_assign_delcode:n {"21EA} % up white arrow from bar
%  \__um_assign_delcode:n {"21F3} % updown white arrow
% }
\ExplSyntaxOff
%
\setmathfont{Latin Modern Math}
\setmathfont{Latin Modern Math}[range=\int]

\begin{document}
\[
\left)\right.x
\]
\end{document}
nfdisco commented 8 years ago

@u-fischer 's solution above works for me.

wspr commented 6 years ago

sorry for the slow followup on this... it should be fixed in the next release.