1

I would like to rotate the \bigcupdot operator, provided by the STIX2 Math font, by 180 degrees about its center. I tried the following code.

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{STIXTwoMath-Regular.otf}
\usepackage{graphicx}
\begin{document}
$[\bigcupdot]\ [\mathop{\rotatebox[origin=c]{180}{\bigcupdot}}]$
\end{document}

The result was this:

A failed attempt to rotate the bigcupdot operator

Why didn't the rotated version typeset? How can I fix it?

Evan Aad
  • 11,066

2 Answers2

3

enter image description here


\documentclass[a4paper,12pt]{article}
\usepackage{unicode-math}
\setmathfont{STIXTwoMath-Regular.otf}
\usepackage{graphicx}
\begin{document}
$[\bigcupdot]$  [\rotatebox[origin=c]{180}{$\bigcupdot$}]
\end{document}
Sebastiano
  • 54,118
3

The problem is that \rotatebox typesets its argument in text mode and you would get “Missing $” errors with XeLaTeX, but nothing in LuaLaTeX (unless the current text font happens to have the character.

Anyway, using $\bigcupdot$ isn't enough.

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\usepackage{graphicx}

\setmathfont{STIXTwoMath-Regular.otf}

\makeatletter \NewDocumentCommand{\bigcapdot}{}{% \mathop{\mathpalette\bigcapdot@\relax}\displaylimits } \newcommand{\bigcapdot@}[2]{% \vcenter{\hbox{\scalebox{1}[-1]{$\m@th#1\bigcupdot$}}}% } \makeatother

\begin{document}

$[\bigcupdot][\bigcapdot]$

[ [\bigcupdot][\bigcapdot] ]

\end{document}

Here twocolumn is just to make a smaller picture.

enter image description here


Why just adding $ around \bigcupdot isn't enough? Look at the comparison below.

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\usepackage{graphicx}

\setmathfont{STIXTwoMath-Regular.otf}

\makeatletter \NewDocumentCommand{\bigcapdot}{}{% \mathop{\mathpalette\bigcapdot@\relax}\displaylimits } \newcommand{\bigcapdot@}[2]{% \vcenter{\hbox{\scalebox{1}[-1]{$\m@th#1\bigcupdot$}}}% } \makeatother

% for comparison \newcommand{\simplebigcapdot}{\mathop{\rotatebox[origin=c]{180}{$\bigcupdot$}}}

\begin{document}

\subsubsection*{Scaling}

$[\bigcupdot][\bigcapdot]$ $\scriptstyle[\bigcupdot][\bigcapdot]$ $\scriptscriptstyle[\bigcupdot][\bigcapdot]$

[ [\bigcupdot][\bigcapdot] ]

\subsubsection*{Not scaling}

$[\bigcupdot][\simplebigcapdot]$ $\scriptstyle[\bigcupdot][\simplebigcapdot]$ $\scriptscriptstyle[\bigcupdot][\simplebigcapdot]$

[ [\bigcupdot][\simplebigcapdot] ]

\end{document}

enter image description here


If you need other flipped symbols:

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\usepackage{graphicx}

\setmathfont{STIXTwoMath-Regular.otf}

\makeatletter \NewDocumentCommand{\bigcapdot}{}{% \genericbigopflip{\bigcupdot}% } \NewDocumentCommand{\bigcapplus}{}{% \genericbigopflip{\biguplus}% }

\newcommand{\genericbigopflip}[1]{% \mathop{\mathpalette\bigcapdot@{#1}}\displaylimits } \newcommand{\bigcapdot@}[2]{% \vcenter{\hbox{\scalebox{1}[-1]{$\m@th#1#2$}}}% } \makeatother

\begin{document}

$[\bigcupdot][\bigcapdot][\biguplus][\bigcapplus]$ $\scriptstyle[\bigcupdot][\bigcapdot][\biguplus][\bigcapplus]$ $\scriptscriptstyle[\bigcupdot][\bigcapdot][\biguplus][\bigcapplus]$

[ [\bigcupdot][\bigcapdot][\biguplus][\bigcapplus] ]

\end{document}

enter image description here

egreg
  • 1,121,712
  • You wrote: "$\bigcupdot$ isn't enough". Why is it not enough? – Evan Aad Mar 22 '23 at 05:00
  • Actually you don't get errors with LuaTeX, which is what puzzled me to start with... – campa Mar 22 '23 at 09:31
  • 1
    @EvanAad I added a comparison between the two approaches. You judge. – egreg Mar 22 '23 at 09:31
  • @campa Oh, yes, the bizarre decision of LuaTeX to allow math symbols not in $. LuaTeX tries to get the character from the text font (and doesn't find it, of course). – egreg Mar 22 '23 at 09:32
  • @egreg Isn't it unicode-math developers choice to define it by letting it to a character instead of \Umathchardef it? The latter case I believe should give an error when used in text mode. – user202729 Mar 22 '23 at 11:51
  • Remark, if correct scaling is needed, it's more user-friendly to use \text instead of \mathpalette as in this other answer of egreg: https://tex.stackexchange.com/a/286069/250119 – user202729 Mar 22 '23 at 11:53
  • 1
    @user202729 In (the current version of) LuaTeX, if a \Umathchardef token is found in text mode, all the information is ignored except for the code point and the character with that code point is typeset from the current font.

    Sometimes it's easier to use \text, sometimes it isn't.

    – egreg Mar 22 '23 at 11:53