The idea is to use \mathpalette
and \ooalign
. Some tricks are necessary, though: a \vphantom{*}
ensures the correct bounding box, because \ooalign
gets the height from the first item and the depth from the second one.
For the slash, one can use \centernot
from the eponymous package.
\documentclass{article}
\usepackage{amsmath}
\usepackage{centernot}
\makeatletter
\newcommand{\astminus}{\mathbin{\mathpalette\astminus@\relax}}
\newcommand{\astminus@}[2]{%
\vphantom{*}%
\ooalign{\hidewidth$\m@th#1*$\hidewidth\cr$\m@th#1-$\cr}%
}
\makeatother
\newcommand{\astslash}{\mathbin{\centernot{*}}}
\begin{document}
$a\astminus b \astslash c$
$\scriptstyle a\astminus b \astslash c$
$\scriptscriptstyle a\astminus b \astslash c$
\end{document}

A different version where the \astslash
symbol is obtained by rotating 60 degrees \astminus
. Don't ask too much about how this is obtained. 😊
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
% syntactic sugar
\newcommand{\xmathpalette}[2]{%
\mathchoice
{#1\displaystyle\textfont{#2}}
{#1\textstyle\textfont{#2}}
{#1\scriptstyle\scriptfont{#2}}
{#1\scriptscriptstyle\scriptscriptfont{#2}}
}
\makeatletter
\newcommand{\astminus}{\mathbin{\mathpalette\astminus@\relax}}
\newcommand{\astminus@}[2]{%
\vphantom{*}%
\ooalign{\hidewidth$\m@th#1*$\hidewidth\cr$\m@th#1-$\cr}%
}
\newcommand{\astslash}{\mathbin{\xmathpalette\astslash@\relax}}
\newcommand{\astslash@}[3]{%
\begingroup\settowidth\dimen@{$\m@th#1*$}%
\makebox[\dimen@][s]{%
\hspace{0pt minus 1fil}%
\raisebox{0pt}[0.75\height][0.1\depth]{%
\rotatebox[origin=c]{60}{%
\raisebox{\dimexpr2\fontdimen22 #2 2 - \height}{%
$\m@th#1\astminus$%
}%
}%
}%
\hspace{0pt minus 1.8fil}%
}%
\endgroup
}
\makeatother
\begin{document}
\fboxsep=0pt\fboxrule=0.1pt
\fbox{$\astslash$}\fbox{$*$}
$a\astminus b \astslash c$
$\scriptstyle a\astminus b \astslash c$
$\scriptscriptstyle a\astminus b \astslash c$
\end{document}
A lot of visual formatting, but the main idea is simple. I lower the \astminus
symbol so it lies on the baseline, then rotate it. The bounding box has been set by eye.
