Custom division symbol

I suggest \mathpalette in order that the symbol properly scales in subscripts and superscripts.

The minus sign has height equal to the plus sign, so we need to smash it and to set it in a box as wide as the plus sign. A vertical phantom will ensure the correct height and depth.

\documentclass{article}
\usepackage{graphicx}

\makeatletter
\newcommand{\newdiv}{\mathbin{\mathpalette\@newdiv\relax}}
\newcommand{\@newdiv}[2]{%
  \begingroup
  \sbox\z@{$\m@th#1+$}%
  \makebox[\wd\z@]{\smash{\rotatebox[origin=c]{45}{$\m@th#1-$}}}%
  \vphantom{\usebox{\z@}}%
  \endgroup
}
\makeatother

\setlength{\fboxsep}{0pt}\setlength{\fboxrule}{0.1pt}% just for the example

\begin{document}

$a+b$ \fbox{$a+b$}

$a\newdiv b$ \fbox{$a\newdiv b$}

$\scriptstyle a+b\newdiv c$

\end{document}

enter image description here


Like this one, from \usepackage{fdsymbol}:

$a\medslash b$ $f_{a\medslash b}$

enter image description here

Tags:

Spacing