Here is a modified version of \sufr
that now takes an optional argument indicating the raise quantity:
\documentclass[a4paper]{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\newcommand\sufr[3][0pt]{$\rule{0pt}{\dimexpr#1+1.4ex\relax}^\frac{#2}{#3}$}
\begin{document}
text$^\frac{1}{6}$ \quad text\sufr{1}{6} \quad text\sufr[5pt]{1}{6}
\end{document}
The example sets the regular sans-\sufr
-style superscript fraction, followed by the regular \sufr
, followed by a 5pt
raise of the fraction. The default raise is 0pt
, which is similar to a regular superscript fraction.
Take caution of possible line height imperfections with such use, as is shown in the following example:
\documentclass[a4paper]{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\newcommand\sufr[3][0pt]{$\rule{0pt}{\dimexpr#1+1.4ex\relax}^\frac{#2}{#3}$}
\begin{document}
The quick brown fox jumps over the lazy\sufr{1}{6} dog.
The quick brown fox jumps over the lazy\sufr{1}{6} dog.
The quick brown fox jumps over the lazy\sufr{1}{6} dog.
The quick brown fox jumps over the lazy\sufr{1}{6} dog.
The quick brown fox jumps over the lazy\sufr{1}{6} dog.
The quick brown fox jumps over the lazy\sufr{1}{6} dog.
The quick brown fox jumps over the lazy\sufr[5pt]{1}{6} dog.
The quick brown fox jumps over the lazy\sufr{1}{6} dog.
The quick brown fox jumps over the lazy\sufr{1}{6} dog.
The quick brown fox jumps over the lazy\sufr{1}{6} dog.
\end{document}
You could, of course, \smash
the superscript, but that may cause overlay problems.
This is the most simple way to produce what you want without using a graphical interface. As mentioned by @ach in the comments, you should replace the $$
by \[
and \]
or \begin{equation}
and \end{equation}
.
Best Answer
I chose to use math mode to set the argument of
\bsfrac
, even though I notice that\nicefrac
sets in text mode. The behavior can be changed for\bsfrac
with the removal of the$
characters.One can simplify the definition as
or even, as Máté suggests,