\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{fontspec}
\setmainfont[Script=Devanagari]{Sanskrit 2003}
\newcommand\sufr[2]{\textsuperscript{$\frac{#1}{#2}$}}
\begin{document}
text\sufr{1}{6}
राम\sufr{1}{6}
\end{document}
In the above example, I managed to get fraction in superscript. However did not like the place where the fraction appears. It can be seen in the Devanagari text that the output does not appear like a superscript.
How can I raise the fraction number.
Best Answer
Here is a modified version of
\sufr
that now takes an optional argument indicating the raise quantity:The example sets the regular sans-
\sufr
-style superscript fraction, followed by the regular\sufr
, followed by a5pt
raise of the fraction. The default raise is0pt
, 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:
You could, of course,
\smash
the superscript, but that may cause overlay problems.