unicode-math icon indicating copy to clipboard operation
unicode-math copied to clipboard

Spacing around ⋯ (U+22EF) vs \cdots

Open jun0 opened this issue 3 years ago • 3 comments

Description

The character ⋯ has the same spacing around it as ordinary characters. Most other math symbols seem to mimic the spacing of their traditional LaTeX-command counterparts (e.g. → U+222A behaves like \rightarrow), so I expected ⋯ to behave like \cdots too. Is it considered different from \cdots?

Add info or delete as appropriate:

  • Relevant for XeTeX
  • Relevant for LuaTeX

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{unicode-math}
\begin{document}
\[
  \begin{array}{l}
    A \cdots B \\ % is spaced as what looks like mathop
    A ⋯ B % U+22EF has no spacing around it
  \end{array}
\]
\end{document}

jun0 avatar Jul 03 '21 03:07 jun0

\cdots is traditionally (almost uniquely) \mathinner (apart from \leftt\right only cdots, ldots and ddtots are \mathinner by default)

unicode-math leaves that alone, and defines U+22EF to be \unicodecdots (again the \unicode... prefix only used for cdots and ellipsis) which is, as you say, \mathord

Unicode's Mathclass-15 data file has this as R (\mathrel)

MathML (cuurently?) has no operator dictionary entry for 22EF so will treat it as \mathord too.

you can't actually give a character a class to act like \mathinner. \mathrel seems a bit over spaced \mathbin is perhaps better

\documentclass{article}
\usepackage{unicode-math}

\AtBeginDocument{\Umathcode"22EF "2 "0 "22EF}% \mathbin
%\AtBeginDocument{\Umathcode"22EF "3 "0 "22EF}% \mathrel

\begin{document}

  \begin{array}{l}
    A \cdots B \\ % is spaced as what looks like mathop
    A ⋯ B % U+22EF has no spacing around it
  \end{array}
\]
\end{document}

@wspr's choice:-) but leaving it as mathord and letting the author choose an alternative spacing isn't completely unreasonable if there is no clear obvious default.

davidcarlisle avatar Jul 03 '21 09:07 davidcarlisle

Very interesting... You say you can't give it a character class to act like \mathinner, but if you make it an active char and define it as \cdots, would that break a lot of things? (Sorry if that's supposed to be obvious; I'm quite ignorant about how unicode-math works.)

\documentclass[xelatex]{article}
\usepackage{unicode-math}
\catcode`⋯=13
\def⋯{\cdots}
\begin{document}
\[
  \begin{array}{l}
    A \cdots B \\
    A ⋯ B
  \end{array}
\]
\end{document}

jun0 avatar Jul 03 '21 10:07 jun0

\mathcode"8000 would be safer than active, not least that it wouldn't affect its use in text.

I think you would then define it to be a \mathinner of a normal U+22EF (I don't think it should use \cdots which is three separate dot characters) which would affect cut and paste, possible accessibility tagging in the PDF , etc.

davidcarlisle avatar Jul 03 '21 10:07 davidcarlisle