I propose five possibilities:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
% no adjustment
\frac{W+W^{*}}{2}=
% push the denominator left by the width of the asterisk
\frac{W+W^{*}}{2\hphantom{^{*}}}=
% make the asterisk protrude to the right (and add a correction)
\frac{W+W^{\mathrlap{*}}}{2}\,=
% push the denominator a bit left
\frac{W+W^{*}}{\!2}=
% change the order
\frac{W^{*}+W}{2}
\]
\end{document}
Probably the middle one is the best, in this particular case.
You can get round caps using picture mode:
\documentclass{article}
\usepackage{amsmath,stmaryrd,pict2e,picture}
\newcommand{\varbslash}{%
\mathbin{\mathpalette\pictvarbslash\relax}%
}
\newcommand{\pictvarbslash}[2]{%
\vcenter{\hbox{%
\sbox0{$#1\varobslash$}\dimen0=.55\wd0
\begin{picture}(\dimen0,\dimen0)
\roundcap
\put(0,\dimen0){\line(1,-1){\dimen0}}
\end{picture}%
}}%
}
\begin{document}
$\varobslash\varbslash_{\varobslash\varbslash}$
\end{document}
Here's an expanded version with \varslash
\documentclass{article}
\usepackage{amsmath,stmaryrd,pict2e,picture}
\newcommand{\varslash}{%
\mathbin{\mathpalette\pictslash{{0}{1}}}%
}
\newcommand{\varbslash}{%
\mathbin{\mathpalette\pictslash{{1}{-1}}}%
}
\makeatletter
\newcommand{\pictslash}[2]{%
\vcenter{\hbox{%
\sbox0{$\m@th#1\varobslash$}\dimen0=.55\wd0
\pictslash@aux#2%
}}%
}
\newcommand{\pictslash@aux}[2]{%
\begin{picture}(\dimen0,\dimen0)
\roundcap
\put(0,#1\dimen0){\line(1,#2){\dimen0}}
\end{picture}%
}
\makeatother
\begin{document}
$\varobslash\varbslash_{\varobslash\varbslash}$
$\varoslash\varslash_{\varoslash\varslash}$
\end{document}
Another variant where the new symbols occupy the same space as the corresponding circled ones:
\documentclass{article}
\usepackage{amsmath,stmaryrd,pict2e,picture}
\newcommand{\varslash}{%
\mathbin{\mathpalette\pictslash{{0}{1}}}%
}
\newcommand{\varbslash}{%
\mathbin{\mathpalette\pictslash{{1}{-1}}}%
}
\makeatletter
\newcommand{\pictslash}[2]{%
\vcenter{%
\sbox0{$\m@th#1\varobslash$}\dimen0=.55\wd0
\hbox to\wd 0{%
\hfil\pictslash@aux#2\hfil
}%
}%
}
\newcommand{\pictslash@aux}[2]{%
\begin{picture}(\dimen0,\dimen0)
\roundcap
\put(0,#1\dimen0){\line(1,#2){\dimen0}}
\end{picture}%
}
\makeatother
\begin{document}
$\varobslash\varobslash_{\varobslash\varobslash}$
$\varobslash\varbslash_{\varobslash\varbslash}$
$\varoslash\varslash_{\varoslash\varslash}$
\end{document}
Best Answer
Here's a LuaLaTeX-based solution. It works for all fractional expressions where both the numerator and the denominator contain only (one or more) digits, and it works both in inline-math and display-math modes. In order for
\frac
to work, the fractional terms must be in math-mode material. Only fractional expressions with digits are processed; expressions such asa/b
will not be modified.If you want "large" fractions throughout the document, be sure to load the
amsmath
package and changefrac
todfrac
in the Lua function below.In case you're curious: The lua function
replace_slash
uses so-called captures to identify the numerator and denominator terms. The lua function is assigned to theprocess_input_buffer
callback. This means that the function operates on the input before TeX starts its own processing. Thus, TeX's "eyes" will never even see an expression such as$1/2$
; instead, they'll only get to see the expression$\frac{1}{2}$
.(Addendum 9 Nov 2015: Generalized the Lua code so that (i) signed integers (positive or negative) and (ii) any whitespace in the input are handled correctly.)
Addendum: Allowing an optional factorial symbol, viz.,
!
, in the numerator and/or denominator would be very easy: In the Lua function, simply replace the search stringwith
In Lua's pattern matching jargon,
%s-
means "0 or more occurrences of whitespace", and the!?
substring means "0 or 1 instance of!
". With this modification,$3! / 2!$
will be typeset as$\frac{3!}{2!}$
.