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

add \diagup (U+27CB) and \diagdown (U+27CD) to unicode-math-table #604

Merged
merged 3 commits into from
Aug 12, 2023

Conversation

AlphaZTX
Copy link
Contributor

@AlphaZTX AlphaZTX commented Nov 2, 2022

Status

READY

Description

Add \diagup(U+27CB) and \diagdown(U+27CD) to unicode-math-table.tex according to Section 2.15 of Unicode TR25.

Minimal example demonstrating the new functionality

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{STIX Two Math}
\begin{document}
\[
  \diagup \qquad \diagdown
\]
\end{document}

@@ -822,7 +822,9 @@
\UnicodeMathSymbol{"027C7}{\veedot }{\mathbin}{or with dot inside}%
\UnicodeMathSymbol{"027C8}{\bsolhsub }{\mathrel}{reverse solidus preceding subset}%
\UnicodeMathSymbol{"027C9}{\suphsol }{\mathrel}{superset preceding solidus}%
\UnicodeMathSymbol{"027CB}{\diagup }{\mathord}{mathematical rising diagnal}%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unicode https://www.unicode.org/reports/tr25/ mathclass15.tx has these as class R and MathML Operator dictionary gives them spacing, so if they are added, they should probably be \mathrel not \mathord

That said, most 8bit math font packges make the command \diagup \mathord

amsfonts/amssymb.sty:\DeclareMathSymbol{\diagup}       {\mathord}{AMSb}{"1E}
arev/ams-mdbch.sty:    \DeclareMathSymbol{\diagup}       {\mathord}{mathdesignA}{"1E}
boisik/boisik.sty:\DeclareMathSymbol{\diagup}               {\mathord}{bsksymbols}{"DB}
breqn/msabm.sym:\DeclareFlexSymbol{\diagup}          {Ord}{MSB}{1E}

with MSymbol the exception

mnsymbol/MnSymbol.sty:  \Decl@Mn@Alias\diagup              {MnSyA}{\mathrel}
mnsymbol/MnSymbol.sty:  \Decl@Mn@Alias\ndiagup             {MnSyB}{\mathrel}

several OTF seem to have this in the private use E0A0 slot

concmath-otf/concmath-otf.sty:     \Umathchardef\diagup =         0 0 "E0A0 \relax
erewhon-math/fourier-otf.sty:     \Umathchardef\diagup =         0 0 "E0A0 \relax
xcharter-math/xcharter-otf.sty:     \Umathchardef\diagup =         0 0 "E0A0 \relax

Font coverage is a bit variable

\documentclass{article}
\usepackage{fontspec}
\newfontfamily{\lmm}{Latin Modern Math}
\newfontfamily{\stm}{STIX Two Math}
\newfontfamily{\tgp}{TeX Gyre Pagella Math}
\newfontfamily{\tgt}{TeX Gyre Termes Math}
\newfontfamily{\ncm}{NewCMMath-Regular.otf}
\newfontfamily{\ghm}{GFSNeohellenicMath.otf}
\newfontfamily{\cambriam}{Cambria Math}
\newfontfamily{\xcm}{XCharter-Math.otf}
\newfontfamily{\concm}{Concrete-Math.otf}

\begin{document}
\makeatletter

{\lmm [\char"2751][\char"27CB][\char"E0A0] \f@family\par}
{\stm [\char"2751][\char"27CB][\char"E0A0] \f@family\par}
{\tgp [\char"2751][\char"27CB][\char"E0A0] \f@family\par}
{\tgt [\char"2751][\char"27CB][\char"E0A0] \f@family\par}
{\ncm [\char"2751][\char"27CB][\char"E0A0] \f@family\par}
{\ghm [\char"2751][\char"27CB][\char"E0A0] \f@family\par}
{\cambriam [\char"2751][\char"27CB][\char"E0A0] \f@family\par}
{\xcm [\char"2751][\char"27CB][\char"E0A0] \f@family\par}
{\concm [\char"2751][\char"27CB][\char"E0A0] \f@family\par}


\end{document}

image

But I suppose adding here might encourage fonts to converge, but mathord or mathrel? amssymb compatbilty means I think the ame \diagup should be mathord, but I wonder if a mathrel version should be supplied as well...

@AlphaZTX
Copy link
Contributor Author

AlphaZTX commented Nov 3, 2022

Maybe we can try the following code:

\UnicodeMathSymbol{"027CB}{\diagup                   }{\mathord}{mathematical rising diagnal}%
\UnicodeMathSymbol{"027CB}{\diaguprel                }{\mathrel}{mathematical rising diagnal (relation)}%

U+27CD is similar.

@davidcarlisle
Copy link
Member

something like that yes (\mathrel for the second one of course:-)

Main argument against adding these is that latin modern math doesn't seem to have anything usable, so the default behaviour of the new commands would be a missing glyph warning, which is a bit unfortunate

@wspr
Copy link
Collaborator

wspr commented Aug 10, 2023

I'm really surprised these were missing given \diagup is in amsmath. Based on a very cursory scan of how \diagup is used in the wild, I think \mathrel doesn't seem right:

https://arxiv.org/search/advanced?advanced=1&terms-0-operator=AND&terms-0-term=%5Cdiagup&terms-0-field=all&classification-physics_archives=all&classification-include_cross_list=include&date-filter_by=all_dates&date-year=&date-from_date=&date-to_date=&date-date_type=submitted_date&abstracts=show&size=50&order=-announced_date_first

I'm inclined to only provide \mathord for now.

@davidcarlisle
Copy link
Member

I'm inclined to only provide \mathord for now.

Given amssymb makes them mathord I guess that is best. Bit of pain that mathml4 and mathml-core give them a default 3mu space left and right following the R(elation) classification from Unicode TR25 but getting all these things lined up is hard.

Copy link
Member

@davidcarlisle davidcarlisle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments already posted

@wspr wspr merged commit c031af9 into latex3:master Aug 12, 2023
@wspr
Copy link
Collaborator

wspr commented Aug 12, 2023

Many thanks!

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

Successfully merging this pull request may close these issues.

3 participants