In essence, the faktor
package defines the command \faktor
in the following way (let's call it \newfaktor
):
\newcommand*{\newfaktor}[2]{% \newfaktor{#1}{#2} -> #1/#2
\raisebox{0.5\height}{\ensuremath{#1}}% Numerator
\mkern-5mu\diagup\mkern-4mu% Slash /
\raisebox{-0.5\height}{\ensuremath{#2}}% Denominator
}
Here is the similarity between \faktor
and \newfaktor
:

In order to satisfy the first request - to modifying the height/depth to which the numerator/denominator is raised/dropped - you could define some extra optional parameters for \newfaktor
. And, for the sake of being complete, the xparse
package provides a convenient way of intermixing mandatory {}
and optional []
arguments:
\usepackage{xparse}%
...
\DeclareDocumentCommand{\newfaktor}{m O{0.5} m O{-0.5}}{% \newfaktor{#1}[#2]{#3}[#4] -> #1/#3
\raisebox{#2\height}{\ensuremath{#1}}% Numerator
\mkern-5mu\diagup\mkern-4mu% Slash /
\raisebox{#4\height}{\ensuremath{#3}}% Denominator
}
This defines the command \newfaktor{#1}[#2]{#3}[#4]
where #2
and #4
have defaults of 0.5
and -0.5
respectively, and are optional. These optional arguments specify the fractional height/depth to which the numerator #1
and denominator #3
are raised/dropped. That is, specifying 0.5
for #2
raises #1
by half of its regular height; specifying -1
for #4
drops #3
by its own height. For example:

In the above image, the first four uses of \newfaktor
yield a typesetting equivalent to \faktor
.
In order to satisfy the second request - \diagup
scales automatically with respect to its arguments - we have to go a different route. The reason for this is that scaling \diagup
happens in 2 dimensions, thereby making \diagup
fatter. See, for example, the difference between:

So, instead, I went with stretching a \rule
, built into the following macro:
\DeclareDocumentCommand{\newfaktor}{s m O{0.5} m O{-0.5}}{% \newfaktor[*]{#2}[#3]{#4}[#5] -> #2/#4
\setbox0=\hbox{\ensuremath{#2}}% Store numerator
\setbox1=\hbox{\ensuremath{\diagup}}% Store slash /
\setbox2=\hbox{\ensuremath{#4}}% Store denominator
\raisebox{#3\ht1}{\usebox0}% Numerator
\mkern-5mu\ifthenelse{\equal{#1}{\BooleanTrue}}% Slash /
{\diagup}% regular \faktor slash
{\rotatebox{-44}{\rule[#5\ht2]{0.4pt}{-#5\ht2+#3\ht0+\ht0}}}% tilted rule as a slash
\mkern-4mu%
\raisebox{#5\ht2}{\usebox2}% Denominator
}
This creates \newfaktor
just like before, but now with an optional *
. The starred version \newfaktor*
reverts to the older definition, using \diagup
as the slanted fraction, while the unstarred \newfaktor
draws a \rule
and tilts it into place. Consider the differences:


Of course, if these definitions are entirely satisfaktory(!), you can change them to your liking.
Best Answer
I've just modified the definition from the source file a bit (it's short enough). That provides the new command
\mfaktor
to achieve your aim.