2

Following up on this question, I am trying to use a unicode character as a binary operator. The answer in the linked question helped me do this, but I am running into a second issue. I want to also use a custom symbol as a binary operator:

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{unicode-math}
\usepackage{fontspec}
\setmathfont{Latin Modern Math}
\setmathfont{Symbola}[range={\sphericalangleup,\lang},Scale=MatchUppercase]

\newcommand{\ang}{\mathbin{\sphericalangleup}}
\newcommand{\lang}{\mathbin{\raisebox{1pt}{\rotatebox[origin=c]{-116}{\sphericalangleup}}}}

This character prints: $\ang$

But this does not: $\lang$

And by the way \textbf{bold} works fine :)

Unless I use the fontspec command...
\fontspec{Symbola}

After which the character prints: $\lang$

Except now \textbf{bold} doesn't work :(

I tried just throwing the command \lang for my custom symbol into the range of setmathfont, but this doesn't work, as shown above. fontspec solves this problem but creates another (see above).

1 Answer 1

4

Since \sphericalangleup is a math command, you need to start math mode in the \raisebox.

On the other hand, it's not necessary to define a math font, which Symbola isn't.

\documentclass{article}
%\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{unicode-math}
\usepackage{fontspec}
\setmathfont{Latin Modern Math}

\newfontface{\symbolafont}{Symbola}
\newcommand{\symbolasphericalangleup}{\text{\symbolafont\symbol{"29A1}}}

\newcommand{\ang}{\mathbin{\symbolasphericalangleup}}
\newcommand{\lang}{%
  \mathbin{%
    \raisebox{1pt}{\rotatebox[origin=c]{-116}{\symbolasphericalangleup}}%
  }%
}

\begin{document}

This character prints: $\ang$

But this does not: $\lang$

And by the way \textbf{bold} works fine :)

\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .